This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
112 lines (96 loc) · 3.09 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(BGPmon, 7.2.2, [email protected])
# Checks for programs.
CFLAGS_MINE="$CFLAGS"
AC_PROG_CC
CFLAGS="$CFLAGS_MINE"
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PATH_PROG(CHKCONFIG,chkconfig,"no")
AC_PATH_PROG(UPDATERC,update-rc.d,"no")
AC_PATH_PROG(STARTSTOPD,start-stop-daemon,"no")
AC_PATH_PROG(USERADD,useradd,"no")
AC_PATH_PROG(ID,id,"no")
AC_SUBST(CONFNAME)
CONFNAME=bgpmon_config.txt
AC_ARG_ENABLE(bgpmonuser,AS_HELP_STRING([--disable-bgpmonuser], [Disable bgpmon user creation.]))
AC_SUBST(ENABLE_BGPMONUSER)
AC_ARG_ENABLE(initscripts,AS_HELP_STRING([--disable-initscripts], [Disable installation of scripts in /etc/init.d.]))
AC_SUBST(ENABLE_INITSCRIPTS)
AS_IF([test "x$enable_initscripts" != "xno"], [ENABLE_INITSCRIPTS="yes"],[ENABLE_INITSCRIPTS="no"])
AS_IF([test "x$enable_bgpmonuser" != "xno"], [ENABLE_BGPMONUSER="yes"],[ENABLE_BGPMONUSER="no" ENABLE_INITSCRIPTS="no"])
#AC_CONFIG_SRCDIR([site_defaults.h])
AC_CONFIG_HEADER([config.h])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/socket.h sys/timeb.h syslog.h unistd.h linux/tcp.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_HEADER_STDBOOL
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([bzero dup2 ftime gethostname inet_ntoa memmove memset select socket strchr strerror strstr])
# check for libraries
AC_CHECK_LIB(pthread, pthread_create,,AC_MSG_ERROR([pthread not found!]))
AC_CHECK_LIB(compat, ftime)
AC_ARG_WITH(xml2-include-dir,
AC_HELP_STRING(
[--with-xml2-include-dir],
[XML2 include directory]),
[xml2_include_dir=$withval])
AC_ARG_WITH(xml2-lib-dir,
AC_HELP_STRING(
[--with-xml2-lib-dir],
[XML2 library directory]),
[xml2_lib_dir=$withval])
## Determine XML2 library path
# try and find libs without any additional libraries
AC_CHECK_LIB(xml2, xmlParseFile,
XML2_LIBS=" ",
XML2_LIBS=
)
# hunt through several directories trying to find the libraries
if test "x$XML2_LIBS" = "x"; then
old_LDFLAGS="$LDFLAGS"
for try in $xml2_lib_dir /usr/lib64 /usr/lib /usr/local/lib ; do
LDFLAGS="$old_LDFLAGS -L$try"
unset ac_cv_lib_xml2_xmlParseFile
AC_CHECK_LIB(xml2, xmlParseFile,
XML2_LIBS="-L$try",
XML2_LIBS=
)
if test "x$XML2_LIBS" != "x"; then
break;
fi
done
LDFLAGS="$old_LDFLAGS $XML2_LIBS"
fi
if test "x$XML2_LIBS" = "x"; then
AC_MSG_ERROR([XML2 libraries not found. Use --with-xml2-lib-dir=<path>])
fi
# don't forget to add xml2 to the list of libraries
LIBS="-lxml2 $LIBS"
CFLAGS="$CFLAGS -O2 -g `xml2-config --cflags`"
AC_CONFIG_FILES([site_defaults.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo "*******************************************"
echo " ok, let's make "
echo "*******************************************"