[Midnightbsd-cvs] mports [17027] trunk/Mk/extensions/libtool.mk: handle la files
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Sep 13 17:17:15 EDT 2014
Revision: 17027
http://svnweb.midnightbsd.org/mports/?rev=17027
Author: laffer1
Date: 2014-09-13 17:17:14 -0400 (Sat, 13 Sep 2014)
Log Message:
-----------
handle la files
Modified Paths:
--------------
trunk/Mk/extensions/libtool.mk
Modified: trunk/Mk/extensions/libtool.mk
===================================================================
--- trunk/Mk/extensions/libtool.mk 2014-09-13 21:17:03 UTC (rev 17026)
+++ trunk/Mk/extensions/libtool.mk 2014-09-13 21:17:14 UTC (rev 17027)
@@ -10,6 +10,9 @@
# refer to .la libraries in this port. As soon as all
# those dependent ports have some form of USES=libtool
# keepla can be removed.
+# build Add a build dependency on devel/libtool. This can
+# be used when a port does not generate its own libtool
+# script and relies on the system to provide one.
#
# MAINTAINER: ports at MidnightBSD.org
@@ -16,8 +19,12 @@
.if !defined(_INCLUDE_USES_LIBTOOL_MK)
_INCLUDE_USES_LIBTOOL_MK= yes
_USES_POST+= libtool
-libtool_ARGS?=
+libtool_ARGS:= ${libtool_ARGS:C/,/ /}
+
+.if ${libtool_ARGS:Mbuild}
+BUILD_DEPENDS+= libtool:${PORTSDIR}/devel/libtool
.endif
+.endif
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_LIBTOOL_POST_MK)
_INCLUDE_USES_LIBTOOL_POST_MK= yes
@@ -24,7 +31,7 @@
patch-libtool:
@${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \) \
- -type f | ${XARGS} ${REINPLACE_CMD} \
+ -type f | while read i; do ${SED} -i.bak \
-e '/dragonfly\*/!s/^ *freebsd\*[ )]/dragonfly* | &/' \
-e '/gcc_dir=\\`/s/gcc /$$CC /' \
-e '/gcc_ver=\\`/s/gcc /$$CC /' \
@@ -31,7 +38,8 @@
-e '/link_all_deplibs[0-9A-Z_]*=/s/=unknown/=no/' \
-e '/objformat=/s/echo aout/echo elf/' \
-e "/freebsd-elf\\*)/,/;;/ { \
- /deplibs_check_method=/s/=.*/=pass_all/; }"
+ /deplibs_check_method=/s/=.*/=pass_all/; }" \
+ $${i} && ${TOUCH} -mr $${i}.bak $${i}; done
@${FIND} ${WRKDIR} -type f -name ltmain.sh | \
${XARGS} ${REINPLACE_CMD} \
@@ -41,7 +49,7 @@
.if ! ${libtool_ARGS:Moldver}
@${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \) \
- -type f | ${XARGS} ${REINPLACE_CMD} \
+ -type f | while read i; do ${SED} -i.bak \
-e "/freebsd-elf\\*)/,/;;/ { \
/library_names_spec=.*\\.so/ \
s/=.*/='\$$libname\$$release.so\$$versuffix \
@@ -51,7 +59,8 @@
s/=.*/='\$$libname\$$release\$$shared_ext\$$versuffix \
\$$libname\$$release\$$shared_ext\$$major \
\$$libname\$$shared_ext' \
- soname_spec='\$$libname\$$release\$$shared_ext\$$major'/; }"
+ soname_spec='\$$libname\$$release\$$shared_ext\$$major'/; \
+ }" $${i} && ${TOUCH} -mr $${i}.bak $${i}; done
@${FIND} ${WRKDIR} -type f -name ltmain.sh | \
${XARGS} ${REINPLACE_CMD} \
@@ -63,10 +72,14 @@
.endif
patch-lafiles:
-.if ${libtool_ARGS} == keepla || ${libtool_ARGS} == oldver
+.if ${libtool_ARGS:Mkeepla} || ${libtool_ARGS:Moldver}
@${FIND} ${FAKE_DESTDIR} -type f -name '*.la' | \
${XARGS} ${SED} -i '' -e "/dependency_libs=/s/=.*/=''/"
.else
+ @${FIND} ${FAKE_DESTDIR} -type l -exec ${SH} -c \
+ 'case `${READLINK_CMD} -f "{}"` in \
+ *.la) ${ECHO_CMD} "{}" ;; esac' \; | \
+ ${XARGS} ${GREP} -l 'libtool library' | ${XARGS} ${RM}
@${FIND} ${FAKE_DESTDIR} -type f -name '*.la' | \
${XARGS} ${GREP} -l 'libtool library' | ${XARGS} ${RM}
.endif
More information about the Midnightbsd-cvs
mailing list