X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5719eab2bff49827ab516dbdfce80498188f781c..3e4e0908a7c8217f87d1c7a521f590c1de3bc0f9:/wx-config.in diff --git a/wx-config.in b/wx-config.in index cf3a6b9dc5..28e9fa4c0c 100755 --- a/wx-config.in +++ b/wx-config.in @@ -44,29 +44,41 @@ usage() cat 1>&2 < $prefix/bin/$_last_chance $_legacy_args" fi - export WXCONFIG_DELEGATED=yes + WXCONFIG_DELEGATED=yes + export WXCONFIG_DELEGATED $prefix/bin/$_last_chance $_legacy_args exit @@ -783,15 +860,15 @@ if not user_mask_fits "$this_config" ; then cat 1>&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,13 +885,14 @@ 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 $*" fi - export WXCONFIG_DELEGATED=yes + WXCONFIG_DELEGATED=yes + export WXCONFIG_DELEGATED $wxconfdir/$best_delegate $* exit fi @@ -836,7 +914,8 @@ if not user_mask_fits "$this_config" ; then decho "--> $wxconfdir/`find_eligible_delegates $configmask` $*" fi - export WXCONFIG_DELEGATED=yes + WXCONFIG_DELEGATED=yes + export WXCONFIG_DELEGATED $wxconfdir/`find_eligible_delegates $configmask` $* exit fi @@ -869,16 +948,19 @@ bindir="@bindir@" [ -z "$output_option_basename" ] || echo "@WX_LIBRARY_BASENAME_GUI@" [ -z "$output_option_cc" ] || echo "@CC@" [ -z "$output_option_cxx" ] || echo "@CXX@" -[ -z "$output_option_ld" ] || echo "@EXE_LINKER@" +[ -z "$output_option_ld" ] || echo "@CXX@ -o" [ -z "$flag_option_selected_config" ] || echo "$this_config" +for q in $query_options; do + eval echo "\$this_$q" +done # --rezflags is deprecated and disabled (2005/11/29) 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 @@ -946,8 +1028,8 @@ ldlibs_core="@EXTRALIBS_GUI@" ldlibs_gl="@OPENGL_LIBS@" 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 +1069,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 +1128,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 +1145,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 +1221,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'" @@ -1135,7 +1243,7 @@ fi if is_installed; then _include_cppflags="-I${includedir}/wx-@WX_RELEASE@@WX_FLAVOUR@" else - _include_cppflags="-I${includedir} -I${prefix}/contrib/include" + _include_cppflags="-I${includedir}" fi _cppflags=`echo "-I${libdir}/wx/include/@TOOLCHAIN_FULLNAME@" $_include_cppflags "@WXCONFIG_CPPFLAGS@" $_gui_cppflags` @@ -1148,6 +1256,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" ] || @@ -1156,7 +1265,12 @@ if [ -n "$output_option_libs" ]; then 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 + + echo $wx_libs fi @@ -1198,16 +1312,15 @@ 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@" \ "@WXCONFIG_RESFLAGS@" else echo "@RESCOMP@ --include-dir ${includedir}" \ - "--include-dir ${prefix}/contrib/include" \ - "@WXCONFIG_RESFLAGS@" + "@WXCONFIG_RESFLAGS@" fi ;;