File: configure.ac

package info (click to toggle)
ample 0.5.7-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 548 kB
  • ctags: 243
  • sloc: ansic: 2,823; sh: 2,624; makefile: 244
file content (137 lines) | stat: -rw-r--r-- 3,851 bytes parent folder | download | duplicates (8)
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
dnl Process this file with autoconf to produce a configure script.



dnl Some intro checks and defines
AC_INIT(Ample,AMPLE_VERSION,david@2gen.com)
AC_REVISION ($Id: configure.ac,v 1.14 2003/11/25 09:28:27 alphix Exp $)
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(src/ample.c)
AC_CONFIG_HEADER(config.h)

PACKAGE=ample
AMPLE_MAJOR_VERSION=0
AMPLE_MINOR_VERSION=5
AMPLE_MICRO_VERSION=7

AMPLE_VERSION=\"$AMPLE_MAJOR_VERSION.$AMPLE_MINOR_VERSION.$AMPLE_MICRO_VERSION\"
AC_DEFINE_UNQUOTED(AMPLE_VERSION,$AMPLE_VERSION,[Define program version])



dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL



dnl Checks for libraries.
dnl from aclocal.m4
AC_CHECK_SOCKET_LIBS



dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h limits.h netinet/in.h stdlib.h \
		  string.h sys/socket.h unistd.h getopt.h signal.h stdint.h \
		  netdb.h])



dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
dnl from aclocal.m4
AC_TYPE_SOCKLEN_T



dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getcwd inet_ntoa memset socket strcasecmp alarm strchr strdup strerror strncasecmp strrchr strtol])
AC_FUNC_FORK
AC_FUNC_MALLOC



dnl Checks for conditionals

dnl Does the combination of tcpwrappers and syslog options make sense?
AC_ARG_ENABLE(libwrap, AC_HELP_STRING([--enable-libwrap],[Use tcpd wrappers]))
AC_ARG_ENABLE(syslog, AC_HELP_STRING([--disable-syslog],[Disable the use of syslog]))
AC_MSG_CHECKING([libwrap/sysconf interoperability])
if test "x$enable_libwrap" = "xyes" -a "x$enable_syslog" = "xno" ; then
	dnl syslog disabled, libwrap enabled
	AC_MSG_ERROR([you can't enable libwrap and disable syslog])
elif test "x$enable_libwrap" = "xyes" ; then
	dnl syslog enabled, libwrap enabled
	AC_MSG_RESULT([ok])
	AC_CHECK_HEADERS([syslog.h],,[AC_MSG_ERROR([syslog enabled but syslog header not found])])
	dnl from aclocal.m4	
	AC_LIB_WRAP
elif test "x$enable_syslog" != "xno" ; then
	dnl syslog enabled, libwrap disabled
	AC_MSG_RESULT([ok])
	AC_CHECK_HEADERS([syslog.h],,AC_MSG_ERROR([syslog enabled but syslog header not found]))
else
	dnl syslog disabled, libwrap disabled
	AC_MSG_RESULT([ok])
fi

dnl Do we want to log to a special facility?
AC_MSG_CHECKING([log facility])
AC_ARG_ENABLE(facility, AC_HELP_STRING([--enable-facility=ARG],[Syslog to ARG instead of LOG_DAEMON]))
if test "x$enable_facility" = "xyes" ; then
	AC_MSG_ERROR([you have to give an option to --enable-facility])
elif test "x$enable_facility" = "xno" -o "x$enable_facility" = "x"; then
	AC_DEFINE_UNQUOTED(LOG_FACILITY, LOG_DAEMON, [Log facility to use with syslog])
else
	AC_DEFINE_UNQUOTED(LOG_FACILITY, $enable_facility, [Log facility to use with syslog])
fi
AC_MSG_RESULT([ok])

dnl Done
echo
echo "Creating files"
AC_OUTPUT([Makefile src/Makefile docs/Makefile])
echo



dnl Pretty-print status message
echo "+----------------------------------------+"
echo "|              SUCCESS                   |"
echo "+----------------------------------------+"
echo "  Ample has been configured, you should"
echo "  now type 'make' to compile Ample."
echo
echo "+----------------------------------------+"
echo "|          YOUR CONFIGURATION            |"
echo "+----------------------------------------+"

echo "  Version:      $AMPLE_MAJOR_VERSION.$AMPLE_MINOR_VERSION.$AMPLE_MICRO_VERSION"

if test "x$enable_syslog" = "xno" ; then
	echo "  Syslog:       disabled"
	echo "  Libwrap:      disabled"
elif test "x$enable_libwrap" = "xyes" ; then
	echo "  Syslog:       enabled"
	echo "  Libwrap:      enabled"
else
	echo "  Syslog:       enabled"
	echo "  Libwrap:      disabled"
fi	

if test "x$enable_facility" != "xno" -a "x$enable_facility" != "x"; then
	echo "  Log facility: $enable_facility"
fi

echo