3 dnl Configuration script for fwd
5 dnl (c) 2008 Straylight/Edgeware
8 dnl ----- Licensing notice --------------------------------------------------
10 dnl This file is part of the `fwd' port forwarder.
12 dnl `fwd' is free software; you can redistribute it and/or modify
13 dnl it under the terms of the GNU General Public License as published by
14 dnl the Free Software Foundation; either version 2 of the License, or
15 dnl (at your option) any later version.
17 dnl `fwd' is distributed in the hope that it will be useful,
18 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 dnl GNU General Public License for more details.
22 dnl You should have received a copy of the GNU General Public License
23 dnl along with `fwd'; if not, write to the Free Software Foundation,
24 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 dnl--------------------------------------------------------------------------
30 AC_INIT([fwd], AUTO_VERSION, [mdw@distorted.org.uk])
31 AC_CONFIG_SRCDIR([fwd.c])
32 AC_CONFIG_AUX_DIR([config])
34 AM_INIT_AUTOMAKE([foreign])
37 dnl--------------------------------------------------------------------------
38 dnl C programming environment.
45 AC_CHECK_HEADERS([unistd.h])
53 AC_CHECK_DECLS([environ])
54 AC_CHECK_DECLS([_sys_siglist])
57 AC_SEARCH_LIBS([modf], [m])
58 AC_SEARCH_LIBS([socket], [socket])
59 AC_SEARCH_LIBS([gethostbyname], [nsl resolv])
62 PKG_CHECK_MODULES([mLib], [mLib >= 2.2.1])
65 AC_CHECK_FUNCS([inet_aton])
66 AC_CHECK_FUNCS([setrlimit])
67 AC_CHECK_FUNCS([setgroups])
68 AC_CHECK_FUNCS([getnetbyname])
69 AC_CHECK_FUNCS([strsignal])
71 dnl Logging is weird under Termux. Unfortunately, it involves macros, so we
72 dnl have to do this the hard way.
74 [library needed for syslog], [mdw_cv_syslog_lib],
75 [mdw_ORIG_LIBS=$LIBS LIBS=
77 AC_TRY_LINK([#include <syslog.h>],
78 [openlog("test", LOG_PID, LOG_DAEMON);
79 syslog(LOG_ERR, "this is a test");],
82 *,t) mdw_cv_syslog_lib=${LIBS:-none}; break ;;
83 0,nil) LIBS="-llog" ;;
84 1,nil) AC_MSG_ERROR("failed to link test program") ;;
88 case $mdw_cv_syslog_lib in
90 *) LIBS="$LIBS $mdw_cv_syslog_lib" ;;
94 dnl--------------------------------------------------------------------------
97 AC_CONFIG_HEADER([config/config.h])
98 AC_CONFIG_FILES([Makefile])
102 dnl ----- That's all, folks -------------------------------------------------