This repository has been archived by the owner on Jun 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathconfigure.ac
86 lines (66 loc) · 2.15 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
81
82
83
84
85
86
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([dmclient], [0.1.0], [[email protected]])
AM_INIT_AUTOMAKE([foreign])
LT_PREREQ([2.2])
LT_INIT
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_ARG_ENABLE([logging], AS_HELP_STRING([--enable-tests], [Build test client and plugins]))
AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [Build test client and plugins]))
# set plugins directory
if test "${prefix}" = "NONE"; then
prefix=${ac_default_prefix}
fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=${prefix}
fi
libdir=${exec_prefix}/lib
# Checks for libraries.
PKG_PROG_PKG_CONFIG(0.16)
AS_IF([test "x$enable_tests" = "xyes"], [
AC_CONFIG_HEADERS([config.h])
AC_CHECK_LIB(dl, dlopen)
PKG_CHECK_MODULES([LIBCURL], [libcurl])
PKG_CHECK_MODULES([SQLITE3], [sqlite3])
mo_install_dir=${exec_prefix}/bin/plugins
AC_SUBST([MO_INSTALL_DIR], [${mo_install_dir}])
AC_DEFINE_UNQUOTED([MO_INSTALL_DIR], ["${mo_install_dir}"], [management objects installation directory])
])
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset])
if test "x${CFLAGS}" = "x"; then
CFLAGS="-O2"
fi
CFLAGS+=" -fPIC"
if test "x${logging}" = xyes; then
AC_DEFINE([DMC_LOGGING], 1, [logging enabled])
fi
AM_CONDITIONAL([BUILD_TESTS], [test "x${enable_tests}" = xyes])
AC_CONFIG_FILES([Makefile
dmcore/Makefile
externals/Makefile
externals/SyncMLRTK/Makefile
externals/libmd5-rfc/Makefile
tests/Makefile
dmcore/libdmclient.pc])
AC_OUTPUT
echo \
"-------------------------------------------------
${PACKAGE_NAME} Version ${PACKAGE_VERSION}
Prefix: '${prefix}'.
Compiler: '${CC} ${CFLAGS} ${CPPFLAGS}'
Package features:
enable-tests: ${enable_tests}
--------------------------------------------------"