106 lines
2.7 KiB
Text
106 lines
2.7 KiB
Text
# -*- Autoconf -*-
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
AC_PREREQ([2.69])
|
|
AC_INIT([PyFCGI], [0.0.1], [yann.weber@member.fsf.org])
|
|
AC_CONFIG_SRCDIR([src/main.c])
|
|
AC_CONFIG_HEADERS([include/config.h])
|
|
AC_CONFIG_MACRO_DIRS([m4])
|
|
|
|
|
|
AC_ARG_ENABLE([debug],
|
|
AS_HELP_STRING([--enable-debug], [Enable debug, disabling -Werror, etc.]))
|
|
AC_ARG_ENABLE([check],
|
|
AS_HELP_STRING([--disable-debug], [Disable unit test support]),
|
|
[case "${enableval}" in
|
|
yes) check=true;;
|
|
no) check=false;;
|
|
*) AC_MSG_ERROR([bad value ${enableval} for --disable-check]);;
|
|
esac],[check=true])
|
|
AM_CONDITIONAL([CHECK], [test x$check = xtrue])
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
AC_GNU_SOURCE
|
|
|
|
# Checks for programs.
|
|
|
|
AC_ARG_VAR(PYTHON_CONFIG_PATH, [python3-config path])
|
|
AC_PATH_PROG(PYTHON_CONFIG_PATH, [python3-config], [no])
|
|
echo "PYTHON CONFIG == ${PYTHON_CONFIG_PATH}"
|
|
if test x"${PYTHON_CONFIG_PATH}" != x"no"; then
|
|
AC_SUBST([PYTHON_CONFIG_PATH])
|
|
PYTHON_CFLAGS=`${PYTHON_CONFIG_PATH} --includes`
|
|
PYTHON_LDFLAGS=`${PYTHON_CONFIG_PATH} --libs`
|
|
AC_SUBST([PYTHON_CFLAGS])
|
|
AC_SUBST([PYTHON_LDFLAGS])
|
|
PYTHON_SO_CFLAGS=`${PYTHON_CONFIG_PATH} --cflags`
|
|
PYTHON_SO_LDFLAGS=`${PYTHON_CONFIG_PATH} --cflags`
|
|
AC_SUBST([PYTHON_SO_CFLAGS])
|
|
AC_SUBST([PYTHON_SO_LDFLAGS])
|
|
else
|
|
AC_MSG_ERROR([Unable to find python3-config])
|
|
fi
|
|
|
|
if test x"${enable_debug}" = x"yes"; then
|
|
AM_CFLAGS="-Wall -g -DDEBUG"
|
|
CFLAGS="-O0"
|
|
else
|
|
AM_CFLAGS="-Wall -Werror -O2"
|
|
fi
|
|
|
|
AC_PROG_CC
|
|
AC_PROG_RANLIB
|
|
|
|
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
|
if test -z "$DOXYGEN";
|
|
then
|
|
AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
|
|
fi
|
|
|
|
|
|
AC_ENABLE_SHARED
|
|
AC_DISABLE_STATIC
|
|
AC_PROG_LIBTOOL
|
|
LT_INIT
|
|
|
|
AC_SUBST([AM_CFLAGS])
|
|
|
|
AC_C_INLINE
|
|
|
|
# Checks for libraries.
|
|
AC_CHECK_LIB([fcgi], [FCGI_Accept])
|
|
AC_CHECK_LIB([rt], [timer_create])
|
|
AC_CHECK_LIB([pthread], [sem_open shm_open])
|
|
if test "x$check" = "xtrue"
|
|
then
|
|
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [],
|
|
AC_MSG_FAILURE([Unabe to locate (check unit test c framework).
|
|
You can run ./configure --disable-check if you do not need unit tests.
|
|
]))
|
|
AS_IF([test x"${enable_debug}" = x"yes"], [CK_FORK=no], [])
|
|
fi
|
|
|
|
# Checks for header files.
|
|
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h sem.h time.h])
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
AC_TYPE_PID_T
|
|
AC_TYPE_SIZE_T
|
|
|
|
# Checks for library functions.
|
|
AC_FUNC_FORK
|
|
AC_FUNC_MALLOC
|
|
AC_FUNC_REALLOC
|
|
AC_CHECK_FUNCS([bzero getcwd gettimeofday memmove strdup strerror strndup get_current_dir_name timer_settime])
|
|
|
|
AM_INIT_AUTOMAKE
|
|
AC_CONFIG_FILES([Makefile
|
|
src/Makefile
|
|
tests/Makefile
|
|
])
|
|
|
|
AM_CONDITIONAL([HAVE_DOXYGEN],
|
|
[test -n "$DOXYGEN"])AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([docs/Doxyfile
|
|
docs/Makefile])])
|
|
|
|
AC_OUTPUT
|