install-wxconfig:
$(INSTALL_DIR) $(DESTDIR)$(bindir)
- $(INSTALL_PROGRAM) wx$(TOOLCHAIN_NAME)-config $(DESTDIR)$(bindir)
- (cd $(DESTDIR)$(bindir) && rm -f wx-config && $(LN_S) wx$(TOOLCHAIN_NAME)-config wx-config)
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)/wx/config
+ $(INSTALL_PROGRAM) lib/wx/config/$(TOOLCHAIN_NAME) $(DESTDIR)$(libdir)/wx/config
+ $(INSTALL_PROGRAM) wx-config $(DESTDIR)$(bindir)
+ (cd $(DESTDIR)$(bindir) && rm -f wx$(TOOLCHAIN_NAME)-config && $(LN_S) wx-config wx$(TOOLCHAIN_NAME)-config)
locale_install:
$(INSTALL_DIR) $(DESTDIR)$(datadir)/locale
cp $(WXDIR)/install-sh $(DISTDIR)
cp $(WXDIR)/mkinstalldirs $(DISTDIR)
cp $(WXDIR)/wx-config.in $(DISTDIR)
+ cp $(WXDIR)/wx-config-wrapper.in $(DISTDIR)
cp $(WXDIR)/version-script.in $(DISTDIR)
cp $(WXDIR)/setup.h.in $(DISTDIR)
cp $(WXDIR)/setup.h_vms $(DISTDIR)
cp $(WXDIR)/install-sh $(DISTDIR)
cp $(WXDIR)/mkinstalldirs $(DISTDIR)
cp $(WXDIR)/wx-config.in $(DISTDIR)
+ cp $(WXDIR)/wx-config-wrapper.in $(DISTDIR)
cp $(WXDIR)/version-script.in $(DISTDIR)
cp $(WXDIR)/setup.h.in $(DISTDIR)
cp $(WXDIR)/setup.h_vms $(DISTDIR)
<dependency-of>install</dependency-of>
<command>
$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
- $(INSTALL_PROGRAM) wx$(TOOLCHAIN_NAME)-config $(DESTDIR)$(BINDIR)
- (cd $(DESTDIR)$(BINDIR) && rm -f wx-config && $(LN_S) wx$(TOOLCHAIN_NAME)-config wx-config)
+ $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/wx/config
+ $(INSTALL_PROGRAM) lib/wx/config/$(TOOLCHAIN_NAME) $(DESTDIR)$(LIBDIR)/wx/config
+ $(INSTALL_PROGRAM) wx-config $(DESTDIR)$(BINDIR)
+ (cd $(DESTDIR)$(BINDIR) && rm -f wx$(TOOLCHAIN_NAME)-config && $(LN_S) wx-config wx$(TOOLCHAIN_NAME)-config)
</command>
</action>
ac_config_headers="$ac_config_headers setup.h"
- ac_config_files="$ac_config_files wx-config version-script Makefile"
+ ac_config_files="$ac_config_files wx-config wx-config-wrapper version-script Makefile"
ac_config_commands="$ac_config_commands default"
case "$ac_config_target" in
# Handling of arguments.
"wx-config" ) CONFIG_FILES="$CONFIG_FILES wx-config" ;;
+ "wx-config-wrapper" ) CONFIG_FILES="$CONFIG_FILES wx-config-wrapper" ;;
"version-script" ) CONFIG_FILES="$CONFIG_FILES version-script" ;;
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"$mk" ) CONFIG_FILES="$CONFIG_FILES $mk" ;;
echo "$as_me: executing $ac_dest commands" >&6;}
case $ac_dest in
default )
- if test ! -h wx-config; then
- chmod +x wx-config
- mv wx-config wx${TOOLCHAIN_NAME}-config
- ${LN_S} wx${TOOLCHAIN_NAME}-config wx-config
- fi
-
if test ! -d lib; then
mkdir lib
fi
if test ! -d lib/wx; then
mkdir lib/wx
fi
+ if test ! -d lib/wx/config; then
+ mkdir lib/wx/config
+ fi
if test ! -d lib/wx/include; then
mkdir lib/wx/include
fi
if test -f setup.h; then
mv -f setup.h lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h
fi
+
+ if test -f wx-config; then
+ chmod +x wx-config
+ mv -f wx-config lib/wx/config/${TOOLCHAIN_NAME}
+ rm -f wx${TOOLCHAIN_NAME}-config
+ ${LN_S} wx-config wx${TOOLCHAIN_NAME}-config
+ fi
+
+ if test -f wx-config-wrapper; then
+ chmod +x wx-config-wrapper
+ mv -f wx-config-wrapper wx-config
+ fi
;;
esac
done
dnl colon)
AC_CONFIG_FILES([
wx-config
+ wx-config-wrapper
version-script
Makefile
])
AC_CONFIG_COMMANDS([default],
[
- dnl This test is required to make the following idempotent.
- dnl Otherwise running config.status or rerunning configure
- dnl would stomp the wx-config link or try to move it onto
- dnl itself.
- dnl Use -h instead of -L to test for link (GD)
- dnl -h is documented as obsolete under Mac OS X but works
- dnl -L is obsolete under Solaris8
- if test ! -h wx-config; then
- chmod +x wx-config
- mv wx-config wx${TOOLCHAIN_NAME}-config
- ${LN_S} wx${TOOLCHAIN_NAME}-config wx-config
- fi
-
if test ! -d lib; then
mkdir lib
fi
if test ! -d lib/wx; then
mkdir lib/wx
fi
+ if test ! -d lib/wx/config; then
+ mkdir lib/wx/config
+ fi
if test ! -d lib/wx/include; then
mkdir lib/wx/include
fi
if test -f setup.h; then
mv -f setup.h lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h
fi
+
+ if test -f wx-config; then
+ chmod +x wx-config
+ mv -f wx-config lib/wx/config/${TOOLCHAIN_NAME}
+ rm -f wx${TOOLCHAIN_NAME}-config
+ ${LN_S} wx-config wx${TOOLCHAIN_NAME}-config
+ fi
+
+ if test -f wx-config-wrapper; then
+ chmod +x wx-config-wrapper
+ mv -f wx-config-wrapper wx-config
+ fi
],
[
TOOLCHAIN_NAME="${TOOLCHAIN_NAME}"
- wxTaskBarIcon now supports freedesktop.org System Tray protocol
- security fixes to wxSingleInstanceChecker
+- wx-config script was modified to allow choosing from multiple installed
+ builds of wxWidgets
wxGTK:
--- /dev/null
+#!/bin/sh
+
+# -------------------------------------------------------------------------
+# Location of wx:
+# -------------------------------------------------------------------------
+
+update_prefixes()
+{
+ includedir="@includedir@"
+ libdir="@libdir@"
+}
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+update_prefixes
+
+srcdir="@top_srcdir@"
+builddir="@top_builddir_wxconfig@"
+
+
+# -------------------------------------------------------------------------
+# Wrapper script:
+# -------------------------------------------------------------------------
+
+exec_prefix_set=no
+
+# return the absolute path prepending builddir to it if needed
+makeabs()
+{
+ path=$1
+ # TODO: this only works under Unix and even there it could be
+ # enhanced to remove ".." and "."
+ if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
+ if [ $path = "." ]; then
+ path=$builddir
+ else
+ path="$builddir/$path"
+ fi
+ fi
+
+ echo $path
+}
+
+# these determine wx-config script to use:
+m_toolkit='*'
+m_univ='*'
+m_unicode='*'
+m_debug='*'
+m_version='*.*'
+
+# lists all wx-config scripts that match criteria specified above
+list_wx_config_scripts()
+{
+ mask="${m_toolkit}${m_univ}${m_unicode}${m_debug}-${m_version}"
+
+ # if wx-config was called via wx$TOOLCHAIN_NAME-config symlink,
+ # try to extract the mask from it:
+ myname=`basename $0`
+ if test $myname != wx-config ; then
+ toolchain=`echo $myname | sed 's/wx\(.*\)-config/\1/'`
+ if test -f ${libdir}/wx/config/${toolchain} ; then
+ mask=$toolchain
+ fi
+ fi
+
+ if test -d ${libdir}/wx/config ; then
+ (cd ${libdir}/wx/config/ && ls -1 $mask 2>/dev/null)
+ fi
+}
+
+# find first wx-config script that matches criteria
+find_wx_config_script()
+{
+ all_scripts=`list_wx_config_scripts`
+ # unless wxBase was explicitly requested, try to find a GUI version:
+ if test "$m_toolkit" != "base" ; then
+ script=`echo $all_scripts | tr ' ' '\n' | grep -v '^base' | head -n 1`
+ if test "x$script" != "x" ; then
+ echo ${libdir}/wx/config/${script}
+ fi
+ fi
+
+ # otherwise (or if no GUI script was found), use alphabetically 1st script:
+ script=`echo $all_scripts | head -n 1`
+ if test -z "$script" ; then
+ echo "no suitable wx-config script found" >&2
+ exit 1
+ fi
+ echo ${libdir}/wx/config/${script}
+}
+
+
+# handle options:
+
+# arguments to pass to the real wx-config script:
+args=""
+
+for i in $*; do
+ case "$i" in
+ -*=*) optarg=`echo "$i" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $i in
+ --inplace)
+ prefix=`makeabs $srcdir`
+ exec_prefix=`makeabs $builddir`
+ exec_prefix_set=yes
+ update_prefixes
+ args="$args --inplace"
+ ;;
+ --prefix=*)
+ prefix=$optarg
+ if test $exec_prefix_set = no ; then
+ exec_prefix=$optarg
+ fi
+ update_prefixes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ update_prefixes
+ ;;
+
+ --list)
+ # list available wx versions:
+ list_wx_config_scripts
+ exit
+ ;;
+
+ --toolkit=*)
+ m_toolkit=$optarg
+ ;;
+ --version=*)
+ m_version=$optarg
+ ;;
+ --unicode=*)
+ if test "x$optarg" = "xyes" ; then
+ m_unicode="u"
+ else
+ m_unicode=""
+ fi
+ ;;
+ --unicode)
+ m_unicode="u"
+ ;;
+ --debug=*)
+ if test "x$optarg" = "xyes" ; then
+ m_debug="d"
+ else
+ m_debug=""
+ fi
+ ;;
+ --debug)
+ m_debug="d"
+ ;;
+ --universal=*)
+ if test "x$optarg" = "xyes" ; then
+ m_univ="univ"
+ else
+ m_univ=""
+ fi
+ ;;
+ --universal)
+ m_univ="univ"
+ ;;
+ *)
+ args="$args $i"
+ ;;
+ esac
+done
+
+args="$args --prefix=$prefix --exec-prefix=$exec_prefix"
+
+script=`find_wx_config_script`;
+if test "x$script" != "x" ; then
+ $script $args
+ exit $?
+else
+ exit 1
+fi
echo $flags_to_ret
}
-# return the absolute path prepending builddir to it if needed
-makeabs()
-{
- path=$1
- # TODO: this only works under Unix and even there it could be
- # enhanced to remove ".." and "."
- if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
- if [ $path = "." ]; then
- path=$builddir
- else
- path="$builddir/$path"
- fi
- fi
-
- echo $path
-}
-
usage()
{
cat <<EOF
Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--inplace]
- [--version] [--release]
- [--basename] [--static] [--libs] [--gl-libs]
+ [--toolkit=TOOLKIT] [--unicode[=yes|no]] [--debug[=yes|no]]
+ [--universal[=yes|no]] [--version[=VERSION]] [--release]
+ [--list] [--basename] [--static] [--libs] [--gl-libs]
[--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
[--cc] [--cxx] [--ld] [LIBRARIES]
--gl-libs option is deprecated, use "--libs gl" instead.
+If there are several different builds of wxWidgets installed in same prefix,
+you can use --toolkit, --unicode, --debug, --universal and --version options
+to select one of them. Use --list option to show all available builds that
+match given criteria.
+
EOF
exit $1
case $1 in
--inplace)
- prefix=`makeabs $srcdir`
- exec_prefix=`makeabs $builddir`
- exec_prefix_set=yes
inplace_flag=yes
- update_prefixes
;;
--prefix=*)
prefix=$optarg
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl [, WX-LIBS]]])
+dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
dnl
dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
dnl case the macro won't even waste time on tests for its existence.
dnl
-dnl Optional WX-LIBS argument contains comma-separated list of wxWindows
-dnl libraries to link against (it may include contrib libraries). If it is not
-dnl specified then WX_LIBS and WX_LIBS_STATIC will contain flags to link
-dnl with all of the core wxWindows libraries.
+dnl Optional WX-LIBS argument contains comma- or space-separated list of
+dnl wxWindows libraries to link against (it may include contrib libraries). If
+dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
+dnl link with all of the core wxWindows libraries.
+dnl
+dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
+dnl invocation command in present. It can be used to fine-tune lookup of
+dnl best wxWidgets build available.
dnl
dnl Example use:
-dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net])
+dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
+dnl [--unicode --debug])
dnl ---------------------------------------------------------------------------
dnl
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
- if test "x$4" != "x" ; then
- wx_config_args="$wx_config_args $4"
- fi
-
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
if test -x "$WX_CONFIG_NAME" ; then
AC_MSG_CHECKING(for wx-config)
no_wx=""
min_wx_version=ifelse([$1], ,2.2.1,$1)
- AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
+ if test -z "$5" ; then
+ AC_MSG_CHECKING([for wxWindows version >= $min_wx_version])
+ else
+ AC_MSG_CHECKING([for wxWindows version >= $min_wx_version ($5)])
+ fi
- WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args"
+ WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
- WX_VERSION=`$WX_CONFIG_WITH_ARGS --version`
+ WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_ver_ok=""
- if test $wx_config_major_version -gt $wx_requested_major_version; then
- wx_ver_ok=yes
- else
- if test $wx_config_major_version -eq $wx_requested_major_version; then
- if test $wx_config_minor_version -gt $wx_requested_minor_version; then
- wx_ver_ok=yes
- else
- if test $wx_config_minor_version -eq $wx_requested_minor_version; then
- if test $wx_config_micro_version -ge $wx_requested_micro_version; then
- wx_ver_ok=yes
- fi
- fi
- fi
+ if test "x$WX_VERSION" != x ; then
+ if test $wx_config_major_version -gt $wx_requested_major_version; then
+ wx_ver_ok=yes
+ else
+ if test $wx_config_major_version -eq $wx_requested_major_version; then
+ if test $wx_config_minor_version -gt $wx_requested_minor_version; then
+ wx_ver_ok=yes
+ else
+ if test $wx_config_minor_version -eq $wx_requested_minor_version; then
+ if test $wx_config_micro_version -ge $wx_requested_micro_version; then
+ wx_ver_ok=yes
+ fi
+ fi
+ fi
+ fi
fi
fi
if test "x$wx_ver_ok" = x ; then
no_wx=yes
else
- wx_libs_arg="--libs"
- WX_LIBS=`$WX_CONFIG_WITH_ARGS $wx_libs_arg`
- WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static $wx_libs_arg`
+ WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
+ WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
dnl starting with version 2.2.6 wx-config has --cppflags argument
wx_has_cppflags=""