4 # A CI_PREREQ(2003.01.16)
6 AC_INIT([simgrid],[2.93-cvs],[simgrid2-users@listes.ens-lyon.fr])
7 AC_CONFIG_SRCDIR([include/gras.h])
8 AC_CONFIG_HEADERS([src/gras_config.h])
10 AC_REVISION($Revision$)
15 # MACRO_DIR should tell aclocal to search for my macro. That's the autoconf
16 # maintainer plan, but automake does not implement this yet (as in 1.8)
17 AC_CONFIG_MACRO_DIR(acmacro)
18 # It seems to be called ACLOCAL_INCLUDE...
19 # A M_ACLOCAL_INCLUDE(acmacro)
23 # declare the modules (no optional module)
26 dnl Load anything under acmacro/*.m4
28 dnl test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
29 ACLOCAL="$ACLOCAL -I acmacro"
36 # Check architecture signature begin
38 # Check architecture signature end
39 GRAS_CHECK_STRUCT_COMPACTION
41 # Checks for header files.
44 AC_CHECK_HEADERS([sys/socket.h winsock.h winsock2.h \
51 AC_CHECK_FUNCS([gettimeofday usleep \
55 AC_ARG_ENABLE(context,
56 [ --enable-context=[ucontext/pthreads] Use either (System V) swapcontext or pthread [[default=ucontext]].],,
57 enable_context=ucontext)
58 AC_MSG_CHECKING(on top of what can we build the contexts)
59 if test "x$enable_context" = "xucontext"; then
61 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
62 if test `eval echo '${'$as_ac_Header'}'` = yes; then
63 AC_MSG_RESULT(found ucontext.h. Great!)
66 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
67 if test `eval echo '${'$as_ac_Header'}'` = yes; then
68 AC_MSG_RESULT(you don't have ucontext.h but we provide an alternative for windows so you should be fine.")
70 AC_MSG_RESULT([[cannot find ucontext. I'm going to try as if you had set --enable-context=pthreads !]])
71 enable_context=pthreads
75 if test "x$enable_context" = "xpthreads"; then
76 AC_CHECK_LIB(pthread,pthread_create,,
77 [AC_MSG_ERROR([[Cannot find pthreads, no way (try --enable-context=ucontext if you haven't already tried).]])])
78 AC_DEFINE([USE_PTHREADS],1,[Define if we USE pthreads or not])
79 AC_MSG_RESULT(You have pthreads. Let's use them.)
83 # Checks for typedefs, structures, and compiler characteristics.
88 # Checks for library functions.
90 dnl A C_CHECK_FUNCS([memset strchr strerror usleep])
92 dnl ####[ Search libs ]#######################################################
93 dnl A CI_PACKAGE([S imGrid],[the SimGrid simulator],[SG_init],[-lsimgrid],[simgrid.h],,:)
94 dnl A M_CONDITIONAL(HAVE_SG,test x$HAVE_SimGrid = xyes)
95 dnl if test x$HAVE_SimGrid = xyes; then
96 dnl SIMGRID_DEP="-lsimgrid"
100 AC_SUBST([SIMGRID_DEP])
103 dnl A C_CHECK_LIB(pthread, pthread_mutex_lock, LIBS="$LIBS -lpthread")
105 AC_CHECK_LIB(nsl, gethostbyname, [GRAS_DEP="$GRAS_DEP -lnsl"])
106 AC_CHECK_LIB(socket, connect, [GRAS_DEP="$GRAS_DEP -lsocket"])
108 AC_MSG_CHECKING(for extra dependencies of libgras)
110 *mingw* ) GRAS_DEP=-lws2_32;;
113 if test "x$GRAS_DEP" = x; then
116 AC_MSG_RESULT($GRAS_DEP)
120 dnl ####[ maint mode ]#######################################################
122 if test x$USE_MAINTAINER_MODE = xyes
124 # enable_iso_c=yes # Let's go funky
125 GNOME_COMPILE_WARNINGS(yes)
132 dnl ####[ check for some programms ]###########################################
133 AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
134 WARNING="This file is generated, do not edit"
137 # Can we rebuild the parsers?
138 # We really want flex and refuse other lex. So, the parser is portable and
139 # does not induce extra lib dependency
142 # Can we rebuild the xml-lexers from the XML specification?
143 # if not, simply touch the flex source files (which are distributed in
144 # tarballs even if generated by flexml) and hope for the best.
145 AC_CHECK_PROG(FLEXML,flexml,,NOTFOUND)
146 AM_CONDITIONAL(HAVE_FLEXML,test x$FLEXML != NOTFOUND)
148 dnl ####[ Makes the output ]###################################################
149 # examples/bandwidth/Makefile examples/bandwidth/test_sg
150 # examples/pastry/Makefile examples/pastry/test_sg
158 examples/msg/Makefile examples/msg/run_msg_test
159 examples/gras/Makefile
160 examples/gras/ping/Makefile examples/gras/ping/test_sg examples/gras/ping/test_rl
161 examples/gras/timer/Makefile examples/gras/timer/test_sg examples/gras/timer/test_rl
162 examples/gras/chrono/Makefile examples/gras/chrono/test_sg examples/gras/chrono/test_rl
164 doc/Doxyfile.main doc/Doxyfile.API doc/Doxyfile.Examples
165 tools/compile-remote-worker tools/Makefile
169 testsuite/gras/trp_tcp_usage
170 testsuite/gras/trp_file_usage
173 testsuite/run_tests \
174 testsuite/gras/trp_tcp_usage testsuite/gras/trp_file_usage \
175 tools/compile-remote-worker \
176 examples/msg/run_msg_test \
177 examples/gras/ping/test_sg examples/gras/ping/test_rl \
178 examples/gras/timer/test_sg examples/gras/timer/test_rl \
179 examples/gras/chrono/test_sg examples/gras/chrono/test_rl \
181 test -e $file && chmod +x $file; \
183 chmod +x $srcdir/tools/gras-check-arch;
186 # examples/gras/pastry/test_sg
187 # examples/gras/bandwidth/test_sg
191 # examples/gras/saturate/Makefile examples/gras/saturate/test_sg
192 # examples/gras/alnem/Makefile examples/gras/alnem/test_sg
200 Configuration of package \`${PACKAGE}' on $gras_arch_name (=$gras_arch):