3 # Updated for more modern systems. Check to see if we need to link against
4 # optional libraries for networking functions.
7 AC_DEFUN([AC_CHECK_NETLIBS],
8 [AC_SEARCH_LIBS([gethostbyname], [nsl], ,
9 [AC_MSG_ERROR([gethostbyname not found])])
10 AC_SEARCH_LIBS([connect], [socket], , [AC_MSG_ERROR([connect not found])])
17 dnl NMH_CHECK_DBM(include,library,action-if-found,action-if-not)
19 dnl Check for presence of dbm_open() in the specified library
20 dnl and with the specified include file (if libname is the empty
21 dnl string then don't try to link against any particular library).
23 dnl We set nmh_ndbm_found to 'yes' or 'no'; if found we set
24 dnl nmh_ndbmheader to the first arg and nmh_ndbm to the second.
26 dnl If this macro accepted a list of include,library tuples
27 dnl to test in order that would be cleaner than the current
28 dnl nest of calls in configure.in.
30 dnl We try to link our own code fragment (which includes the
31 dnl headers in the same way slocal.c does) rather than
32 dnl using AC_CHECK_LIB because on later versions of libdb
33 dnl the dbm_open() function is provided via a #define and
34 dnl we don't want to hardcode searching for the internal
35 dnl function that lies behind it. (AC_CHECK_LIB works by
36 dnl defining its own bogus prototype rather than pulling in
37 dnl the right header files.)
39 dnl An oddity (bug) of this macro is that if you haven't
40 dnl done AC_PROG_CC or something that implies it before
41 dnl using this macro autoconf complains about a recursive
44 AC_DEFUN(NMH_CHECK_NDBM,
46 if test "x$2" = "x"; then
48 AC_MSG_CHECKING([for dbm in $1])
51 AC_MSG_CHECKING([for dbm in $1 and $2])
54 dnl We don't try to cache the result, because that exceeds
55 dnl my autoconf skills -- feel free to put it in :-> -- PMM
57 nmh_saved_libs="$LIBS"
58 LIBS="$nmh_libs $5 $LIBS"
59 AC_LINK_IFELSE(AC_LANG_PROGRAM([[
60 #define DB_DBM_HSEARCH 1
63 [[dbm_open("",0,0);]]),[nmh_ndbm_found=yes],[nmh_ndbm_found=no])
64 LIBS="$nmh_saved_libs"
66 if test "$nmh_ndbm_found" = "yes"; then
82 dnl From Jim Meyering.
84 dnl Check whether struct dirent has a member named d_type.
87 # Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
90 # This file is free software; the Free Software Foundation
91 # gives unlimited permission to copy and/or distribute it,
92 # with or without modifications, as long as this notice is preserved.
94 AC_DEFUN([CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
95 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
96 AC_CACHE_CHECK([for d_type member in directory struct],
97 jm_cv_struct_dirent_d_type,
100 #include <sys/types.h>
103 #else /* not HAVE_DIRENT_H */
104 # define dirent direct
105 # ifdef HAVE_SYS_NDIR_H
106 # include <sys/ndir.h>
107 # endif /* HAVE_SYS_NDIR_H */
108 # ifdef HAVE_SYS_DIR_H
109 # include <sys/dir.h>
110 # endif /* HAVE_SYS_DIR_H */
113 # endif /* HAVE_NDIR_H */
114 #endif /* HAVE_DIRENT_H */
116 [struct dirent dp; dp.d_type = 0;],
118 jm_cv_struct_dirent_d_type=yes,
119 jm_cv_struct_dirent_d_type=no)
122 if test $jm_cv_struct_dirent_d_type = yes; then
123 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
124 [Define if there is a member named d_type in the struct describing