From a8ab8facbe4e8ec5637f5f6ace8433be086e653b Mon Sep 17 00:00:00 2001 From: meep-eep Date: Thu, 19 Jan 2006 19:13:39 +0000 Subject: [PATCH] Some small portability improvements. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2199 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/build.vars.in | 4 ++-- sc2/build/unix/build.config | 10 +++++----- sc2/build/unix/config_proginfo_host | 2 ++ sc2/src/config_unix.h.in | 4 ++-- sc2/src/getopt/getopt.c | 4 ++-- sc2/src/getopt/getopt1.c | 4 ++-- sc2/src/msvc++/config.h | 4 ++-- sc2/src/sc2code/libs/sound/decoders/wav.c | 1 - sc2/src/starcon2.c | 2 +- 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/sc2/build.vars.in b/sc2/build.vars.in index 6db9e278c..7ade16b6d 100644 --- a/sc2/build.vars.in +++ b/sc2/build.vars.in @@ -17,8 +17,8 @@ BUILD_SYSTEM='@BUILD_SYSTEM@' HOST_SYSTEM='@HOST_SYSTEM@' -COMPILE=gcc -MKDEPEND='gcc -MM' +COMPILE='@COMPILE@' +MKDEPEND='@COMPILE@ -MM' MAKE='@MAKE@' ECHON='@ECHON@' SED='@SED@' diff --git a/sc2/build/unix/build.config b/sc2/build/unix/build.config index cb5e3110a..5c1397e18 100644 --- a/sc2/build/unix/build.config +++ b/sc2/build/unix/build.config @@ -33,7 +33,7 @@ uqm_requirements() use_library SDL_image || exit 1 - # Add defines for HAVE_READDIR_R, HAVE_SETENV, HAVE_STRUPR + # Add defines for HAVE_READDIR_R, HAVE_SETENV, HAVE_STRUPR, # and HAVE_STRICMP define_have_symbol readdir_r define_have_symbol setenv @@ -45,9 +45,8 @@ uqm_requirements() define_have_type wchar_t define_have_type wint_t - - # Add defines for HAVE_GETOPT_H and HAVE_REGEX_H - define_have_header getopt.h + # Add defines for HAVE_GETOPT_LONG and HAVE_REGEX_H + define_have_symbol getopt_long define_have_header regex.h } @@ -279,7 +278,8 @@ uqm_process_config() { substitute_vars SUBSTITUTE_VARS SUBSTITUTE_FILES src "$BUILD_WORK" # Make build.vars from build.vars.in, substituting variables. - SUBSTITUTE_VARS="BUILD_SYSTEM HOST_SYSTEM CFLAGS LDFLAGS MAKE \ + SUBSTITUTE_VARS="BUILD_SYSTEM HOST_SYSTEM COMPILE \ + CFLAGS LDFLAGS MAKE \ ECHON DEBUG SED SOUNDMODULE \ HAVE_OPENGL HAVE_REGEX_H_FLAG USE_ZIP_IO \ USE_PLATFORM_ACCEL \ diff --git a/sc2/build/unix/config_proginfo_host b/sc2/build/unix/config_proginfo_host index 59d8d87ac..d767ae4a8 100644 --- a/sc2/build/unix/config_proginfo_host +++ b/sc2/build/unix/config_proginfo_host @@ -235,4 +235,6 @@ SYMBOL_wint_t_EXTRA="#include " SYMBOL_iswgraph_EXTRA="#include " +SYMBOL_getopt_long_EXTRA="#include " + diff --git a/sc2/src/config_unix.h.in b/sc2/src/config_unix.h.in index 12550c7b5..6932bd3f4 100644 --- a/sc2/src/config_unix.h.in +++ b/sc2/src/config_unix.h.in @@ -40,8 +40,8 @@ /* Defined if your system has stricmp of its own */ @HAVE_STRICMP@ -/* Defined if your system has getopt.h */ -@HAVE_GETOPT_H@ +/* Defined if your system has getopt_long */ +@HAVE_GETOPT_LONG@ /* Defined if your system has iswgraph of its own*/ @HAVE_ISWGRAPH@ diff --git a/sc2/src/getopt/getopt.c b/sc2/src/getopt/getopt.c index 510d22189..4d933a741 100644 --- a/sc2/src/getopt/getopt.c +++ b/sc2/src/getopt/getopt.c @@ -29,7 +29,7 @@ #include -#ifndef HAVE_GETOPT_H +#ifndef HAVE_GETOPT_LONG #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ @@ -1057,4 +1057,4 @@ main (argc, argv) #endif /* TEST */ -#endif /* HAVE_GETOPT_H */ +#endif /* HAVE_GETOPT_LONG */ diff --git a/sc2/src/getopt/getopt1.c b/sc2/src/getopt/getopt1.c index 57eee0821..9acca1b57 100644 --- a/sc2/src/getopt/getopt1.c +++ b/sc2/src/getopt/getopt1.c @@ -20,7 +20,7 @@ #include -#ifndef HAVE_GETOPT_H +#ifndef HAVE_GETOPT_LONG #include "getopt.h" #if !defined __STDC__ || !__STDC__ @@ -186,4 +186,4 @@ main (argc, argv) #endif /* TEST */ -#endif /* HAVE_GETOPT_H */ +#endif /* HAVE_GETOPT_LONG */ diff --git a/sc2/src/msvc++/config.h b/sc2/src/msvc++/config.h index 3307762aa..030f12a12 100644 --- a/sc2/src/msvc++/config.h +++ b/sc2/src/msvc++/config.h @@ -41,8 +41,8 @@ /* Defined if your system has stricmp of its own */ #define HAVE_STRICMP -/* Defined if your system has getopt.h */ -#undef HAVE_GETOPT_H +/* Defined if your system has getopt_long */ +#undef HAVE_GETOPT_LONG /* Defined if your system has iswgraph of its own*/ #define HAVE_ISWGRAPH diff --git a/sc2/src/sc2code/libs/sound/decoders/wav.c b/sc2/src/sc2code/libs/sound/decoders/wav.c index 7831bbbb6..231d342c3 100644 --- a/sc2/src/sc2code/libs/sound/decoders/wav.c +++ b/sc2/src/sc2code/libs/sound/decoders/wav.c @@ -20,7 +20,6 @@ #include #include -#include #include "port.h" #include "types.h" #include "uio.h" diff --git a/sc2/src/starcon2.c b/sc2/src/starcon2.c index c54f0fd38..020d2ff7c 100644 --- a/sc2/src/starcon2.c +++ b/sc2/src/starcon2.c @@ -20,7 +20,7 @@ # include #endif -#ifdef HAVE_GETOPT_H +#ifdef HAVE_GETOPT_LONG # include #else # include "getopt/getopt.h"