Home | History | Annotate | Line # | Download | only in compat
configure.ac revision 1.15
      1  1.15  bjh21 #	$NetBSD: configure.ac,v 1.15 2002/04/18 15:31:52 bjh21 Exp $
      2   1.1     tv #
      3   1.1     tv # Autoconf definition file for libnbcompat.
      4   1.1     tv #
      5   1.1     tv 
      6   1.1     tv AC_INIT([libnbcompat], [noversion], [lib-bug-people (a] netbsd.org])
      7   1.1     tv AC_CONFIG_HEADERS(config.h)
      8   1.1     tv AC_CONFIG_FILES(defs.mk)
      9   1.1     tv 
     10   1.4     tv AC_C_BIGENDIAN
     11   1.6     tv AC_HEADER_STDC
     12   1.6     tv 
     13   1.6     tv # Confirm existence of zlib.  (This is available as a default install
     14   1.6     tv # option on many OS's; this could be added as a reachover build in the
     15   1.6     tv # future.)
     16   1.6     tv AC_CHECK_HEADER(zlib.h,,
     17   1.6     tv 	AC_MSG_ERROR([zlib must be installed in a compiler-visible path]))
     18   1.6     tv AC_CHECK_LIB(z, gzdopen,,
     19   1.6     tv 	AC_MSG_ERROR([zlib must be installed in a compiler-visible path]))
     20   1.4     tv 
     21   1.4     tv # Make sure certain required headers are available.
     22   1.4     tv # These are not necessarily required by the code, but they are not
     23   1.4     tv # currently conditionalized.
     24   1.6     tv AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h sys/mtio.h sys/param.h \
     25   1.7     tv 	sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h \
     26   1.6     tv 	assert.h ctype.h errno.h fcntl.h grp.h limits.h locale.h \
     27   1.6     tv 	netdb.h pwd.h signal.h stdarg.h stdio.h stdlib.h string.h \
     28   1.6     tv 	unistd.h,,
     29   1.4     tv 	AC_MSG_ERROR([standard system header file not found]))
     30   1.4     tv 
     31   1.4     tv # Find headers that may not be available.
     32   1.6     tv AC_HEADER_DIRENT
     33  1.10     tv AC_CHECK_HEADERS(sys/sysmacros.h sys/syslimits.h features.h malloc.h stddef.h stdint.h)
     34   1.7     tv AC_CHECK_HEADERS(machine/bswap.h sys/cdefs.h sys/featuretest.h \
     35  1.11     tv 	err.h inttypes.h libgen.h paths.h util.h,,
     36  1.11     tv 	[test -f include/$ac_header || touch include/$ac_header])
     37  1.12  bjh21 AC_CHECK_HEADERS(rpc/types.h fts.h getopt.h md2.h md4.h md5.h netconfig.h \
     38  1.12  bjh21 	rmd160.h sha1.h vis.h,,
     39  1.11     tv 	[echo '#include "config.h"' >include/$ac_header.new
     40  1.11     tv 	echo '#include "'$srcdir/../../include/$ac_header'"' >>include/$ac_header.new
     41  1.11     tv 	if cmp include/$ac_header.new include/$ac_header >/dev/null 2>&1; then
     42  1.11     tv 		rm -f include/$ac_header.new
     43  1.11     tv 	else
     44  1.11     tv 		mv -f include/$ac_header.new include/$ac_header
     45  1.11     tv 	fi])
     46   1.4     tv 
     47   1.4     tv # Typedefs.
     48   1.1     tv AC_TYPE_SIZE_T
     49   1.7     tv AC_CHECK_TYPES([id_t, long long, u_quad_t])
     50   1.6     tv 
     51   1.9     tv dnl XXX - This is UGLY.  Need a better way to homogenize the bitsized types,
     52   1.9     tv dnl including use of compiler primitive types via AC_CHECK_SIZEOF.
     53   1.9     tv dnl
     54   1.6     tv define([NB_CHECK_INTTYPE], [
     55   1.9     tv 	AC_CHECK_TYPE(uint][$1][_t,, [
     56   1.9     tv 		AC_CHECK_TYPE(u_int][$1][_t,
     57   1.9     tv 			AC_DEFINE(uint][$1][_t, u_int][$1][_t),
     58   1.9     tv 			AC_MSG_ERROR([cannot find a suitable type for uint][$1][_t]))
     59   1.9     tv 	])
     60   1.6     tv 	AC_CHECK_TYPE(u_int][$1][_t,, [
     61   1.6     tv 		AC_CHECK_TYPE(uint][$1][_t,
     62   1.6     tv 			AC_DEFINE(u_int][$1][_t, uint][$1][_t),
     63   1.6     tv 			AC_MSG_ERROR([cannot find a suitable type for u_int][$1][_t]))
     64   1.6     tv 	])
     65   1.6     tv ])
     66   1.6     tv 
     67   1.6     tv NB_CHECK_INTTYPE(8)
     68   1.6     tv NB_CHECK_INTTYPE(16)
     69   1.6     tv NB_CHECK_INTTYPE(32)
     70   1.6     tv NB_CHECK_INTTYPE(64)
     71   1.4     tv 
     72   1.4     tv # Struct members.
     73   1.8     tv AC_CHECK_MEMBERS([DIR.dd_fd, struct dirent.d_namlen],,,
     74   1.8     tv 	[#include <dirent.h>])
     75   1.7     tv AC_CHECK_MEMBERS([struct stat.st_flags, struct stat.st_gen,
     76   1.7     tv 	struct stat.st_mtimensec],,, [#include <sys/stat.h>])
     77   1.7     tv AC_CHECK_MEMBERS(struct statfs.f_iosize,,, [#include <sys/mount.h>])
     78   1.4     tv 
     79   1.4     tv # Global variable decls.
     80   1.7     tv AC_CHECK_DECLS([optind, optreset],,, [
     81   1.7     tv #include <stdio.h>
     82   1.7     tv #include <stdlib.h>
     83   1.7     tv #include <unistd.h>
     84   1.7     tv ])
     85   1.4     tv AC_CHECK_DECLS(sys_signame,,, [#include <signal.h>])
     86   1.4     tv 
     87   1.4     tv # Library functions (where a .h check isn't enough).
     88   1.4     tv AC_SEARCH_LIBS(fparseln, util)
     89   1.6     tv AC_CHECK_FUNCS(asprintf asnprintf basename dirfd dirname \
     90   1.7     tv 	fgetln flock fparseln futimes getopt getopt_long \
     91  1.15  bjh21 	isblank issetugid lchmod lchown lutimes pread pwcache_userdb \
     92   1.8     tv 	pwrite setenv setgroupent setprogname setpassent \
     93   1.6     tv 	snprintf strlcat strlcpy strsep vasprintf vasnprintf vsnprintf)
     94   1.8     tv 
     95   1.8     tv AC_CHECK_DECLS([setgroupent, setpassent],,, [
     96   1.8     tv #include <grp.h>
     97   1.8     tv #include <pwd.h>
     98   1.8     tv ])
     99   1.1     tv 
    100   1.4     tv # regcomp() and regexec() are also names of functions in the old V8
    101   1.4     tv # regexp package.  To avoid them, we need to find out who has regfree().
    102   1.1     tv 
    103   1.4     tv dnl # Cygwin: We *MUST* look at -lregex *before* the "no libs" condition.
    104   1.4     tv dnl # Thus AC_CHECK_LIB(regex...) comes first, and AC_SEARCHLIBS next.
    105   1.4     tv AC_CHECK_LIB(regex, regfree)
    106   1.4     tv AC_SEARCH_LIBS(regfree, rx posix)
    107   1.1     tv 
    108   1.1     tv AC_OUTPUT
    109