"Fossies" - the Fresh Open Source Software Archive 
Member "leafnode-1.12.0/configure.ac" (26 May 2022, 14058 Bytes) of package /linux/misc/leafnode-1.12.0.tar.xz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
See also the latest
Fossies "Diffs" side-by-side code changes report for "configure.ac":
1.11.12_vs_1.12.0.
1 dnl autoconf script for leafnode -*- m4 -*- vim: set tw=0:
2 dnl written by Cornelius Krasel, 1999
3 dnl enhanced and copyright by Matthias Andree, 2000 - 2022
4 dnl
5 dnl Process this file with autoconf to produce a configure script.
6 AC_INIT([leafnode],[1.12.0])
7 AC_PREREQ([2.69])
8 AC_CONFIG_SRCDIR([leafnode.h])
9 AM_INIT_AUTOMAKE
10 AC_CONFIG_HEADERS([config.h])
11
12 dnl Checks for programs.
13 AC_PROG_AWK
14 AC_PROG_CC_STDC
15
16 AC_USE_SYSTEM_EXTENSIONS
17
18 dnl figure inline
19 AC_C_INLINE
20 dnl kill volatile if not understood:
21 AC_C_VOLATILE
22
23 AC_PROG_RANLIB
24 AC_PROG_MAKE_SET
25 AC_PROG_INSTALL
26 AC_PROG_MAKE_SET
27 AC_PROG_RANLIB
28 AC_PROG_SED
29
30 AC_CHECK_TOOL([AR],ar,ar,$PATH:/usr/sbin:/usr/ccs/bin )
31 AC_CHECK_TOOL([STRIP],[strip])
32 AC_PATH_PROG( RPM, rpm )
33 AC_PATH_PROG([ID], [id], [false], /usr/xpg4/bin:/usr/bin:/bin)
34
35 dnl check whether called with --with-ipv6
36 AC_ARG_WITH(ipv6,
37 AS_HELP_STRING([--without-ipv6],[disable IPv6 support (default enable)]),,[with_ipv6=yes])
38 if test "$with_ipv6" != "no" ; then
39 AC_DEFINE(HAVE_IPV6, 1, [Define to 1 this to compile with IPv6 support.])
40 fi
41
42 AC_CHECK_DECL(AI_ADDRCONFIG,,AC_DEFINE(AI_ADDRCONFIG,0,[define to 0 if your system does not support AI_ADDRCONFIG]),[#define _XOPEN_SOURCE 600
43 #include <netdb.h>])
44
45 dnl check where to put the confdir
46 AC_ARG_WITH(confdir,
47 AS_HELP_STRING([--with-confdir],[obsolete option, use --sysconfdir]),
48 AC_MSG_ERROR([--with-confdir=D is obsolete. Please use --sysconfdir=D.]))
49 if test "$sysconfdir" = '${prefix}/etc' && test "x$prefix" = "xNONE" ; then
50 CONFDIR='/etc/leafnode'
51 else
52 CONFDIR="$sysconfdir"
53 fi
54
55 if test "$CONFDIR" != "$sysconfdir"; then
56 AC_MSG_WARN([***])
57 AC_MSG_WARN([*** overriding sysconfdir to $CONFDIR])
58 AC_MSG_WARN([*** use --sysconfdir to fix])
59 AC_MSG_WARN([*** use --sysconfdir='\$prefix/etc' to get default autoconf behaviour])
60 AC_MSG_WARN([***])
61 sleep 1
62 fi
63 sysconfdir=$CONFDIR
64 AC_SUBST(sysconfdir)
65
66 if test "$localstatedir" = '${prefix}/var' && test "$prefix" = NONE ; then
67 myvar=/var
68 else
69 myvar="$localstatedir"
70 fi
71
72 dnl check where to put the spooldir
73 AC_MSG_CHECKING(spooldir)
74 AC_ARG_WITH(spooldir,
75 AS_HELP_STRING([--with-spooldir],[news spool directory (/var/spool/news)]),
76 [ case "${withval-}" in
77 /*) ;;
78 *) AC_MSG_ERROR(you must give an absolute path)
79 ;;
80 esac
81 withval=`echo "$withval" | sed 'sx/*$xx;'`]
82 ,
83 withval="$myvar/spool/news"
84 )
85 SPOOLDIR=$withval
86 AC_MSG_RESULT($SPOOLDIR)
87 AC_SUBST(SPOOLDIR)
88
89 dnl check where to put the lockfile
90 AC_MSG_CHECKING(lockfile)
91 AC_ARG_WITH(lockfile,
92 AS_HELP_STRING([--with-lockfile],[lockfile path (${spooldir}/leaf.node/lock.file)]),
93 [
94 case "${withval-}" in
95 /*) ;;
96 *) AC_MSG_ERROR(you must give an absolute path)
97 ;;
98 esac ]
99 ,
100 withval="$SPOOLDIR/leaf.node/lock.file"
101 )
102 LOCKFILE=$withval
103 AC_MSG_RESULT($LOCKFILE)
104 AC_SUBST(LOCKFILE)
105
106 dnl Checks for types.
107 AC_TYPE_MODE_T
108 AC_TYPE_OFF_T
109 AC_TYPE_UID_T
110
111 dnl Checks for header files.
112 AC_HEADER_DIRENT
113 AC_HEADER_STDC
114 AC_HEADER_SYS_WAIT
115
116 dnl Check whether all necessary include files are there
117 AC_MSG_CHECKING(for system include files)
118 AC_CACHE_VAL(cf_cv_sysheaders, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
119 #include <sys/param.h>]], [[
120 return 0; ]])],[ cf_cv_sysheaders="yes" ],[ cf_cv_sysheaders="no" ])
121 )
122 if test "$cf_cv_sysheaders" = "yes"
123 then
124 AC_MSG_RESULT(yes)
125 else
126 AC_MSG_RESULT(no)
127 AC_MSG_ERROR(Kernel sources not installed - unable to continue)
128 fi
129
130 AC_HEADER_TIME
131 AC_CHECK_HEADERS([fcntl.h sys/time.h syslog.h unistd.h sys/socket.h sys/sockio.h strings.h sys/types.h stdlib.h])
132 AC_CHECK_HEADERS([net/if.h], [], [],
133 [#include <stdio.h>
134 #ifdef HAVE_SYS_TYPES_H
135 # include <sys/types.h>
136 #endif
137 #ifdef STDC_HEADERS
138 # include <stdlib.h>
139 # include <stddef.h>
140 #else
141 # ifdef HAVE_STDLIB_H
142 # include <stdlib.h>
143 # endif
144 #endif
145 #ifdef HAVE_SYS_SOCKET_H
146 # include <sys/socket.h>
147 #endif
148 ])
149 AC_CHECK_HEADERS([netinet/in.h], [], [],
150 [#include <stdio.h>
151 #ifdef HAVE_SYS_TYPES_H
152 # include <sys/types.h>
153 #endif
154 #ifdef STDC_HEADERS
155 # include <stdlib.h>
156 # include <stddef.h>
157 #else
158 # ifdef HAVE_STDLIB_H
159 # include <stdlib.h>
160 # endif
161 #endif
162 #ifdef HAVE_SYS_SOCKET_H
163 # include <sys/socket.h>
164 #endif
165 ])
166 AC_CHECK_HEADERS([net/if_var.h], [], [],
167 [#include <stdio.h>
168 #ifdef HAVE_SYS_TYPES_H
169 # include <sys/types.h>
170 #endif
171 #ifdef STDC_HEADERS
172 # include <stdlib.h>
173 # include <stddef.h>
174 #else
175 # ifdef HAVE_STDLIB_H
176 # include <stdlib.h>
177 # endif
178 #endif
179 #ifdef HAVE_SYS_SOCKET_H
180 # include <sys/socket.h>
181 #endif
182 #ifdef HAVE_NET_IF_H
183 # include <net/if.h>
184 #endif
185 ])
186 AC_CHECK_HEADERS([netinet/in_var.h], [], [],
187 [#include <stdio.h>
188 #ifdef HAVE_SYS_TYPES_H
189 # include <sys/types.h>
190 #endif
191 #ifdef STDC_HEADERS
192 # include <stdlib.h>
193 # include <stddef.h>
194 #else
195 # ifdef HAVE_STDLIB_H
196 # include <stdlib.h>
197 # endif
198 #endif
199 #ifdef HAVE_SYS_SOCKET_H
200 # include <sys/socket.h>
201 #endif
202 #ifdef HAVE_NET_IF_H
203 # include <net/if.h>
204 #endif
205 #ifdef HAVE_NETINET_IN_H
206 # include <netinet/in.h>
207 #endif
208 #ifdef HAVE_NET_IF_VAR_H
209 # include <net/if_var.h>
210 #endif
211 ])
212 AC_CHECK_TYPE(socklen_t, [],
213 [AC_DEFINE(socklen_t,int,[Define to 'int' if <sys/socket.h> does not define.])],
214 [
215 #ifdef HAVE_SYS_TYPES_H
216 #include <sys/types.h>
217 #endif
218 #ifdef HAVE_SYS_SOCKET_H
219 #include <sys/socket.h>
220 #endif
221 ])
222
223 dnl Checks for typedefs, structures, and compiler characteristics.
224 AC_C_CONST
225 AC_TYPE_PID_T
226 AC_TYPE_SIZE_T
227 AC_STRUCT_TM
228 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
229 #if TIME_WITH_SYS_TIME
230 # include <sys/time.h>
231 # include <time.h>
232 #else
233 # if HAVE_SYS_TIME_H
234 # include <sys/time.h>
235 # else
236 # include <time.h>
237 # endif
238 #endif
239 ])
240
241 AC_CHECK_SIZEOF(long)
242 AC_CHECK_SIZEOF(time_t)
243
244 dnl Coerce GLIBC 2.3 to GLIBC 2.2 compatibility.
245 dnl May not be complete with future extensions, but appears to work
246 dnl today, 2003-10-02. Matthias Andree
247 AC_DEFINE(__NO_CTYPE,1,[Define __NO_CTYPE to 1 to avoid GLIBC_2.3-specific ctype.h functions.])
248
249 dnl check whether called with --with-newsuser
250 AC_MSG_CHECKING(user)
251 AC_ARG_WITH(user,
252 AS_HELP_STRING([--with-user=<userid>],[name of user account to run as (news)]),,
253 [ withval=news ])
254 if test "x$withval" = "xyes" ; then
255 AC_MSG_ERROR([--with-user=<userid> requires an argument])
256 fi
257 if test "x$withval" = "xno" ; then
258 AC_MSG_ERROR([--without-user is not supported])
259 fi
260 if test "x$withval" = "xroot" ; then
261 AC_MSG_ERROR([--with-user=root is not allowed])
262 fi
263 AC_DEFINE_UNQUOTED(NEWS_USER, "$withval", [what user ID to run as])
264 NEWS_USER="$withval"
265 AC_MSG_RESULT($NEWS_USER)
266 AC_SUBST(NEWS_USER)
267 if $ID -u "$withval" >/dev/null 2>/dev/null ; then
268 :
269 else
270 AC_MSG_WARN([User "$withval" does not exist.])
271 warned=1
272 fi
273
274 dnl check whether called with --with-newsgroup
275 AC_MSG_CHECKING(group)
276 AC_ARG_WITH(group,
277 AS_HELP_STRING([--with-group=<group>],[name of news group to run as (news)]),,
278 [ withval=news ]
279 )
280 AC_DEFINE_UNQUOTED(NEWS_GROUP, "$withval", [what group ID to run as.])
281 if test "x$withval" = "xyes" ; then
282 AC_MSG_ERROR([--with-group=<groupid> requires an argument])
283 fi
284 if test "x$withval" = "xno" ; then
285 AC_MSG_ERROR([--without-group is not supported])
286 fi
287 NEWS_GROUP="$withval"
288 AC_MSG_RESULT($NEWS_GROUP)
289 AC_SUBST(NEWS_GROUP)
290 if test "x$withval" = "xroot" || test "x$withval" = "xwheel" ; then
291 AC_MSG_WARN([--with-group=root and --with-group=wheel are not recommended])
292 warned=1
293 fi
294 if find / -prune -group "$withval" >/dev/null 2>/dev/null ; then
295 :
296 else
297 AC_MSG_WARN([Group "$withval" does not exist.])
298 warned=1
299 fi
300
301 AC_CACHE_SAVE
302
303 AC_ARG_VAR(PCRE2CONFIG,where the pcre2-config script is installed)
304 AC_PATH_PROG(PCRE2CONFIG,pcre2-config,no)
305 ORIG_CFLAGS="$CFLAGS"
306 ORIG_CPPFLAGS="$CPPFLAGS"
307 ORIG_LIBS="$LIBS"
308 ORIG_LDFLAGS="$LDFLAGS"
309 if test "$PCRE2CONFIG" != "no" ; then
310 PCRE_CFLAGS=`$PCRE2CONFIG --cflags`
311 PCRE_LIBS=`$PCRE2CONFIG --libs8`
312 else
313 AC_MSG_WARN([cannot find pcre2-config, this can cause PCRE2 to not be found.])
314 fi
315
316 dnl check for PCRE2
317 CFLAGS="$CFLAGS $PCRE_CFLAGS"
318 LIBS="$LIBS $PCRE_LIBS"
319 AC_CHECK_HEADERS([pcre2.h], [], [], [
320 #define PCRE2_CODE_UNIT_WIDTH 0
321 ])
322 AC_CHECK_LIB(pcre2-8, pcre2_compile_8,[PCRE2LIB="-lpcre2-8"])
323
324 if test x$ac_cv_header_pcre2_h = xno \
325 || test x$ac_cv_lib_pcre2_8_pcre2_compile = xno ; then
326 cat <<EOF
327 -------------------------------------------------------------------------
328 PCRE2 10.0 or newer is not installed in your system or cannot be found.
329 Please obtain PCRE2 separately from https://github.com/PhilipHazel/pcre2 .
330 Compile and install it, then retry to install leafnode.
331 See the PCRE_README file for instructions.
332 -------------------------------------------------------------------------
333 EOF
334 AC_MSG_ERROR([PCRE2 is not installed, cannot continue.])
335 fi
336
337 AC_SUBST(PCRE2_8LIB)
338 AC_SUBST(PCRE2_8DEP)
339
340 dnl Check for BSD4.2 syslog
341 AC_MSG_CHECKING(for BSD4.2 syslog)
342 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
343 #include <syslog.h>]], [[
344 openlog( "configure", LOG_PID|LOG_CONS, LOG_NEWS ); ]])],[ cf_cv_have_bsd42="no" ],[ cf_cv_have_bsd42="yes" ])
345 if test $cf_cv_have_bsd42 = "yes"
346 then
347 AC_MSG_RESULT(yes)
348 AC_DEFINE(HAVE_OLD_SYSLOG, 1,
349 [Define to 1 if your openlog(3) takes only two arguments (BSD4.2 style).])
350 else
351 AC_MSG_RESULT(no)
352 fi
353
354 dnl Checks for library functions.
355 AC_FUNC_STRFTIME
356 dnl AC_FUNC_UTIME_NULL
357 dnl The next two aren't needed and just confuse dietlibc:
358 dnl AC_FUNC_MALLOC
359 dnl AC_FUNC_REALLOC
360 AC_CHECK_FUNCS(setgid setuid getifaddrs)
361 AC_CHECK_FUNC(lstat,,AC_DEFINE(lstat, stat, [Define to stat if you don't have lstat]))
362 AC_REPLACE_FUNCS(getline strdup mkstemp strlcpy timegm)
363 AC_FUNC_FORK
364
365 dnl Check if system snprintf works
366 AC_MSG_CHECKING(if your system's snprintf works)
367 AC_RUN_IFELSE([ AC_LANG_SOURCE([
368 /* tell xsnprintf.c to not include leafnode.h which depends
369 * on config.h, which doesn't exist at this time,
370 * and we don't want the overrides just yet. */
371 #define RUN_FROM_CONFIGURE 1
372 `cat $srcdir/xsnprintf.c`
373 ])],
374 result=yes,
375 result=no,
376 result="unknown -- cross-compiling -- assuming yes")
377 AC_MSG_RESULT([$result])
378 if test "$result" != "no" ; then
379 AC_DEFINE(HAVE_WORKING_SNPRINTF, 1, [Define to 1 if you have a _properly working_ 'snprintf' function.])
380 else
381 AC_MSG_WARN([Your system's libc is broken and provides only a faulty snprintf.])
382 fi
383
384 # Whenever both -lsocket and -lnsl are needed, it seems to be always the
385 # case that gethostbyname requires -lnsl. So, check -lnsl first, for it
386 # to be in LIBS before the setsockopt checks are performed. *However*,
387 # on SINIX-N 5.43, this is false, and gethostent seems to be a better
388 # candidate. So, let's use it below instead of gethostbyname, and see.
389 # Stolen from GNU tar 1.12
390
391 AC_SEARCH_LIBS(gethostent, nsl)
392 AC_SEARCH_LIBS(setsockopt, socket)
393 AC_SEARCH_LIBS(syslog, bsd socket inet)
394
395 AC_MSG_CHECKING(if your sockaddr has sa_len)
396 AC_CACHE_VAL(cf_cv_have_salen, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
397 #include <sys/types.h>
398 #include <sys/socket.h>]], [[
399 struct sockaddr sa;
400 (void)sa.sa_len;]])],[ cf_cv_have_salen="yes" ],[ cf_cv_have_salen="no" ])
401 )
402 if test $cf_cv_have_salen = yes
403 then
404 AC_MSG_RESULT(yes)
405 AC_DEFINE(HAVE_SALEN, 1, [Define to 1 if your ifreq's if_addr has a
406 sa_len member.])
407 else
408 AC_MSG_RESULT(no)
409 fi
410
411 AC_MSG_CHECKING(if your system supports SIOCGIFALIAS)
412 AC_CACHE_VAL(cf_cv_have_SIOCGIFALIAS, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
413 #include <stddef.h>
414 #include <sys/types.h>
415 #include <sys/socket.h>
416 #ifdef HAVE_SYS_SOCKIO_H
417 #include <sys/sockio.h>
418 #endif
419 #include <net/if.h>
420 ]], [[
421 (void)ioctl(0, SIOCGIFALIAS, NULL);]])],[ cf_cv_have_SIOCGIFALIAS="yes" ],[ cf_cv_have_SIOCGIFALIAS="no" ])
422 )
423 if test $cf_cv_have_SIOCGIFALIAS = yes
424 then
425 AC_MSG_RESULT(yes)
426 AC_DEFINE(HAVE_SIOCGIFALIAS, 1, [Define to 1 if your system supports ioctl(., SIOCGIFALIAS; .)])
427 else
428 AC_MSG_RESULT(no)
429 fi
430
431 if test "$GCC" = yes ; then
432 AC_MSG_CHECKING([if $CC is really Intel C++])
433 case "`$CC -V 2>&1`" in
434 [[iI][nN][tT][eE][lL]]*) ICC=yes ;;
435 *) ICC=no ;;
436 esac
437 AC_MSG_RESULT($ICC)
438 fi
439
440 if test "$GCC" = yes && test "x$GCC_FLAGS" = "x" && test "$ICC" = no
441 then
442 AC_MSG_CHECKING(for some good GCC flags)
443 AC_LANG_CONFTEST([AC_LANG_SOURCE([])])
444 for i in -Wall -W -Wextra -Wstrict-prototypes -Wwrite-strings -Wno-unused-result
445 do
446 if $CC $i -c conftest.c
447 then
448 GCC_FLAGS="$GCC_FLAGS $i"
449 fi
450 done
451 rm -f conftest.c conftest.o
452 AC_MSG_RESULT($GCC_FLAGS)
453 fi
454 export GCC_FLAGS
455 AC_SUBST(GCC_FLAGS)
456 AC_SUBST(BINDIR)
457 AC_SUBST(SYSCONFDIR)
458
459 dnl check for rpm build dir
460 AC_MSG_CHECKING(rpm build dir)
461 dnl avoid checking against /SPECS
462 d=${RPMSRC:-/usr/src/rpm}
463 test -d ${d}/SPECS || d=/usr/src/rpm
464 test -d ${d}/SPECS || d=/usr/src/packages
465 test -d ${d}/SPECS || d=/usr/src/redhat
466 test -d ${d}/SPECS || d=$HOME/rpmbuild
467 test -d ${d}/SPECS || d=none
468 RPMSRC=${d}
469 AC_MSG_RESULT(${RPMSRC})
470 AC_SUBST(RPMSRC)
471
472 dnl figure path to some tools
473 AC_ARG_VAR(TCPD, where tcpd is installed)
474 AC_PATH_PROG([TCPD],tcpd,none,/usr/sbin /usr/libexec /usr/lbin /usr/etc /usr/bin /usr/local/sbin /usr/local/bin $PATH)
475
476 dnl sysconfdir can still contain unexpanded variables, so we try to
477 dnl expand them, hopefully safely enough.
478 tmp="`echo $sysconfdir | sed -f ${srcdir}/sanitize.sed`"
479 msysconfdir="`(
480 if test "x$prefix" = xNONE ; then
481 prefix=$ac_default_prefix
482 fi
483 eval echo \"\\\"$tmp\\\"\" )`"
484 AC_SUBST(msysconfdir)
485 AC_CONFIG_FILES([leafnode.spec Makefile doc_german/Makefile])
486 AC_OUTPUT
487
488 cat <<EOF
489 *** leafnode $VERSION is now configured and prepared to be compiled.
490 *** to compile, type 'make' (without the quotes)
491 *** to run some tests, type 'make check' (without the quotes)
492 *** to install, type 'make install' as root (without the quotes)
493 EOF
494
495 if test "x$warned" = "x1" ; then
496 AC_MSG_WARN(Review the warnings given above and check if you need to fix)
497 AC_MSG_WARN(the situation that caused the warning)
498 fi