(svn r4219) - Add support for WITH_ICONV. It is enabled by default for OSX > 10.3 for all others set it with WITH_ICONV in Makefile.config or with --with-iconv with configure. --with-config=/somedir will search for iconv include files somewhere (or in Makefile.config with WITH_ICONV_PATH). Custom library loading is not (yet) supported
authorDarkvater
Fri, 31 Mar 2006 21:22:41 +0000
changeset 3408 313f35564673
parent 3407 eb0845aa1db7
child 3409 1f01831f0636
(svn r4219) - Add support for WITH_ICONV. It is enabled by default for OSX > 10.3 for all others set it with WITH_ICONV in Makefile.config or with --with-iconv with configure. --with-config=/somedir will search for iconv include files somewhere (or in Makefile.config with WITH_ICONV_PATH). Custom library loading is not (yet) supported
Makefile
configure
makefiledir/Makefile.config_writer
unix.c
--- a/Makefile	Fri Mar 31 21:13:53 2006 +0000
+++ b/Makefile	Fri Mar 31 21:22:41 2006 +0000
@@ -448,10 +448,19 @@
 endif
 endif
 
+# iconv is enabled defaultly on OSX > 10.3
 ifdef OSX
-ifndef JAGUAR
-LIBS += -liconv
+	ifndef JAGUAR
+		WITH_ICONV=1
+		LIBS += -liconv
+	endif
 endif
+
+ifdef WITH_ICONV
+	CDEFS += -DWITH_ICONV
+	ifdef WITH_ICONV_PATH
+		CFLAGS += -I$(WITH_ICONV_PATH)
+	endif
 endif
 
 # enables/disables assert()
--- a/configure	Fri Mar 31 21:13:53 2006 +0000
+++ b/configure	Fri Mar 31 21:22:41 2006 +0000
@@ -31,12 +31,14 @@
 	echo " zlib               Do you want zlib-support?           [yes]"
 	echo " sdl                Do you want SDL-support?            [yes]"
 	echo " png                Do you want PNG-support?            [yes]"
+	echo " iconv              Do you want iconv-support?          [no]"
 	echo " cocoa              Do you want cocoa-support? (MacOSX) [no]"
 	echo ""
 	echo "Params used to configure external libs:"
 	echo " --static-zlib-path Set the path to your static zlib    []"
 	echo " --sdl-config       Where is your sdl-config            [sdl-config]"
 	echo " --libpng-config    Where is your libpng-config         [libpng-config]"
+	echo " --with-iconv       Set the path to your iconv headers  []"
 	echo " "
 }
 
@@ -149,6 +151,16 @@
 		--without-png)
 			PARAM="$PARAM WITH_PNG="
 			;;
+		--with-iconv)
+			PARAM="$PARAM WITH_ICONV=1"
+			;;
+		--with-iconv=*)
+			PARAM="$PARAM WITH_ICONV=1"
+			handle WITH_ICONV_PATH "$n"
+			;;
+		--without-iconv)
+			PARAM="$PARAM WITH_ICONV="
+			;;
 		--with-cocoa)
 			PARAM="$PARAM WITH_COCOA=1"
 			;;
--- a/makefiledir/Makefile.config_writer	Fri Mar 31 21:13:53 2006 +0000
+++ b/makefiledir/Makefile.config_writer	Fri Mar 31 21:22:41 2006 +0000
@@ -67,6 +67,8 @@
 	$(call CONFIG_LINE,WITH_ZLIB:=$(WITH_ZLIB))
 	$(call CONFIG_LINE,WITH_SDL:=$(WITH_SDL))
 	$(call CONFIG_LINE,WITH_PNG:=$(WITH_PNG))
+	$(call CONFIG_LINE,WITH_ICONV:=$(WITH_ICONV))
+	$(call CONFIG_LINE,WITH_ICONV_PATH:=$(WITH_ICONV_PATH))
 	$(call CONFIG_LINE,STATIC_ZLIB_PATH:=$(STATIC_ZLIB_PATH))
 	$(call CONFIG_LINE,WITH_COCOA:=$(WITH_COCOA))
 	$(call CONFIG_LINE,)
--- a/unix.c	Fri Mar 31 21:13:53 2006 +0000
+++ b/unix.c	Fri Mar 31 21:22:41 2006 +0000
@@ -603,11 +603,6 @@
 	#endif // __AMIGA__
 }
 
-// No proper makefile detection, so just force this for the time being
-#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
-# define WITH_ICONV
-#endif
-
 #ifdef WITH_ICONV
 
 #include <iconv.h>
@@ -621,7 +616,7 @@
  * locale can be found, don't do any conversion "" */
 static const char *GetLocalCode(void)
 {
-#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
+#if defined(__APPLE__)
 	return "UTF-8-MAC";
 #else
 	/* Strip locale (eg en_US.UTF-8) to only have UTF-8 */