[packages/iconv] fix linking issue when using libtool2
authorMirko Vogt <mirko@openwrt.org>
Fri, 3 Dec 2010 11:56:56 +0000 (11:56 +0000)
committerMirko Vogt <mirko@openwrt.org>
Fri, 3 Dec 2010 11:56:56 +0000 (11:56 +0000)
SVN-Revision: 24226

libs/libiconv/Makefile
libs/libiconv/patches/200-work-with-libtool2.patch [new file with mode: 0644]

index 345ba01..11be1cf 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/libiconv
 PKG_MD5SUM:=d42b97f6ef5dd0ba4469d520ed732fed
 
-#PKG_FIXUP = libtool
+PKG_FIXUP = libtool
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -58,7 +58,6 @@ define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC="$(TARGET_CC)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-               HOST_CPU="$(PKGARCH)" \
                install
 endef
 
diff --git a/libs/libiconv/patches/200-work-with-libtool2.patch b/libs/libiconv/patches/200-work-with-libtool2.patch
new file mode 100644 (file)
index 0000000..6e31967
--- /dev/null
@@ -0,0 +1,17 @@
+Make iconv 1.11.x link correctly with libtool2 - argument "-Xcompiler" ensures "-shared" is passed to $(CC) when used as linker. Otherwise $(CC) tries to create an executable and fails while looking for a main()-function
+
+diff -ruN libiconv-1.11.1/lib/Makefile.in libiconv-1.11.1.mod/lib/Makefile.in
+--- libiconv-1.11.1/lib/Makefile.in    2006-07-14 15:18:42.000000000 +0200
++++ libiconv-1.11.1.mod/lib/Makefile.in        2010-12-01 20:47:57.000000000 +0100
+@@ -70,9 +70,9 @@
+ preloadable_libiconv_linux.so : $(SOURCES)
+       if test -n "@GCC@"; then \
+-        $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
++        $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -Xcompiler -shared -o preloadable_libiconv_linux.so; \
+       else \
+-        $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
++        $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -Xcompiler -shared -o preloadable_libiconv_linux.so; \
+       fi
+ preloadable_libiconv_solaris.so : $(SOURCES)