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/pthread] 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
74 else if test "x$enable_context" = "xpthread"; then
75 AC_CHECK_LIB(pthread,pthread_create,,
76 [AC_MSG_ERROR([[Cannot find pthreads, no way (try --enable-context=ucontext if you haven't already tried).]])])
77 AC_DEFINE([USE_PTHREADS],1,[Define if we USE pthreads or not])
78 AC_MSG_RESULT(You have pthreads. Let's use them.)
80 AC_MSG_ERROR("--enable-context must be either ucontext or pthread")
84 # Checks for typedefs, structures, and compiler characteristics.
89 # Checks for library functions.
91 dnl A C_CHECK_FUNCS([memset strchr strerror usleep])
93 dnl ####[ Search libs ]#######################################################
94 dnl A CI_PACKAGE([S imGrid],[the SimGrid simulator],[SG_init],[-lsimgrid],[simgrid.h],,:)
95 dnl A M_CONDITIONAL(HAVE_SG,test x$HAVE_SimGrid = xyes)
96 dnl if test x$HAVE_SimGrid = xyes; then
97 dnl SIMGRID_DEP="-lsimgrid"
101 AC_SUBST([SIMGRID_DEP])
104 dnl A C_CHECK_LIB(pthread, pthread_mutex_lock, LIBS="$LIBS -lpthread")
106 AC_CHECK_LIB(nsl, gethostbyname, [GRAS_DEP="$GRAS_DEP -lnsl"])
107 AC_CHECK_LIB(socket, connect, [GRAS_DEP="$GRAS_DEP -lsocket"])
109 AC_MSG_CHECKING(for extra dependencies of libgras)
111 *mingw* ) GRAS_DEP=-lws2_32;;
114 if test "x$GRAS_DEP" = x; then
117 AC_MSG_RESULT($GRAS_DEP)
121 dnl ####[ maint mode ]#######################################################
123 if test x$USE_MAINTAINER_MODE = xyes
125 # enable_iso_c=yes # Let's go funky
126 GNOME_COMPILE_WARNINGS(yes)
133 dnl ####[ check for some programms ]###########################################
134 AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
135 WARNING="This file is generated, do not edit"
138 # Can we rebuild the parsers?
139 # We really want flex and refuse other lex. So, the parser is portable and
140 # does not induce extra lib dependency
143 # Can we rebuild the xml-lexers from the XML specification?
144 # if not, simply touch the flex source files (which are distributed in
145 # tarballs even if generated by flexml) and hope for the best.
146 AC_CHECK_PROG(FLEXML,flexml,,NOTFOUND)
147 AM_CONDITIONAL(HAVE_FLEXML,test x$FLEXML != NOTFOUND)
149 dnl ####[ Makes the output ]###################################################
150 # examples/bandwidth/Makefile examples/bandwidth/test_sg
151 # examples/pastry/Makefile examples/pastry/test_sg
159 examples/msg/Makefile examples/msg/run_msg_test
160 examples/gras/Makefile
161 examples/gras/ping/Makefile examples/gras/ping/test_sg examples/gras/ping/test_rl
162 examples/gras/timer/Makefile examples/gras/timer/test_sg examples/gras/timer/test_rl
163 examples/gras/chrono/Makefile examples/gras/chrono/test_sg examples/gras/chrono/test_rl
165 doc/Doxyfile.main doc/Doxyfile.API doc/Doxyfile.Examples
166 tools/compile-remote-worker tools/Makefile
170 testsuite/gras/trp_tcp_usage
171 testsuite/gras/trp_file_usage
174 testsuite/run_tests \
175 testsuite/gras/trp_tcp_usage testsuite/gras/trp_file_usage \
176 tools/compile-remote-worker \
177 examples/msg/run_msg_test \
178 examples/gras/ping/test_sg examples/gras/ping/test_rl \
179 examples/gras/timer/test_sg examples/gras/timer/test_rl \
180 examples/gras/chrono/test_sg examples/gras/chrono/test_rl \
182 test -e $file && chmod +x $file; \
184 chmod +x $srcdir/tools/gras-check-arch;
187 # examples/gras/pastry/test_sg
188 # examples/gras/bandwidth/test_sg
192 # examples/gras/saturate/Makefile examples/gras/saturate/test_sg
193 # examples/gras/alnem/Makefile examples/gras/alnem/test_sg
201 Configuration of package \`${PACKAGE}' on $gras_arch_name (=$gras_arch):