1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
AC_INIT([libneardal], [0.1.0])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_PROG_LIBTOOL
AC_CONFIG_HEADERS([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
## Default values
CFLAGS="-W -Wall"
## Compiled in debug mode
debug=yes
## Compiled with traces
traces=yes
AC_PROG_CC
AM_PROG_CC_C_O
## Compiler option
## Debug ?
AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],
[disable compiling with debugging information]), [
if (test "${enableval}" = "no" &&
test "${ac_cv_prog_cc_g}" = "yes"); then
debug=no
fi
])
if (test "${debug}" = "yes"); then
CFLAGS="$CFLAGS -g -O0"
echo 'NEARDAL will be compiled in debug mode. CFLAGS='${CFLAGS}
else
CFLAGS="$CFLAGS -O2"
echo 'NEARDAL will not be compiled in debug mode. CFLAGS='${CFLAGS}
fi
## Traces ?
AC_ARG_ENABLE(traces, AC_HELP_STRING([--disable-traces],
[remove traces while compiling]), [
if (test "${enableval}" = "no"); then
traces=no
echo 'NEARDAL will be compiled without traces... ('NEARDAL_TRACES' will not be defined)'
fi
])
if (test "${traces}" = "yes"); then
CFLAGS="$CFLAGS -DNEARDAL_TRACES"
echo 'NEARDAL will be compiled with traces...('NEARDAL_TRACES' will be defined)'
fi
## Check dependances
GLIB_REQUIRED=2.30.0
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED, dummy=yes,
AC_MSG_ERROR(GLib >= $GLIB_REQUIRED is required))
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0 >= $GLIB_REQUIRED, dummy=yes,
AC_MSG_ERROR(gio-unix >= $GLIB_REQUIRED is required))
AC_SUBST(GIO_UNIX_CFLAGS)
AC_SUBST(GIO_UNIX_LIBS)
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN";
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
fi
AM_CONDITIONAL([HAVE_DOXYGEN],
[test -n "$DOXYGEN"])AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doxygen.cfg])])
AC_CONFIG_FILES([Makefile lib/Makefile ncl/Makefile neardal.pc])
AC_OUTPUT
|