forked from PavelVinogradov/sams2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
137 lines (119 loc) · 3.94 KB
/
configure.in
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
AC_INIT(sams2, 2.0.0, [email protected])
AM_INIT_AUTOMAKE(sams2, 2.0.0)
AC_CONFIG_SRCDIR([src/tools.h])
AC_CONFIG_HEADER([src/config.h])
AC_GNU_SOURCE
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
# Checks for header files.
AC_HEADER_DIRENT
AC_CHECK_HEADERS([arpa/inet.h netdb.h syslog.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_PID_T
AC_C_RESTRICT
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_REPLACE_FNMATCH
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_HEADER_STDC
AC_FUNC_MKTIME
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([inet_ntoa memset strerror])
gl_READUTMP
gl_SYS_PROC_UPTIME
gl_GETLOADAVG([plugins/loadavg])
gl_FSUSAGE
#gl_LIST_MOUNTED_FILE_SYSTEMS
# SCO-ODT-3.0 is reported to need -lufc for crypt.
# NetBSD needs -lcrypt for crypt.
# Uncomment this, if function CryptPassword is used
#sams_saved_libs="$LIBS"
#AC_SEARCH_LIBS(crypt, [ufc crypt],
# [test "$ac_cv_search_crypt" = "none required" ||
# LIB_CRYPT="$ac_cv_search_crypt"])
#LIBS="$sams_saved_libs"
#AC_SUBST(LIB_CRYPT)
AC_CHECK_LDAP([use_ldap_dev])
AC_CHECK_SRC_DOCS
AC_CHECK_PCRE([which_pcre])
AC_CHECK_MYSQL([use_mysql_dev])
AC_CHECK_PQ([use_pq_dev])
AC_CHECK_UNIXODBC([use_unixodbc_dev])
AC_CHECK_HTTPD([httpd_server])
AC_SUBST(httpd_server)
AC_SUBST(HTTPD_ROOT)
AC_SUBST(SERVER_CONFIG_FILE)
AC_SUBST(HTTPD_INCLUDE)
use_dl_dev="no"
if test "$lt_cv_dlopen" = "dlopen"; then
if test ! x"$lt_cv_dlopen_libs" = "x"; then
dl_libname=`echo $lt_cv_dlopen_libs | sed -s 's|^-l||g'`
AC_CHECK_LIB([$dl_libname], [dlopen], [have_dlopen=yes], [])
AC_CHECK_LIB([$dl_libname], [dlclose], [have_dlclose=yes], [])
AC_CHECK_LIB([$dl_libname], [dlerror], [have_dlerror=yes], [])
AC_CHECK_LIB([$dl_libname], [dlsym], [have_dlsym=yes], [])
else
AC_CHECK_FUNC([dlopen], [have_dlopen=yes], [])
AC_CHECK_FUNC([dlclose], [have_dlclose=yes], [])
AC_CHECK_FUNC([dlerror], [have_dlerror=yes], [])
AC_CHECK_FUNC([dlsym], [have_dlsym=yes], [])
fi
if test "$have_dlopen" = "yes" -a "$have_dlclose" = "yes" -a "$have_dlerror" = "yes" -a "$have_dlsym" = "yes"; then
AC_DEFINE([USE_DL], [1], [Define to 1 if compile with dynamic plugin support])
LIBS="$LIBS $lt_cv_dlopen_libs"
use_dl_dev="yes"
fi
fi
AC_CONFIG_FILES([Makefile src/Makefile php/Makefile doc/Makefile plugins/loadavg/Makefile plugins/fsusage/Makefile])
AC_OUTPUT
eval path_sysconfdir=$sysconfdir
eval path_bindir=$bindir
eval path_bindir=$path_bindir
eval path_datadir=$datadir
eval path_datadir=$path_datadir
eval httpd_server=$httpd_server
eval HTTPD_ROOT=$HTTPD_ROOT
eval SERVER_CONFIG_FILE=$SERVER_CONFIG_FILE
eval HTTPD_INCLUDE=$HTTPD_INCLUDE
echo ""
echo "Use MySQL API: $use_mysql_dev"
echo "Use PostgreSQL API: $use_pq_dev"
echo "Use unixODBC API: $use_unixodbc_dev"
echo "Use LDAP API: $use_ldap_dev"
echo "Using pcre: $which_pcre"
echo "Use dynamic plugin: $use_dl_dev"
echo ""
echo "Locations:"
echo "config file: $path_sysconfdir/sams2.conf"
echo "daemons: $path_bindir"
echo "web interface: $path_datadir/${PACKAGE}"
echo "documentation: $path_datadir/doc/${PACKAGE}-${VERSION}"
echo ""
echo "Note: If later on, you will use"
echo " make install exec_prefix=/foo"
echo " or make install DESTDIR=/tmp/package"
echo " the locations above would be incorrect"
echo ""
if test "$which_pcre" = "none"; then
echo "WARNING: Regular expressions won't work without pcre or pcrecpp"
echo ""
fi
if test "$use_mysql_dev" = "no" -a "$use_pq_dev" = "no" -a "$use_unixodbc_dev" = "no"; then
echo "Neither MySQL nor PostgreSQL nor unixODBC API detected."
echo "Install at least one of them and run configure again."
echo "Aborted."
else
echo "Configure completed. Run make (or gmake) to build the programs."
fi
echo ""