[Midnightbsd-cvs] mports [17983] trunk/Mk: refactor libtool handling so that patch-libtool is called properly.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jan 3 16:53:38 EST 2015
Revision: 17983
http://svnweb.midnightbsd.org/mports/?rev=17983
Author: laffer1
Date: 2015-01-03 16:53:37 -0500 (Sat, 03 Jan 2015)
Log Message:
-----------
refactor libtool handling so that patch-libtool is called properly. this solves an issue with the textproc/jade port
Modified Paths:
--------------
trunk/Mk/bsd.mport.mk
trunk/Mk/extensions/libtool.mk
Modified: trunk/Mk/bsd.mport.mk
===================================================================
--- trunk/Mk/bsd.mport.mk 2015-01-03 20:51:40 UTC (rev 17982)
+++ trunk/Mk/bsd.mport.mk 2015-01-03 21:53:37 UTC (rev 17983)
@@ -1720,15 +1720,37 @@
.endif
.for target in check-sanity fetch checksum extract patch configure all build fake install reinstall package
-.if !target(${target})
-${target}:
- @${IGNORECMD}
-.if defined(INSTALLS_DEPENDS)
- @${FALSE}
+.if !target(${target}) && defined(_OPTIONS_OK)
+_PHONY_TARGETS+= ${target}
+${target}: ${${target:tu}_COOKIE}
+ echo foo
+.elif !target(${target})
+${target}: config-conditional
+ echo bar
+ @cd ${.CURDIR} && ${MAKE} CONFIG_DONE_${UNIQUENAME:tu}=1 ${${target:tu}_COOKIE}
+.elif target(${target}) && defined(IGNORE)
.endif
-.endif
-.endfor
+.if !exists(${${target:tu}_COOKIE})
+. if defined(USE_SUBMAKE)
+${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
+ @cd ${.CURDIR} && \
+ ${MAKE} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
+ @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
+. else # !USE_SUBMAKE
+${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
+ @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
+. endif # USE_SUBMAKE
+.else # exists(cookie)
+${${target:tu}_COOKIE}::
+ @if [ -e ${.TARGET} ]; then \
+ ${DO_NADA}; \
+ else \
+ cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
+ fi
+.endif # !exists(cookie)
+.endfor # foreach(targets)
+
.endif
.endif
@@ -1858,6 +1880,16 @@
pre-everything::
@${DO_NADA}
+.if !target(do-autoreconf)
+do-autoreconf::
+ @${DO_NADA}
+.endif
+
+.if !target(patch-libtool)
+patch-libtool::
+ @${DO_NADA}
+.endif
+
buildanyway-message:
.if defined(TRYBROKEN) && defined(BROKEN)
@${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
@@ -2546,7 +2578,8 @@
_CONFIGURE_DEP= patch
_CONFIGURE_SEQ= build-depends lib-depends misc-depends configure-message \
pre-configure pre-configure-script \
- run-autotools do-configure post-configure post-configure-script
+ run-autotools do-autoreconf patch-libtool \
+ do-configure post-configure post-configure-script
_BUILD_DEP= configure
_BUILD_SEQ= build-message pre-build pre-build-script do-build \
Modified: trunk/Mk/extensions/libtool.mk
===================================================================
--- trunk/Mk/extensions/libtool.mk 2015-01-03 20:51:40 UTC (rev 17982)
+++ trunk/Mk/extensions/libtool.mk 2015-01-03 21:53:37 UTC (rev 17983)
@@ -4,12 +4,9 @@
#
# Feature: libtool
# Usage: USES=libtool or USES=libtool:args
-# Valid args: keepla Normally libtool libraries (*.la) are not installed.
-# With this option they are. This is needed as long
-# as there are dependent ports with .la libraries that
-# refer to .la libraries in this port. As soon as all
-# those dependent ports have some form of USES=libtool
-# keepla can be removed.
+# Valid args: keepla Don't remove libtool libraries (*.la) from the stage
+# directory. Some ports need them at runtime (e.g. ports
+# that call lt_dlopen from libltdl).
# 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.
@@ -32,25 +29,13 @@
patch-libtool:
@${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \) \
-type f | while read i; do ${SED} -i.bak \
- -e '/dragonfly\*/!s/^ *freebsd\*[ )]/dragonfly* | &/' \
+ -e '/midnightbsd\*/!s/^ *freebsd\*[ )]/midnightbsd* | &/' \
-e '/gcc_dir=\\`/s/gcc /$$CC /' \
-e '/gcc_ver=\\`/s/gcc /$$CC /' \
-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/; }" \
- $${i} && ${TOUCH} -mr $${i}.bak $${i}; done
-
- @${FIND} ${WRKDIR} -type f -name ltmain.sh | \
- ${XARGS} ${REINPLACE_CMD} \
- -e '/if.*linkmode.*prog.*mode.*!= relink/s/if.*;/if :;/'\
- -e '/if.*linkmode.*prog.*mode.* = relink/s/||.*;/;/' \
- -e 's/|-p|-pg|/|-B*|-p|-pg|/'
-
-.if ! ${libtool_ARGS:Moldver}
- @${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \) \
- -type f | while read i; do ${SED} -i.bak \
- -e "/freebsd-elf\\*)/,/;;/ { \
+ /deplibs_check_method=/s/=.*/=pass_all/; \
/library_names_spec=.*\\.so/ \
s/=.*/='\$$libname\$$release.so\$$versuffix \
\$$libname\$$release.so\$$major \$$libname.so' \
@@ -68,16 +53,20 @@
s/darwin|linux|/darwin|freebsd-elf|linux|/' \
-e '/freebsd-elf)/,+2 { \
/major=/s/=.*/=.$$(($$current - $$age))/; \
- /versuffix=/s/=.*/="$$major.$$age.$$revision"/; }'
-.endif
+ /versuffix=/s/=.*/="$$major.$$age.$$revision"/; }' \
+ -e '/if.*linkmode.*prog.*mode.*!= relink/s/if.*;/if :;/'\
+ -e '/if.*prog.*linkmode.*relink !=.*mode/s/if.*;/if :;/'\
+ -e '/if.*linkmode.*prog.*mode.* = relink/s/||.*;/;/' \
+ -e '/if.*prog.*linkmode.*relink = .*mode/s/||.*;/;/' \
+ -e 's/|-p|-pg|/|-B*|-p|-pg|/'
patch-lafiles:
-.if ${libtool_ARGS:Mkeepla} || ${libtool_ARGS:Moldver}
+.if ${libtool_ARGS:Mkeepla}
@${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 \
+ 'case `${REALPATH} -q "{}"` in \
*.la) ${ECHO_CMD} "{}" ;; esac' \; | \
${XARGS} ${GREP} -l 'libtool library' | ${XARGS} ${RM}
@${FIND} ${FAKE_DESTDIR} -type f -name '*.la' | \
More information about the Midnightbsd-cvs
mailing list