build: Rewrite the build system to be nicer.
[fwd] / configure.ac
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..5da430b
--- /dev/null
@@ -0,0 +1,76 @@
+dnl -*-autoconf-*-
+dnl
+dnl Configuration script for fw
+dnl
+dnl (c) 2008 Straylight/Edgeware
+dnl
+
+dnl ----- Licensing notice --------------------------------------------------
+dnl
+dnl This file is part of the `fw' port forwarder.
+dnl
+dnl `fw' is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl `fw' is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with `fw'; if not, write to the Free Software Foundation,
+dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+dnl--------------------------------------------------------------------------
+dnl Initialization.
+
+mdw_AUTO_VERSION
+AC_INIT([fw], AUTO_VERSION, [mdw@distorted.org.uk])
+AC_CONFIG_SRCDIR([fw.c])
+AC_CONFIG_AUX_DIR([config])
+
+AM_INIT_AUTOMAKE([foreign])
+
+dnl--------------------------------------------------------------------------
+dnl C programming environment.
+
+dnl Compiler.
+AC_PROG_CC
+AX_CFLAGS_WARN_ALL
+
+dnl Headers.
+AC_CHECK_HEADERS([unistd.h])
+
+dnl Types.
+AC_TYPE_UID_T
+AC_TYPE_PID_T
+
+dnl Declarations.
+AC_CHECK_DECLS([environ])
+AC_CHECK_DECLS([_sys_siglist])
+
+dnl Libraries.
+AC_SEARCH_LIBS([socket], [socket])
+AC_SEARCH_LIBS([gethostbyname], [nsl resolv])
+
+dnl Packages.
+PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4])
+
+dnl Functions.
+AC_CHECK_FUNCS([inet_aton])
+AC_CHECK_FUNCS([setrlimit])
+AC_CHECK_FUNCS([setgroups])
+AC_CHECK_FUNCS([getnetbyname])
+AC_CHECK_FUNCS([strsignal])
+
+dnl--------------------------------------------------------------------------
+dnl Output.
+
+AC_CONFIG_HEADER([config/config.h])
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
+
+dnl ----- That's all, folks -------------------------------------------------