autotools

[email protected]
Newsgroups gmane.comp.web.dillo.devel
Message-ID <20130105201901.GA2069@darkstar>
There is autogen.sh in source tree. It can be replaced with
"autoreconf -i" or simply removed. According to ChangeLog of autoconf,
autoreconf has been there for at least 10 years.

I also looked at configure.ac. In attached patch I added dillo URL,
used AS_HELP_STRING to format help lines, replaced AC_ERROR with
AC_MSG_ERROR (it was renamed) and replaced -D flags with AC_DEFINE.

If no config.h is used, flags should be added to DEFS variable, but
with config.h they should be defined in config.h using AC_DEFINE.

The problem is that not all files include config.h. I added #includes
where necessary, but to avoid problems when some files see defines and
some files don't, config.h should be included by every .c and .cc file
before all other includes.

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
configure.patch (text/plain, 6.5 KB)
# HG changeset patch
# Parent eae7e07e4cc4f404d293a316774064e8796a2615

diff -r eae7e07e4cc4 configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 dnl Process this file with aclocal, autoconf and automake.
 
-AC_INIT([dillo], [3.0.2])
+AC_INIT([dillo],[3.0.2],[],[],[http://www.dillo.org/])
 
 dnl Detect the canonical target build environment
 AC_CANONICAL_TARGET
@@ -13,29 +13,20 @@
 
 dnl Options
 
-AC_ARG_WITH(jpeg-lib, [  --with-jpeg-lib=DIR     Specify where to find libjpeg], LIBJPEG_LIBDIR=$withval)
-AC_ARG_WITH(jpeg-inc, [  --with-jpeg-inc=DIR     Specify where to find libjpeg's headers], LIBJPEG_INCDIR=$withval)
+AC_ARG_WITH(jpeg-lib, [AS_HELP_STRING([--with-jpeg-lib=DIR], [Specify where to find libjpeg])], LIBJPEG_LIBDIR=$withval)
+AC_ARG_WITH(jpeg-inc, [AS_HELP_STRING([--with-jpeg-inc=DIR], [Specify where to find libjpeg's headers])], LIBJPEG_INCDIR=$withval)
 
-AC_ARG_ENABLE(efence, [  --enable-efence         Try to compile and run with Electric Fence],
-                    , enable_efence=no)
-AC_ARG_ENABLE(gprof,  [  --enable-gprof          Try to compile and run with profiling enabled],
-                    , enable_gprof=no)
-AC_ARG_ENABLE(insure, [  --enable-insure         Try to compile and run with Insure++],
-                    , enable_insure=no)
-AC_ARG_ENABLE(ssl,    [  --enable-ssl            Enable ssl, https (ALPHA CODE)],
-                    , enable_ssl=no)
-AC_ARG_ENABLE(ipv6,   [  --enable-ipv6           Build with support for IPv6], , )
-AC_ARG_ENABLE(cookies,[  --disable-cookies       Don't compile support for cookies],
-                    , enable_cookies=yes)
-AC_ARG_ENABLE(png,    [  --disable-png           Disable support for PNG images],
-              enable_png=$enableval, enable_png=yes)
-AC_ARG_ENABLE(jpeg,   [  --disable-jpeg          Disable support for JPEG images],
-              enable_jpeg=$enableval, enable_jpeg=yes)
-AC_ARG_ENABLE(gif,    [  --disable-gif           Disable support for GIF images],
-              enable_gif=$enableval, enable_gif=yes)
-AC_ARG_ENABLE(threaded-dns,[  --disable-threaded-dns  Disable the advantage of a reentrant resolver library],
-              enable_threaded_dns=$enableval, enable_threaded_dns=yes)
-AC_ARG_ENABLE(rtfl,   [  --enable-rtfl           Build with rtfl messages (for debugging rendering)])
+AC_ARG_ENABLE(efence, [AS_HELP_STRING([--enable-efence], [Try to compile and run with Electric Fence])],, enable_efence=no)
+AC_ARG_ENABLE(gprof, [AS_HELP_STRING([--enable-gprof], [Try to compile and run with profiling enabled])],, enable_gprof=no)
+AC_ARG_ENABLE(insure, [AS_HELP_STRING([--enable-insure], [Try to compile and run with Insure++])],, enable_insure=no)
+AC_ARG_ENABLE(ssl, [AS_HELP_STRING([--enable-ssl], [Enable ssl, https (ALPHA CODE)])],, enable_ssl=no)
+AC_ARG_ENABLE(ipv6, [AS_HELP_STRING([--enable-ipv6], [Build with support for IPv6])],,)
+AC_ARG_ENABLE(cookies, [AS_HELP_STRING([--disable-cookies], [Don't compile support for cookies])],, enable_cookies=yes)
+AC_ARG_ENABLE(png, [AS_HELP_STRING([--disable-png], [Disable support for PNG images])], enable_png=$enableval, enable_png=yes)
+AC_ARG_ENABLE(jpeg, [AS_HELP_STRING([--disable-jpeg], [Disable support for JPEG images])], enable_jpeg=$enableval, enable_jpeg=yes)
+AC_ARG_ENABLE(gif, [AS_HELP_STRING([--disable-gif], [Disable support for GIF images])], enable_gif=$enableval, enable_gif=yes)
+AC_ARG_ENABLE(threaded-dns, [AS_HELP_STRING([--disable-threaded-dns], [Disable the advantage of a reentrant resolver library])], enable_threaded_dns=$enableval, enable_threaded_dns=yes)
+AC_ARG_ENABLE(rtfl, [AS_HELP_STRING([--enable-rtfl], [Build with rtfl messages (for debugging rendering)])])
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_RANLIB
@@ -119,9 +110,9 @@
          LIBFLTK_CFLAGS=`fltk-config --cflags`
          LIBFLTK_LIBS=`fltk-config --ldflags`;;
   ?*)    AC_MSG_RESULT(no)
-         AC_ERROR(FLTK 1.3 required; version found: $fltk_version);;
+         AC_MSG_ERROR(FLTK 1.3 required; version found: $fltk_version);;
   *)     AC_MSG_RESULT(no)
-         AC_ERROR(FLTK 1.3 required; fltk-config not found)
+         AC_MSG_ERROR(FLTK 1.3 required; fltk-config not found)
 esac
 
 
@@ -393,11 +384,10 @@
 dnl --------------------
 dnl
 if test "x$enable_cookies" = "xno" ; then
-  CFLAGS="$CFLAGS -DDISABLE_COOKIES"
-  CXXFLAGS="$CXXFLAGS -DDISABLE_COOKIES"
+  AC_DEFINE([DISABLE_COOKIES], [1], [Disable cookies])
 fi
 if test "x$enable_ipv6" = "xyes" ; then
-  CFLAGS="$CFLAGS -DENABLE_IPV6"
+  AC_DEFINE([ENABLE_IPV6], [1], [Enable IPv6])
 fi
 if test "x$enable_efence" = "xyes" ; then
   LIBS="-lefence $LIBS"
@@ -411,10 +401,10 @@
   LIBS="$LIBS -lstdc++-2-libc6.1-1-2.9.0"
 fi
 if test "x$enable_threaded_dns" = "xyes" ; then
-  CFLAGS="$CFLAGS -DD_DNS_THREADED"
+  AC_DEFINE([D_DNS_THREADED], [1], [Enable threaded DNS])
 fi
 if test "x$enable_rtfl" = "xyes" ; then
-  CXXFLAGS="$CXXFLAGS -DDBG_RTFL"
+  AC_DEFINE([DBG_RTFL], [1], [Enable rtfl messages])
 fi
 
 dnl -----------------------
diff -r eae7e07e4cc4 dpi/cookies.c
--- a/dpi/cookies.c
+++ b/dpi/cookies.c
@@ -13,6 +13,8 @@
  *
  */
 
+#include <config.h>
+
 /* The current standard for cookies is RFC 6265.
  *
  * Info from 2009 on cookies in the wild:
diff -r eae7e07e4cc4 lout/debug.hh
--- a/lout/debug.hh
+++ b/lout/debug.hh
@@ -1,6 +1,8 @@
 #ifndef __LOUT_DEBUG_H__
 #define __LOUT_DEBUG_H__
 
+#include <config.h>
+
 /*
  * Simple debug messages. Add:
  *
diff -r eae7e07e4cc4 src/cache.c
--- a/src/cache.c
+++ b/src/cache.c
@@ -13,6 +13,8 @@
  * Dillo's cache module
  */
 
+#include <config.h>
+
 #include <sys/types.h>
 
 #include <limits.h>
diff -r eae7e07e4cc4 src/cookies.c
--- a/src/cookies.c
+++ b/src/cookies.c
@@ -10,6 +10,8 @@
  * (at your option) any later version.
  */
 
+#include <config.h>
+
 /* Handling of cookies takes place here. */
 
 #include "msg.h"
diff -r eae7e07e4cc4 src/dns.c
--- a/src/dns.c
+++ b/src/dns.c
@@ -13,16 +13,7 @@
  * Non blocking pthread-handled Dns scheme
  */
 
-
-/*
- * Uncomment the following line for debugging or gprof profiling.
- */
-/* #undef D_DNS_THREADED */
-
-#ifdef D_DNS_THREADED
-#  include <pthread.h>
-#endif
-
+#include <config.h>
 
 #include <assert.h>
 #include <netdb.h>
@@ -42,6 +33,14 @@
 #include "list.h"
 #include "IO/iowatch.hh"
 
+/*
+ * Uncomment the following line for debugging or gprof profiling.
+ */
+/* #undef D_DNS_THREADED */
+
+#ifdef D_DNS_THREADED
+#  include <pthread.h>
+#endif
 
 /* Maximum dns resolving threads */
 #ifdef D_DNS_THREADED
diff -r eae7e07e4cc4 src/dns.h
--- a/src/dns.h
+++ b/src/dns.h
@@ -1,6 +1,7 @@
 #ifndef __DNS_H__
 #define __DNS_H__
 
+#include <config.h>
 #include <netinet/in.h>
 
 #ifdef __cplusplus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.