Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update
[simgrid.git] / configure.ac
1 AC_PREREQ(2.59)
2
3 # We need a recent ACI
4 # A CI_PREREQ(2003.01.16)
5
6 AC_INIT([simgrid],[2.91],[simgrid2-users@listes.ens-lyon.fr])
7 AC_CONFIG_SRCDIR([include/gras.h])
8 AC_CONFIG_HEADERS([src/gras_config.h])
9
10 AC_REVISION($Revision$)
11 AC_CANONICAL_TARGET
12 AC_LANG([C])
13
14 AM_INIT_AUTOMAKE(gnu)
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)
20
21 AC_PROG_LIBTOOL
22
23 # declare the modules (no optional module)
24
25 dnl
26 dnl Load anything under acmacro/*.m4
27 dnl
28 dnl test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
29 ACLOCAL="$ACLOCAL -I acmacro"
30
31
32 AC_PROG_CC
33 AM_SANITY_CHECK
34 AC_PROG_MAKE_SET
35
36 # Check architecture signature begin
37 GRAS_ARCH
38 # Check architecture signature end
39 GRAS_CHECK_STRUCT_COMPACTION
40
41 # Checks for header files.
42 AC_HEADER_STDC
43 AC_HEADER_TIME
44 AC_CHECK_HEADERS([sys/socket.h winsock.h winsock2.h \
45                   sys/stat.h \
46                   ucontext.h \
47                   sys/time.h \
48                   errno.h unistd.h ])
49 AC_CHECK_FUNCS([gettimeofday \
50                 getdtablesize \
51                 sysconf])
52
53 # Checks for typedefs, structures, and compiler characteristics.
54 AC_C_CONST
55 AC_C_INLINE
56 AC_TYPE_SIZE_T
57
58 # Checks for library functions.
59 dnl A C_FUNC_MEMCMP
60 dnl A C_CHECK_FUNCS([memset strchr strerror usleep])
61
62 dnl ####[ Search libs ]#######################################################
63 dnl A CI_PACKAGE([S imGrid],[the SimGrid simulator],[SG_init],[-lsimgrid],[simgrid.h],,:)
64 dnl A M_CONDITIONAL(HAVE_SG,test x$HAVE_SimGrid = xyes)
65 dnl if test x$HAVE_SimGrid = xyes; then
66 dnl   SIMGRID_DEP="-lsimgrid"
67 dnl else
68   SIMGRID_DEP=""
69 dnl fi
70 AC_SUBST([SIMGRID_DEP])
71
72
73 dnl A C_CHECK_LIB(pthread, pthread_mutex_lock, LIBS="$LIBS -lpthread")
74 GRAS_DEP=""
75 AC_CHECK_LIB(nsl, gethostbyname, [GRAS_DEP="$GRAS_DEP -lnsl"])
76 AC_CHECK_LIB(socket, connect,    [GRAS_DEP="$GRAS_DEP -lsocket"])
77
78 AC_MSG_CHECKING(for extra dependencies of libgras)
79 case $host_os in
80   *mingw* ) GRAS_DEP=-lws2_32;;
81 esac
82            
83 if test "x$GRAS_DEP" = x; then 
84    AC_MSG_RESULT(none)
85 else
86    AC_MSG_RESULT($GRAS_DEP)
87 fi
88 AC_SUBST([GRAS_DEP])
89
90 dnl ####[ maint mode ]#######################################################
91 AM_MAINTAINER_MODE
92 if test x$USE_MAINTAINER_MODE = xyes 
93 then
94 #   enable_iso_c=yes             # Let's go funky
95    GNOME_COMPILE_WARNINGS(yes)
96 fi
97
98 AC_SUBST(CFLAGS)
99 AC_SUBST(CPPFLAGS)
100 AC_SUBST(LDFLAGS)
101
102 dnl ####[ check for some programms ]###########################################
103 AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
104 WARNING="This file is generated, do not edit"
105 AC_SUBST(WARNING)
106
107 # Can we rebuild the parsers?
108 # We really want flex and refuse other lex. So, the parser is portable and
109 # does not induce extra lib dependency
110 AC_PROG_FLEX(2.5.30)
111                 
112 # Can we rebuild the xml-lexers from the XML specification?
113 # if not, simply touch the flex source files (which are distributed in
114 #  tarballs even if generated by flexml) and hope for the best.
115 AC_CHECK_PROG(FLEXML,flexml,,NOTFOUND)
116 AM_CONDITIONAL(HAVE_FLEXML,test x$FLEXML != NOTFOUND)
117
118 dnl ####[ Makes the output ]###################################################
119 #    examples/bandwidth/Makefile examples/bandwidth/test_sg
120 #    examples/pastry/Makefile    examples/pastry/test_sg
121
122 AC_CONFIG_FILES([
123   Makefile
124   include/Makefile
125   src/Makefile
126   src/amok/Makefile
127   examples/Makefile 
128     examples/msg/Makefile          examples/msg/run_msg_test
129     examples/gras/Makefile 
130       examples/gras/ping/Makefile  examples/gras/ping/test_sg  examples/gras/ping/test_rl
131   doc/Makefile
132     doc/Doxyfile.main           doc/Doxyfile.API          doc/Doxyfile.Examples   
133   tools/compile-remote-worker tools/Makefile
134     tools/gras/Makefile
135   testsuite/Makefile
136   testsuite/run_tests    
137   testsuite/gras/trp_tcp_usage
138   testsuite/gras/trp_file_usage
139 ],[
140      test -e testsuite/run_tests          && chmod +x testsuite/run_tests;
141      test -e testsuite/gras/trp_tcp_usage && chmod +x testsuite/gras/trp_tcp_usage;
142      test -e testsuite/gras/trp_file_usage&& chmod +x testsuite/gras/trp_file_usage;
143      test -e tools/compile-remote-worker  && chmod +x tools/compile-remote-worker;
144      test -e examples/msg/run_msg_test    && chmod +x examples/msg/run_msg_test;
145      test -e examples/gras/ping/test_sg   && chmod +x examples/gras/ping/test_sg;
146      test -e examples/gras/ping/test_rl   && chmod +x examples/gras/ping/test_rl;
147 #     test -e examples/gras/bandwidth/test_sg   && chmod +x examples/gras/bandwidth/test_sg;
148      test -e examples/gras/pastry/test_sg && chmod +x examples/gras/pastry/test_sg;
149      chmod +x $srcdir/tools/gras-check-arch;
150 ])
151
152
153
154
155 #    examples/gras/saturate/Makefile  examples/gras/saturate/test_sg
156 #    examples/gras/alnem/Makefile     examples/gras/alnem/test_sg
157
158
159
160 AC_OUTPUT
161
162 echo "
163
164 Configuration of package \`${PACKAGE}' on $gras_arch_name (=$gras_arch):
165
166         Compiler:       ${CC}
167
168         CFlags:         ${CFLAGS}
169         LDFlags:        ${LDFLAGS}
170 "
171
172 exit 0;