File: configure.ac

package info (click to toggle)
syslog-ng 3.3.5-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 14,120 kB
  • sloc: ansic: 60,880; sh: 12,423; yacc: 7,308; xml: 1,554; makefile: 1,242; python: 801; lex: 262; perl: 216; awk: 184
file content (147 lines) | stat: -rw-r--r-- 4,536 bytes parent folder | download
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
dnl Process this file with autoconf to produce a configure script.
dnl

AC_INIT(libmongo-client, 0.1.4, algernon@madhouse-project.org, libmongo-client, https://github.com/algernon/libmongo-client)
AM_INIT_AUTOMAKE([1.9 tar-ustar])

dnl ***************************************************************************
dnl dependencies

GLIB_MIN_VERSION="2.12.0"
OPENSSL_MIN_VERSION="0.9.8"

dnl ***************************************************************************
dnl Initial setup

AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_CONFIG_HEADER(config.h)

AC_ARG_WITH([versioned-symbols], AC_HELP_STRING([--with-versioned-symbols],[Use versioned symbols]),[dnl
vsymldflags="-Wl,--version-script,\${srcdir}/libmongo-client.ver -Wl,-O1"
],[vsymldflags=])

dnl ***************************************************************************
dnl Checks for programs.
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
LT_INIT([shared])

dnl ***************************************************************************
dnl Miscellanneous headers
dnl ***************************************************************************

AC_HEADER_STDC

dnl ***************************************************************************
dnl Header checks
dnl ***************************************************************************
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h sys/socket.h netdb.h])

AC_CACHE_CHECK(for struct sockaddr_storage, blb_cv_c_struct_sockaddr_storage,
  [AC_EGREP_HEADER([sockaddr_storage], sys/socket.h, blb_cv_c_struct_sockaddr_storage=yes,blb_cv_c_struct_sockaddr_storage=no)])

if test "$blb_cv_c_struct_sockaddr_storage" = "yes"; then
	AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE,[1],[struct sockaddr_storage is present on your system])
fi

AC_CACHE_CHECK(for struct sockaddr_in6, blb_cv_c_struct_sockaddr_in6,
  [AC_EGREP_HEADER([sockaddr_in6], netinet/in.h, blb_cv_c_struct_sockaddr_in6=yes,blb_cv_c_struct_sockaddr_in6=no)])

dnl ***************************************************************************
dnl Checks for libraries
AC_CHECK_FUNC(socket,,
 AC_CHECK_LIB(socket, socket))

AC_FUNC_MMAP
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_FUNCS(memset socket getaddrinfo munmap strtol strerror)

dnl ***************************************************************************
dnl GLib headers/libraries
dnl ***************************************************************************

PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_MIN_VERSION,,)

old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$GLIB_CFLAGS"

AC_CACHE_CHECK(sanity checking Glib headers,
               blb_cv_glib_sane,
[AC_TRY_RUN([
#include <glib.h>

int main()
{
  if (sizeof(long) != GLIB_SIZEOF_LONG)
    return 1;
  return 0;
}
],
blb_cv_glib_sane=yes,
blb_cv_glib_sane=no,
blb_cv_glib_sane=yes)])
CPPFLAGS=$old_CPPFLAGS

if test "x$blb_cv_glib_sane" = "xno"; then
	AC_MSG_ERROR([Glib headers inconsistent with current compiler setting. You might be using 32 bit Glib with a 64 bit compiler, check PKG_CONFIG_PATH])
fi

dnl Check for g_checksum_new
old_LIBS=$LIBS

dnl to make sure we're using glib from the proper path
LIBS=$GLIB_LIBS
AC_CHECK_LIB(glib-2.0, g_checksum_new, [glib_checksum="yes"; with_openssl="0"], [glib_checksum="no"; with_openssl="1"])
LIBS=$old_LIBS
if test "x$glib_checksum" = "xno"; then
  dnl Using the compat stuff disables symbol versioning
  vsymldflags=""
  PKG_CHECK_MODULES(OPENSSL, openssl >= $OPENSSL_MIN_VERSION,, OPENSSL_LIBS="")
  if test "x$OPENSSL_LIBS" = "x"; then
     AC_MSG_ERROR([OpenSSL is required when glib-2.0 << 2.16.0])
  fi
fi

AC_DEFINE_UNQUOTED(WITH_OPENSSL, $with_openssl, [Compile with OpenSSL])

dnl ***************************************************************************
dnl misc features to be enabled
dnl ***************************************************************************
AC_C_INLINE

AC_MSG_CHECKING(whether to enable IPv6 support)
if test "x$blb_cv_c_struct_sockaddr_in6" = "xyes"; then
	enable_ipv6=yes
	AC_MSG_RESULT(yes)
else
	enable_ipv6=no
	AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING([whether to enable symbol versioning])
AC_SUBST(vsymldflags)
if test -z "${vsymldflags}"; then
   AC_MSG_RESULT([no])
else
   AC_MSG_RESULT([yes, ${vsymldflags}])
fi

AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [package name])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [version number])

AC_OUTPUT(
	Doxyfile
	Makefile
	docs/Makefile
	docs/tutorial/Makefile
	examples/Makefile
	src/Makefile
	src/libmongo-client.pc
	tests/Makefile
	tests/libtap/Makefile
)