Blame configure.ac

Packit eba2e2
dnl Process this file with autoconf to produce a configure script.
Packit eba2e2
Packit eba2e2
# Copyright (C) 2010-2017 Colin Watson.
Packit eba2e2
#
Packit eba2e2
# This file is part of libpipeline.
Packit eba2e2
#
Packit eba2e2
# libpipeline is free software; you can redistribute it and/or modify
Packit eba2e2
# it under the terms of the GNU General Public License as published by
Packit eba2e2
# the Free Software Foundation; either version 2 of the License, or (at
Packit eba2e2
# your option) any later version.
Packit eba2e2
#
Packit eba2e2
# libpipeline is distributed in the hope that it will be useful, but
Packit eba2e2
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit eba2e2
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit eba2e2
# General Public License for more details.
Packit eba2e2
#
Packit eba2e2
# You should have received a copy of the GNU General Public License
Packit eba2e2
# along with libpipeline; if not, write to the Free Software
Packit eba2e2
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
Packit eba2e2
# USA.
Packit eba2e2
Packit eba2e2
m4_pattern_forbid([^PIPELINE_])
Packit eba2e2
Packit eba2e2
# Initialise and check we're in the correct directory.
Packit eba2e2
AC_INIT([libpipeline], [1.5.0], [cjwatson@debian.org])
Packit eba2e2
AC_CONFIG_AUX_DIR([build-aux])
Packit eba2e2
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign])
Packit eba2e2
AM_MAINTAINER_MODE
Packit eba2e2
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Packit eba2e2
AC_PREREQ([2.59])
Packit eba2e2
AC_CONFIG_SRCDIR([lib/pipeline.c])
Packit eba2e2
AC_GNU_SOURCE
Packit eba2e2
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Packit eba2e2
LT_INIT([disable-static])
Packit eba2e2
Packit eba2e2
AC_CONFIG_HEADER([config.h])
Packit eba2e2
AC_CANONICAL_HOST
Packit eba2e2
Packit eba2e2
# Check $PATH for the following programs and append suitable options.
Packit eba2e2
AC_PROG_CC
Packit eba2e2
gl_EARLY
Packit eba2e2
AC_PROG_CPP
Packit eba2e2
CFLAGS="$CFLAGS -Wall"
Packit eba2e2
if test "$GCC" = yes
Packit eba2e2
then
Packit eba2e2
	gl_WARN_ADD([-W])
Packit eba2e2
	gl_WARN_ADD([-Wpointer-arith])
Packit eba2e2
	gl_WARN_ADD([-Wwrite-strings])
Packit eba2e2
	gl_WARN_ADD([-Wstrict-prototypes])
Packit eba2e2
	gl_WARN_ADD([-Wshadow])
Packit eba2e2
	gl_WARN_ADD([-Wformat-security])
Packit eba2e2
	gl_WARN_ADD([-Wredundant-decls])
Packit eba2e2
	gl_WARN_ADD([-Wno-missing-field-initializers])
Packit eba2e2
fi
Packit eba2e2
AC_PROG_LN_S
Packit eba2e2
AC_DEFINE_UNQUOTED([SHELL], ["$SHELL"], [A POSIX shell interpreter.])
Packit eba2e2
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [run_tests=yes], [run_tests=no])
Packit eba2e2
AM_CONDITIONAL([RUN_TESTS], [test "x$run_tests" = xyes])
Packit eba2e2
Packit eba2e2
# Check for various header files and associated libraries.
Packit eba2e2
AC_ISC_POSIX
Packit eba2e2
gl_INIT
Packit eba2e2
AC_CHECK_HEADERS([fcntl.h])
Packit eba2e2
AC_CHECK_FUNCS([clearenv])
Packit eba2e2
Packit eba2e2
# Checks for structures and compiler characteristics.
Packit eba2e2
AC_C_CONST
Packit eba2e2
AC_TYPE_PID_T
Packit eba2e2
AC_TYPE_SIZE_T
Packit eba2e2
Packit eba2e2
# We must have fork(2) support.
Packit eba2e2
AC_FUNC_FORK
Packit eba2e2
if test "x$ac_cv_func_fork_works" != xyes; then
Packit eba2e2
  AC_MSG_FAILURE([cannot use libpipeline on systems without fork])
Packit eba2e2
fi
Packit eba2e2
Packit eba2e2
# Check for socketpair(2) as fast replacement for pipe(2).
Packit eba2e2
AC_ARG_ENABLE([socketpair-pipe],
Packit eba2e2
[AS_HELP_STRING([--enable-socketpair-pipe], [Use socketpair(2) as fast replacement for pipe(2)])],
Packit eba2e2
  [ if test "$enableval" = "yes"
Packit eba2e2
    then
Packit eba2e2
      PIPELINE_SOCKETPAIR_PIPE
Packit eba2e2
      if test "$pipeline_cv_socketpair_pipe" = yes; then
Packit eba2e2
	PIPELINE_SOCKETPAIR_MODE
Packit eba2e2
      fi
Packit eba2e2
    fi
Packit eba2e2
  ])
Packit eba2e2
Packit eba2e2
dnl PIPELINE_ECHO_VAR(ENV-VARIABLE)
Packit eba2e2
define(PIPELINE_ECHO_VAR, [AC_MSG_NOTICE([default $1 = "$$1"])])dnl
Packit eba2e2
dnl
Packit eba2e2
PIPELINE_ECHO_VAR(CC)
Packit eba2e2
PIPELINE_ECHO_VAR(CPP)
Packit eba2e2
PIPELINE_ECHO_VAR(CPPFLAGS)
Packit eba2e2
PIPELINE_ECHO_VAR(CFLAGS)
Packit eba2e2
PIPELINE_ECHO_VAR(LDFLAGS)
Packit eba2e2
PIPELINE_ECHO_VAR(LIBS)
Packit eba2e2
Packit eba2e2
AC_CONFIG_FILES([Makefile
Packit eba2e2
	gnulib/lib/Makefile
Packit eba2e2
	lib/Makefile
Packit eba2e2
	lib/libpipeline.pc
Packit eba2e2
	man/Makefile
Packit eba2e2
	tests/Makefile])
Packit eba2e2
AC_OUTPUT