summaryrefslogtreecommitdiffstats
path: root/src/wxwidgets.mk
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2013-07-28 12:24:38 (GMT)
committerTony Theodore <tonyt@logyst.com>2013-07-28 13:13:14 (GMT)
commit6440f756e7d944eea80f7062d3ac23719633e94f (patch)
tree4498c6f3e3e025055d653cdddbd60108e461137b /src/wxwidgets.mk
parentb62c2b4d1a917f8af0095dabc6686f808ee52f1c (diff)
downloadmxe-6440f756e7d944eea80f7062d3ac23719633e94f.zip
mxe-6440f756e7d944eea80f7062d3ac23719633e94f.tar.gz
mxe-6440f756e7d944eea80f7062d3ac23719633e94f.tar.bz2
package wxwidgets: refactor build rules
Diffstat (limited to 'src/wxwidgets.mk')
-rw-r--r--src/wxwidgets.mk81
1 files changed, 32 insertions, 49 deletions
diff --git a/src/wxwidgets.mk b/src/wxwidgets.mk
index 18519e3..61d29f8 100644
--- a/src/wxwidgets.mk
+++ b/src/wxwidgets.mk
@@ -16,10 +16,12 @@ define $(PKG)_UPDATE
head -1
endef
-define $(PKG)_BUILD
+define $(PKG)_PRE_CONFIGURE
$(SED) -i 's,png_check_sig,png_sig_cmp,g' '$(1)/configure'
$(SED) -i 's,wx_cv_cflags_mthread=yes,wx_cv_cflags_mthread=no,' '$(1)/configure'
- cd '$(1)' && ./configure \
+endef
+
+define $(PKG)_CONFIGURE_OPTS
--host='$(TARGET)' \
--build="`config.guess`" \
--disable-shared \
@@ -27,7 +29,6 @@ define $(PKG)_BUILD
--enable-gui \
--enable-stl \
--enable-threads \
- --enable-unicode \
--disable-universal \
--with-themes=all \
--with-msw \
@@ -55,66 +56,41 @@ define $(PKG)_BUILD
--without-dmalloc \
--without-odbc \
LIBS=" `'$(TARGET)-pkg-config' --libs-only-l libtiff-4`"
- $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
- -$(MAKE) -C '$(1)/locale' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= allmo
- $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= __install_wxrc___depname=
+endef
+
+define $(PKG)_BUILD_UNICODE
+ # build the wxWidgets variant with unicode support
+ mkdir '$(1).unicode'
+ cd '$(1).unicode' && '$(1)/configure' \
+ $($(PKG)_CONFIGURE_OPTS) \
+ --enable-unicode
+ $(MAKE) -C '$(1).unicode' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+ -$(MAKE) -C '$(1).unicode/locale' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= allmo
+ $(MAKE) -C '$(1).unicode' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= __install_wxrc___depname=
$(INSTALL) -m755 '$(PREFIX)/$(TARGET)/bin/wx-config' '$(PREFIX)/bin/$(TARGET)-wx-config'
+endef
+define $(PKG)_BUILD_ANSI
# build the wxWidgets variant without unicode support
- cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,wxwidgets)
- $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/wxwidgets-*.patch)),
- (cd '$(1)/$(wxwidgets_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH))
- $(SED) -i 's,png_check_sig,png_sig_cmp,g' '$(1)/$(wxwidgets_SUBDIR)/configure'
- $(SED) -i 's,wx_cv_cflags_mthread=yes,wx_cv_cflags_mthread=no,' '$(1)/$(wxwidgets_SUBDIR)/configure'
- cd '$(1)/$(wxwidgets_SUBDIR)' && ./configure \
- --host='$(TARGET)' \
- --build="`config.guess`" \
- --disable-shared \
- --prefix='$(PREFIX)/$(TARGET)' \
- --enable-gui \
- --enable-stl \
- --enable-threads \
- --disable-unicode \
- --disable-universal \
- --with-themes=all \
- --with-msw \
- --with-opengl \
- --with-libpng=sys \
- --with-libjpeg=sys \
- --with-libtiff=sys \
- --with-regex=yes \
- --with-zlib=sys \
- --with-expat=sys \
- --with-sdl \
- --without-gtk \
- --without-motif \
- --without-mac \
- --without-macosx-sdk \
- --without-cocoa \
- --without-wine \
- --without-pm \
- --without-microwin \
- --without-libxpm \
- --without-libmspack \
- --without-gnomeprint \
- --without-gnomevfs \
- --without-hildon \
- --without-dmalloc \
- --without-odbc \
- LIBS=" `'$(TARGET)-pkg-config' --libs-only-l libtiff-4`"
- $(MAKE) -C '$(1)/$(wxwidgets_SUBDIR)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+ mkdir '$(1).ansi'
+ cd '$(1).ansi' && '$(1)/configure' \
+ $($(PKG)_CONFIGURE_OPTS) \
+ --disable-unicode
+ $(MAKE) -C '$(1).ansi' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
# backup of the unicode wx-config script
# such that "make install" won't overwrite it
mv '$(PREFIX)/$(TARGET)/bin/wx-config' '$(PREFIX)/$(TARGET)/bin/wx-config-backup'
- $(MAKE) -C '$(1)/$(wxwidgets_SUBDIR)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= __install_wxrc___depname=
+ $(MAKE) -C '$(1).ansi' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= __install_wxrc___depname=
mv '$(PREFIX)/$(TARGET)/bin/wx-config' '$(PREFIX)/$(TARGET)/bin/wx-config-nounicode'
$(INSTALL) -m755 '$(PREFIX)/$(TARGET)/bin/wx-config-nounicode' '$(PREFIX)/bin/$(TARGET)-wx-config-nounicode'
# restore the unicode wx-config script
mv '$(PREFIX)/$(TARGET)/bin/wx-config-backup' '$(PREFIX)/$(TARGET)/bin/wx-config'
+endef
+define $(PKG)_TEST
# build test program
'$(TARGET)-g++' \
-W -Wall -Werror -Wno-error=unused-local-typedefs -pedantic -std=gnu++0x \
@@ -122,5 +98,12 @@ define $(PKG)_BUILD
`'$(TARGET)-wx-config' --cflags --libs`
endef
+define $(PKG)_BUILD
+ $($(PKG)_PRE_CONFIGURE)
+ $($(PKG)_BUILD_UNICODE)
+ $($(PKG)_BUILD_ANSI)
+ $($(PKG)_TEST)
+endef
+
$(PKG)_BUILD_i686-w64-mingw32 =
$(PKG)_BUILD_x86_64-w64-mingw32 =