Eschew config-post.h.

This commit is contained in:
Micah Cowan 2007-10-18 20:50:40 -07:00
parent 27ed78ddd6
commit 212396c7e1
39 changed files with 125 additions and 160 deletions

View File

@ -5,6 +5,8 @@
some point other than autoreconf.
* Makefile.am: Put autogen.sh back in EXTRA_DIST. Just in case
someone needs to rebuild configure.
* configure.ac: Removed config-post.h inclusion from bottom of
generated config.h.
2007-10-16 Micah Cowan <micah@cowan.name>

View File

@ -458,7 +458,4 @@ AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile
po/Makefile.in tests/Makefile tests/WgetTest.pm
lib/Makefile windows/Makefile])
AC_CONFIG_HEADERS([src/config.h])
AH_BOTTOM([
#include "config-post.h"
])
AC_OUTPUT

View File

@ -1,6 +1,17 @@
2007-10-18 Micah Cowan <micah@cowan.name>
* Makefile.am: version.c should not be distributed.
* Makefile.am: version.c should not be distributed. Removed
config-post.h.
* sysdep.h: Got contents of config-post.h
* config-post.h: Removed.
* wget.h: #include "config.h".
* alloca.c, cmpt.c, connect.c, convert.c, cookies.c,
ftp-basic.c, ftp-ls.c, ftp-opie.c, ftp.c, gen-md5.c, gnutls.c,
hash.c, host.c, html-parse.c, html-url.c, http-ntlm.c, http.c,
init.c, log.c, main.c, mswindows.c, netrc.c, openssl.c,
progress.c, ptimer.c, recur.c, res.c, retr.c, spider.c, url.c,
utils.c, xmalloc.c: Use wget.h at very top, and instead of
config.h.
2007-10-15 Micah Cowan <micah@cowan.name>

View File

@ -39,7 +39,7 @@ wget_SOURCES = cmpt.c connect.c convert.c cookies.c ftp.c ftp-basic.c \
init.c log.c main.c netrc.c progress.c ptimer.c recur.c \
res.c retr.c snprintf.c spider.c url.c \
utils.c xmalloc.c \
config-post.h connect.h convert.h cookies.h \
connect.h convert.h cookies.h \
ftp.h gen-md5.h hash.h host.h html-parse.h \
http.h http-ntlm.h init.h log.h mswindows.h netrc.h \
options.h progress.h ptimer.h recur.h res.h retr.h \

View File

@ -21,6 +21,8 @@
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection. */
#include "wget.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@ -88,7 +90,6 @@ typedef char *pointer;
Callers below should use malloc. */
#ifndef emacs
#include "wget.h"
#define malloc xmalloc
#define free xfree
#endif

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -40,8 +40,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include "wget.h"
/* Some systems lack certain functions normally taken for granted.
For example, Windows doesn't have strptime, and some systems don't
have a usable fnmatch. This file should contain fallback

View File

@ -1,79 +0,0 @@
/* Some autoconf-unrelated preprocessor magic that needs to be done
*before* including the system includes and therefore cannot belong
in sysdep.h.
Everything else related to system tweaking belongs to sysdep.h.
This file is included at the bottom of config.h. */
/* Testing for __sun is not enough because it's also defined on SunOS. */
#ifdef __sun
# ifdef __SVR4
# define solaris
# endif
#endif
/* The "namespace tweaks" below attempt to set a friendly "compilation
environment" under popular operating systems. Default compilation
environment often means that some functions that are "extensions"
are not declared -- `strptime' is one example.
But non-default environments can expose bugs in the system header
files, crippling compilation in _very_ non-obvious ways. Because
of that, we define them only on well-tested architectures where we
know they will work. */
#undef NAMESPACE_TWEAKS
#ifdef solaris
# define NAMESPACE_TWEAKS
#endif
#ifdef __linux__
# define NAMESPACE_TWEAKS
#endif
#ifdef NAMESPACE_TWEAKS
/* Request the "Unix 98 compilation environment". */
#define _XOPEN_SOURCE 500
/* For Solaris: request everything else that is available and doesn't
conflict with the above. */
#define __EXTENSIONS__
/* For Linux: request features of 4.3BSD and SVID (System V Interface
Definition). */
#define _SVID_SOURCE
#define _BSD_SOURCE
/* Under glibc-based systems we want all GNU extensions as well. This
declares some unnecessary cruft, but also useful functions such as
timegm, FNM_CASEFOLD extension to fnmatch, memrchr, etc. */
#define _GNU_SOURCE
#endif /* NAMESPACE_TWEAKS */
/* Alloca declaration, based on recommendation in the Autoconf manual.
These have to be after the above namespace tweaks, but before any
non-preprocessor code. */
#if HAVE_ALLOCA_H
# include <alloca.h>
#elif defined WINDOWS
# include <malloc.h>
# ifndef alloca
# define alloca _alloca
# endif
#elif defined __GNUC__
# define alloca __builtin_alloca
#elif defined _AIX
# define alloca __alloca
#else
# include <stddef.h>
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
#endif

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -50,8 +50,6 @@ so, delete this exception statement from your version. */
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
#include "wget.h"
#include "utils.h"
#include "host.h"
#include "connect.h"

View File

@ -26,7 +26,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -36,8 +36,6 @@ so, delete this exception statement from your version. */
#endif /* HAVE_UNISTD_H */
#include <errno.h>
#include <assert.h>
#include "wget.h"
#include "convert.h"
#include "url.h"
#include "recur.h"

View File

@ -42,7 +42,7 @@ so, delete this exception statement from your version. */
sites that do send Set-Cookie2 also emit Set-Cookie for
compatibility. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <string.h>
@ -50,8 +50,6 @@ so, delete this exception statement from your version. */
#include <assert.h>
#include <errno.h>
#include <time.h>
#include "wget.h"
#include "utils.h"
#include "hash.h"
#include "cookies.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <assert.h>
#include <stdio.h>
@ -38,8 +38,6 @@ so, delete this exception statement from your version. */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "wget.h"
#include "utils.h"
#include "connect.h"
#include "host.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -37,8 +37,6 @@ so, delete this exception statement from your version. */
#endif
#include <errno.h>
#include <time.h>
#include "wget.h"
#include "utils.h"
#include "ftp.h"
#include "url.h"

View File

@ -27,13 +27,12 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "wget.h"
#include "gen-md5.h"
#include "ftp.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -39,7 +39,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include <time.h>
#include "wget.h"
#include "utils.h"
#include "url.h"
#include "retr.h"

View File

@ -27,7 +27,6 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include "gen-md5.h"

View File

@ -26,7 +26,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <assert.h>
#include <errno.h>
@ -39,7 +39,6 @@ so, delete this exception statement from your version. */
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include "wget.h"
#include "utils.h"
#include "connect.h"
#include "url.h"

View File

@ -30,8 +30,8 @@ so, delete this exception statement from your version. */
/* With -DSTANDALONE, this file can be compiled outside Wget source
tree. To test, also use -DTEST. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#ifndef STANDALONE
# include "wget.h"
#endif
#include <stdio.h>
@ -42,7 +42,6 @@ so, delete this exception statement from your version. */
#ifndef STANDALONE
/* Get Wget's utility headers. */
# include "wget.h"
# include "utils.h"
#else
/* Make do without them. */

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -48,7 +48,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include "wget.h"
#include "utils.h"
#include "host.h"
#include "url.h"

View File

@ -88,7 +88,7 @@ so, delete this exception statement from your version. */
/* To test as standalone, compile with `-DSTANDALONE -I.'. You'll
still need Wget headers to compile. */
#include <config.h>
#include "wget.h"
#ifdef STANDALONE
# define I_REALLY_WANT_CTYPE_MACROS
@ -99,7 +99,6 @@ so, delete this exception statement from your version. */
#include <string.h>
#include <assert.h>
#include "wget.h"
#include "html-parse.h"
#ifdef STANDALONE

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <string.h>
@ -35,7 +35,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include <assert.h>
#include "wget.h"
#include "html-parse.h"
#include "url.h"
#include "utils.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
/* NTLM details:
@ -44,7 +44,6 @@ so, delete this exception statement from your version. */
#include <openssl/md4.h>
#include <openssl/opensslv.h>
#include "wget.h"
#include "utils.h"
#include "http-ntlm.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -40,7 +40,6 @@ so, delete this exception statement from your version. */
#include <time.h>
#include <locale.h>
#include "wget.h"
#include "hash.h"
#include "http.h"
#include "utils.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -42,7 +42,6 @@ so, delete this exception statement from your version. */
#endif
#include <assert.h>
#include "wget.h"
#include "utils.h"
#include "init.h"
#include "host.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <string.h>
@ -39,7 +39,6 @@ so, delete this exception statement from your version. */
#include <assert.h>
#include <errno.h>
#include "wget.h"
#include "utils.h"
#include "log.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -43,7 +43,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include <time.h>
#include "wget.h"
#include "utils.h"
#include "init.h"
#include "retr.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -38,7 +38,6 @@ so, delete this exception statement from your version. */
#define INHIBIT_WRAP /* avoid wrapping of socket, bind, ... */
#include "wget.h"
#include "utils.h"
#include "url.h"

View File

@ -29,16 +29,13 @@ so, delete this exception statement from your version. */
/* This file used to be kept in synch with the code in Fetchmail, but
the latter has diverged since. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "wget.h"
#include "utils.h"
#include "netrc.h"
#include "init.h"

View File

@ -28,7 +28,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <assert.h>
#include <errno.h>
@ -42,7 +42,6 @@ so, delete this exception statement from your version. */
#include <openssl/err.h>
#include <openssl/rand.h>
#include "wget.h"
#include "utils.h"
#include "connect.h"
#include "url.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -38,7 +38,6 @@ so, delete this exception statement from your version. */
#endif
#include <signal.h>
#include "wget.h"
#include "progress.h"
#include "utils.h"
#include "retr.h"

View File

@ -49,7 +49,7 @@ so, delete this exception statement from your version. */
double secs = ptimer_measure ();
printf ("The loop took %.2fs\n", secs); */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -70,7 +70,6 @@ so, delete this exception statement from your version. */
# include <windows.h>
#endif
#include "wget.h"
#include "ptimer.h"
/* Depending on the OS, one and only one of PTIMER_POSIX,

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -38,7 +38,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include <assert.h>
#include "wget.h"
#include "url.h"
#include "recur.h"
#include "utils.h"

View File

@ -66,9 +66,7 @@ so, delete this exception statement from your version. */
res_match_path, res_register_specs, res_get_specs, and
res_retrieve_file. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -76,7 +74,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include <assert.h>
#include "wget.h"
#include "utils.h"
#include "hash.h"
#include "url.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -38,7 +38,6 @@ so, delete this exception statement from your version. */
#include <string.h>
#include <assert.h>
#include "wget.h"
#include "utils.h"
#include "retr.h"
#include "progress.h"

View File

@ -26,13 +26,12 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include "wget.h"
#include "spider.h"
#include "url.h"
#include "utils.h"

View File

@ -33,6 +33,78 @@ so, delete this exception statement from your version. */
#ifndef SYSDEP_H
#define SYSDEP_H
/* Testing for __sun is not enough because it's also defined on SunOS. */
#ifdef __sun
# ifdef __SVR4
# define solaris
# endif
#endif
/* The "namespace tweaks" below attempt to set a friendly "compilation
environment" under popular operating systems. Default compilation
environment often means that some functions that are "extensions"
are not declared -- `strptime' is one example.
But non-default environments can expose bugs in the system header
files, crippling compilation in _very_ non-obvious ways. Because
of that, we define them only on well-tested architectures where we
know they will work. */
#undef NAMESPACE_TWEAKS
#ifdef solaris
# define NAMESPACE_TWEAKS
#endif
#ifdef __linux__
# define NAMESPACE_TWEAKS
#endif
#ifdef NAMESPACE_TWEAKS
/* Request the "Unix 98 compilation environment". */
#define _XOPEN_SOURCE 500
/* For Solaris: request everything else that is available and doesn't
conflict with the above. */
#define __EXTENSIONS__
/* For Linux: request features of 4.3BSD and SVID (System V Interface
Definition). */
#define _SVID_SOURCE
#define _BSD_SOURCE
/* Under glibc-based systems we want all GNU extensions as well. This
declares some unnecessary cruft, but also useful functions such as
timegm, FNM_CASEFOLD extension to fnmatch, memrchr, etc. */
#define _GNU_SOURCE
#endif /* NAMESPACE_TWEAKS */
/* Alloca declaration, based on recommendation in the Autoconf manual.
These have to be after the above namespace tweaks, but before any
non-preprocessor code. */
#if HAVE_ALLOCA_H
# include <alloca.h>
#elif defined WINDOWS
# include <malloc.h>
# ifndef alloca
# define alloca _alloca
# endif
#elif defined __GNUC__
# define alloca __builtin_alloca
#elif defined _AIX
# define alloca __alloca
#else
# include <stddef.h>
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
#endif
/* Must include these, so we can test for the missing stat macros and
define them as necessary. */
#include <sys/types.h>

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -38,7 +38,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include <assert.h>
#include "wget.h"
#include "utils.h"
#include "url.h"
#include "host.h" /* for is_valid_ipv6_address */

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -80,7 +80,6 @@ so, delete this exception statement from your version. */
# define USE_SIGNAL_TIMEOUT
#endif
#include "wget.h"
#include "utils.h"
#include "hash.h"

View File

@ -35,6 +35,11 @@ so, delete this exception statement from your version. */
#ifndef WGET_H
#define WGET_H
#include "config.h"
/* Include these, so random files need not include them. */
#include "sysdep.h"
/* Disable assertions when debug support is not compiled in. */
#ifndef ENABLE_DEBUG
# define NDEBUG
@ -76,9 +81,6 @@ so, delete this exception statement from your version. */
debug problems with Wget. If I get them in a language I don't
understand, debugging will become a new challenge of its own! */
/* Include these, so random files need not include them. */
#include "sysdep.h"
/* locale independent replacement for ctype.h */
#include "c-ctype.h"

View File

@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#include <config.h>
#include "wget.h"
#include <stdio.h>
#include <stdlib.h>
@ -35,7 +35,6 @@ so, delete this exception statement from your version. */
#include <errno.h>
#include <assert.h>
#include "wget.h"
#include "xmalloc.h"
#include "hash.h" /* for hash_pointer */