Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Include the changelog into the tarball
[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.0.4],[martin.quinson@ens-lyon.fr])
7
8
9 AC_CONFIG_SRCDIR([src/include/gras.h])
10 # MACRO_DIR should tell aclocal to search for my macro. That's the autoconf
11 # maintainer plan, but automake does not implement this yet (as in 1.8)
12 AC_CONFIG_MACRO_DIR(acmacro) 
13
14 AC_REVISION($Revision$)
15
16 AC_CANONICAL_TARGET
17 AC_LANG([C])
18
19 AC_CONFIG_HEADERS([src/gras_config.h])
20 AM_INIT_AUTOMAKE
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 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_CHECK_HEADERS([stddef.h stdlib.h string.h unistd.h])
45
46 # Checks for typedefs, structures, and compiler characteristics.
47 AC_C_CONST
48 AC_C_INLINE
49 AC_TYPE_SIZE_T
50
51 # Checks for library functions.
52 AC_FUNC_MALLOC
53 AC_FUNC_MEMCMP
54 AC_CHECK_FUNCS([memset strchr strerror usleep])
55
56 # Can we rebuild the parsers?
57 # We really want flex and refuse other lex. So, the parser is portable and
58 # does not induce extra lib dependency
59 AC_PROG_LEX
60 if test "$LEX" != flex; then
61   LEX="$SHELL $missing_dir/missing flex"
62 fi
63                                                                   
64 # Can we rebuild the documentation?
65 GTK_DOC_CHECK()
66
67 dnl ####[ Search libs ]#######################################################
68 ACI_PACKAGE([SimGrid],[the SimGrid simulator],[SG_init],[-lsimgrid],[simgrid.h],,:)
69 AM_CONDITIONAL(HAVE_SG,test x$HAVE_SimGrid = xyes)
70
71 dnl A C_CHECK_LIB(pthread, pthread_mutex_lock, LIBS="$LIBS -lpthread")
72 AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])
73 AC_CHECK_LIB(socket, connect,    [LIBS="$LIBS -lsocket"])
74         
75 dnl ####[ maint mode ]#######################################################
76 AM_MAINTAINER_MODE
77 if test x$USE_MAINTAINER_MODE = xyes 
78 then
79    GNOME_COMPILE_WARNINGS(yes)
80 fi
81
82 AC_SUBST(CFLAGS)
83 AC_SUBST(CPPFLAGS)
84 AC_SUBST(LDFLAGS)
85
86 dnl ####[ check for some programms ]###########################################
87 AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
88 WARNING="This file is generated, do not edit"
89 AC_SUBST(WARNING)
90
91 dnl ####[ Makes the output ]###################################################
92 AC_CONFIG_FILES([
93   Makefile
94   src/Makefile
95     src/include/Makefile
96       src/include/modules/Makefile
97     src/base/Makefile
98       src/base/Tests/Makefile
99       src/base/Tests/run_tests
100         src/base/Tests/trp_tcp_usage
101         src/base/Tests/trp_file_usage
102     src/examples/Makefile 
103       src/examples/ping/Makefile 
104   doc/Makefile
105   tools/compile-remote-worker
106 ],[( cd src/include ; test -e gras || ln -s . gras )
107      test -e src/base/Tests/trp_tcp_usage && chmod +x src/base/Tests/trp_tcp_usage;
108      test -e src/base/Tests/trp_file_usage && chmod +x src/base/Tests/trp_file_usage;
109      test -e src/base/Tests/run_tests     && chmod +x src/base/Tests/run_tests;
110      test -e tools/compile-remote-worker  && chmod +x tools/compile-remote-worker;
111      chmod +x tools/gras-check-arch;
112      chmod +x src/examples/ping/test_rl; chmod +x src/examples/ping/test_sg])
113
114 #      src/examples/pastry/Makefile
115 #    src/modules/Makefile
116 #      src/examples/bandwidth/Makefile src/examples/saturate/Makefile
117 #      src/examples/alnem/Makefile 
118
119 AC_OUTPUT
120
121 echo "
122
123 Configuration of package \`${PACKAGE}' on $gras_arch_name (=$gras_arch):
124
125         Compiler:       ${CC}
126
127         CFlags:         ${CFLAGS}
128         LDFlags:        ${LDFLAGS}
129 "
130
131 exit 0;