2014-01-28 18:25:52 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Bring libtool scripts up to date.
|
|
|
|
#
|
|
|
|
# Feature: libtool
|
2014-04-23 13:25:16 +00:00
|
|
|
# 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.
|
2014-08-10 13:41:19 +00:00
|
|
|
# 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.
|
2014-03-15 10:31:54 +00:00
|
|
|
#
|
|
|
|
# MAINTAINER: autotools@FreeBSD.org
|
2014-01-28 18:25:52 +00:00
|
|
|
|
|
|
|
.if !defined(_INCLUDE_USES_LIBTOOL_MK)
|
|
|
|
_INCLUDE_USES_LIBTOOL_MK= yes
|
|
|
|
_USES_POST+= libtool
|
2014-08-10 13:41:19 +00:00
|
|
|
libtool_ARGS:= ${libtool_ARGS:C/,/ /}
|
|
|
|
|
|
|
|
.if ${libtool_ARGS:Mbuild}
|
|
|
|
BUILD_DEPENDS+= libtool:${PORTSDIR}/devel/libtool
|
|
|
|
.endif
|
2014-01-28 18:25:52 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_LIBTOOL_POST_MK)
|
|
|
|
_INCLUDE_USES_LIBTOOL_POST_MK= yes
|
|
|
|
|
|
|
|
patch-libtool:
|
2014-02-09 22:00:35 +00:00
|
|
|
@${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \) \
|
2014-09-05 15:31:31 +00:00
|
|
|
-type f | while read i; do ${SED} -i.bak \
|
2014-03-03 14:10:31 +00:00
|
|
|
-e '/dragonfly\*/!s/^ *freebsd\*[ )]/dragonfly* | &/' \
|
2014-02-27 09:51:45 +00:00
|
|
|
-e '/gcc_dir=\\`/s/gcc /$$CC /' \
|
|
|
|
-e '/gcc_ver=\\`/s/gcc /$$CC /' \
|
2014-02-14 22:29:05 +00:00
|
|
|
-e '/link_all_deplibs[0-9A-Z_]*=/s/=unknown/=no/' \
|
|
|
|
-e '/objformat=/s/echo aout/echo elf/' \
|
|
|
|
-e "/freebsd-elf\\*)/,/;;/ { \
|
2014-09-05 15:31:31 +00:00
|
|
|
/deplibs_check_method=/s/=.*/=pass_all/; }" \
|
|
|
|
$${i} && ${TOUCH} -mr $${i}.bak $${i}; done
|
2014-01-28 18:25:52 +00:00
|
|
|
|
2014-02-27 09:51:45 +00:00
|
|
|
@${FIND} ${WRKDIR} -type f -name ltmain.sh | \
|
|
|
|
${XARGS} ${REINPLACE_CMD} \
|
2014-06-22 10:44:29 +00:00
|
|
|
-e '/if.*linkmode.*prog.*mode.*!= relink/s/if.*;/if :;/'\
|
|
|
|
-e '/if.*linkmode.*prog.*mode.* = relink/s/||.*;/;/' \
|
2014-02-27 09:51:45 +00:00
|
|
|
-e 's/|-p|-pg|/|-B*|-p|-pg|/'
|
|
|
|
|
2014-01-28 21:31:50 +00:00
|
|
|
.if ! ${libtool_ARGS:Moldver}
|
2014-02-09 22:00:35 +00:00
|
|
|
@${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \) \
|
2014-09-05 15:31:31 +00:00
|
|
|
-type f | while read i; do ${SED} -i.bak \
|
2014-02-09 22:00:35 +00:00
|
|
|
-e "/freebsd-elf\\*)/,/;;/ { \
|
|
|
|
/library_names_spec=.*\\.so/ \
|
|
|
|
s/=.*/='\$$libname\$$release.so\$$versuffix \
|
|
|
|
\$$libname\$$release.so\$$major \$$libname.so' \
|
|
|
|
soname_spec='\$$libname\$$release.so\$$major'/; \
|
|
|
|
/library_names_spec=.*shared_ext/ \
|
|
|
|
s/=.*/='\$$libname\$$release\$$shared_ext\$$versuffix \
|
|
|
|
\$$libname\$$release\$$shared_ext\$$major \
|
|
|
|
\$$libname\$$shared_ext' \
|
2014-09-05 15:31:31 +00:00
|
|
|
soname_spec='\$$libname\$$release\$$shared_ext\$$major'/; \
|
|
|
|
}" $${i} && ${TOUCH} -mr $${i}.bak $${i}; done
|
2014-01-28 18:25:52 +00:00
|
|
|
|
|
|
|
@${FIND} ${WRKDIR} -type f -name ltmain.sh | \
|
|
|
|
${XARGS} ${REINPLACE_CMD} \
|
|
|
|
-e '/case $$version_type in/,+2 \
|
|
|
|
s/darwin|linux|/darwin|freebsd-elf|linux|/' \
|
|
|
|
-e '/freebsd-elf)/,+2 { \
|
|
|
|
/major=/s/=.*/=.$$(($$current - $$age))/; \
|
|
|
|
/versuffix=/s/=.*/="$$major.$$age.$$revision"/; }'
|
|
|
|
.endif
|
|
|
|
|
2014-04-23 13:25:16 +00:00
|
|
|
patch-lafiles:
|
2014-08-10 13:41:19 +00:00
|
|
|
.if ${libtool_ARGS:Mkeepla} || ${libtool_ARGS:Moldver}
|
2014-04-23 13:25:16 +00:00
|
|
|
@${FIND} ${STAGEDIR} -type f -name '*.la' | \
|
|
|
|
${XARGS} ${SED} -i '' -e "/dependency_libs=/s/=.*/=''/"
|
|
|
|
.else
|
2014-09-08 12:21:50 +00:00
|
|
|
@${FIND} ${STAGEDIR} -type l -exec ${SH} -c \
|
2014-09-13 20:25:58 +00:00
|
|
|
'case `${REALPATH} "{}"` in \
|
2014-09-08 12:21:50 +00:00
|
|
|
*.la) ${ECHO_CMD} "{}" ;; esac' \; | \
|
|
|
|
${XARGS} ${GREP} -l 'libtool library' | ${XARGS} ${RM}
|
2014-04-23 13:25:16 +00:00
|
|
|
@${FIND} ${STAGEDIR} -type f -name '*.la' | \
|
|
|
|
${XARGS} ${GREP} -l 'libtool library' | ${XARGS} ${RM}
|
|
|
|
.endif
|
|
|
|
|
2014-01-28 18:25:52 +00:00
|
|
|
.endif
|