7 AC_INIT([simgrid],[2.93-cvs],[simgrid2-users@listes.ens-lyon.fr])
8 AC_CONFIG_SRCDIR([include/gras.h])
9 AC_CONFIG_HEADERS([src/gras_config.h])
10 # A CI_PREREQ(2003.01.16) # We need a recent ACI when having sub-modules
12 AC_REVISION($Revision$)
17 AC_CONFIG_MACRO_DIR(acmacro)
18 ACLOCAL="$ACLOCAL -I acmacro"
30 # Checks for header files.
33 AC_CHECK_HEADERS([sys/socket.h \
35 windows.h winsock.h winsock2.h \
38 AC_CHECK_FUNCS([gettimeofday usleep \
42 # Checks for typedefs, structures, and compiler characteristics.
47 ###################################
48 ## SimGrid and GRAS specific checks
51 # Check architecture signature begin
53 # Check architecture signature end
54 GRAS_CHECK_STRUCT_COMPACTION
56 AC_ARG_ENABLE(context,
57 [ --enable-context=[ucontext/pthread] Use either (System V) swapcontext or pthread [[default=pthread]].],,
58 enable_context=pthread)
59 AC_MSG_CHECKING(on top of what can we build the contexts)
60 if test "x$enable_context" = "xucontext"; then
61 AC_CHECK_HEADERS([ucontext.h])
63 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
64 if test `eval echo '${'$as_ac_Header'}'` = yes; then
65 AC_MSG_RESULT(found ucontext.h. Great!)
68 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
69 if test `eval echo '${'$as_ac_Header'}'` = yes; then
70 AC_MSG_RESULT(you don't have ucontext.h but we provide an alternative for windows so you should be fine.")
72 AC_MSG_RESULT([[cannot find ucontext. I'm going to try as if you had set --enable-context=pthreads !]])
73 enable_context=pthreads
76 else if test "x$enable_context" = "xpthread"; then
77 AC_CHECK_HEADERS([pthread.h])
78 dnl A C_CHECK_LIB(pthread, pthread_mutex_lock, LIBS="$LIBS -lpthread")
79 AC_CHECK_LIB(pthread,pthread_create,,
80 [AC_MSG_ERROR([[Cannot find pthreads, no way (try --enable-context=ucontext if you haven't already tried).]])])
81 AC_DEFINE([USE_PTHREADS],1,[Define if we USE pthreads or not])
82 AC_MSG_RESULT(You have pthreads. Let's use them.)
84 AC_MSG_ERROR("--enable-context must be either ucontext or pthread")
87 #########################################
88 ## Check for libraries extra-dependencies
92 AC_SUBST([SIMGRID_DEP])
95 AC_CHECK_LIB(nsl, gethostbyname, [GRAS_DEP="$GRAS_DEP -lnsl"])
96 AC_CHECK_LIB(socket, connect, [GRAS_DEP="$GRAS_DEP -lsocket"])
98 AC_MSG_CHECKING(for extra dependencies of libgras)
100 *mingw* ) GRAS_DEP="$GRAS_DEP -lws2_32" ; SIMGRID_DEP="$SIMGRID_DEP -lws2_32" ;;
103 if test "x$GRAS_DEP" = x; then
106 AC_MSG_RESULT($GRAS_DEP)
110 ##############################################
111 ## Enhance maintainer mode and SUBST variables
112 ## (must be placed after any compilation tests since our overprotective flags
113 ## let some tests fail)
116 if test x$USE_MAINTAINER_MODE = xyes
118 GNOME_COMPILE_WARNINGS(yes)
125 #####################
126 ## Check for programs
129 AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
130 WARNING="This file is generated, do not edit"
133 # Can we rebuild the parsers?
134 # We really want flex and refuse other lex. So, the parser is portable and
135 # does not induce extra lib dependency
138 # Can we rebuild the xml-lexers from the XML specification?
139 # if not, simply touch the flex source files (which are distributed in
140 # tarballs even if generated by flexml) and hope for the best.
141 AC_CHECK_PROG(FLEXML,flexml,,NOTFOUND)
142 AM_CONDITIONAL(HAVE_FLEXML,test x$FLEXML != NOTFOUND)
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):