X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0df5d6731668e490c464a826cb8016e54e4906d4..22a3b6e4b2010f425a54708e46b1b463bd2817a7:/wx-config.in diff --git a/wx-config.in b/wx-config.in index cb0397a472..261e024e9b 100755 --- a/wx-config.in +++ b/wx-config.in @@ -245,13 +245,16 @@ check_yesno_option() } +MAC_FRAMEWORK= +MAC_FRAMEWORK_PREFIX= + # Now we are ready to find out what the user wants from us. # -------------------------------------------------------------- # With just a little more complexity here we could have shortest # unique string matching for options, but that is probably overkill -# today, so lets just get the job done. +# today, so let's just get the job done. # # The important thing now then is that we simply read all input from # the user and don't try to act prematurely on partial information. @@ -357,7 +360,7 @@ fi -# Everything came in as a legal argument then, lets put some of +# Everything came in as a legal argument then, let's put some of # the pieces together with a little self knowledge to see what # we should do next. # -------------------------------------------------------------- @@ -560,7 +563,7 @@ not() { if "$@"; then false; else true; fi; } # and its downhill fast from here if we have to ride that boat. # Early pruning still gets that down to under half a second (up from about # .25), so we have some breathing space yet before a different search method -# will be called for, but lets not squander it. +# will be called for, but let's not squander it. do_find_best_delegate() { ( @@ -796,7 +799,7 @@ fi if not user_mask_fits "$this_config" ; then - # No? Then lets see if it knows anybody who can. + # No? Then let's see if it knows anybody who can. # But first, just be sure someone hasn't typo'd us into a loop. # In present day wx, correct delegation should never need more # than one hop so this is trivial to detect. @@ -1032,6 +1035,41 @@ ldlibs_adv="@EXTRALIBS_SDL@" ldlibs_stc="@EXTRALIBS_STC@" +# Order the libraries passed to us correctly for static linking. +# +# While the libraries order doesn't matter when linking dynamically, we must +# put the libraries depending on other libraries in front of their dependencies +# when linking statically or the dependencies wouldn't be resolved by the +# standard UNIX linkers. +order_libs() +{ + if is_static; then + for lib do + # Distinguish between the libraries that may need to be moved to + # the end of the list (because other ones may depend on them) and + # those that can be output immediately because no other libraries + # depend on them. + case "$lib" in + base|core|html|xml|adv) eval "use_$lib=1" ;; + *) libs="$libs $lib" ;; + esac + done + + # Add the libraries that we postponed adding above. + # Order of the checks here is important. + [ -z "$use_html" ] || libs="$libs html" + [ -z "$use_adv" ] || libs="$libs adv" + [ -z "$use_core" ] || libs="$libs core" + [ -z "$use_xml" ] || libs="$libs xml" + [ -z "$use_base" ] || libs="$libs base" + else + # No need to order them. + libs="$@" + fi + + echo $libs +} + # lib_flags_for _liblist # This function returns a list of flags suitable to return with the # output of --libs for all of the libraries in _liblist. You can @@ -1171,6 +1209,7 @@ if is_monolithic; then wx_libs=`remove_field $i $wx_libs` done + wx_libs=`order_libs $wx_libs` wx_libs="@WXCONFIG_LDFLAGS_GUI@ `lib_flags_for $wx_libs`" # We still need the core lib deps for a static build though @@ -1217,6 +1256,7 @@ else # MONOLITHIC = 0 if is_static; then link_deps=`link_deps_for $wx_libs` fi + wx_libs=`order_libs $wx_libs` wx_libs="$_guildflags `lib_flags_for $wx_libs`" fi @@ -1263,9 +1303,18 @@ if [ -n "$output_option_libs" ]; then [ "x$libdir" = "x/usr/lib" ] || _ldflags="-L$libdir" + if [ -n "$MAC_FRAMEWORK" ]; then + wx_libs="-framework $MAC_FRAMEWORK" + if [ -n "$MAC_FRAMEWORK_PREFIX" ]; then + _ldflags="-F$MAC_FRAMEWORK_PREFIX" + else + _ldflags="" + fi + fi + is_installed || [ -n "$flag_option_no_rpath" ] || _rpath="@WXCONFIG_RPATH@" - echo $_ldflags "@LDFLAGS@" $_rpath $wx_libs "@DMALLOC_LIBS@" + echo $_ldflags "@WXCONFIG_LDFLAGS@" $_rpath $wx_libs "@DMALLOC_LIBS@" elif [ -n "$output_option_optional_libs" ]; then # if only --optional-libs then output just the libs