From 5c452301377e01ae49868457992e8221ba06eb07 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 7 Aug 2003 02:01:00 +0000 Subject: [PATCH] check for getopt.h --- dtool/Config.Irix.pp | 3 +++ dtool/Config.Linux.pp | 3 +++ dtool/Config.Win32.pp | 3 +++ dtool/LocalSetup.pp | 3 +++ dtool/src/dtoolbase/dtoolbase.h | 1 - dtool/src/interrogate/interrogate.cxx | 12 +++++++----- dtool/src/interrogate/interrogate.h | 8 ++++---- ppremake/configure.in | 2 +- ppremake/ppremake.cxx | 4 +++- 9 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dtool/Config.Irix.pp b/dtool/Config.Irix.pp index 08d5a79be4..c5ea362eb8 100644 --- a/dtool/Config.Irix.pp +++ b/dtool/Config.Irix.pp @@ -39,6 +39,9 @@ #define HAVE_GETOPT 1 #define HAVE_GETOPT_LONG_ONLY +// Are the above getopt() functions defined in getopt.h, or somewhere else? +#define HAVE_GETOPT_H 1 + // Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call? #define IOCTL_TERMINAL_WIDTH 1 diff --git a/dtool/Config.Linux.pp b/dtool/Config.Linux.pp index 3f4e0e0c05..052cc54479 100644 --- a/dtool/Config.Linux.pp +++ b/dtool/Config.Linux.pp @@ -42,6 +42,9 @@ #define HAVE_GETOPT 1 #define HAVE_GETOPT_LONG_ONLY 1 +// Are the above getopt() functions defined in getopt.h, or somewhere else? +#define HAVE_GETOPT_H 1 + // Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call? #define IOCTL_TERMINAL_WIDTH 1 diff --git a/dtool/Config.Win32.pp b/dtool/Config.Win32.pp index d60387622a..52476493d6 100644 --- a/dtool/Config.Win32.pp +++ b/dtool/Config.Win32.pp @@ -42,6 +42,9 @@ #define HAVE_GETOPT #define HAVE_GETOPT_LONG_ONLY +// Are the above getopt() functions defined in getopt.h, or somewhere else? +#define HAVE_GETOPT_H + // Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call? #define IOCTL_TERMINAL_WIDTH diff --git a/dtool/LocalSetup.pp b/dtool/LocalSetup.pp index 26b7241250..0b683ceb26 100644 --- a/dtool/LocalSetup.pp +++ b/dtool/LocalSetup.pp @@ -173,6 +173,9 @@ $[cdefine HAVE_GETOPT] /* Define if you have the getopt_long_only function. */ $[cdefine HAVE_GETOPT_LONG_ONLY] +/* Define if getopt appears in getopt.h. */ +$[cdefine HAVE_GETOPT_H] + /* Define if you have ioctl(TIOCGWINSZ) to determine terminal width. */ $[cdefine IOCTL_TERMINAL_WIDTH] diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index c1f003c96a..d14303bd28 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -113,7 +113,6 @@ #include #endif - #ifdef CPPPARSER #include #endif diff --git a/dtool/src/interrogate/interrogate.cxx b/dtool/src/interrogate/interrogate.cxx index 1bfa8ed53c..b2aee8ae48 100644 --- a/dtool/src/interrogate/interrogate.cxx +++ b/dtool/src/interrogate/interrogate.cxx @@ -19,17 +19,19 @@ #include "interrogate.h" #include "interrogateBuilder.h" -#include -#include -#include +#include "interrogateDatabase.h" +#include "cppGlobals.h" +#include "notify.h" #include // If our system getopt() doesn't come with getopt_long_only(), then use // the GNU flavor that we've got in tool for this purpose. #ifndef HAVE_GETOPT_LONG_ONLY -#include +#include "gnu_getopt.h" #else -#include + #ifdef HAVE_GETOPT_H + #include + #endif #endif CPPParser parser; diff --git a/dtool/src/interrogate/interrogate.h b/dtool/src/interrogate/interrogate.h index c219970604..0f6f592394 100644 --- a/dtool/src/interrogate/interrogate.h +++ b/dtool/src/interrogate/interrogate.h @@ -19,11 +19,11 @@ #ifndef INTERROGATE_H #define INTERROGATE_H -#include +#include "dtoolbase.h" -#include -#include -#include +#include "cppParser.h" +#include "cppVisibility.h" +#include "filename.h" extern CPPParser parser; diff --git a/ppremake/configure.in b/ppremake/configure.in index 750e10a244..3ae4655c6e 100644 --- a/ppremake/configure.in +++ b/ppremake/configure.in @@ -42,7 +42,7 @@ AC_SUBST(libm) dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(malloc.h alloca.h unistd.h utime.h io.h minmax.h dirent.h sys/types.h sys/time.h sys/utime.h sys/wait.h string.h regex.h) +AC_CHECK_HEADERS(malloc.h alloca.h unistd.h utime.h io.h minmax.h dirent.h sys/types.h sys/time.h sys/utime.h sys/wait.h string.h regex.h getopt.h) dnl Checks for typedefs, structures, and compiler characteristics. diff --git a/ppremake/ppremake.cxx b/ppremake/ppremake.cxx index 76eab81c0b..16c78274ac 100644 --- a/ppremake/ppremake.cxx +++ b/ppremake/ppremake.cxx @@ -11,10 +11,12 @@ #include "sedProcess.h" #ifdef HAVE_GETOPT +#ifdef HAVE_GETOPT_H #include +#endif // HAVE_GETOPT_H #else #include "gnu_getopt.h" -#endif +#endif // HAVE_GETOPT #ifdef HAVE_UNISTD_H #include