Logo AND Algorithmique Numérique Distribuée

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