X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5719eab2bff49827ab516dbdfce80498188f781c..3af0741ccc1eaaf3c115a92ccedf8c864101a4e3:/wx-config.in diff --git a/wx-config.in b/wx-config.in index cf3a6b9dc5..066d2c2337 100755 --- a/wx-config.in +++ b/wx-config.in @@ -44,29 +44,35 @@ usage() cat 1>&2 <&2 <<-EOF - Warning: No config found to match: $config_spec - in $wxconfdir - If you require this configuration, please install the desired - library build. If this is part of an automated configuration - test and no other errors occur, you may safely ignore it. - You may use wx-config --list to see all configs available in - the default prefix. + Warning: No config found to match: $config_spec + in $wxconfdir + If you require this configuration, please install the desired + library build. If this is part of an automated configuration + test and no other errors occur, you may safely ignore it. + You may use wx-config --list to see all configs available in + the default prefix. - EOF +EOF # PIPEDREAM: from here we are actually just a teensy step # from simply building the missing config for the user @@ -808,7 +832,7 @@ if not user_mask_fits "$this_config" ; then best_delegate=`find_best_delegate` if [ -n "$best_delegate" ]; then - + if [ -n "$WXDEBUG" ]; then decho " found a suitable delegate: $best_delegate" decho "--> $wxconfdir/$best_delegate $*" @@ -878,7 +902,7 @@ if [ -n "$output_option_rezflags" ]; then echo "@true" decho "Warning: --rezflags, along with Mac OS classic resource building" \ "is deprecated. You should remove this from your Makefile and" \ - "build .app bundles instead." + "build .app bundles instead." fi @@ -948,6 +972,7 @@ ldlibs_html="@EXTRALIBS_HTML@" ldlibs_xml="@EXTRALIBS_XML@" ldlibs_odbc="@EXTRALIBS_ODBC@" ldlibs_adv="@EXTRALIBS_SDL@" +ldlibs_stc="@EXTRALIBS_STC@" # lib_flags_for _liblist @@ -987,7 +1012,7 @@ lib_flags_for() match_field "$f" $_all_ldflags || _all_ldflags="$_all_ldflags $f" done - if match_field "$lib" @CORE_BASE_LIBS@ ; then + if match_field "$lib" @STD_BASE_LIBS@ ; then _libname="@WX_LIBRARY_BASENAME_NOGUI@" else _libname="@WX_LIBRARY_BASENAME_GUI@" @@ -1046,7 +1071,7 @@ link_deps_for() is_cross && _target="-${target}" for lib do - if match_field "$lib" @CORE_BASE_LIBS@ ; then + if match_field "$lib" @STD_BASE_LIBS@ ; then _libname="@WX_LIBRARY_BASENAME_NOGUI@" else _libname="@WX_LIBRARY_BASENAME_GUI@" @@ -1063,54 +1088,74 @@ link_deps_for() # Sanity check the list of libs the user provided us, if any. # -------------------------------------------------------------- -wx_libs=`echo "$input_parameters" | tr ',' ' '` +wx_libs=`echo "$libs_parameters" | tr ',' ' '` +wx_optional_libs=`echo "$optional_libs_parameters" | tr ',' ' '` + +# Add the --optional-libs, if they've been compiled and aren't already added +for i in $wx_optional_libs; do + if match_field $i @BUILT_WX_LIBS@; then + if not match_field $i $wx_libs; then + wx_libs="${wx_libs:+$wx_libs }$i" + fi + fi +done [ -z "$WXDEBUG" ] || decho " user supplied libs: '$wx_libs'" +# Assume we are using the GUI, unless --libs was specified with no GUI libs +using_gui=yes + if is_monolithic; then - # Core libs are already built into the blob. - for i in std @CORE_GUI_LIBS@ @CORE_BASE_LIBS@; do - wx_libs=`remove_field $i $wx_libs` - done + # Only add additional info if --libs was specified and not just --optional-libs + if [ -n "$output_option_libs" ]; then + # Core libs are already built into the blob. + for i in std @STD_GUI_LIBS@ @STD_BASE_LIBS@; do + wx_libs=`remove_field $i $wx_libs` + done - wx_libs="@WXCONFIG_LDFLAGS_GUI@ `lib_flags_for $wx_libs`" + wx_libs="@WXCONFIG_LDFLAGS_GUI@ `lib_flags_for $wx_libs`" - # We still need the core lib deps for a static build though - if is_static; then - link_deps="${libdir}/libwx_@TOOLCHAIN_NAME@.a" - wx_libs="$wx_libs $link_deps $ldlibs_core $ldlibs_base" - else - wx_libs="$wx_libs -lwx_@TOOLCHAIN_NAME@" + # We still need the core lib deps for a static build though + if is_static; then + link_deps="${libdir}/libwx_@TOOLCHAIN_NAME@.a" + wx_libs="$wx_libs $link_deps $ldlibs_core $ldlibs_base" + else + wx_libs="$wx_libs -lwx_@TOOLCHAIN_NAME@" + fi fi - - using_gui=yes - else # MONOLITHIC = 0 - # Import everything by default, expand std if specified, or add base if omitted. - if [ -z "$wx_libs" ]; then - wx_libs="@CORE_GUI_LIBS@ @CORE_BASE_LIBS@" + # Import core libs by default, expand std if specified, or add base if omitted. + if [ -n "$output_option_libs" ] && [ -z "$libs_parameters" ]; then + wx_libs="@STD_GUI_LIBS@ @STD_BASE_LIBS@" + elif match_field all $wx_libs; then + wx_libs="@BUILT_WX_LIBS@" elif match_field std $wx_libs; then # Bubble any libs that were already specified to the end # of the list and ensure static linking order is retained. wx_libs=`remove_field std $wx_libs` - for i in @CORE_GUI_LIBS@ @CORE_BASE_LIBS@; do + for i in @STD_GUI_LIBS@ @STD_BASE_LIBS@; do wx_libs="`remove_field $i $wx_libs` $i" done elif not match_field base $wx_libs ; then - wx_libs="$wx_libs base" + # Only add base if --libs was specified and not just --optional-libs + if [ -n "$output_option_libs" ]; then + wx_libs="$wx_libs base" + fi fi - using_gui=no - for i in $wx_libs ; do - if match_field "$i" @CORE_GUI_LIBS@ ; then - _guildflags="@WXCONFIG_LDFLAGS_GUI@" - using_gui=yes - break - fi - match_field "$i" @CORE_BASE_LIBS@ || using_gui=yes - done + if [ -n "$output_option_libs" ]; then + using_gui=no + for i in $wx_libs ; do + if match_field "$i" @STD_GUI_LIBS@; then + _guildflags="@WXCONFIG_LDFLAGS_GUI@" + using_gui=yes + break + fi + match_field "$i" @STD_BASE_LIBS@ || using_gui=yes + done + fi if is_static; then link_deps=`link_deps_for $wx_libs` @@ -1119,6 +1164,12 @@ else # MONOLITHIC = 0 fi +# If they explicitly set "--cxx(pp)flags base" then they don't want the GUI +if [ "$cxx_parameters" = "base" ]; then + using_gui=no +fi + + if [ -n "$WXDEBUG" ]; then decho decho " using libs: '$wx_libs'" @@ -1148,6 +1199,7 @@ _cppflags=`echo "-I${libdir}/wx/include/@TOOLCHAIN_FULLNAME@" $_include_cppflags [ -z "$output_option_linkdeps" ] || echo $link_deps if [ -n "$output_option_libs" ]; then + # if --libs [--optional-libs] then output the full linker information is_cross && [ "x$libdir" = "x/usr/${target}/lib" ] || @@ -1157,6 +1209,11 @@ if [ -n "$output_option_libs" ]; then is_installed || [ -n "$flag_option_no_rpath" ] || _rpath="@WXCONFIG_RPATH@" echo $_ldflags "@LDFLAGS@" $_rpath $wx_libs "@DMALLOC_LIBS@" + +elif [ -n "$output_option_optional_libs" ]; then + # if only --optional-libs then output just the libs + + echo $wx_libs fi @@ -1198,8 +1255,8 @@ if [ -n "$output_option_rescomp" ]; then case "@RESCOMP@" in *windres|wrc) # Note that with late model windres, we could just insert - # _include_cppflags here, but use the old notation for now - # as it is more universally accepted. + # _include_cppflags here, but use the old notation for now + # as it is more universally accepted. if is_installed; then echo "@RESCOMP@ --include-dir" \ "${includedir}/wx-@WX_RELEASE@@WX_FLAVOUR@" \ @@ -1207,7 +1264,7 @@ if [ -n "$output_option_rescomp" ]; then else echo "@RESCOMP@ --include-dir ${includedir}" \ "--include-dir ${prefix}/contrib/include" \ - "@WXCONFIG_RESFLAGS@" + "@WXCONFIG_RESFLAGS@" fi ;;