Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify ssh requierement for remote compilation
[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.6.2],[martin.quinson@ens-lyon.fr])
7 AC_CONFIG_SRCDIR([src/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_CHECK_HEADERS([stddef.h stdlib.h string.h unistd.h])
47
48 # Checks for typedefs, structures, and compiler characteristics.
49 AC_C_CONST
50 AC_C_INLINE
51 AC_TYPE_SIZE_T
52
53 # Checks for library functions.
54 AC_FUNC_MALLOC
55 AC_FUNC_MEMCMP
56 AC_CHECK_FUNCS([memset strchr strerror usleep])
57
58 # Can we rebuild the parsers?
59 # We really want flex and refuse other lex. So, the parser is portable and
60 # does not induce extra lib dependency
61 AC_PROG_LEX
62 if test "$LEX" != flex; then
63   LEX="$SHELL $missing_dir/missing flex"
64 fi
65                                                                   
66 # Can we rebuild the documentation?
67 GTK_DOC_CHECK()
68 AC_SUBST([htmldir],         ['${datadir}/doc/gras/html'])dnl
69
70 dnl ####[ Search libs ]#######################################################
71 ACI_PACKAGE([SimGrid],[the SimGrid simulator],[SG_init],[-lsimgrid],[simgrid.h],,:)
72 AM_CONDITIONAL(HAVE_SG,test x$HAVE_SimGrid = xyes)
73
74 dnl A C_CHECK_LIB(pthread, pthread_mutex_lock, LIBS="$LIBS -lpthread")
75 AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])
76 AC_CHECK_LIB(socket, connect,    [LIBS="$LIBS -lsocket"])
77         
78 dnl ####[ maint mode ]#######################################################
79 AM_MAINTAINER_MODE
80 if test x$USE_MAINTAINER_MODE = xyes 
81 then
82 #   enable_iso_c=yes                 Ouais, un autre jour
83    GNOME_COMPILE_WARNINGS(yes)
84 fi
85
86 AC_SUBST(CFLAGS)
87 AC_SUBST(CPPFLAGS)
88 AC_SUBST(LDFLAGS)
89
90 dnl ####[ check for some programms ]###########################################
91 AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
92 WARNING="This file is generated, do not edit"
93 AC_SUBST(WARNING)
94
95 dnl ####[ Makes the output ]###################################################
96 AC_CONFIG_FILES([
97   Makefile
98   src/Makefile
99     src/include/Makefile
100     src/base/Makefile
101       src/base/Tests/Makefile
102       src/base/Tests/run_tests
103         src/base/Tests/trp_tcp_usage
104         src/base/Tests/trp_file_usage
105     src/examples/Makefile 
106       src/examples/ping/Makefile 
107       src/examples/ping/test_sg
108   doc/Makefile
109   tools/compile-remote-worker
110 ],[
111      test -e src/base/Tests/trp_tcp_usage && chmod +x src/base/Tests/trp_tcp_usage;
112      test -e src/base/Tests/trp_file_usage&& chmod +x src/base/Tests/trp_file_usage;
113      test -e src/base/Tests/run_tests     && chmod +x src/base/Tests/run_tests;
114      test -e tools/compile-remote-worker  && chmod +x tools/compile-remote-worker;
115      test -e src/examples/ping/test_sg    && chmod +x src/examples/ping/test_sg;
116      chmod +x $srcdir/tools/gras-check-arch;
117      chmod +x $srcdir/src/examples/ping/test_rl])
118
119 #      src/examples/pastry/Makefile
120 #    src/modules/Makefile
121 #      src/examples/bandwidth/Makefile src/examples/saturate/Makefile
122 #      src/examples/alnem/Makefile 
123
124 AC_OUTPUT
125
126 echo "
127
128 Configuration of package \`${PACKAGE}' on $gras_arch_name (=$gras_arch):
129
130         Compiler:       ${CC}
131
132         CFlags:         ${CFLAGS}
133         LDFlags:        ${LDFLAGS}
134 "
135
136 exit 0;