1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([pkg_install], [20070804], [joerg@NetBSD.org])
4 AC_CONFIG_SRCDIR([lib/plist.c])
5 AC_CONFIG_HEADER(lib/config.h)
9 AC_SUBST(CANONICAL_HOST)
12 # Checks for programs.
18 AC_CHECK_PROG(AR, ar, ar)
20 AC_PATH_PROG(CHMOD, chmod)
21 AC_PATH_PROG(CMP, cmp)
23 AC_PATH_PROG(ENV, env)
24 AC_PATH_PROG(FIND, find)
25 AC_PATH_PROG(GREP, grep)
27 AC_PATH_PROG(MKDIR, mkdir)
28 AC_PATH_PROG(RMDIR, rmdir)
30 AC_PATH_PROG(SED, sed)
31 AC_PATH_PROG(SORT, sort)
32 AC_PATH_PROG(TOUCH, touch)
34 AUTOCONF=${AUTOCONF-"$srcdir/missing --run autoconf"}
36 AUTOHEADER=${AUTOHEADER-"$srcdir/missing --run autoheader"}
39 dnl Set the default pkg dbdir
41 [ --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg)],
42 [ pkgdbdir="$with_pkgdbdir" ],
43 [ pkgdbdir="/var/db/pkg" ])
47 [ --with-pax=path Path to pax (PREFIX/bin/pax)],
49 [ pax='$(prefix)/bin/pax' ])
53 [ --with-ssl Enable OpenSSL based signature support],
58 AC_ARG_ENABLE([bootstrap],
59 [AS_HELP_STRING([--enable-bootstrap], [build minimal version of pkg_install])],
60 [bootstrap=yes], [bootstrap=])
64 dnl Checks for libraries.
65 AC_CHECK_LIB(db, __db185_open, , AC_SEARCH_LIBS(dbopen, [db db1]))
66 AC_SEARCH_LIBS(tgetent, [termcap termlib curses ncurses])
68 dnl Checks for header files.
70 AC_CHECK_HEADERS([assert.h ctype.h dirent.h err.h errno.h fnctl.h \
71 fnmatch.h glob.h grp.h inttypes.h limits.h netdb.h \
72 pwd.h regex.h signal.h stdarg.h stdio.h stdlib.h string.h \
73 termcap.h termios.h time.h unistd.h vis.h])
74 AC_CHECK_HEADERS([db1/db.h db_185.h db.h])
75 AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/ioctl.h sys/param.h \
76 sys/poll.h sys/queue.h sys/resource.h sys/signal.h sys/stat.h \
77 sys/statvfs.h sys/time.h sys/types.h sys/utsname.h sys/vfs.h \
80 # Checks for library functions.
81 AC_CHECK_FUNCS([chflags dbopen __db185_open tgetent vfork])
82 AC_CHECK_FUNCS([getrlimit setrlimit])
84 AC_SEARCH_LIBS([gethostbyname], [nsl])
85 AC_SEARCH_LIBS([socket],
88 [AC_CHECK_LIB([socket],
90 [LIBS="-lsocket -lnsl $LIBS"],
101 AC_MSG_CHECKING([for a working PRIu64])
106 #ifdef HAVE_INTTYPES_H
107 #include <inttypes.h>
124 # program worked correctly
130 AC_DEFINE([NEED_PRI_MACRO], [1], [Defined when PRIu64 is missing or broken])
134 # we are cross compiling
135 AC_MSG_RESULT([unable to check when crosscompiling])
136 AC_DEFINE([NEED_PRI_MACRO], [1], [Defined when PRIu64 is missing or broken])
141 AC_CHECK_SIZEOF(long)
142 AC_CHECK_SIZEOF(long long)
145 *-*-dragonfly* |*-*-freebsd*)
146 AC_DEFINE([NUMERIC_VERSION_ONLY], [1], [Defined when to retain only the numeric OS version])
156 AC_CONFIG_FILES([Makefile add/Makefile admin/Makefile
157 audit-packages/Makefile audit-packages/audit-packages.1 \
158 audit-packages/audit-packages.cat1 audit-packages/audit-packages.conf \
159 audit-packages/audit-packages.conf.5 \
160 audit-packages/audit-packages.conf.cat5 \
161 audit-packages/download-vulnerability-list.1 \
162 audit-packages/download-vulnerability-list.cat1 \
163 audit-packages/download-vulnerability-list.sh bpm/bpm.sh \
164 create/Makefile delete/Makefile info/Makefile lib/Makefile \
165 view/Makefile view/linkfarm.sh view/pkg_view.sh])