[Dnsmasq-discuss] [PATCH] Add support for autotools

Cristian Rodríguez crrodriguez at opensuse.org
Sat Sep 8 22:16:05 BST 2012


---
 Makefile          |  134 -----------------------------------------------------
 Makefile.am       |   16 +++++++
 configure.ac      |  113 ++++++++++++++++++++++++++++++++++++++++++++
 src/bpf.c         |    4 ++
 src/cache.c       |    4 ++
 src/config.h      |    2 +-
 src/conntrack.c   |    4 ++
 src/dbus.c        |    4 ++
 src/dhcp-common.c |    4 ++
 src/dhcp.c        |    4 ++
 src/dhcp6.c       |    4 ++
 src/dnsmasq.c     |    4 ++
 src/dnsmasq.h     |    9 +---
 src/forward.c     |    4 ++
 src/helper.c      |   11 ++++-
 src/lease.c       |    4 ++
 src/log.c         |    4 ++
 src/netlink.c     |    4 ++
 src/network.c     |    4 ++
 src/option.c      |    6 ++-
 src/outpacket.c   |    4 ++
 src/radv.c        |    4 ++
 src/rfc1035.c     |    4 ++
 src/rfc2131.c     |    4 ++
 src/rfc3315.c     |    4 ++
 src/slaac.c       |    4 ++
 src/tftp.c        |    4 ++
 src/util.c        |    4 ++
 28 files changed, 230 insertions(+), 145 deletions(-)
 delete mode 100644 Makefile
 create mode 100644 Makefile.am
 create mode 100644 configure.ac

diff --git a/Makefile b/Makefile
deleted file mode 100644
index ee7d36f..0000000
--- a/Makefile
+++ /dev/null
@@ -1,134 +0,0 @@
-# dnsmasq is Copyright (c) 2000-2012 Simon Kelley
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; version 2 dated June, 1991, or
-#  (at your option) version 3 dated 29 June, 2007.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#    
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# NOTE: Building the i18n targets requires GNU-make 
-
-
-# Variables you may well want to override.
-
-PREFIX        = /usr/local
-BINDIR        = $(PREFIX)/sbin
-MANDIR        = $(PREFIX)/share/man
-LOCALEDIR     = $(PREFIX)/share/locale
-BUILDDIR      = $(SRC)
-DESTDIR       = 
-CFLAGS        = -Wall -W -O2
-LDFLAGS       = 
-COPTS         = 
-RPM_OPT_FLAGS = 
-LIBS          = 
-
-#################################################################
-
-# Variables you might want to override.
-
-PKG_CONFIG = pkg-config
-INSTALL    = install
-MSGMERGE   = msgmerge
-MSGFMT     = msgfmt
-XGETTEXT   = xgettext
-
-SRC = src
-PO  = po
-MAN = man
-
-#################################################################
-
-# pmake way. (NB no spaces to keep gmake 3.82 happy)
-top!=pwd
-# GNU make way.
-top?=$(CURDIR)
-
-dbus_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --cflags dbus-1` 
-dbus_libs =   `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --libs dbus-1` 
-idn_cflags =  `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --cflags libidn` 
-idn_libs =    `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --libs libidn` 
-ct_cflags =   `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --cflags libnetfilter_conntrack`
-ct_libs =     `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --libs libnetfilter_conntrack`
-lua_cflags =  `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua5.1` 
-lua_libs =    `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.1` 
-sunos_libs =  `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi`
-version =     -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
-
-objs = cache.o rfc1035.o util.o option.o forward.o network.o \
-       dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
-       helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
-       dhcp-common.o outpacket.o radv.o slaac.o
-
-hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
-       dns-protocol.h radv-protocol.h
-
-all : $(BUILDDIR)
-	@cd $(BUILDDIR) && $(MAKE) \
- top="$(top)" \
- build_cflags="$(version) $(dbus_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags)" \
- build_libs="$(dbus_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs)" \
- -f $(top)/Makefile dnsmasq 
-
-clean :
-	rm -f *~ $(BUILDDIR)/*.mo contrib/*/*~ */*~ $(BUILDDIR)/*.pot 
-	rm -f $(BUILDDIR)/*.o $(BUILDDIR)/dnsmasq.a $(BUILDDIR)/dnsmasq core */core
-
-install : all install-common
-
-install-common :
-	$(INSTALL) -d $(DESTDIR)$(BINDIR) -d $(DESTDIR)$(MANDIR)/man8
-	$(INSTALL) -m 644 $(MAN)/dnsmasq.8 $(DESTDIR)$(MANDIR)/man8 
-	$(INSTALL) -m 755 $(BUILDDIR)/dnsmasq $(DESTDIR)$(BINDIR)
-
-all-i18n : $(BUILDDIR)
-	@cd $(BUILDDIR) && $(MAKE) \
- top="$(top)" \
- i18n=-DLOCALEDIR=\'\"$(LOCALEDIR)\"\' \
- build_cflags="$(version) $(dbus_cflags) $(ct_cflags) $(lua_cflags) `$(PKG_CONFIG) --cflags libidn`" \
- build_libs="$(dbus_libs) $(ct_libs) $(lua_libs) $(sunos_libs) `$(PKG_CONFIG) --libs libidn`"  \
- -f $(top)/Makefile dnsmasq
-	for f in `cd $(PO); echo *.po`; do \
-		cd $(top) && cd $(BUILDDIR) && $(MAKE) top="$(top)" -f $(top)/Makefile $${f%.po}.mo; \
-	done
-
-install-i18n : all-i18n install-common
-	cd $(BUILDDIR); $(top)/bld/install-mo $(DESTDIR)$(LOCALEDIR) $(INSTALL)
-	cd $(MAN); ../bld/install-man $(DESTDIR)$(MANDIR) $(INSTALL)
-
-merge : 
-	@cd $(BUILDDIR) && $(MAKE) -f $(top)/Makefile dnsmasq.pot
-	for f in `cd $(PO); echo *.po`; do \
-		echo -n msgmerge $(PO)/$$f && $(MSGMERGE) --no-wrap -U $(PO)/$$f $(BUILDDIR)/dnsmasq.pot; \
-	done
-
-$(BUILDDIR):
-	mkdir -p $(BUILDDIR)
-
-
-# rules below are targets in recusive makes with cwd=$(SRC)
-
-$(objs:.o=.c) $(hdrs):
-	ln -s $(top)/$(SRC)/$@ .
-
-.c.o:
-	$(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<	
-
-dnsmasq : $(hdrs) $(objs) 
-	$(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS) 
-
-dnsmasq.pot : $(objs:.o=.c) $(hdrs)
-	$(XGETTEXT) -d dnsmasq --foreign-user --omit-header --keyword=_ -o $@ -i $(objs:.o=.c)
-
-%.mo : $(top)/$(PO)/%.po dnsmasq.pot
-	$(MSGMERGE) -o - $(top)/$(PO)/$*.po dnsmasq.pot | $(MSGFMT) -o $*.mo -
-
-
-.PHONY : all clean install install-common all-i18n install-i18n merge 
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..12248cb
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,16 @@
+AM_CFLAGS	= $(DBUS_CFLAGS) $(IDN_CFLAGS) $(LUA_CFLAGS) $(NETFILTER_CFLAGS)
+
+sbin_PROGRAMS = dnsmasq
+
+dnsmasq_SOURCES = src/bpf.c src/cache.c src/config.h src/conntrack.c \
+				  src/dbus.c src/dhcp6.c src/dhcp6-protocol.h src/dhcp.c \
+				  src/dhcp-common.c src/dhcp-protocol.h src/dnsmasq.c \
+				  src/dnsmasq.h src/dns-protocol.h src/forward.c src/helper.c \
+				  src/lease.c src/log.c src/netlink.c src/network.c src/option.c \
+				  src/outpacket.c src/radv.c src/radv-protocol.h src/rfc1035.c \
+				  src/rfc2131.c src/rfc3315.c src/slaac.c src/tftp.c src/util.c
+
+dnsmasq_LDADD = $(IDN_LIBS) $(DBUS_LIBS) $(LUA_LIBS) $(NETFILTER_LIBS)
+
+#automake does not handle translated man pages correctly.
+dist_man8_MANS = man/dnsmasq.8
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..fd38726
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,113 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.60])
+AC_INIT([dnsmasq],
+        [2.63],
+        [dnsmasq-discuss at lists.thekelleys.org.uk],
+        [dnsmasq],
+        [http://www.thekelleys.org.uk/dnsmasq/doc.html])
+AC_CONFIG_SRCDIR([src/dnsmasq.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([foreign -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
+AC_CONFIG_HEADERS([autoconfig.h])
+
+# Checks for programs.
+AC_PROG_CC_STDC
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AM_PROG_CC_C_O
+
+# Checks for libraries.
+
+AC_SEARCH_LIBS([gethostbyname], [nsl])
+AC_SEARCH_LIBS([socket], [socket], [], [AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],[], [-lnsl])])
+
+PKG_PROG_PKG_CONFIG
+
+AC_ARG_WITH([idn],
+    AS_HELP_STRING([--without-idn], [Ignore presence of libidn]))
+
+AS_IF([test "x$with_idn" != "xno"],
+      [PKG_CHECK_MODULES([IDN], [libidn], [have_idn=yes], [have_idn=no])],
+      [have_idn=no])
+
+AS_IF([test "x$have_idn" = "xyes"],
+      [AC_DEFINE([HAVE_IDN], [1], [We have IDN])],
+      [AS_IF([test "x$with_idn" = "xyes"],
+             [AC_MSG_ERROR([libidn requested but not found])
+      ])
+])
+
+AC_ARG_WITH([dbus],
+    AS_HELP_STRING([--without-dbus], [Ignore presence of dbus libraries]))
+
+AS_IF([test "x$with_dbus" != "xno"],
+      [PKG_CHECK_MODULES([DBUS], [dbus-1], [have_dbus=yes], [have_dbus=no])],
+      [have_dbus=no])
+
+AS_IF([test "x$have_dbus" = "xyes"],
+      [AC_DEFINE([HAVE_DBUS], 1, [We have DBUS support])],
+      [AS_IF([test "x$with_dbus" = "xyes"],
+             [AC_MSG_ERROR([DBUS requested but not found])
+      ])
+])
+
+AC_ARG_WITH([lua],
+    AS_HELP_STRING([--without-lua], [Ignore presence of LUA libraries]))
+
+AS_IF([test "x$with_lua" != "xno"],
+      [PKG_CHECK_MODULES([LUA], [lua], [have_lua=yes], [have_lua=no])],
+      [have_lua=no])
+
+AS_IF([test "x$have_lua" = "xyes"],
+      [AC_DEFINE([HAVE_LUASCRIPT], [1], [Have LUA support])],
+      [AS_IF([test "x$with_lua" = "xyes"],
+             [AC_MSG_ERROR([LUA requested but not found])
+      ])
+])
+
+AC_ARG_WITH([netfilter],
+    AS_HELP_STRING([--without-netfilter], [Ignore presence of libnetfilter_conntrack]))
+
+AS_IF([test "x$with_netfilter" != "xno"],
+      [PKG_CHECK_MODULES([NETFILTER], [libnetfilter_conntrack], [have_netfilter=yes], [have_netfilter=no])],
+      [have_netfilter=no])
+
+AS_IF([test "x$have_netfilter" = "xyes"],
+      [AC_DEFINE([HAVE_CONNTRACK], [1], [Have linux netfilter])],
+      [AS_IF([test "x$with_netfilter" = "xyes"],
+             [AC_MSG_ERROR([libnetfilter_conntrack requested but not found])
+      ])
+])
+
+AC_ARG_ENABLE([ipv6],
+    AS_HELP_STRING([--disable-ipv6], [Disable support for IPv6]))
+
+AS_IF([test "x$enable_ipv6" = "xno"], [
+  AC_DEFINE([NO_IPV6], [1], [User has disabled ipv6])
+])
+
+
+# Checks for header files.
+AC_FUNC_ALLOCA
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_UID_T
+AC_TYPE_INT64_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+# Checks for library functions.
+AC_FUNC_FORK
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([alarm dup2 ftruncate gethostname inet_ntoa isascii memmove memset select setenv setlocale strcasecmp strchr strerror strrchr strstr strtol])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/src/bpf.c b/src/bpf.c
index b6fbd90..a97415f 100644
--- a/src/bpf.c
+++ b/src/bpf.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #if defined(HAVE_BSD_NETWORK) || defined(HAVE_SOLARIS_NETWORK)
diff --git a/src/cache.c b/src/cache.c
index ee4e763..bffce28 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 static struct crec *cache_head = NULL, *cache_tail = NULL, **hash_table = NULL;
diff --git a/src/config.h b/src/config.h
index 1a08e95..2f3b6e7 100644
--- a/src/config.h
+++ b/src/config.h
@@ -313,7 +313,7 @@ HAVE_SOCKADDR_SA_LEN
 
 #ifdef DNSMASQ_COMPILE_OPTS
 
-static char *compile_opts = 
+static const char compile_opts[] = 
 #ifndef HAVE_IPV6
 "no-"
 #endif
diff --git a/src/conntrack.c b/src/conntrack.c
index 1d6bf0e..bfcb526 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_CONNTRACK
diff --git a/src/dbus.c b/src/dbus.c
index 16a05e8..5b63227 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DBUS
diff --git a/src/dhcp-common.c b/src/dhcp-common.c
index da982aa..ff96a2d 100644
--- a/src/dhcp-common.c
+++ b/src/dhcp-common.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP
diff --git a/src/dhcp.c b/src/dhcp.c
index 75a4427..0d02d1a 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP
diff --git a/src/dhcp6.c b/src/dhcp6.c
index e31456c..3d8175d 100644
--- a/src/dhcp6.c
+++ b/src/dhcp6.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP6
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 6abd201..24320d3 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -17,6 +17,10 @@
 /* Declare static char *compiler_opts  in config.h */
 #define DNSMASQ_COMPILE_OPTS
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 struct daemon *daemon;
diff --git a/src/dnsmasq.h b/src/dnsmasq.h
index b131c96..0a9606b 100644
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -16,16 +16,9 @@
 
 #define COPYRIGHT "Copyright (c) 2000-2012 Simon Kelley" 
 
-#ifndef NO_LARGEFILE
-/* Ensure we can use files >2GB (log files may grow this big) */
-#  define _LARGEFILE_SOURCE 1
-#  define _FILE_OFFSET_BITS 64
-#endif
-
 /* Get linux C library versions and define _GNU_SOURCE for kFreeBSD. */
 #if defined(__linux__) || defined(__GLIBC__)
 #  ifndef __ANDROID__
-#      define _GNU_SOURCE
 #  endif
 #  include <features.h> 
 #endif
@@ -921,7 +914,7 @@ void check_log_writer(fd_set *set);
 void flush_log(void);
 
 /* option.c */
-void read_opts (int argc, char **argv, char *compile_opts);
+void read_opts (int argc, char **argv, const char *compile_opts);
 char *option_string(int prot, unsigned int opt, unsigned char *val, 
 		    int opt_len, char *buf, int buf_len);
 void reread_dhcp(void);
diff --git a/src/forward.c b/src/forward.c
index f672194..3e5b69b 100644
--- a/src/forward.c
+++ b/src/forward.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 static struct frec *lookup_frec(unsigned short id, unsigned int crc);
diff --git a/src/helper.c b/src/helper.c
index 5c07f05..1e73f82 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -9,11 +9,15 @@
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-     
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_SCRIPT
@@ -34,10 +38,15 @@ static void my_setenv(const char *name, const char *value, int *error);
 static unsigned char *grab_extradata(unsigned char *buf, unsigned char *end,  char *env, int *err);
 
 #ifdef HAVE_LUASCRIPT
+#define LUA_COMPAT_ALL
 #include <lua.h>  
 #include <lualib.h>  
 #include <lauxlib.h>  
 
+#ifndef lua_open
+#define lua_open()     luaL_newstate()
+#endif
+
 lua_State *lua;
 
 static unsigned char *grab_extradata_lua(unsigned char *buf, unsigned char *end, char *field);
diff --git a/src/lease.c b/src/lease.c
index cff24a2..e90bda8 100644
--- a/src/lease.c
+++ b/src/lease.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP
diff --git a/src/log.c b/src/log.c
index 29b82fd..0f94df6 100644
--- a/src/log.c
+++ b/src/log.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef __ANDROID__
diff --git a/src/netlink.c b/src/netlink.c
index 4956fc9..971c339 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_LINUX_NETWORK
diff --git a/src/network.c b/src/network.c
index fda50bd..adecc59 100644
--- a/src/network.c
+++ b/src/network.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_LINUX_NETWORK
diff --git a/src/option.c b/src/option.c
index 22c08e7..6191aa8 100644
--- a/src/option.c
+++ b/src/option.c
@@ -16,6 +16,10 @@
 
 /* define this to get facilitynames */
 #define SYSLOG_NAMES
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 #include <setjmp.h>
 
@@ -3564,7 +3568,7 @@ void reread_dhcp(void)
 }
 #endif
     
-void read_opts(int argc, char **argv, char *compile_opts)
+void read_opts(int argc, char **argv, const char *compile_opts)
 {
   char *buff = opt_malloc(MAXDNAME);
   int option, conffile_opt = '7', testmode = 0;
diff --git a/src/outpacket.c b/src/outpacket.c
index 2fa1e26..51e1b70 100644
--- a/src/outpacket.c
+++ b/src/outpacket.c
@@ -15,6 +15,10 @@
 */
 
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
  
 #ifdef HAVE_DHCP6
diff --git a/src/radv.c b/src/radv.c
index d1f5268..bee3542 100644
--- a/src/radv.c
+++ b/src/radv.c
@@ -20,6 +20,10 @@
    not used by DHCPv4 code. This code may also be called when DHCP 4 or 6 isn't
    active, so we ensure that outpacket is allocated here too */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP6
diff --git a/src/rfc1035.c b/src/rfc1035.c
index 67325ca..8109568 100644
--- a/src/rfc1035.c
+++ b/src/rfc1035.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 static int add_resource_record(struct dns_header *header, char *limit, int *truncp, 
diff --git a/src/rfc2131.c b/src/rfc2131.c
index 207f450..c3704bb 100644
--- a/src/rfc2131.c
+++ b/src/rfc2131.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP
diff --git a/src/rfc3315.c b/src/rfc3315.c
index a1c8326..a4fd33e 100644
--- a/src/rfc3315.c
+++ b/src/rfc3315.c
@@ -15,6 +15,10 @@
 */
 
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP6
diff --git a/src/slaac.c b/src/slaac.c
index 7713ac4..42a84f3 100644
--- a/src/slaac.c
+++ b/src/slaac.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_DHCP6
diff --git a/src/tftp.c b/src/tftp.c
index 82bbccc..13b8be9 100644
--- a/src/tftp.c
+++ b/src/tftp.c
@@ -14,6 +14,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_TFTP
diff --git a/src/util.c b/src/util.c
index a1d47d6..e252e3f 100644
--- a/src/util.c
+++ b/src/util.c
@@ -18,6 +18,10 @@
    Daniel J Bernstein, which is public domain. */
 
 
+#ifdef HAVE_CONFIG_H
+#include "autoconfig.h"
+#endif
+
 #include "dnsmasq.h"
 
 #ifdef HAVE_BROKEN_RTC
-- 
1.7.10.4




More information about the Dnsmasq-discuss mailing list