-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfigure.ac
More file actions
76 lines (60 loc) · 1.89 KB
/
configure.ac
File metadata and controls
76 lines (60 loc) · 1.89 KB
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
AC_INIT([Puttle], [1.1.3], [moncelier@devlife.org])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS(config.h)
AC_PROG_CXX
AC_PROG_LIBTOOL
PKG_CHECK_MODULES(LOG4CPP, log4cpp)
PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.6)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS([tr1/cstdint])
AC_CHECK_HEADERS([boost/cstdint.hpp])
AC_LANG_RESTORE
dnl enable debug
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug], [build with debugging symbols @<:@default=no@:>@]),
[case "${enableval}" in
yes | no ) enable_debug="${enableval}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],
[enable_debug="no"]
)
AC_MSG_RESULT([$debugit])
AC_DEFUN([PUTTLE_BOOST_CHECK_LIB],[
for i in "-gcc-mt" "-mt" ""; do
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_LIB([$1$i], [main], [pt_boost_lib="-l$1$i"; break], [pt_boost_lib=""])
AC_LANG_RESTORE
done
if test -z "${pt_boost_lib}"; then
AC_MSG_ERROR([Not Found: $1])
else
LIBS="$LIBS ${pt_boost_lib}"
fi
])
PUTTLE_BOOST_CHECK_LIB([boost_regex])
PUTTLE_BOOST_CHECK_LIB([boost_system])
PUTTLE_BOOST_CHECK_LIB([boost_thread])
PUTTLE_BOOST_CHECK_LIB([boost_program_options])
AC_CHECK_HEADERS(pthread.h,, [AC_MSG_ERROR([pthread.h required])])
AC_CHECK_LIB(pthread, pthread_create, [PTHREAD_LIBS="-lpthread"])
AM_CONDITIONAL(HAVE_DEBUG, test "$enable_debug" = yes)
if test "$enable_debug" = yes; then
AM_CFLAGS="-g -Wall -Werror -Wno-uninitialized -O0"
AM_CXXFLAGS="-g -Wall -Werror -Wno-uninitialized -O0"
AC_DEFINE(HAVE_DEBUG, 1, [Define to 1 if you want debug.])
fi
AM_CXXFLAGS="$AM_CXXFLAGS $OPENSSL_CFLAGS -std=gnu++0x"
LIBS="$LIBS $OPENSSL_LIBS $LOG4CPP_LIBS $PTHREAD_LIBS"
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST([LIBS])
AC_CONFIG_FILES(
Makefile
src/Makefile
tests/Makefile
)
AC_OUTPUT