Logo AND Algorithmique Numérique Distribuée

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