summaryrefslogtreecommitdiff
path: root/mk/autoconf.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-02-20 09:58:49 +0000
committerjlam <jlam@pkgsrc.org>2004-02-20 09:58:49 +0000
commit0575966fae1421dfab7aafd510c88b8ceebe8540 (patch)
tree0c29fce122a7875e1cf88df297b9644d38f88e5c /mk/autoconf.mk
parentc69471ee9f7f4d4b6b6c757b1a74354bfba5fb94 (diff)
downloadpkgsrc-0575966fae1421dfab7aafd510c88b8ceebe8540.tar.gz
Symlink the libtool-1.4.m4 file into any directory in which there's a
configure script under ${WRKSRC}. The symlink is called "libtool.m4", which is the name expected by the autoconf tools. The symlinking is only done if ${AUTOCONF_REQD} == 2.13 and USE_LIBTOOL is defined. This allows autoconf-2.13, autoreconf-2.13 and aclocal-2.13 to use the older libtool.m4 file when regenerating files. This is okay, because we later override the generated libtool file anyway. This fixes problems when libtool-1.5.x is installed and a package tries to invoke autoconf-2.13 programs at pre-configure time, e.g., gnome-games, xpuyopuyo, faad2, libwww, etc. These packages no longer need to be worked around by bumping AUTOCONF_REQD to 2.50.
Diffstat (limited to 'mk/autoconf.mk')
-rw-r--r--mk/autoconf.mk34
1 files changed, 32 insertions, 2 deletions
diff --git a/mk/autoconf.mk b/mk/autoconf.mk
index 52ba1952ab2..5ab5d38633e 100644
--- a/mk/autoconf.mk
+++ b/mk/autoconf.mk
@@ -1,4 +1,4 @@
-# $NetBSD: autoconf.mk,v 1.3 2002/10/03 19:36:36 wiz Exp $
+# $NetBSD: autoconf.mk,v 1.4 2004/02/20 09:58:49 jlam Exp $
#
# makefile fragment for packages that use autoconf
# AUTOCONF_REQD can be set to the minimum version required.
@@ -15,7 +15,7 @@ AUTOCONF_MK= # defined
# minimal required version
AUTOCONF_REQD?= 2.50
-.if ${AUTOCONF_REQD:M2.1[0-9]*} == ""
+.if empty(AUTOCONF_REQD:M2.1[0-9]*)
BUILD_DEPENDS+= autoconf>=${AUTOCONF_REQD}:../../devel/autoconf
AUTOCONF= ${LOCALBASE}/bin/autoconf
AUTORECONF= ${LOCALBASE}/bin/autoreconf
@@ -25,6 +25,36 @@ BUILD_DEPENDS+= autoconf213>=${AUTOCONF_REQD}:../../devel/autoconf213
AUTOCONF= ${LOCALBASE}/bin/autoconf-2.13
AUTORECONF= ${LOCALBASE}/bin/autoreconf-2.13
AUTOHEADER= ${LOCALBASE}/bin/autoheader-2.13
+. if defined(USE_LIBTOOL)
+pre-configure: do-libtool-m4-override
+. endif
.endif
+# LIBTOOL_M4_OVERRIDE lists the locations where the libtool.m4 symlink
+# will be created. The libtool.m4 is only created if a GNU configure
+# script exists at that location.
+#
+LIBTOOL_M4_OVERRIDE?= libtool.m4 */libtool.m4 */*/libtool.m4
+
+# Symlink the libtool-1.4.m4 file into any directory in which there's a
+# configure script under ${WRKSRC}. The symlink is called "libtool.m4",
+# which is the name expected by the autoconf tools. The symlinking is
+# only done if ${AUTOCONF_REQD} == 2.13 and USE_LIBTOOL is defined. This
+# allows autoconf-2.13, autoreconf-2.13 and aclocal-2.13 to use the older
+# libtool.m4 file when regenerating files. This is okay, because we later
+# override the generated libtool file anyway.
+#
+.PHONY: do-libtool-m4-override
+do-libtool-m4-override:
+.for _pattern_ in ${LIBTOOL_M4_OVERRIDE}
+ ${_PKG_SILENT}${_PKG_DEBUG}cd ${WRKSRC}; \
+ for file in ${_pattern_:S/libtool.m4$/configure/}; do \
+ if [ -f "$$file" ]; then \
+ libtool_m4=`${DIRNAME} $$file`/libtool.m4; \
+ ${LN} -sf ${_PKGSRCDIR}/mk/gnu-config/libtool-1.4.m4 \
+ $$libtool_m4; \
+ fi; \
+ done
+.endfor
+
.endif # AUTOCONF_MK