package/libgeotiff: fix static linking with tiff
PATCH 1/3 package/libgeotiff: fix static linking with tiff
Put back patch that was wrongly removed when bumping libgeotiff to
version 1.5.1 in commit 1edf0383a6a9d17a27d831bb02833870655d43d9
Fixes:
- http://autobuild.buildroot.org/results/3eb3d41d3288c08616b68d52fdc7525c57c8e023
--- ...Use-pkg-config-for-libtiff-detection.patch | 49 +++++++++++++++++++ package/libgeotiff/libgeotiff.mk | 2 + 2 files changed, 51 insertions(+) create mode 100644 package/libgeotiff/0001-Use-pkg-config-for-libtiff-detection.patch
package/libgeotiff/0001-Use-pkg-config-for-libtiff-detection.patch new file +49 -0
@@ -0,0 +1,49 @@ +From 2fbae8298d7cc976d7c0f329fc26dafe57fb0fc4 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Mon, 1 Apr 2019 08:04:39 +0200 +Subject: [PATCH] Use pkg-config for libtiff detection + +Using pkg-config allows proper behavior in static-only contexts: the +libtiff library might depend on libz and libjpeg. + +Signed-off-by: Thomas Petazzoni <[email protected]> +[Patch retrieved (and slightly updated) from: +https://git.buildroot.net/buildroot/tree/package/libgeotiff/0001-use-pkg-config.patch] +Signed-off-by: Fabrice Fontaine <[email protected]> +[Retrieved (and slightly updated) from: +https://github.com/OSGeo/libgeotiff/commit/2fbae8298d7cc976d7c0f329fc26dafe57fb0fc4] +--- + libgeotiff/configure.ac | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/configure.ac b/configure.ac +index aa38af4..c3395d5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -211,16 +211,18 @@ if test "$with_libtiff" != "" ; then + libgeotiff. Please upgrade or use an older version of libgeotiff.]),-lm) + LIBS="$LIBS_SAVED" + else +- AC_CHECK_LIB(tiff,TIFFOpen,[TIFF_CONFIG=yes], +- AC_MSG_ERROR([You will need to substantially rewrite libxtiff to ++ PKG_CHECK_MODULES(LIBTIFF, libtiff-4, ++ [TIFF_INC="$LIBTIFF_CFLAGS" LIBS="$LIBS $LIBTIFF_LIBS" TIFF_CONFIG="yes"], ++ [AC_CHECK_LIB(tiff,TIFFOpen,[TIFF_CONFIG=yes], ++ AC_MSG_ERROR([You will need to substantially rewrite libxtiff to + build libgeotiff without libtiff]),-lm) +- LIBS_SAVED="$LIBS" +- AC_CHECK_LIB(tiff,TIFFMergeFieldInfo,[TIFF_CONFIG=yes], +- AC_MSG_ERROR([Libtiff 3.6.0 Beta or later required for this version of ++ LIBS_SAVED="$LIBS" ++ AC_CHECK_LIB(tiff,TIFFMergeFieldInfo,[TIFF_CONFIG=yes], ++ AC_MSG_ERROR([Libtiff 3.6.0 Beta or later required for this version of + libgeotiff. Please upgrade libtiff or use an older version of libgeotiff.]),-lm) +- LIBS="$LIBS -ltiff" +- TIFF_INC= +- TIFF_CONFIG="yes" ++ LIBS="$LIBS -ltiff" ++ TIFF_INC= ++ TIFF_CONFIG="yes"]) + fi + +
package/libgeotiff/libgeotiff.mk +2 -0
@@ -11,6 +11,8 @@ LIBGEOTIFF_LICENSE_FILES = LICENSE LIBGEOTIFF_DEPENDENCIES = proj tiff host-pkgconf LIBGEOTIFF_INSTALL_STAGING = YES LIBGEOTIFF_CONF_OPTS = --with-proj=$(STAGING_DIR)/usr +# We're patching configure.ac +LIBGEOTIFF_AUTORECONF = YES ifeq ($(BR2_PACKAGE_ZLIB),y) LIBGEOTIFF_DEPENDENCIES += zlib
Signature · 1 line
2.23.0
PATCH 2/3 package/proj: add -lsdtc++ to Libs.Private
--- .../0001-proj.pc.in-add-Libs.Private.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 package/proj/0001-proj.pc.in-add-Libs.Private.patch
package/proj/0001-proj.pc.in-add-Libs.Private.patch new file +27 -0
@@ -0,0 +1,27 @@ +From bdee73f3e0d8b4b6f2b6e0edb945dbd9abfd3255 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Wed, 9 Oct 2019 15:24:08 +0200 +Subject: [PATCH] proj.pc.in: add Libs.Private + +Add -lstdc++ to Libs.Private to allow packages such as libgeotiff to +retrieve this dependency when linking statically with proj + +Signed-off-by: Fabrice Fontaine <[email protected]> +[Upstream status: https://github.com/OSGeo/PROJ/pull/1664] +--- + proj.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/proj.pc.in b/proj.pc.in +index a6a5d75f..001f08a1 100644 +--- a/proj.pc.in ++++ b/proj.pc.in +@@ -9,4 +9,5 @@ Description: Cartographic Projections Library. + Requires: + Version: @VERSION@ + Libs: -L${libdir} -lproj ++Libs.Private: -lstdc++ + Cflags: -I${includedir} +-- +2.23.0 +
Signature · 1 line
2.23.0
PATCH 3/3 package/libgeotiff: fix static linking with proj
In reply to Fabrice FontaineUse pkg-config to retrieve proj static dependency such as -lstdc++
Fixes:
- http://autobuild.buildroot.org/results/77721989e5b057995e6c5f1f184fe368d8a8fa78
--- ...e-pkg-config-to-find-proj-dependency.patch | 37 +++++++++++++++++++ package/libgeotiff/libgeotiff.mk | 1 - 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 package/libgeotiff/0002-configure.ac-use-pkg-config-to-find-proj-dependency.patch
package/libgeotiff/0002-configure.ac-use-pkg-config-to-find-proj-dependency.patch new file +37 -0
@@ -0,0 +1,37 @@ +From 33937e2861fda87dc314378bf87db2c766c37a6b Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Wed, 9 Oct 2019 15:11:34 +0200 +Subject: [PATCH] configure.ac: use pkg-config to find proj dependency + +Use pkg-config to retrieve proj and its static dependencies such as +-lstdc++ + +Signed-off-by: Fabrice Fontaine <[email protected]> +[Upstream status: https://github.com/OSGeo/libgeotiff/pull/24] +--- + libgeotiff/configure.ac | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/libgeotiff/configure.ac +index c3395d5..f7a8f28 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -246,9 +246,12 @@ if test "x$with_proj" = "xno" ; then + else + + if test "x$with_proj" = "xyes" -o "x$with_proj" = "x"; then +- ORIG_LIBS="$LIBS" +- LIBS="-lproj $ORIG_LIBS" +- AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) ++ PKG_CHECK_MODULES(PROJ, proj, [LIBS="$LIBS $PROJ_LIBS" PROJ_FOUND=yes], [PROJ_FOUND=no]) ++ if test "$PROJ_FOUND" = "no"; then ++ ORIG_LIBS="$LIBS" ++ LIBS="-lproj $ORIG_LIBS" ++ AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) ++ fi + if test "$PROJ_FOUND" = "no"; then + AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) + if test "$PROJ_FOUND" = "yes"; then +-- +2.23.0 +
package/libgeotiff/libgeotiff.mk +0 -1
@@ -10,7 +10,6 @@ LIBGEOTIFF_LICENSE = X11-style, public domain LIBGEOTIFF_LICENSE_FILES = LICENSE LIBGEOTIFF_DEPENDENCIES = proj tiff host-pkgconf LIBGEOTIFF_INSTALL_STAGING = YES -LIBGEOTIFF_CONF_OPTS = --with-proj=$(STAGING_DIR)/usr # We're patching configure.ac LIBGEOTIFF_AUTORECONF = YES
Signature · 1 line
2.23.0
PATCH 1/3 package/libgeotiff: fix static linking with tiff
In reply to Fabrice FontaineQuoted 6 lines · On Wed, 9 Oct 2019 19:03:23 +0200 Fabrice Fontaine…
Put back patch that was wrongly removed when bumping libgeotiff to
version 1.5.1 in commit1edf0383a6a9d17a27d831bb02833870655d43d9Fixes:
- http://autobuild.buildroot.org/results/3eb3d41d3288c08616b68d52fdc7525c57c8e023
Quoted 6 lines
Signed-off-by Fabrice Fontaine <[email protected]>--- ...Use-pkg-config-for-libtiff-detection.patch | 49 +++++++++++++++++++ package/libgeotiff/libgeotiff.mk | 2 + 2 files changed, 51 insertions(+) create mode 100644 package/libgeotiff/0001-Use-pkg-config-for-libtiff-detection.patch
Series applied, thanks. In PATCH 2/3, the solution to add -lstdc++ is not great, as we really hardcode something that is quite internal to the toolchain, but there's no other easy way to solve this.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com