Subject: Re: mk/gnu-config question/request
To: None <tech-pkg@netbsd.org>
From: Jeroen Ruigrok/asmodai <asmodai@in-nomine.org>
List: tech-pkg
Date: 06/12/2005 01:57:31
--UugvWAfsgieZRqgk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Find attached an updated patch with an auto-run target for some autotools if
GNU_CONFIGURE is specified.

Not the best quality-wise, but more to prove the concept/idea.

I would probably need to add a detection for Makefile.am and rerun automake
as well.  Also note that a port, right now, needs to add USE_TOOLS+=
autoconf automake in order to allow the .tools directory to be used.

It also fixes a small \ omission in my previous diff, causing some verbose
printing.

With this in place I don't have to overload each and every pkg that uses
libtool to generate its libraries to rerun the tools in order to be able to
build shared libraries.

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
Free Tibet! http://www.savetibet.org/ | http://ashemedai.deviantart.com/
http://www.tendra.org/   | http://www.in-nomine.org/
You are not thinking. You are merely being logical. - N. Bohr to A. Einstein

--UugvWAfsgieZRqgk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="bsd.pkg.mk.diff"

Index: bsd.pkg.mk
===================================================================
RCS file: /home/ncvs/NetBSD/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1687
diff -u -r1.1687 bsd.pkg.mk
--- bsd.pkg.mk	4 Jun 2005 20:56:47 -0000	1.1687
+++ bsd.pkg.mk	11 Jun 2005 23:50:28 -0000
@@ -739,6 +739,8 @@
 #
 CONFIG_STATUS_OVERRIDE?=	\
 	config.status */config.status */*/config.status
+LTMAIN_OVERRIDE?=		\
+	ltmain.sh */ltmain.sh */*/ltmain.sh
 .endif
 
 #
@@ -1745,6 +1747,24 @@
 .  endfor
 .endif
 
+.if defined(USE_LIBTOOL)
+_CONFIGURE_PREREQ+=	do-ltmain-override
+.PHONY: do-ltmain-override
+do-ltmain-override:
+.  if !empty(LTMAIN_OVERRIDE)
+.    for _pattern_ in ${LTMAIN_OVERRIDE}
+	${_PKG_SILENT}${_PKG_DEBUG}cd ${WRKSRC};			\
+	for file in ${_pattern_}; do					\
+		if [ -f "$$file" ]; then				\
+			${RM} -f $$file;				\
+			${LN} -s ${LOCALBASE}/share/libtool/ltmain.sh	\
+				$$file;					\
+		fi;							\
+	done
+.    endfor
+.  endif
+.endif
+
 _CONFIGURE_PREREQ+=	do-config-star-override
 .PHONY: do-config-star-override
 do-config-star-override:
@@ -1805,6 +1825,22 @@
 SUBST_SED.pkgconfig=		${PKGCONFIG_OVERRIDE_SED}
 .endif
 
+.if defined(GNU_CONFIGURE)
+CONFIGURE_OVERRIDE?=	configure.in */configure.in */*/configure.in
+_CONFIGURE_PREREQ+=	do-configure-override
+.PHONY: do-configure-override
+do-configure-override:
+.  for _pattern_ in ${CONFIGURE_OVERRIDE}
+	${_PKG_SILENT}${_PKG_DEBUG}cd ${WRKSRC};			\
+	for file in ${_pattern_}; do					\
+		if [ -f "$$file" ]; then				\
+			(cd `dirname $$file` && aclocal --force &&	\
+			 autoheader --force && autoconf --force);	\
+		fi;							\
+	done
+.  endfor
+.endif
+
 # By adding this target, it makes sure the above PREREQ's work.
 .PHONY: pre-configure-override
 pre-configure-override: ${_CONFIGURE_PREREQ}

--UugvWAfsgieZRqgk--