From b0c4cb71315a6fa6a7f3bfdd892b8baa8c14efbd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 8 Dec 2017 02:36:12 +0100 Subject: [PATCH] Correct order of 3rd party libraries in wx-config output A recent change fixing monolithic build broke the normal build when using built-in libraries under Unix as -lwxzlib now came before -lwxpng and so zlib symbols used by libpng were not found (in fact, they could still be found in the system library which is usually available under Unix, so the problem wasn't seen immediately, but it was still there). See https://github.com/wxWidgets/wxWidgets/pull/621 --- configure | 44 ++++++++++++++++++++++---------------------- configure.in | 52 +++++++++++++++++++++++++++++----------------------- 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/configure b/configure index 66c3685538..fa8141305a 100755 --- a/configure +++ b/configure @@ -35902,28 +35902,6 @@ LDFLAGS="$LDFLAGS $PROFILE_FLAGS" WXCONFIG_LIBS="$LIBS" -if test "$wxUSE_REGEX" = "builtin" ; then - wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty" -fi -if test "$wxUSE_STC" = "yes" ; then - wxconfig_3rdparty="scintilla $wxconfig_3rdparty" -fi -case "$wxUSE_EXPAT" in - builtin) - wxconfig_3rdparty="expat $wxconfig_3rdparty" - ;; - sys) - WXCONFIG_LIBS="$EXPAT_LINK $WXCONFIG_LIBS" - ;; -esac -case "$wxUSE_ZLIB" in - builtin) - wxconfig_3rdparty="zlib $wxconfig_3rdparty" - ;; - sys) - WXCONFIG_LIBS="$ZLIB_LINK $WXCONFIG_LIBS" - ;; -esac if test "$wxUSE_GUI" = "yes"; then case "$wxUSE_LIBTIFF" in builtin) @@ -35950,6 +35928,28 @@ if test "$wxUSE_GUI" = "yes"; then ;; esac fi +if test "$wxUSE_REGEX" = "builtin" ; then + wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty" +fi +if test "$wxUSE_STC" = "yes" ; then + wxconfig_3rdparty="scintilla $wxconfig_3rdparty" +fi +case "$wxUSE_EXPAT" in + builtin) + wxconfig_3rdparty="expat $wxconfig_3rdparty" + ;; + sys) + WXCONFIG_LIBS="$EXPAT_LINK $WXCONFIG_LIBS" + ;; +esac +case "$wxUSE_ZLIB" in + builtin) + wxconfig_3rdparty="zlib $wxconfig_3rdparty" + ;; + sys) + WXCONFIG_LIBS="$ZLIB_LINK $WXCONFIG_LIBS" + ;; +esac for i in $wxconfig_3rdparty ; do WXCONFIG_LIBS="-lwx${i}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS" diff --git a/configure.in b/configure.in index c12406e52e..9b0bbd969e 100644 --- a/configure.in +++ b/configure.in @@ -7827,29 +7827,13 @@ LDFLAGS="$LDFLAGS $PROFILE_FLAGS" WXCONFIG_LIBS="$LIBS" -dnl wx-config must output 3rd party libs in --libs in static build: -if test "$wxUSE_REGEX" = "builtin" ; then - wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty" -fi -if test "$wxUSE_STC" = "yes" ; then - wxconfig_3rdparty="scintilla $wxconfig_3rdparty" -fi -case "$wxUSE_EXPAT" in - builtin) - wxconfig_3rdparty="expat $wxconfig_3rdparty" - ;; - sys) - WXCONFIG_LIBS="$EXPAT_LINK $WXCONFIG_LIBS" - ;; -esac -case "$wxUSE_ZLIB" in - builtin) - wxconfig_3rdparty="zlib $wxconfig_3rdparty" - ;; - sys) - WXCONFIG_LIBS="$ZLIB_LINK $WXCONFIG_LIBS" - ;; -esac +dnl wx-config must output 3rd party libs in --libs in static build, so collect +dnl them in wxconfig_3rdparty variable +dnl +dnl Notice that the libraries must be listed in correct order whenever there +dnl are dependencies between them for linking to work when using static +dnl libraries, e.g. jpeg, used by tiff, must come after it and zlib, used by +dnl png, must come after it as well. if test "$wxUSE_GUI" = "yes"; then case "$wxUSE_LIBTIFF" in builtin) @@ -7876,6 +7860,28 @@ if test "$wxUSE_GUI" = "yes"; then ;; esac fi +if test "$wxUSE_REGEX" = "builtin" ; then + wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty" +fi +if test "$wxUSE_STC" = "yes" ; then + wxconfig_3rdparty="scintilla $wxconfig_3rdparty" +fi +case "$wxUSE_EXPAT" in + builtin) + wxconfig_3rdparty="expat $wxconfig_3rdparty" + ;; + sys) + WXCONFIG_LIBS="$EXPAT_LINK $WXCONFIG_LIBS" + ;; +esac +case "$wxUSE_ZLIB" in + builtin) + wxconfig_3rdparty="zlib $wxconfig_3rdparty" + ;; + sys) + WXCONFIG_LIBS="$ZLIB_LINK $WXCONFIG_LIBS" + ;; +esac for i in $wxconfig_3rdparty ; do WXCONFIG_LIBS="-lwx${i}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS"