Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
d6af0b764ecf14683de8e508593c7f92a705ce3c
[simgrid.git] / configure.ac
1  AC_PREREQ(2.57)
2
3 #We need a recent ACI
4 ACI_PREREQ(2003.01.16)
5
6 AC_INIT([GRAS],[0.0.2],[martin.quinson@ens-lyon.fr])
7 AC_CONFIG_SRCDIR([src/include/gras.h])
8 AC_REVISION($Revision$)
9 dnl A C_CONFIG_SUBDIRS(src/nws_portability)
10
11 AC_CANONICAL_TARGET
12 AC_LANG([C])
13
14 AM_CONFIG_HEADER(src/gras_config.h)
15 AM_INIT_AUTOMAKE
16
17 AM_PROG_LIBTOOL
18
19 # declare the modules (no optional module)
20
21 dnl
22 dnl Load anything under acmacro/*.m4
23 dnl
24 test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
25 ACLOCAL="$ACLOCAL -I acmacro"
26
27
28 AC_PROG_CC
29 AM_SANITY_CHECK
30 AC_PROG_MAKE_SET
31
32 # Check architecture signature begin
33 GRAS_ARCH
34 # Check architecture signature end
35
36 # Checks for header files.
37 AC_HEADER_STDC
38 AC_CHECK_HEADERS([stddef.h stdlib.h string.h unistd.h])
39
40 # Checks for typedefs, structures, and compiler characteristics.
41 AC_C_CONST
42 AC_C_INLINE
43 AC_TYPE_SIZE_T
44
45 # Checks for library functions.
46 AC_FUNC_MALLOC
47 AC_FUNC_MEMCMP
48 AC_CHECK_FUNCS([memset strchr strerror usleep])
49
50 # Can we rebuild the documentation?
51 GNOME_GTKDOC_CHECK
52
53 dnl ####[ Search libs ]#######################################################
54 dnl A CI_PACKAGE_SAVED(XML,[XML library (version XML2)],xml2-config,,,:)
55 ACI_PACKAGE([SimGrid],[the SimGrid simulator],[SG_init],[-lsimgrid],[simgrid.h],,:)
56 AM_CONDITIONAL(HAVE_SG,test x$HAVE_SimGrid = xyes)
57
58 dnl A C_CHECK_LIB(pthread, pthread_mutex_lock, LIBS="$LIBS -lpthread")
59 AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])
60 AC_CHECK_LIB(socket, connect,    [LIBS="$LIBS -lsocket"])
61         
62 dnl ####[ maint mode ]#######################################################
63 AM_MAINTAINER_MODE
64 if test x$USE_MAINTAINER_MODE = xyes 
65 then
66    GNOME_COMPILE_WARNINGS(yes)
67 fi
68
69 AC_SUBST(CFLAGS)
70 AC_SUBST(CPPFLAGS)
71 AC_SUBST(LDFLAGS)
72
73 dnl ####[ check for some programms ]###########################################
74 AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
75 WARNING="This file is generated, do not edit"
76 AC_SUBST(WARNING)
77
78 AC_SUBST(SED)
79
80 dnl ####[ Makes the output ]###################################################
81 AC_CONFIG_FILES([
82   Makefile
83   src/Makefile
84     src/include/Makefile
85       src/include/modules/Makefile
86     src/base/Makefile
87       src/base/Tests/Makefile
88       src/base/Tests/run_tests
89         src/base/Tests/trp_tcp_usage
90         src/base/Tests/trp_file_usage
91     src/examples/Makefile 
92       src/examples/ping/Makefile 
93   doc/Makefile
94 ],[( cd src/include ; test -e gras || ln -s . gras )
95      test -e src/base/Tests/trp_tcp_usage && chmod +x src/base/Tests/trp_tcp_usage;
96      test -e src/base/Tests/trp_file_usage && chmod +x src/base/Tests/trp_file_usage;
97      test -e src/base/Tests/run_tests     && chmod +x src/base/Tests/run_tests;
98      chmod +x src/examples/ping/test_rl; chmod +x src/examples/ping/test_sg])
99
100 #    src/modules/Makefile
101 #      src/examples/bandwidth/Makefile src/examples/saturate/Makefile
102 #      src/examples/alnem/Makefile 
103
104 AC_OUTPUT
105
106 echo "
107
108 Configuration of package \`${PACKAGE}' on $gras_arch_name (=$gras_arch):
109
110         Compiler:       ${CC}
111
112         CFlags:         ${CFLAGS}
113         LDFlags:        ${LDFLAGS}
114 "
115
116 exit 0;