Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
[Freeciv-Dev] patch: configure-check all non-standard header files (PR#9
Home

[Freeciv-Dev] patch: configure-check all non-standard header files (PR#9

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] patch: configure-check all non-standard header files (PR#90)
From: dwp@xxxxxxxxxxxxxx
Date: Sun, 1 Aug 1999 05:01:17 -0700 (PDT)

This is a multi-part message in MIME format.

--_----------=_93350887890910
Content-Disposition: inline
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This patch adds and uses configure checks for all non-standard
header includes which I could find; I think this is probably 
a good idea.  (It excludes the Mac-specific ones; those should 
also be changed soon once the Mac port changes to use a
hand-written config.h)

This _should_ be a straightforward patch; possible problems 
though:
- If on any systems some of these headers are not 'stand-alone',
  but require other headers first?  Hopefully not.
- If there are any systems where some of these headers exist
  but for some reason should _not_ be used.
- If I've made any typos which happen not to matter on the
  systems I've tested this on (...)
- "If its not broken..."

Regards,
-- David

--_----------=_93350887890910
Content-Disposition: inline; filename="have_headers.diff"
Content-Type: text/plain; name="have_headers.diff"
Content-Transfer-Encoding: 7bit

diff -u -r --exclude-from exclude_auto fc-adv/client/civclient.c 
freeciv-mod/client/civclient.c
--- fc-adv/client/civclient.c   Sat Jul 31 18:15:05 1999
+++ freeciv-mod/client/civclient.c      Sat Jul 31 18:11:05 1999
@@ -19,8 +19,9 @@
 #include <string.h>
 #include <time.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
+#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
diff -u -r --exclude-from exclude_auto fc-adv/client/climisc.c 
freeciv-mod/client/climisc.c
--- fc-adv/client/climisc.c     Sat Jul 31 18:15:06 1999
+++ freeciv-mod/client/climisc.c        Sat Jul 31 18:11:05 1999
@@ -16,12 +16,18 @@
 used throughout the client.
 ***********************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "game.h"
 #include "log.h"
diff -u -r --exclude-from exclude_auto fc-adv/client/gui-gtk/clinet.c 
freeciv-mod/client/gui-gtk/clinet.c
--- fc-adv/client/gui-gtk/clinet.c      Sat Jul 31 18:15:06 1999
+++ freeciv-mod/client/gui-gtk/clinet.c Sat Jul 31 18:11:05 1999
@@ -20,28 +20,44 @@
 #include <ctype.h>
 #include <errno.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
+#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_SIGNAL_H
 #include <sys/signal.h>
+#endif
+#ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 
+#ifdef HAVE_PWD_H
 #include <pwd.h>
-
+#endif
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
-
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 
 #include <gtk/gtk.h>
 
diff -u -r --exclude-from exclude_auto fc-adv/client/gui-gtk/gui_main.c 
freeciv-mod/client/gui-gtk/gui_main.c
--- fc-adv/client/gui-gtk/gui_main.c    Sat Jul 31 18:15:06 1999
+++ freeciv-mod/client/gui-gtk/gui_main.c       Sat Jul 31 18:11:06 1999
@@ -19,8 +19,12 @@
 #include <string.h>
 #include <time.h>
 
+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff -u -r --exclude-from exclude_auto fc-adv/client/gui-gtk/mapview.c 
freeciv-mod/client/gui-gtk/mapview.c
--- fc-adv/client/gui-gtk/mapview.c     Sat Jul 31 18:15:06 1999
+++ freeciv-mod/client/gui-gtk/mapview.c        Sat Jul 31 18:11:06 1999
@@ -10,9 +10,15 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 ***********************************************************************/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include <gtk/gtk.h>
 
diff -u -r --exclude-from exclude_auto fc-adv/client/gui-xaw/clinet.c 
freeciv-mod/client/gui-xaw/clinet.c
--- fc-adv/client/gui-xaw/clinet.c      Sat Jul 31 18:15:07 1999
+++ freeciv-mod/client/gui-xaw/clinet.c Sat Jul 31 18:11:06 1999
@@ -20,28 +20,46 @@
 #include <ctype.h>
 #include <errno.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
+#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_SIGNAL_H
 #include <sys/signal.h>
+#endif
+#ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 
+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
 
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
 
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 
 #include "capstr.h"
 #include "game.h"
diff -u -r --exclude-from exclude_auto fc-adv/client/gui-xaw/gui_main.c 
freeciv-mod/client/gui-xaw/gui_main.c
--- fc-adv/client/gui-xaw/gui_main.c    Sat Jul 31 18:15:07 1999
+++ freeciv-mod/client/gui-xaw/gui_main.c       Sat Jul 31 18:11:06 1999
@@ -18,7 +18,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
diff -u -r --exclude-from exclude_auto fc-adv/common/packets.c 
freeciv-mod/common/packets.c
--- fc-adv/common/packets.c     Sat Jul 31 18:15:08 1999
+++ freeciv-mod/common/packets.c        Sat Jul 31 18:11:06 1999
@@ -19,14 +19,16 @@
 #include <string.h>
 #include <assert.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
+#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-
-#if !(defined(GENERATING68K) || defined(GENERATINGPPC)) /* non mac header(s) */
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
 
diff -u -r --exclude-from exclude_auto fc-adv/common/shared.c 
freeciv-mod/common/shared.c
--- fc-adv/common/shared.c      Sat Jul 31 18:15:08 1999
+++ freeciv-mod/common/shared.c Sat Jul 31 18:11:06 1999
@@ -20,20 +20,21 @@
 #include <ctype.h>
 #include <assert.h>
 
-#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac header(s) */
-#include <events.h> /* for WaitNextEvent() */
-#else
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
-
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-
-#include <unistd.h>
-
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
+#endif
+
+#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac header(s) */
+#include <events.h> /* for WaitNextEvent() */
 #endif
 
 #include "log.h"
diff -u -r --exclude-from exclude_auto fc-adv/configure.in 
freeciv-mod/configure.in
--- fc-adv/configure.in Sat Jul 31 18:15:09 1999
+++ freeciv-mod/configure.in    Sat Jul 31 18:11:07 1999
@@ -241,7 +241,9 @@
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(sys/ioctl.h sys/select.h sys/time.h sys/types.h unistd.h)
+AC_CHECK_HEADERS(arpa/inet.h netdb.h netinet/in.h pwd.h sys/ioctl.h \
+                 sys/select.h sys/signal.h sys/socket.h sys/termio.h \
+                sys/time.h sys/types.h sys/uio.h termios.h unistd.h)
 if test x$client = xtrue; then
   dnl Want to get appropriate -I flags:
   fc_save_CPPFLAGS="$CPPFLAGS"
diff -u -r --exclude-from exclude_auto fc-adv/server/civserver.c 
freeciv-mod/server/civserver.c
--- fc-adv/server/civserver.c   Sat Jul 31 18:15:10 1999
+++ freeciv-mod/server/civserver.c      Sat Jul 31 18:11:07 1999
@@ -21,21 +21,27 @@
 #include <assert.h>
 #include <time.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
-#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac header(s) */
-#include <bool.h> /*from STL, but works w/ c*/
 #endif
-
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-
-#ifdef __EMX__
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
+#endif
+#ifdef HAVE_SYS_TERMIO_H
 #include <sys/termio.h>
+#endif
+#ifdef HAVE_TERMIOS_H
 #include <termios.h>
+#endif
+
+#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac header(s) */
+#include <bool.h> /*from STL, but works w/ c*/
 #endif
 
 #include "capability.h"
diff -u -r --exclude-from exclude_auto fc-adv/server/meta.c 
freeciv-mod/server/meta.c
--- fc-adv/server/meta.c        Sat Jul 31 18:15:10 1999
+++ freeciv-mod/server/meta.c   Sat Jul 31 18:11:07 1999
@@ -22,20 +22,28 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
+#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-
-#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac network headers 
*/
-#include <OpenTransport.h>
-#else /* Unix network headers */
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
-#endif /* end network header selection */
+#endif 
+
+#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac network headers 
*/
+#include <OpenTransport.h>
+#endif
 
 #include "packets.h"
 #include "console.h"
diff -u -r --exclude-from exclude_auto fc-adv/server/sernet.c 
freeciv-mod/server/sernet.c
--- fc-adv/server/sernet.c      Sat Jul 31 18:15:10 1999
+++ freeciv-mod/server/sernet.c Sat Jul 31 18:11:07 1999
@@ -19,16 +19,21 @@
 #include <string.h>
 #include <time.h>
 #include <errno.h>
+#include <signal.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
+#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-
-#if !(defined(GENERATING68K) || defined(GENERATINGPPC)) /* non mac header(s) */
+#ifdef HAVE_SYS_SIGNAL_H
 #include <sys/signal.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
+#ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
 
@@ -36,13 +41,19 @@
 #include <sys/select.h>
 #endif
 
-#include <signal.h>
-
-#if !(defined(GENERATING68K) || defined(GENERATINGPPC)) /* non mac header(s) */
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
 

--_----------=_93350887890910--





[Prev in Thread] Current Thread [Next in Thread]