changeset 5305:af7797503fc8 draft

(svn r7461) -Fix: [FS#262] Add support for building with GCC on OS/2 (psmedley)
author Darkvater <Darkvater@openttd.org>
date Sun, 10 Dec 2006 00:20:26 +0000
parents a0ea47ce8def
children 01a14eda8e3a
files Makefile configure driver.c makefiledir/Makefile.config_writer network_core.h
diffstat 5 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile
+++ b/Makefile
@@ -254,9 +254,13 @@
 
 # Executable file extension
 ifdef WIN32
-EXE=.exe
+  EXE=.exe
 else
-EXE=
+  ifdef OS2
+    EXE=.exe
+  else
+    EXE=
+  endif
 endif
 
 # Set output executable names
--- a/configure
+++ b/configure
@@ -20,7 +20,7 @@
 	echo " --host-cxx          Sets the C++ host-compiler          []"
 	echo " --os                Sets the OS. Listens to:            [detected]"
 	echo "                        UNIX, OSX, FREEBSD, MORPHOS"
-	echo "                        BEOS, SUNOS, CYGWIN, MINGW"
+	echo "                        BEOS, SUNOS, CYGWIN, MINGW, OS2"
 	echo " --windres           Sets the windres (Windows)          [windres]"
 	echo " --force-le          Force LE platform                   [no]"
 	echo " --force-be          Force BE platform                   [no]"
@@ -277,6 +277,9 @@
 		BEOS)
 			PARAM="$PARAM BEOS=1 UNIX=1"
 			;;
+		OS2)
+			PARAM="$PARAM OS2=1 UNIX=1"
+			;;
 		SUNOS)
 			PARAM="$PARAM SUNOS=1 UNIX=1"
 			;;
--- a/driver.c
+++ b/driver.c
@@ -45,7 +45,7 @@
 #ifdef __BEOS__
 	M("bemidi",  "BeOS MIDI Driver",        &_bemidi_music_driver),
 #endif
-#ifdef __OS2__
+#if defined(__OS2__) && !defined(__INNOTEK_LIBC__)
 	M("os2",     "OS/2 Music Driver",       &_os2_music_driver),
 #endif
 #ifdef WIN32_ENABLE_DIRECTMUSIC_SUPPORT
--- a/makefiledir/Makefile.config_writer
+++ b/makefiledir/Makefile.config_writer
@@ -84,6 +84,7 @@
 	$(call CONFIG_LINE,FREEBSD:=$(FREEBSD))
 	$(call CONFIG_LINE,MORPHOS:=$(MORPHOS))
 	$(call CONFIG_LINE,BEOS:=$(BEOS))
+	$(call CONFIG_LINE,OS2:=$(OS2))
 	$(call CONFIG_LINE,SUNOS:=$(SUNOS))
 	$(call CONFIG_LINE,CYGWIN:=$(CYGWIN))
 	$(call CONFIG_LINE,MINGW:=$(MINGW))
--- a/network_core.h
+++ b/network_core.h
@@ -64,7 +64,7 @@
 #		include <arpa/inet.h>
 #		include <net/if.h>
 // According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3.
-#		if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) \
+#		if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) && !defined(__INNOTEK_LIBC__) \
 		   && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__)
 // If for any reason ifaddrs.h does not exist on your system, comment out
 //   the following two lines and an alternative way will be used to fetch
@@ -118,7 +118,9 @@
 #	define INADDR_NONE 0xffffffff
 
 typedef int socklen_t;
+#if !defined(__INNOTEK_LIBC__)
 typedef unsigned long in_addr_t;
+#endif /* __INNOTEK_LIBC__ */
 #endif // OS/2
 
 // MorphOS and Amiga stuff