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-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-01-28 21:31:50 +00:00
|
|
|
libtool_ARGS?=
|
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 \) \
|
|
|
|
-type f | ${XARGS} ${REINPLACE_CMD} \
|
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-02-21 21:43:20 +00:00
|
|
|
/deplibs_check_method=/s/=.*/=pass_all/; }"
|
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 \) \
|
|
|
|
-type f | ${XARGS} ${REINPLACE_CMD} \
|
|
|
|
-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' \
|
|
|
|
soname_spec='\$$libname\$$release\$$shared_ext\$$major'/; }"
|
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:
|
|
|
|
.if ${libtool_ARGS} == keepla || ${libtool_ARGS} == oldver
|
|
|
|
@${FIND} ${STAGEDIR} -type f -name '*.la' | \
|
|
|
|
${XARGS} ${SED} -i '' -e "/dependency_libs=/s/=.*/=''/"
|
|
|
|
.else
|
|
|
|
@${FIND} ${STAGEDIR} -type f -name '*.la' | \
|
|
|
|
${XARGS} ${GREP} -l 'libtool library' | ${XARGS} ${RM}
|
|
|
|
.endif
|
|
|
|
|
2014-01-28 18:25:52 +00:00
|
|
|
.endif
|