# $Id: configure.ac,v 1.22 2011/01/30 10:28:09 imil Exp $ AC_PREREQ([2.61]) AC_INIT([pkgin], [0.4.0], [imil@NetBSD.org]) AC_CONFIG_SRCDIR([actions.c]) AC_CONFIG_HEADERS([config.h]) AC_CANONICAL_HOST # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_ARG_WITH(libraries, [ --with-libraries= additional place to look for libraries], [LDFLAGS="$LDFLAGS -L$withval"], , ) AC_ARG_WITH(includes, [ --with-includes= additional place to look for header files], [CPPFLAGS="$CPPFLAGS -I$withval"], , ) # strsep is not available in libc, get it from libnbcompat and # add nbcompat/string.h AC_CHECK_FUNC([strsep],, [CPPFLAGS="-DWANT_NBCOMPAT_H $CPPFLAGS"] ) AC_CHECK_FUNC([pthread_create],, AC_SEARCH_LIBS([pthread_create], [pthread],, ) ) # check for humanize_number AC_CHECK_FUNC([humanize_number],, # in DragonFly humanize_number is in libutil AC_SEARCH_LIBS([humanize_number], [util],, # don't have it, include humanize_number.c to SRCS [SRCS="humanize_number.c $SRCS"] ) ) AC_SUBST(SRCS) AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([inet_addr], [nsl]) AC_SEARCH_LIBS([tgetent], [termcap]) AC_SEARCH_LIBS([BN_init], [crypto], [LDFLAGS="$LDFLAGS -lcrypto"] AC_SEARCH_LIBS([SSL_accept], [ssl], [LDFLAGS="$LDFLAGS -lssl"] ) ) # check for libnbcompat AC_CHECK_LIB([nbcompat], [strlcpy], [LIBS="$LIBS -lnbcompat"] ) AC_SEARCH_LIBS([fetchGetURL], [fetch],, [AC_MSG_ERROR(libfetch not found.)], ) # Checks for header files. AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h locale.h netdb.h stdint.h stdlib.h string.h sys/file.h sys/param.h sys/statvfs.h sys/time.h unistd.h sys/queue.h ctype.h stdio.h assert.h err.h stdarg.h sys/wait.h errno.h dirent.h regex.h sys/poll.h sys/signal.h signal.h termcap.h fnmatch.h sys/utsname.h nbcompat.h nbcompat/string.h util.h libutil.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_INT64_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T AC_CHECK_FUNCS([dup2 getcwd localeconv memmove memset mkdir putenv regcomp rmdir setenv strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strstr strtol]) AC_CHECK_PROG(SED,nbsed,nbsed,sed) dnl fix rpath for SunOS, is there a cleaner way to do this ? case $host_os in sunos* | solaris*) RPATH="-Wl,-R" ;; *) RPATH="-Wl,-rpath" ;; esac AC_SUBST(RPATH) AC_CONFIG_FILES([Makefile]) AC_OUTPUT