2010-12-17 11:13:04 +01:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ([2.67])
|
|
|
|
AC_INIT([libbsd], m4_esyscmd([./get-version]), [libbsd@lists.freedesktop.org])
|
|
|
|
AC_CONFIG_SRCDIR([src/fgetln.c])
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE([1.8 foreign nostdinc])
|
|
|
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
|
|
|
|
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
|
|
|
|
|
2012-06-03 07:39:42 +02:00
|
|
|
# Check and store if we got user supplied variables
|
|
|
|
user_CFLAGS=${CFLAGS-unset}
|
|
|
|
|
2010-12-17 11:13:04 +01:00
|
|
|
# Checks for operating system services and capabilities.
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
|
|
|
LT_INIT
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
|
2012-06-03 07:39:42 +02:00
|
|
|
# Set default compiler variables
|
|
|
|
if test "$user_CFLAGS" = unset && test "$GCC" = yes; then
|
|
|
|
CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter"
|
|
|
|
fi
|
|
|
|
|
2010-12-17 11:13:04 +01:00
|
|
|
# Checks for libraries.
|
|
|
|
|
|
|
|
# Checks for header files.
|
2011-12-31 08:39:44 +01:00
|
|
|
AC_CHECK_HEADERS([sys/ndir.h sys/dir.h dir.h dirent.h])
|
2010-12-17 11:13:04 +01:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_TYPE_UID_T
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_TYPE_INT64_T
|
|
|
|
AC_TYPE_MODE_T
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_TYPE_PID_T
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
|
|
|
|
2011-12-31 08:39:44 +01:00
|
|
|
AC_CHECK_DECL([F_CLOSEM],
|
|
|
|
[AC_DEFINE([HAVE_FCNTL_CLOSEM], [1],
|
|
|
|
[Define to 1 if you have fcntl(F_CLOSEM)])],
|
|
|
|
[],
|
|
|
|
[#include <limits.h>
|
|
|
|
#include <fcntl.h>])
|
|
|
|
|
2010-12-17 11:13:04 +01:00
|
|
|
# Checks for library functions.
|
2012-01-03 08:58:01 +01:00
|
|
|
AC_MSG_CHECKING([for program_invocation_short_name])
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <errno.h>]],
|
|
|
|
[[const char *p = program_invocation_short_name;]])],
|
|
|
|
[AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
|
|
|
|
[Define to 1 if you have program_invocation_short_name])
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])])
|
|
|
|
|
2011-07-06 16:29:26 +02:00
|
|
|
AC_MSG_CHECKING([for __progname])
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[]],
|
|
|
|
[[extern char *__progname;
|
|
|
|
const char *p = __progname;]])],
|
|
|
|
[AC_DEFINE([HAVE___PROGNAME], [1], [Define to 1 if you have __progname])
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])])
|
|
|
|
|
2012-11-25 21:10:53 +01:00
|
|
|
AC_CHECK_FUNCS([clearenv dirfd __fpurge getexecname getline sysconf])
|
2010-12-17 11:13:04 +01:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
include/Makefile
|
|
|
|
man/Makefile
|
|
|
|
src/Makefile
|
|
|
|
src/libbsd.pc
|
|
|
|
src/libbsd-overlay.pc
|
2012-03-23 10:43:33 +01:00
|
|
|
test/Makefile
|
2010-12-17 11:13:04 +01:00
|
|
|
])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
AC_OUTPUT
|