-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.ac
81 lines (61 loc) · 1.93 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
77
78
79
80
AC_PREREQ(2.59)
AC_INIT([netmgmt], [1.1.0], [support@vmware.com])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
m4_pattern_allow([AM_PROG_AR])
AM_PROG_AR
AC_PROG_CC
AC_PROG_LIBTOOL
dnl Check supported operating systems
dnl
case "${host_os}:${host_cpu}" in
linux*:x86_64)
;;
linux*:aarch64)
;;
*)
AC_ERROR("Unsupported operating system - ${host_os}:${host_cpu}")
;;
esac
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_GNU_SOURCE -fPIC"
AM_CPPFLAGS="$AM_CPPFLAGS -I${top_srcdir}/include"
AM_CFLAGS="$AM_CFLAGS -Wall -Werror -fno-strict-aliasing"
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CFLAGS)
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug], [enable debugging (default: disabled)])],
[
if test x"$enableval" = x"yes"
then
AM_CFLAGS="$AM_CFLAGS -g -O0"
AM_CPPFLAGS="$AM_CPPFLAGS -DDEBUG -DLDAP_DEBUG"
fi
])
AC_HEADER_STDC
AC_CHECK_HEADERS(pthread.h errno.h sys/types.h stdio.h string.h strings.h)
AC_CHECK_HEADERS(unistd.h time.h inttypes.h sys/socket.h netdb.h syslog.h)
AC_CHECK_HEADERS(stdlib.h locale.h stddef.h stdarg.h assert.h signal.h)
AC_CHECK_HEADERS(ctype.h netinet/in.h stdint.h)
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_FUNCS(strerror)
AC_CHECK_LIB([dl], [dlopen], [DL_LIBS="-ldl"])
AC_CHECK_LIB([pthread], [pthread_self], [PTHREAD_LIBS="-lpthread"])
PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_libglib=yes], [have_libglib=no])
AM_CONDITIONAL([GLIB], [test "$have_libglib" = "yes"])
AC_SUBST(DL_LIBS)
AC_SUBST(PTHREAD_LIBS)
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
AC_CONFIG_FILES([Makefile
common/Makefile
cli/Makefile
src/Makefile
tools/Makefile
tools/netmgr/Makefile
tests/Makefile
tests/apitest/Makefile
])
AC_OUTPUT