From 9b5a2404254eb1e80ab13263d9965ee0095d4406 Mon Sep 17 00:00:00 2001 From: Daniel Sahlberg Date: Thu, 14 Nov 2024 09:03:16 +0000 Subject: [PATCH] In tools/dev/unix-build: Enable building with local swig for 1.14.x and trunk builds. * Makefile.svn - Rename SWIG_OLD_* variables to SWIG_* and swig-old-* targets to swig-*, there is nothing inherently old about those. - Check for SWIG 3 if building 1.13.x and older. - Add --with-swig also for 1.14.x and trunk builds, if SWIG_VER is set. git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1921887 13f79535-47bb-0310-9956-ffa450edef68 --- tools/dev/unix-build/Makefile.svn | 117 ++++++++++++++++++------------ 1 file changed, 70 insertions(+), 47 deletions(-) diff --git a/tools/dev/unix-build/Makefile.svn b/tools/dev/unix-build/Makefile.svn index 4c52017cd3a61..e1e152f1df83a 100644 --- a/tools/dev/unix-build/Makefile.svn +++ b/tools/dev/unix-build/Makefile.svn @@ -124,7 +124,11 @@ PY3C_VER = 1.1 JUNIT_VER = 4.10 GETTEXT_VER = 0.19.8.1 LZ4_VER = 1.7.5 -SWIG_OLD_VER = 3.0.12 +ifeq ($(BRANCH_MAJOR), $(filter 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13, $(BRANCH_MAJOR))) +SWIG_VER = 3.0.12 +else +SWIG_VER = +endif # Get local dependency versions include Makefile.local @@ -146,7 +150,7 @@ PY3C_DIST = py3c-$(PY3C_VER).tar.gz JUNIT_DIST = junit-${JUNIT_VER}.jar GETTEXT_DIST = gettext-$(GETTEXT_VER).tar.gz LZ4_DIST = lz4-$(LZ4_VER).tar.gz -SWIG_OLD_DIST = swig-$(SWIG_OLD_VER).tar.gz +SWIG_DIST = swig-$(SWIG_VER).tar.gz SHA256_${BDB_DIST} = f14fd96dd38915a1d63dcb94a63fbb8092334ceba6b5060760427096f631263e SHA256_${APR_ICONV_DIST} = 19381959d50c4a5f3b9c84d594a5f9ffb3809786919b3058281f4c87e1f4b245 @@ -208,7 +212,7 @@ DISTFILES = $(DISTDIR)/$(NEON_DIST) \ $(DISTDIR)/$(PY3C_DIST) \ $(DISTDIR)/$(JUNIT_DIST) \ $(DISTDIR)/$(GETTEXT_DIST) \ - $(DISTDIR)/$(SWIG_OLD_DIST) + $(DISTDIR)/$(SWIG_DIST) FETCH_CMD = wget -c @@ -233,7 +237,7 @@ PY3C_URL = https://stsp.name/distfiles/py3c-${PY3C_VER}.tar.gz JUNIT_URL = https://stsp.name/distfiles/$(JUNIT_DIST) GETTEXT_URL = https://ftp.gnu.org/pub/gnu/gettext/$(GETTEXT_DIST) LZ4_URL = https://github.com/lz4/lz4/archive/v$(LZ4_VER).tar.gz -SWIG_OLD_URL = https://downloads.sourceforge.net/sourceforge/swig/swig-$(SWIG_OLD_VER).tar.gz +SWIG_URL = https://downloads.sourceforge.net/sourceforge/swig/swig-$(SWIG_VER).tar.gz BDB_SRCDIR = $(SRCDIR)/db-$(BDB_VER) @@ -255,7 +259,7 @@ PYTHON2_SRCDIR = $(SRCDIR)/Python-$(PYTHON2_VER) PY3C_SRCDIR = $(SRCDIR)/py3c-$(PY3C_VER) GETTEXT_SRCDIR = $(SRCDIR)/gettext-$(GETTEXT_VER) LZ4_SRCDIR = ${SRCDIR}/lz4-$(LZ4_VER) -SWIG_OLD_SRCDIR = ${SRCDIR}/swig-$(SWIG_OLD_VER) +SWIG_SRCDIR = ${SRCDIR}/swig-$(SWIG_VER) SVN_SRCDIR = $(SVN_WC) BDB_OBJDIR = $(OBJDIR)/db-$(BDB_VER) @@ -277,7 +281,7 @@ PYTHON2_OBJDIR = $(OBJDIR)/python-$(PYTHON2_VER) PY3C_OBJDIR = $(OBJDIR)/py3c-$(PY3C_VER) GETTEXT_OBJDIR = $(OBJDIR)/gettext-$(GETTEXT_VER) LZ4_OBJDIR = ${OBJDIR}/lz4-$(LZ4_VER) -SWIG_OLD_OBJDIR = ${OBJDIR}/swig-$(SWIG_OLD_VER) +SWIG_OBJDIR = ${OBJDIR}/swig-$(SWIG_VER) SVN_OBJDIR = $(OBJDIR)/$(SVN_REL_WC) # Tweak this for out-of-tree builds. Note that running individual @@ -306,20 +310,20 @@ all: dirs-create bdb-install apr-install iconv-install apr-util-install \ pcre-install httpd-install neon-install serf-install \ sqlite-install cyrus-sasl-install libmagic-install \ ruby-install bz2-install python-install python2-install py3c-retrieve \ - gettext-install lz4-install swig-old-install svn-install \ + gettext-install lz4-install swig-install svn-install \ svn-bindings-install # Use these to start a build from the beginning. reset: dirs-reset bdb-reset apr-reset iconv-reset apr-util-reset \ pcre-reset httpd-reset neon-reset serf-reset \ sqlite-reset cyrus-sasl-reset libmagic-reset ruby-reset python-reset \ - python2-reset bz2-reset gettext-reset lz4-reset swig-old-reset svn-reset + python2-reset bz2-reset gettext-reset lz4-reset swig-reset svn-reset # Use to save disk space. clean: bdb-clean apr-clean iconv-clean apr-util-clean pcre-clean httpd-clean \ neon-clean serf-clean sqlite-clean cyrus-sasl-clean \ libmagic-clean ruby-clean bz2-clean python-clean python2-clean \ - gettext-clean lz4-clean swig-old-clean svn-clean + gettext-clean lz4-clean swig-clean svn-clean # Nukes everything (including installed binaries!) # Use this to start ALL OVER AGAIN! Use with caution! @@ -1654,54 +1658,64 @@ $(LZ4_OBJDIR)/.installed: $(LZ4_OBJDIR)/.compiled touch $@ ####################################################################### -# swig-old +# swig ####################################################################### -swig-old-retrieve: $(SWIG_OLD_OBJDIR)/.retrieved -swig-old-configure: $(SWIG_OLD_OBJDIR)/.configured -swig-old-compile: $(SWIG_OLD_OBJDIR)/.compiled -swig-old-install: $(SWIG_OLD_OBJDIR)/.installed -swig-old-reset: +swig-retrieve: $(SWIG_OBJDIR)/.retrieved +swig-configure: $(SWIG_OBJDIR)/.configured +swig-compile: $(SWIG_OBJDIR)/.compiled +swig-install: $(SWIG_OBJDIR)/.installed +swig-reset: $(foreach f, .retrieved .configured .compiled .installed, \ - rm -f $(SWIG_OLD_OBJDIR)/$(f);) + rm -f $(SWIG_OBJDIR)/$(f);) -swig-old-clean: - -(cd $(SWIG_OLD_SRCDIR) && env MAKEFLAGS= $(MAKE) clean) +swig-clean: + -(cd $(SWIG_SRCDIR) && env MAKEFLAGS= $(MAKE) clean) -# fetch distfile for swig-old -$(DISTDIR)/$(SWIG_OLD_DIST): - cd $(DISTDIR) && $(FETCH_CMD) -O $(SWIG_OLD_DIST) $(SWIG_OLD_URL) +# fetch distfile for swig +$(DISTDIR)/$(SWIG_DIST): +ifneq ($(SWIG_VER),) + cd $(DISTDIR) && $(FETCH_CMD) -O $(SWIG_DIST) $(SWIG_URL) +endif -# retrieve swig-old -$(SWIG_OLD_OBJDIR)/.retrieved: $(DISTDIR)/$(SWIG_OLD_DIST) - $(call do_check_sha256,$(SWIG_OLD_DIST)) - [ -d $(SWIG_OLD_OBJDIR) ] || mkdir -p $(SWIG_OLD_OBJDIR) - tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SWIG_OLD_DIST) +# retrieve swig +$(SWIG_OBJDIR)/.retrieved: $(DISTDIR)/$(SWIG_DIST) +ifneq ($(SWIG_VER),) + $(call do_check_sha256,$(SWIG_DIST)) + [ -d $(SWIG_OBJDIR) ] || mkdir -p $(SWIG_OBJDIR) + tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SWIG_DIST) touch $@ +endif -# configure swig-old -$(SWIG_OLD_OBJDIR)/.configured: $(SWIG_OLD_OBJDIR)/.retrieved - cd $(SWIG_OLD_SRCDIR) \ +# configure swig +$(SWIG_OBJDIR)/.configured: $(SWIG_OBJDIR)/.retrieved +ifneq ($(SWIG_VER),) + cd $(SWIG_SRCDIR) \ && env CFLAGS="-g $(PROFILE_CFLAGS)" GREP="`which grep`"\ CC=$(CC) CXX=$(CXX) \ LDFLAGS="-L$(PREFIX)/iconv/lib" \ PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \ - $(SWIG_OLD_SRCDIR)/configure \ - --prefix=$(PREFIX)/swig-old + $(SWIG_SRCDIR)/configure \ + --prefix=$(PREFIX)/swig touch $@ +endif -# compile swig-old -$(SWIG_OLD_OBJDIR)/.compiled: $(SWIG_OLD_OBJDIR)/.configured - (cd $(SWIG_OLD_SRCDIR) && \ +# compile swig +$(SWIG_OBJDIR)/.compiled: $(SWIG_OBJDIR)/.configured +ifneq ($(SWIG_VER),) + (cd $(SWIG_SRCDIR) && \ env MAKEFLAGS= $(MAKE) CC=$(CC) CXX=$(CXX) \ - -j${MAKE_JOBS} PREFIX=$(PREFIX)/swig-old) + -j${MAKE_JOBS} PREFIX=$(PREFIX)/swig) touch $@ +endif -# install swig-old -$(SWIG_OLD_OBJDIR)/.installed: $(SWIG_OLD_OBJDIR)/.compiled - (cd $(SWIG_OLD_SRCDIR) && \ - env MAKEFLAGS= $(MAKE) PREFIX=$(PREFIX)/swig-old install) +# install swig +$(SWIG_OBJDIR)/.installed: $(SWIG_OBJDIR)/.compiled +ifneq ($(SWIG_VER),) + (cd $(SWIG_SRCDIR) && \ + env MAKEFLAGS= $(MAKE) PREFIX=$(PREFIX)/swig install) touch $@ +endif ####################################################################### # svn @@ -1757,7 +1771,7 @@ MOD_DONTDOTHAT=modules/svn-$(WC)/mod_dontdothat.so LIBMAGIC_FLAG=--with-libmagic=$(PREFIX)/libmagic NEON_FLAG=--with-neon="$(PREFIX)/neon" JAVAHL_CHECK_TARGET=check-javahl -SWIG_OLD_FLAG=--with-swig=$(PREFIX)/swig-old/bin/swig +SWIG_FLAG=--with-swig=$(PREFIX)/swig/bin/swig PYTHON_BIN_PATH=$(PREFIX)/python2/bin else ifeq ($(BRANCH_MAJOR),1.6) BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER) @@ -1768,7 +1782,7 @@ MOD_DONTDOTHAT=modules/svn-$(WC)/mod_dontdothat.so W_NO_SYSTEM_HEADERS=-Wno-system-headers NEON_FLAG=--with-neon="$(PREFIX)/neon" JAVAHL_CHECK_TARGET=check-javahl -SWIG_OLD_FLAG=--with-swig=$(PREFIX)/swig-old/bin/swig +SWIG_FLAG=--with-swig=$(PREFIX)/swig/bin/swig PYTHON_BIN_PATH=$(PREFIX)/python2/bin else ifeq ($(BRANCH_MAJOR), $(filter 1.8 1.9, $(BRANCH_MAJOR))) BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER) @@ -1780,7 +1794,7 @@ MOD_AUTHZ_SVN=modules/svn-$(WC)/mod_authz_svn.so MOD_DONTDOTHAT=modules/svn-$(WC)/mod_dontdothat.so LIBMAGIC_FLAG=--with-libmagic=$(PREFIX)/libmagic JAVAHL_CHECK_TARGET=check-all-javahl -SWIG_OLD_FLAG=--with-swig=$(PREFIX)/swig-old/bin/swig +SWIG_FLAG=--with-swig=$(PREFIX)/swig/bin/swig PYTHON_BIN_PATH=$(PREFIX)/python2/bin else ifeq ($(BRANCH_MAJOR), $(filter 1.10 1.11, 1.12, 1.13 $(BRANCH_MAJOR))) BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER) @@ -1795,7 +1809,7 @@ LIBMAGIC_FLAG=--with-libmagic=$(PREFIX)/libmagic JAVAHL_CHECK_TARGET=check-all-javahl LZ4_FLAG=--with-lz4=$(PREFIX)/lz4 UTF8PROC_FLAG=--with-utf8proc=internal -SWIG_OLD_FLAG=--with-swig=$(PREFIX)/swig-old/bin/swig +SWIG_FLAG=--with-swig=$(PREFIX)/swig/bin/swig PYTHON_BIN_PATH=$(PREFIX)/python2/bin else # 1.14, trunk BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER) @@ -1810,6 +1824,9 @@ LIBMAGIC_FLAG=--with-libmagic=$(PREFIX)/libmagic JAVAHL_CHECK_TARGET=check-all-javahl LZ4_FLAG=--with-lz4=$(PREFIX)/lz4 UTF8PROC_FLAG=--with-utf8proc=internal +ifneq ($(SWIG_VER),) +SWIG_FLAG=--with-swig=$(PREFIX)/swig/bin/swig +endif PYTHON_BIN_PATH=$(PREFIX)/python/bin endif @@ -1845,8 +1862,14 @@ $(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)/.retrieved $(DISTDIR)/$(JUNIT_DIST) \ $(BDB_OBJDIR)/.installed $(SQLITE_OBJDIR)/.installed \ $(HTTPD_OBJDIR)/.installed $(CYRUS_SASL_OBJDIR)/.installed \ $(LIBMAGIC_OBJDIR)/.installed $(NEON_OBJDIR)/.installed \ - $(SERF_OBJDIR)/.installed \ + $(SERF_OBJDIR)/.installed $(SWIG_OBJDIR)/.installed \ $(RUBY_OBJDIR)/.installed $(PYTHON_OBJDIR)/.installed +ifeq ($(BRANCH_MAJOR), $(filter 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13, $(BRANCH_MAJOR))) +ifneq ($(shell test $(SWIG_VER) \< 4.0 && echo 1), 1) + @echo "SWIG 3 is required for Subversion < 1.14" + @exit 1 +endif +endif cd $(SVN_SRCDIR) && ./autogen.sh $(SWIG_PL_INCLUDES_HACK) $(SWIG_PL_LINK_HACK) @@ -1881,7 +1904,7 @@ $(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)/.retrieved $(DISTDIR)/$(JUNIT_DIST) \ $(LIBMAGIC_FLAG) \ $(LZ4_FLAG) \ $(UTF8PROC_FLAG) \ - $(SWIG_OLD_FLAG) \ + $(SWIG_FLAG) \ --with-swig-python=$(PYTHON_BIN_PATH)/python \ $(SVN_STATIC_FLAG) \ $(DISABLE_NEON_VERSION_CHECK) @@ -2523,8 +2546,8 @@ ifdef LZ4_FLAG @echo "lz4: $(LZ4_VER)" endif @echo "libssl: `openssl version`" -ifdef SWIG_OLD_FLAG - @echo "swig: `$(PREFIX)/swig-old/bin/swig -version | grep Version | cut -d' ' -f3`" +ifdef SWIG_FLAG + @echo "swig: `$(PREFIX)/swig/bin/swig -version | grep Version | cut -d' ' -f3`" else @echo "swig: `swig -version | grep Version | cut -d' ' -f3`" endif