From d37698cbe909596db364df460f4a31fc888eb87b Mon Sep 17 00:00:00 2001 From: nico Date: Tue, 12 Oct 2010 20:08:18 +0000 Subject: [PATCH] packages/gd: various fixes * fix patch to tweak configure.ac instead of configure since autoreconf is used in Build/Configure * pass --force to libtoolize to actually update libtool * add a patch to properly deal with LIBICONV * install gdlib-config in $(STAGING_DIR) and a symlink in $(STAGING_DIR_HOST) git-svn-id: svn://svn.openwrt.org/openwrt/packages@23417 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- libs/gd/Makefile | 16 +-- libs/gd/patches/100-configure_fix.patch | 172 +++----------------------------- libs/gd/patches/101-gdlib-config.patch | 20 ++++ 3 files changed, 45 insertions(+), 163 deletions(-) create mode 100644 libs/gd/patches/101-gdlib-config.patch diff --git a/libs/gd/Makefile b/libs/gd/Makefile index ffe31ebfb..ed4c2d110 100644 --- a/libs/gd/Makefile +++ b/libs/gd/Makefile @@ -34,6 +34,8 @@ define Package/libgd/description programmers. GD creates PNG, JPEG and GIF images, among other formats. endef +TARGET_CFLAGS += $(FPIC) + CONFIGURE_ARGS += \ --enable-shared \ --enable-static \ @@ -48,23 +50,25 @@ CONFIGURE_ARGS += \ CONFIGURE_VARS += \ LIBPNG12_CONFIG="$(STAGING_DIR)/host/bin/libpng12-config" -TARGET_CFLAGS += $(FPIC) - define Build/Configure - ( cd $(PKG_BUILD_DIR); aclocal; libtoolize; autoreconf; ); + ( cd $(PKG_BUILD_DIR); aclocal; libtoolize --force; autoreconf; ); $(call Build/Configure/Default) endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdlib-config $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/gdlib-config $(1)/usr/bin/ + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(1)/usr/bin/gdlib-config $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/entities.h $(1)/usr/include/ $(CP) $(PKG_INSTALL_DIR)/usr/include/gd{,_io,cache,fontg,fontl,fontmb,fonts,fontt,fx}.h \ $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.{a,so*} $(1)/usr/lib/ - $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/gdlib-config + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.{a,la,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(2)/bin + $(LN) ../../usr/bin/gdlib-config $(2)/bin/ endef define Package/libgd/install diff --git a/libs/gd/patches/100-configure_fix.patch b/libs/gd/patches/100-configure_fix.patch index e9f4d5f49..b0123b389 100644 --- a/libs/gd/patches/100-configure_fix.patch +++ b/libs/gd/patches/100-configure_fix.patch @@ -1,172 +1,30 @@ ---- a/configure -+++ b/configure -@@ -9454,21 +9454,6 @@ - shlibpath_overrides_runpath=unknown - version_type=none - dynamic_linker="$host_os ld.so" --sys_lib_dlsearch_path_spec="/lib /usr/lib" --if test "$GCC" = yes; then -- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -- # if the path contains ";" then we assume it to be the separator -- # otherwise default to the standard path separator (i.e. ":") - it is -- # assumed that no part of a normal pathname contains ";" but that should -- # okay in the real world where ";" in dirpaths is itself problematic. -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -- else -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -- fi --else -- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" --fi - need_lib_prefix=unknown - hardcode_into_libs=no - -@@ -9816,12 +9801,6 @@ - # before this can be enabled. - hardcode_into_libs=yes - -- # Append ld.so.conf contents to the search path -- if test -f /etc/ld.so.conf; then -- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -- fi -- - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, -@@ -13364,21 +13343,6 @@ - shlibpath_overrides_runpath=unknown - version_type=none - dynamic_linker="$host_os ld.so" --sys_lib_dlsearch_path_spec="/lib /usr/lib" --if test "$GCC" = yes; then -- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -- # if the path contains ";" then we assume it to be the separator -- # otherwise default to the standard path separator (i.e. ":") - it is -- # assumed that no part of a normal pathname contains ";" but that should -- # okay in the real world where ";" in dirpaths is itself problematic. -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -- else -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -- fi --else -- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" --fi - need_lib_prefix=unknown - hardcode_into_libs=no - -@@ -13726,12 +13690,6 @@ - # before this can be enabled. - hardcode_into_libs=yes - -- # Append ld.so.conf contents to the search path -- if test -f /etc/ld.so.conf; then -- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -- fi -- - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, -@@ -15936,21 +15894,6 @@ - shlibpath_overrides_runpath=unknown - version_type=none - dynamic_linker="$host_os ld.so" --sys_lib_dlsearch_path_spec="/lib /usr/lib" --if test "$GCC" = yes; then -- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -- # if the path contains ";" then we assume it to be the separator -- # otherwise default to the standard path separator (i.e. ":") - it is -- # assumed that no part of a normal pathname contains ";" but that should -- # okay in the real world where ";" in dirpaths is itself problematic. -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -- else -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -- fi --else -- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" --fi - need_lib_prefix=unknown - hardcode_into_libs=no - -@@ -16298,12 +16241,6 @@ - # before this can be enabled. - hardcode_into_libs=yes - -- # Append ld.so.conf contents to the search path -- if test -f /etc/ld.so.conf; then -- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -- fi -- - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, -@@ -18515,21 +18452,6 @@ - shlibpath_overrides_runpath=unknown - version_type=none - dynamic_linker="$host_os ld.so" --sys_lib_dlsearch_path_spec="/lib /usr/lib" --if test "$GCC" = yes; then -- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -- # if the path contains ";" then we assume it to be the separator -- # otherwise default to the standard path separator (i.e. ":") - it is -- # assumed that no part of a normal pathname contains ";" but that should -- # okay in the real world where ";" in dirpaths is itself problematic. -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -- else -- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -- fi --else -- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" --fi - need_lib_prefix=unknown - hardcode_into_libs=no - -@@ -18877,12 +18799,6 @@ - # before this can be enabled. - hardcode_into_libs=yes - -- # Append ld.so.conf contents to the search path -- if test -f /etc/ld.so.conf; then -- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -- fi -- - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, -@@ -22026,14 +21942,14 @@ - +--- a/configure.ac ++++ b/configure.ac +@@ -61,7 +61,7 @@ fi + AC_HEADER_STDC + AC_CHECK_HEADERS([errno.h limits.h stddef.h stdlib.h string.h unistd.h]) +-AM_ICONV ++m4_pattern_allow([AM_ICONV]) + # if test -n "$LIBICONV" ; then + # LIBS="$LIBS $LIBICONV" + # fi +@@ -353,14 +353,14 @@ if test "$withval" != no; then + AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config]) + AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config]) if test -n "$LIBPNG12_CONFIG"; then - libpng_CPPFLAGS=`libpng12-config --cflags` + libpng_CPPFLAGS=`$LIBPNG12_CONFIG --cflags` # should be --ldopts, but it's currently broken - libpng_LDFLAGS=`libpng12-config --ldflags` + libpng_LDFLAGS=`$LIBPNG12_CONFIG --ldflags` - libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[^ ][^ ]*//g'` + libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'` elif test -n "$LIBPNG_CONFIG"; then - libpng_CPPFLAGS=`libpng-config --cflags` + libpng_CPPFLAGS=`$LIBPNG_CONFIG --cflags` # should be --ldopts, but it's currently broken - libpng_LDFLAGS=`libpng-config --ldflags` + libpng_LDFLAGS=`$LIBPNG_CONFIG --ldflags` - libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[^ ][^ ]*//g'` + libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'` elif test -d "$withval"; then libpng_CPPFLAGS="-I$withval/include" ---- a/configure.ac -+++ b/configure.ac -@@ -61,7 +61,7 @@ - AC_HEADER_STDC - AC_CHECK_HEADERS([errno.h limits.h stddef.h stdlib.h string.h unistd.h]) - --AM_ICONV -+m4_pattern_allow([AM_ICONV]) - # if test -n "$LIBICONV" ; then - # LIBS="$LIBS $LIBICONV" - # fi diff --git a/libs/gd/patches/101-gdlib-config.patch b/libs/gd/patches/101-gdlib-config.patch new file mode 100644 index 000000000..217f01e8d --- /dev/null +++ b/libs/gd/patches/101-gdlib-config.patch @@ -0,0 +1,20 @@ +--- a/config/gdlib-config.in ++++ b/config/gdlib-config.in +@@ -71,7 +71,7 @@ while test $# -gt 0; do + echo @LDFLAGS@ + ;; + --libs) +- echo @LIBS@ @LIBICONV@ ++ echo @LIBS@ + ;; + --cflags|--includes) + echo -I@includedir@ +@@ -84,7 +84,7 @@ while test $# -gt 0; do + echo "includedir: $includedir" + echo "cflags: -I@includedir@" + echo "ldflags: @LDFLAGS@" +- echo "libs: @LIBS@ @LIBICONV@" ++ echo "libs: @LIBS@ + echo "libdir: $libdir" + echo "features: @FEATURES@" + ;; -- 2.11.0