Logo AND Algorithmique Numérique Distribuée

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