File: configure.ac

package info (click to toggle)
nc6 1.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,108 kB
  • ctags: 1,581
  • sloc: ansic: 12,966; sh: 6,695; makefile: 541; yacc: 288; sed: 16
file content (228 lines) | stat: -rw-r--r-- 5,464 bytes parent folder | download | duplicates (3)
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
dnl Process this file with autoconf to produce a configure script.
AC_INIT(nc6, 1.0, [ds6-devel@deepspace6.net])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src/main.c)
AM_GNU_GETTEXT_VERSION(0.14.1)
AM_INIT_AUTOMAKE(1.6)           dnl Automake 1.6 or better is required
AM_CONFIG_HEADER(config.h)
AC_PREREQ(2.52)                 dnl Autoconf 2.52 or better is required


dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_ISC_POSIX
AC_PROG_INSTALL


dnl default CFLAGS to use for nc6 source
NC6_CFLAGS=""


dnl add option for maintainer mode
AM_MAINTAINER_MODE

dnl internationalization macros
AM_GNU_GETTEXT


dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(
  [errno.h fcntl.h limits.h netdb.h netinet/in.h signal.h sys/socket.h sys/time.h unistd.h],,
  [AC_MSG_ERROR([Missing headers required to compile nc6])]
)
AC_CHECK_HEADER(stdint.h)


dnl Check paths
PATH_BSHELL
PATH_DEVNULL


dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_HEADER_STDBOOL
AC_CHECK_TYPE(ssize_t, int)
TYPE_SOCKLEN_T
TYPE_STRUCT_SOCKADDR_STORAGE(,
  [AC_MSG_ERROR([Your system does not support 'struct sockaddr_storage', which is needed to compile nc6])])
DEFINED_SOMAXCONN(,AC_DEFINE([SOMAXCONN], 5, [Default backlog parameter for listen(2).]))
DEFINED_WAIT_ANY(,AC_DEFINE([WAIT_ANY], (pid_t)0, [Parameter for waitpid(2) to wait for any processes.]))

dnl Configure Bluez support
bluez=
AC_ARG_ENABLE(bluez,
  AC_HELP_STRING(
    [--enable-bluez],[enable Bluetooth support (only on Linux)]),
  [case "${enable_bluez}" in
  no)
    AC_MSG_NOTICE([Disabling Bluetooth at user request])
    bluez=no
    ;;
  *)
    bluez=yes
    ;;
  esac],
  [bluez=yes]
)

dnl Check for sockaddr_l2
if test "X$bluez" = "Xyes"; then
  TYPE_STRUCT_SOCKADDR_L2(,[
    AC_MSG_NOTICE([Disabling Bluetooth support: 'struct sockaddr_l2cap' support is required])
    bluez=no
  ])
fi

dnl Check for Bluetooth protocol flags (PF_BLUETOOTH, etc)
if test "X$bluez" = "Xyes"; then
  PROTO_BLUEZ([
    AC_CHECK_LIB(bluetooth, baswap, , bluez=no)
  ],[
    AC_MSG_NOTICE([Disabling Bluetooth support: PF_BLUETOOTH protocol family is required])
    bluez=no
  ])
fi

if test "X$bluez" = "Xyes"; then
  AC_DEFINE([ENABLE_BLUEZ], 1, [Define if Bluetooth support is enabled.])
fi
AM_CONDITIONAL(BLUEZ, test "X$bluez" = "Xyes")


dnl Configure IPv6 support
ipv6=
AC_ARG_ENABLE(ipv6,
  AC_HELP_STRING(
    [--disable-ipv6],[disable IPv6 support]),
  [case "${enable_ipv6}" in
  no)
    AC_MSG_NOTICE([Disabling IPv6 at user request])
    ipv6=no
    ;;
  *)
    ipv6=yes
    ;;
  esac],
  [ipv6=yes]
)

dnl Check for sockaddr_in6
if test "X$ipv6" = "Xyes"; then
  TYPE_STRUCT_SOCKADDR_IN6(,[
    AC_MSG_NOTICE([Disabling IPv6 support: 'struct sockaddr_in6' support is required])
    ipv6=no
  ])

  dnl Check for scope id
  MEMBER_SIN6_SCOPE_ID
fi

dnl Check for in6 protocol flags (AF_INET6, etc)
if test "X$ipv6" = "Xyes"; then
  PROTO_INET6(,[
    AC_MSG_NOTICE([Disabling IPv6 support: INET6 protocol support is required])
    ipv6=no
  ])
fi

if test "X$ipv6" = "Xyes"; then
  AC_DEFINE([ENABLE_IPV6], 1, [Define if IPv6 support is enabled.])
fi


AC_ARG_ENABLE(stack-guess,
  AC_HELP_STRING(
    [--disable-stack-guess],
    [disable guess of IPv6 stack]
  ),
  [case "${enable_stack_guess}" in
  yes)  
    stack_guess=yes
    ;;
  no) 
    stack_guess=no
    ;;
  *)    
    AC_MSG_ERROR(bad value ${enable_stack_guess} for --enable-stack-guess option) 
    ;;
  esac],
  [stack_guess=yes]
)

if test "X$stack_guess" != "Xno"; then
  IN6_GUESS_STACK
  NC6_CFLAGS="${NC6_CFLAGS} ${INET6_CFLAGS}"
  LIBS="${INET6_LIBS} ${LIBS}"
fi

dnl Check for libraries
AC_CHECK_LIB(socket, socket)


dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF

AC_CHECK_FUNCS(
  [gettimeofday memset select socket getsockopt strerror strrchr strtol signal fcntl getaddrinfo freeaddrinfo gai_strerror getnameinfo],,
  [AC_MSG_ERROR([Missing functions required to compile nc6])]
)

dnl actually, the GETADDRINFO_AI_* macros do __NOT__ check if getaddrinfo 
dnl supports the AI_* flag, but only if the flag is defined in <netdb.h>
GETADDRINFO_AI_ADDRCONFIG(
  AC_DEFINE(
    [HAVE_GETADDRINFO_AI_ADDRCONFIG], 1, 
    [Define if the system headers support the AI_ADDRCONFIG flag.]
  )
)

GETADDRINFO_AI_V4MAPPED(
  AC_DEFINE(
    [HAVE_GETADDRINFO_AI_V4MAPPED], 1, 
    [Define if the system headers support the AI_V4MAPPED flag.]
  )
)

GETADDRINFO_AI_ALL(
  AC_DEFINE(
    [HAVE_GETADDRINFO_AI_ALL], 1, 
    [Define if the system headers support the AI_ALL flag.]
  )
)

dnl check if EAI_ADDRFAMILY is defined in <netdb.h> 
GETADDRINFO_EAI_ADDRFAMILY(
  AC_DEFINE(
    [HAVE_GETADDRINFO_EAI_ADDRFAMILY], 1,
    [Define if the system headers support the EAI_ADDRFAMILY error code.]
  )
)

dnl check if EAI_NODATA is defined in <netdb.h>
GETADDRINFO_EAI_NODATA(
  AC_DEFINE(
    [HAVE_GETADDRINFO_EAI_NODATA], 1,
    [Define if the system headers support the EAI_NODATA error code.]
  )
)

dnl The CFLAGS to use with GCC
if test "X$GCC" = "Xyes"; then
  NC6_CFLAGS="${NC6_CFLAGS} -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes -Wcast-qual -Wcast-align -finline-functions"
fi

AC_SUBST(NC6_CFLAGS)
AC_SUBST(ac_aux_dir)
AC_CONFIG_FILES([Makefile docs/Makefile src/Makefile contrib/Makefile config/Makefile intl/Makefile po/Makefile.in nc6.spec docs/nc6.1])
AC_OUTPUT