This repository has been archived by the owner on Sep 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
76 lines (61 loc) · 1.8 KB
/
configure.ac
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
73
74
75
76
dnl generic configuration
AC_PREREQ(2.59)
AC_INIT(libexception, 0.1)
AC_GNU_SOURCE
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2])
dnl check for progs
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
# define PTHREAD_LIBS to the linker flag used for pthread support
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[[#include <pthread.h>]],
[[pthread_mutex_t test_mutex;]]
)])
${CC} -pthread conftest.c -o conftest.o > /dev/null 2>&1
if test $? -eq 0; then
PTHREAD_LIBS="-pthread"
else
${CC} -lpthread conftest.c -o conftest.o > /dev/null 2>&1
if test $? -eq 0; then
PTHREAD_LIBS="-lpthread"
fi
fi
AC_SUBST(PTHREAD_LIBS)
dnl check for debugging code
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug], [enable debugging (default: disabled)]),
[enable_debug=$enableval], [enable_debug=no])
if test "$enable_debug" = "yes"; then
CPPFLAGS="$CPPFLAGS -DCONFIG_DEBUG=1"
fi
dnl checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
dnl compiler settings
CFLAGS="${CFLAGS} -std=gnu99 -pedantic -Wall"
CFLAGS="${CFLAGS} -Wpointer-arith -Wcast-qual -Winline"
CFLAGS="${CFLAGS} -Wredundant-decls -Wcast-align -Wno-unused-parameter"
# Final info page
AC_CONFIG_COMMANDS_PRE([SUMMARY="$PACKAGE_STRING configured successfully:
CC: $CC ($($CC --version | head -n1))
CPPFLAGS: '$CPPFLAGS'
CFLAGS: '$CFLAGS'
build: $build
host: $host
target: $target
prefix: $prefix
"])
dnl Makefile outputs
AC_CONFIG_FILES(Makefile
Doxyfile
src/Makefile
test/Makefile)
AC_OUTPUT
AC_MSG_NOTICE([$SUMMARY])
# vim: ts=4 expandtab