-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
127 lines (107 loc) · 3.62 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
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
dnl Process this file with autoconf to produce configure.
AC_INIT(EcProcess.h)
AC_CONFIG_HEADER(config.h)
if test -z "$GNUSTEP_MAKEFILES"; then
GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null`
fi
if test -z "$GNUSTEP_MAKEFILES"; then
AC_MSG_ERROR([You must run the GNUstep initialization script first!])
fi
#--------------------------------------------------------------------
# Find the compiler
#--------------------------------------------------------------------
if test "$CC" = ""; then
CC=`gnustep-config --variable=CC`
fi
if test "$CPP" = ""; then
CPP=`gnustep-config --variable=CPP`
fi
if test "$CXX" = ""; then
CXX=`gnustep-config --variable=CXX`
fi
AC_PROG_CC
AC_PROG_CPP
AC_CANONICAL_HOST
dnl start proper config checks
AC_TYPE_SIGNAL
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(arpa/inet.h arpa/telnet.h netinet/in.h netdb.h pwd.h string.h fcntl.h sys/fcntl.h sys/file.h sys/resource.h sys/time.h sys/types.h sys/socket.h sys/signal.h stdlib.h unistd.h termios.h valgrind.h valgrind/valgrind.h)
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
AC_TYPE_MODE_T
AC_CHECK_FUNCS(getpid setpgid)
AC_CHECK_LIB([malloc],[mallinfo])
AC_CACHE_CHECK([for gettid()], ac_cv_gettid,
[AC_TRY_RUN(#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
int main(int argc, char **argv) {
pid_t t = syscall(SYS_gettid); return t == -1 ? 1 : 0; },
[ac_cv_gettid=yes], [ac_cv_gettid=no], [ac_cv_gettid=no])])
if test "$ac_cv_gettid" = "yes"; then
AC_DEFINE(HAVE_GETTID, 1, [Define if you have gettid()])
fi
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline],
[support fancy command line editing @<:@default=check@:>@])],
[],
[with_readline=yes])
LIBREADLINE=
AS_IF([test "x$with_readline" = xyes],
[AC_CHECK_LIB([readline], [main],
[AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"])
AC_DEFINE([HAVE_LIBREADLINE], [1],
[Define if you have libreadline])
],
[if test "x$with_readline" != xcheck; then
AC_MSG_FAILURE(
[--with-readline was given, but test for readline failed])
fi
], -lncurses)])
WITH_NET_SNMP="no"
AC_ARG_ENABLE(net-snmp,
[ --disable-net-snmp
Disables the use of net-snmp to provide SNMP alarms.],,
enable_net_snmp="yes")
if test $enable_net_snmp = "yes"; then
AC_PATH_PROG(NETSNMPCONFIG, net-snmp-config, no, )
if test "x$NETSNMPCONFIG" != "xno" ; then
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags | sed -e 's/-fstack-protector-strong//'`"
AC_CHECK_HEADERS(net-snmp/net-snmp-config.h)
CPPFLAGS="$ac_save_CPPFLAGS"
if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = "xyes"; then
CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags | sed -e 's/-fstack-protector-strong//'`"
SNMP_LIBS=`$NETSNMPCONFIG --libs`
AC_DEFINE(WITH_NET_SNMP, 1, [Define to enable support for NET-SNMP])
WITH_NET_SNMP="yes"
fi
fi
if test $WITH_NET_SNMP = "no"; then
AC_MSG_ERROR([Unable to find/use net-snmp ... you must install the net-snmp development package for your system or disable the use of net-snmp])
fi
fi
AC_SUBST(WITH_NET_SNMP)
AC_CHECK_HEADERS(readpassphrase.h bsd/readpassphrase.h)
oldlibs=$LIBS
AC_SEARCH_LIBS(readpassphrase, bsd)
AC_CHECK_FUNCS(readpassphrase)
if test "x$ac_cv_search_readpassphrase" != "xno";
then
if test "x$ac_cv_search_readpassphrase" != "xnone needed" ;
then
AC_SUBST([READPASSPHRASE_LIBS], ["$ac_cv_search_readpassphrase"])
fi
fi
LIBS=$oldlibs
oldlibs=$LIBS
AC_CHECK_LIB([crypt],[crypt])
if test "$ac_cv_lib_crypt_crypt" = "yes";
then
AC_SUBST([LIBCRYPT], ["-lcrypt"])
fi
LIBS=$oldlibs
AC_OUTPUT(config.make)