File: configure.in

package info (click to toggle)
asp 1.7
  • links: PTS
  • area: main
  • in suites: potato
  • size: 264 kB
  • ctags: 89
  • sloc: ansic: 1,058; sh: 189; makefile: 166
file content (163 lines) | stat: -rw-r--r-- 3,318 bytes parent folder | download
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
dnl -*-Fundamental-*-
dnl $Id: configure.in,v 1.25 1998/02/19 17:10:03 ste Exp $
dnl Process this file with autoconf to produce a configure script.

dnl Aggiunge il numero di revisione.
AC_REVISION($Revision: 1.25 $)

AC_INIT(asp.c)

dnl Crea il file config.h che contiene i #define.
AC_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(	\
	arpa/inet.h	\
	errno.h		\
	libc.h		\
	limits.h	\
	netdb.h		\
	netinet/in.h	\
	pwd.h		\
	string.h	\
	strings.h	\
	sys/ddi.h	\
	sys/select.h	\
	sys/socket.h	\
	sys/socketvar.h \
	sys/syslog.h	\
	sys/time.h 	\
	sys/utsname.h	\
	syslog.h	\
	unistd.h	\
)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME

ASP_CHECK_DECL(errno,
	[#ifdef HAVE_ERRNO_H
	#include <errno.h>
	#endif]
)

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(		\
	inet_aton	\
	select		\
	strchr		\
	uname		\
)

AC_REPLACE_FUNCS(strtol)

if test $ac_cv_func_inet_aton = yes; then
	ASP_CHECK_DECL(inet_aton,
		[#ifdef HAVE_ARPA_INET_H
		#include <arpa/inet.h>
		#endif]
	)
fi

AC_CHECK_FUNC(gethostname,
	AC_DEFINE(HAVE_GETHOSTNAME),
	[for lib in nsl resolv; do
		AC_CHECK_LIB($lib,
			gethostname,
			[AC_DEFINE(HAVE_GETHOSTNAME)
			LIBS="$LIBS -l$lib"
			break]
		)
	done]
)

AC_CHECK_FUNC(socket,
	AC_DEFINE(HAVE_SOCKET),
	[for lib in bsd socket; do
		AC_CHECK_LIB($lib,
			socket,
			[AC_DEFINE(HAVE_SOCKET)
			LIBS="$LIBS -l$lib"
			break]
		)
	done]
)

dnl Controlla la funzione strerror. In caso negativo controlla
dnl la dichiarazione di sys_errlist.
AC_CHECK_FUNC(strerror,
	AC_DEFINE(HAVE_STRERROR),
	ASP_CHECK_DECL(sys_errlist,
		[#include <stdio.h>
		#ifdef HAVE_ERRNO_H
		#   include <errno.h>
		#endif]
	)
)

dnl Controlla la funzione strsignal. In caso negativo controlla
dnl la dichiarazione di sys_siglist.
AC_CHECK_FUNC(strsignal,
	[AC_DEFINE(HAVE_STRSIGNAL)
	ASP_CHECK_DECL(strsignal,
		[#ifdef HAVE_STRING_H
		#   include <string.h>
		#else
		#   ifdef HAVE_STRINGS_H
		#      include <strings.h>
		#   endif
		#endif]
	)],
	AC_DECL_SYS_SIGLIST
)

dnl Controlla le features passate a configure tramite --enamble=FEATURE.
dnl Indica che sta controllando se vogliamo il debug.
AC_MSG_CHECKING(if you want to compile-in debug support)
AC_ARG_ENABLE(debug,
	[  --enable-debug          print some debugging information],
	[if test "$enableval" = "yes"; then
		ENABLE_DEBUG=-DENABLE_DEBUG
	else
		ENABLE_DEBUG=''
		# Toglie -g da $CFLAGS
		CFLAGS=`echo $CFLAGS | sed -e 's/-g //' -e 's/-g$//'`
		# Forza enableval a no
		enableval=no
	fi],
	[CFLAGS=`echo $CFLAGS | sed -e 's/-g //' -e 's/-g$//'`
	enableval=no]
)
dnl Scrive yes/no.
AC_MSG_RESULT($enableval)
dnl Sostituisce @ENABLE_DEBUG@ nel Makefile.in.
AC_SUBST(ENABLE_DEBUG)

dnl Controlla se e` stato passato un path alternativo per /etc/hosts.
AC_MSG_CHECKING(for hosts data base path)
AC_ARG_WITH(hosts-path,
	[  --with-hosts-path=PATH  hosts data base (default: /etc/hosts)],
	[if ! test -f "$withval"; then
		AC_MSG_ERROR(File $withval not found)
	fi],
	withval=/etc/hosts
)
dnl Scrive il PATH.
AC_MSG_RESULT($withval)
dnl Definisce su config.h HOSTS_PATH.
AC_DEFINE_UNQUOTED(HOSTS_PATH, "$withval")


AC_OUTPUT(Makefile)