+ifdef CONCURRENCY_LEVEL
+
+ # A user who knows what they want, that's like gold...
+ # respect their precious opinion of how much blue smoke to use.
+ JOB_COUNT := $(CONCURRENCY_LEVEL)
+
+else ifdef DISTCC_HOSTS
+
+ # Otherwise, if they have a cluster, try to put it to good use.
+ JOB_COUNT := $(shell set $${DISTCC_HOSTS} > /dev/null 2>&1 ; echo $$\#)
+
+ # Not much faster, but it might keep you warm in winter...
+ #JOB_COUNT := $(shell set $${DISTCC_HOSTS} > /dev/null 2>&1 ; echo $$(($$\# + $$\#)))
+
+endif
+
+ifdef JOB_COUNT
+ FAST_MAKE = $(MAKE) -j $(JOB_COUNT)
+else
+ FAST_MAKE = $(MAKE)
+endif
+
+-include debian/python-version
+
+
+# If another source package is to supply the common binary packages
+# for a particular Debian release, then define this variable to indicate
+# the $(release) that is expected to provide it. Do not define it at
+# all if this is to be the default (or only) wx source package for the
+# target release.
+#
+# for etch:
+#DEBIAN_WX_DEFAULT_VERSION = 2.6
+
+
+# This will extract a flavour out of the name of the source directory
+# and flavour the packages and binaries with it. 'Official' builds
+# should use a source dir of the form wxwidgets$RELEASE-$VERSION.
+# Flavoured builds may use wxwidgets$RELEASE-$FLAVOUR-$VERSION, where
+# any descriptive alphanumeric name will do for FLAVOUR. This will
+# allow a custom build to be installed alongside the mainline ones
+# without conflict. You will also need to make a corresponding
+# changelog entry for your flavour source package using:
+# wxwidget$RELEASE-$FLAVOUR ($VERSION) to satify dpkg-source and
+# to correctly set the release below.
+DEBIAN_WXFLAVOUR := $(shell pwd | sed -e 's@.*/wxwidgets[0-9.]\+-\?\(.*\)-[0-9.]\+-\?.*@\1@')
+
+release := $(shell dpkg-parsechangelog | sed -n 's/^Source: wxwidgets//p' | sed 's/-ansi//')
+
+# This is broken completely now by bakefiles changes. Until we add
+# some hocus pocus to the main tree, to export these values from it
+# again, we approximate its behaviour (fairly precisely fwiw) to
+# specify $soversion below. Re-automate if incompatible changes
+# result in it actually changing.
+#soversion := $(shell grep '^WX_CURRENT=' configure.in | sed 's/WX_CURRENT=\([0-9]\+\).*/\1/')
+soversion := 0
+sorelease := $(release:%-$(DEBIAN_WXFLAVOUR)=%)-$(soversion)$(addprefix -,$(DEBIAN_WXFLAVOUR))
+
+# In some places we use the full version number, including the micro version,
+# for the development releases (which can be incompatible for the same major
+# and minor version) but just the major.minor for the stable releases (which
+# are supposed to be compatible), this variable contains the appropriate value
+ifeq ($(shell echo `echo $(release) | sed 's/.\+\.\(.\+\)/\1/'`%2 | bc),1)
+ # development release
+ compatible_release := $(release).$(soversion)
+else
+ compatible_release := $(release)
+endif
+
+# Base value for alternative priorities.
+alt_prio := $(subst .,,$(release))
+
+pytoolkit := gtk2
+pydir := usr/lib/$(python_ver)/site-packages
+wxpydir := $(pydir)/wx-$(compatible_release)-$(pytoolkit)
+
+cross_host := i586-mingw32msvc
+cross_build := $(shell ./config.guess)
+
+config_cache = ../config_deb.cache
+config_cache_cross = ../config_deb_cross.cache
+
+
+# build options
+COMMON_CONFIGURE_OPTIONS = \
+ --prefix=/usr \
+ --cache-file=$(config_cache) \
+ --with-flavour=$(DEBIAN_WXFLAVOUR) \
+ --with-zlib=sys \
+ --disable-reserved_virtual \
+
+BASE_CONFIGURE_OPTIONS = $(COMMON_CONFIGURE_OPTIONS) \
+ --disable-gui \
+
+GTK_CONFIGURE_OPTIONS = $(COMMON_CONFIGURE_OPTIONS) \
+ --with-gtk \
+ --with-gnomeprint \
+ --enable-mediactrl \
+ --enable-sound \
+ --with-sdl \
+ --enable-display \
+ --enable-geometry \
+ --enable-graphics_ctx \
+ --with-libjpeg=sys \
+ --with-libpng=sys \
+ --with-libtiff=sys \
+
+
+PY_WX_CONFIG_OPTIONS = --version=$(release) --toolkit=$(pytoolkit) --static=no
+
+WX_UNICODE := 1
+WX_OPENGL := 1
+
+ifeq ($(WX_UNICODE),1)
+ COMMON_CONFIGURE_OPTIONS += --enable-unicode
+ PY_WX_CONFIG_OPTIONS += --unicode
+ PY_UNICODE="UNICODE=1"
+ wxpydir := $(pydir)/wx-$(compatible_release)-$(pytoolkit)-unicode
+
+ # for compatibility with the existing 2.6 packages, we don't use "u" in
+ # the Unicode (default) package names
+ unicode_suffix :=
+else
+ # but we do need to use something for non-Unicode packages to distinguish
+ # them
+ unicode_suffix := -ansi
+endif
+
+ifeq ($(WX_OPENGL),1)
+ GTK_CONFIGURE_OPTIONS += --with-opengl
+else
+ GTK_CONFIGURE_OPTIONS += --without-opengl
+endif