Add autoconf/automake build system

This commit is contained in:
Stefan Bühler 2009-03-28 13:35:16 +01:00
parent 7572c77974
commit ae457595a1
3 changed files with 91 additions and 0 deletions

9
Makefile.am Normal file
View File

@ -0,0 +1,9 @@
# fcgi-cgi.1
EXTRA_DIST=autogen.sh CMakeLists.txt config.h.cmake
#man1_MANS=fcgi-cgi.1
AM_CFLAGS=$(GLIB_CFLAGS)
fcgi_cgi_LDADD=$(GLIB_LIBS)
bin_PROGRAMS=fcgi-cgi
fcgi_cgi_SOURCES=fastcgi.c fcgi-cgi.c

24
autogen.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
ACLOCAL=${ACLOCAL:-aclocal}
AUTOHEADER=${AUTOHEADER:-autoheader}
AUTOMAKE=${AUTOMAKE:-automake}
AUTOMAKE_FLAGS="--add-missing --copy"
AUTOCONF=${AUTOCONF:-autoconf}
ARGV0=$0
set -e
run() {
echo "$ARGV0: running \`$@'"
$@
}
run $ACLOCAL $ACLOCAL_FLAGS
run $AUTOHEADER
run $AUTOMAKE $AUTOMAKE_FLAGS
run $AUTOCONF
echo "Now type './configure ...' and 'make' to compile."

58
configure.ac Normal file
View File

@ -0,0 +1,58 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([fcgi-cgi], [0.1.0], [lighttpd@stbuehler.de])
AC_CONFIG_SRCDIR([fcgi-cgi.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
# Checks for libraries.
# glib-2.0
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16.0, [
AC_DEFINE([HAVE_GLIB_H], [1], [glib.h])
],[AC_MSG_ERROR("glib-2.0 >= 2.16.0 not found")])
# lib ev
AC_CHECK_HEADERS([ev.h], [], [AC_MSG_ERROR("ev.h not found")])
AC_CHECK_LIB([ev], [ev_loop], [
LIBS="-lev ${LIBS}"
AC_DEFINE([HAVE_LIBEV], [1], [ev_loop in -lev])
], [AC_MSG_ERROR("libev not found")])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h stdlib.h string.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([dup2])
# check for extra compiler options (warning options)
if test "${GCC}" = "yes"; then
CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
fi
AC_ARG_ENABLE(extra-warnings,
AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
[case "${enableval}" in
yes) extrawarnings=true ;;
no) extrawarnings=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
esac],[extrawarnings=false])
if test x$extrawarnings = xtrue; then
CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT