~ubuntu-branches/ubuntu/oneiric/libee/oneiric

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2010-12-11 12:37:09 UTC
  • Revision ID: james.westby@ubuntu.com-20101211123709-i8v7mpdtzhgjoqn5
Tags: upstream-0.1.0
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_PREREQ(2.61)
 
5
AC_INIT([libee], [0.1.0], [rgerhards@adiscon.com])
 
6
AM_INIT_AUTOMAKE
 
7
AM_SILENT_RULES([yes])
 
8
AC_CONFIG_SRCDIR([src/ctx.c])
 
9
AC_CONFIG_HEADER([config.h])
 
10
 
 
11
# Checks for programs.
 
12
AC_PROG_CC
 
13
AM_PROG_CC_C_O
 
14
if test "$GCC" = "yes"
 
15
then CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
 
16
fi
 
17
 
 
18
AC_PROG_LIBTOOL
 
19
 
 
20
# Checks for libraries.
 
21
save_LIBS=$LIBS
 
22
LIBS=
 
23
#AC_SEARCH_LIBS(clock_gettime, rt)
 
24
#rt_libs=$LIBS
 
25
LIBS=$save_LIBS
 
26
 
 
27
AC_CHECK_PROG(
 
28
  [HAVE_LIBXML2_CONFIG],
 
29
  [xml2-config],
 
30
  [yes],,,
 
31
)
 
32
if test "x${HAVE_LIBXML2_CONFIG}" != "xyes"; then
 
33
  AC_MSG_FAILURE([xml2-config not found in PATH - this means libxml2 development package is missing])
 
34
fi
 
35
AC_CHECK_LIB(
 
36
  [xml2],
 
37
  [xmlReadFile],
 
38
  [LIBXML2_CFLAGS=`xml2-config --cflags`
 
39
   LIBXML2_LIBS=`xml2-config --libs`
 
40
  ],
 
41
  [AC_MSG_FAILURE([libxml2 is missing])],
 
42
  [`xml2-config --libs`]
 
43
)
 
44
AC_SUBST(LIBXML2_CFLAGS)
 
45
AC_SUBST(LIBXML2_LIBS)
 
46
 
 
47
AC_SUBST(rt_libs)
 
48
 
 
49
# Checks for header files.
 
50
#AC_HEADER_STDC
 
51
#AC_CHECK_HEADERS([])
 
52
 
 
53
# Checks for typedefs, structures, and compiler characteristics.
 
54
#AC_C_CONST
 
55
#AC_TYPE_SIZE_T
 
56
#AC_HEADER_TIME
 
57
#AC_STRUCT_TM
 
58
 
 
59
# Checks for library functions.
 
60
AC_FUNC_MALLOC
 
61
#AC_FUNC_SELECT_ARGTYPES
 
62
#AC_TYPE_SIGNAL
 
63
#AC_CHECK_FUNCS([])
 
64
 
 
65
LIBEE_CFLAGS="-I\$(top_srcdir)/include"
 
66
LIBEE_LIBS="\$(top_builddir)/src/libee.la"
 
67
AC_SUBST(LIBEE_CFLAGS)
 
68
AC_SUBST(LIBEE_LIBS)
 
69
 
 
70
# modules we require
 
71
PKG_CHECK_MODULES(LIBESTR, libestr >= 0.0.0)
 
72
 
 
73
# enable/disable the testbench (e.g. because some important parts
 
74
# are missing)
 
75
AC_ARG_ENABLE(testbench,
 
76
        [AS_HELP_STRING([--enable-testbench],[file input module enabled @<:@default=yes@:>@])],
 
77
        [case "${enableval}" in
 
78
         yes) enable_testbench="yes" ;;
 
79
          no) enable_testbench="no" ;;
 
80
           *) AC_MSG_ERROR(bad value ${enableval} for --enable-testbench) ;;
 
81
         esac],
 
82
        [enable_testbench=yes]
 
83
)
 
84
AM_CONDITIONAL(ENABLE_TESTBENCH, test x$enable_testbench = xyes)
 
85
 
 
86
 
 
87
# debug mode settings
 
88
AC_ARG_ENABLE(debug,
 
89
        [AS_HELP_STRING([--enable-debug],[Enable debug mode @<:@default=no@:>@])],
 
90
        [case "${enableval}" in
 
91
         yes) enable_debug="yes" ;;
 
92
          no) enable_debug="no" ;;
 
93
           *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
 
94
         esac],
 
95
        [enable_debug="no"]
 
96
)
 
97
AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes)
 
98
if test "$enable_debug" = "yes"; then
 
99
        AC_DEFINE(DEBUG, 1, [Defined if debug mode is enabled (it's easier to check in the code).])
 
100
fi
 
101
if test "$enable_debug" = "no"; then
 
102
        AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.])
 
103
fi
 
104
 
 
105
 
 
106
 
 
107
AC_CONFIG_FILES([Makefile \
 
108
                libee.pc \
 
109
                src/Makefile \
 
110
                include/Makefile \
 
111
                include/libee/Makefile \
 
112
                tests/Makefile])
 
113
AC_OUTPUT
 
114
AC_CONFIG_MACRO_DIR([m4])
 
115
 
 
116
 
 
117
echo "*****************************************************"
 
118
echo "libee will be compiled with the following settings:"
 
119
echo
 
120
echo "Debug mode enabled:          $enable_debug"
 
121
echo "Testbench enabled:           $enable_testbench"