+ echo " Specification was ambiguous. Use additional feature options"
+ echo " to choose between alternate matches."
+ fi
+
+ [ -z "$_best_delegate" ] || _delegates=$(remove_field $_best_delegate $_delegates)
+
+ if [ -n "$_delegates" ]; then
+ echo
+ echo " Alternate matches:"
+ for d in $_delegates; do
+ echo " $d"
+ done
+ fi
+ if [ -n "$_remains_in_prefix" ]; then
+ echo
+ echo " Also available in $prefix:"
+ for d in $_remains_in_prefix; do
+ echo " $d"
+ done
+ fi
+
+ echo
+ exit
+fi
+
+
+
+# ... so if that wasn't what they wanted, then we need to know for
+# certain, can this config satisfy the user specification?
+# --------------------------------------------------------------
+
+if ! user_mask_fits "$this_config" ; then
+
+ # No? Then lets 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.
+
+ if [ -n "$WXCONFIG_DELEGATED" ]; then
+ decho
+ decho " *** Error: Bad config delegation"
+ decho
+ decho " to: $0"
+ decho " ($this_config) cannot satisfy:"
+ decho " $config_spec"
+ decho " Someone has been terribly careless."
+ decho
+ exit 1
+ fi
+
+ count_delegates "$configmask"
+ _numdelegates=$?
+
+ if [ -n "$WXDEBUG" ]; then
+ decho " must delegate to an alternate config"
+ decho " potential delegates ($_numdelegates):"
+ for i in $(find_eligible_delegates "$configmask"); do
+ decho " $i"
+ done
+ fi
+
+ if [ $_numdelegates -eq 0 ]; then
+ cat 1>&2 <<-EOF
+
+ No config found to match: $config_spec
+ in $wxconfdir
+ Please install the desired library build, or use --list
+ without any feature specifiers to see all available configs.
+
+ EOF
+
+ # PIPEDREAM: This will probably give Vadim an aneurysm if I
+ # mention it out of context, but from here we are actually
+ # just a teensy step from simply building the missing config
+ # for the user on the fly if this is an in tree wx-config.
+
+ exit 1
+ fi
+
+ if [ $_numdelegates -gt 1 ]; then
+
+ [ -z "$WXDEBUG" ] || decho " must prune the list of eligible delegates"
+
+ 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
+ $wxconfdir/$best_delegate $*
+ exit
+ fi
+
+ decho
+ decho " Specification was ambiguous."
+ decho " Use additional feature options to choose between:"
+ for i in $(find_eligible_delegates "$configmask"); do
+ decho " $i"
+ done
+ decho
+
+ exit 1
+ fi
+
+ if [ -n "$WXDEBUG" ]; then
+ decho " using the only suitable delegate"
+ decho "--> $wxconfdir/$(find_eligible_delegates $configmask) $*"
+ fi
+
+ export WXCONFIG_DELEGATED=yes
+ $wxconfdir/$(find_eligible_delegates $configmask) $*
+ exit
+fi
+
+
+
+
+
+# If we are still here, then from now on we are responsible for
+# all the user's needs. Time to rustle up some output for them.
+# --------------------------------------------------------------
+
+[ -z "$WXDEBUG" ] || decho " using this config"
+
+# If the user supplied a prefix, and the in tree config did not
+# delegate out to anything in that prefix, then reset the build
+# tree prefix to provide the correct output for using this
+# uninstalled wx build. Or put more simply:
+prefix=${this_prefix-$prefix}
+exec_prefix=${this_exec_prefix-$exec_prefix}
+
+includedir="@includedir@"
+libdir="@libdir@"
+
+# Trivial queries we can answer now.
+[ -z "$output_option_prefix" ] || echo $prefix
+[ -z "$output_option_exec_prefix" ] || echo $exec_prefix
+[ -z "$output_option_release" ] || echo "@WX_RELEASE@"
+[ -z "$output_option_version" ] || echo "@WX_VERSION@"
+[ -z "$output_option_version_full" ] || echo "@WX_SUBVERSION@"
+[ -z "$output_option_basename" ] || echo "@WX_LIBRARY_BASENAME_GUI@"
+[ -z "$output_option_rezflags" ] || echo $(eval echo @MACRESWXCONFIG@)
+[ -z "$output_option_cc" ] || echo "@CC@"
+[ -z "$output_option_cxx" ] || echo "@CXX@"
+[ -z "$output_option_ld" ] || echo "@EXE_LINKER@"
+
+
+# The rest are going to need a little more work.
+# --------------------------------------------------------------
+
+is_cross() { [ "x@cross_compiling@" = "xyes" ]; }
+is_monolithic() { [ @MONOLITHIC@ -eq 1 ]; }
+
+
+# Additional configuration for individual library components.
+ldflags_gl="@LDFLAGS_GL@"
+
+ldlibs_base="@WXCONFIG_EXTRALIBS@"
+ldlibs_core="@EXTRALIBS_GUI@"
+ldlibs_gl="@OPENGL_LIBS@"
+ldlibs_html="@EXTRALIBS_HTML@"
+ldlibs_xml="@EXTRALIBS_XML@"
+ldlibs_odbc="@EXTRALIBS_ODBC@"
+ldlibs_adv="@EXTRALIBS_SDL@"
+
+
+# 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
+# add support for a new library by adding an entry for it in the
+# psuedo-hashes above if it requires additional linker options.
+lib_flags_for()
+{
+ [ -z "$WXDEBUG" ] || decho " fetching lib flags for: '$*'"
+
+ _all_ldflags=''
+ _all_libs=''
+ _wxlibs=''
+
+ ! is_cross || _target="-${target}"
+
+ for lib; do
+
+ # We evidently can't trust people not to duplicate things in
+ # configure, or to keep them in any sort of sane order overall,
+ # so only add unique new fields here even if it takes us a while.
+ # In the case of libs, we bubble any duplicates to the end,
+ # because if multiple libs require it, static linking at least
+ # will require it to come after all of them. So long as local
+ # order is ok in configure then we should always be able to
+ # massage a correct result here like this.
+ #
+ # FIXME: ldlibs_core is totally bogus. Fix the duplication
+ # there independently of this. This covers for it, but we
+ # want to do this anyway because some libs may share common
+ # deps without a common ancestor in wx. This is not a licence
+ # for sloppy work elsewhere though and @GUI_TK_LIBRARY should
+ # be fixed.
+
+ for f in $(eval echo \"\$ldflags_$lib\"); do
+ match_field "$f" $_all_ldflags || _all_ldflags="$_all_ldflags $f"
+ done
+
+ if match_field "$lib" @CORE_BASE_LIBS@ ; then
+ _libname="@WX_LIBRARY_BASENAME_NOGUI@"
+ else
+ _libname="@WX_LIBRARY_BASENAME_GUI@"
+ fi
+ [ $lib = base ] || _libname="${_libname}_$lib"
+ _libname="${_libname}-@WX_RELEASE@$_target"
+
+ if [ "x$this_linkage" = "x-static" ]; then
+ _wxlibs="$_wxlibs ${libdir}/lib${_libname}.a"
+ for f in $(eval echo \"\$ldlibs_$lib\"); do
+ _all_libs="$(remove_field $f $_all_libs) $f"
+ done
+ else
+ _wxlibs="$_wxlibs -l${_libname}"
+ fi
+
+ done
+
+ if [ -n "$WXDEBUG" ]; then
+ decho " retrieved: ldflags = $_all_ldflags"
+ decho " wxlibs = $_wxlibs"
+ decho " alllibs = $_all_libs"