Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ignore ignorable autogenerated crufts
[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.92-cvs],[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 usleep \
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       examples/gras/timer/Makefile examples/gras/timer/test_sg examples/gras/timer/test_rl
132       examples/gras/chrono/Makefile examples/gras/chrono/test_sg examples/gras/chrono/test_rl
133   doc/Makefile
134     doc/Doxyfile.main           doc/Doxyfile.API          doc/Doxyfile.Examples   
135   tools/compile-remote-worker tools/Makefile
136     tools/gras/Makefile
137   testsuite/Makefile
138   testsuite/run_tests    
139   testsuite/gras/trp_tcp_usage
140   testsuite/gras/trp_file_usage
141 ],[
142     for file in                                                 \
143      testsuite/run_tests                                        \
144      testsuite/gras/trp_tcp_usage testsuite/gras/trp_file_usage \
145      tools/compile-remote-worker                                \
146      examples/msg/run_msg_test                                  \
147      examples/gras/ping/test_sg   examples/gras/ping/test_rl    \
148      examples/gras/timer/test_sg  examples/gras/timer/test_rl   \
149      examples/gras/chrono/test_sg  examples/gras/chrono/test_rl \
150     ; do                                                        \
151       test -e $file && chmod +x $file;                          \
152     done
153     chmod +x $srcdir/tools/gras-check-arch;
154 ])
155
156 #    examples/gras/pastry/test_sg   
157 #    examples/gras/bandwidth/test_sg 
158
159
160
161 #    examples/gras/saturate/Makefile  examples/gras/saturate/test_sg
162 #    examples/gras/alnem/Makefile     examples/gras/alnem/test_sg
163
164
165
166 AC_OUTPUT
167
168 echo "
169
170 Configuration of package \`${PACKAGE}' on $gras_arch_name (=$gras_arch):
171
172         Compiler:       ${CC}
173
174         CFlags:         ${CFLAGS}
175         LDFlags:        ${LDFLAGS}
176 "
177
178 exit 0;