Index: Mk/Scripts/qa.sh =================================================================== --- Mk/Scripts/qa.sh +++ Mk/Scripts/qa.sh @@ -206,7 +206,56 @@ fi } -checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool" +libperl() { + local has_some_libperl_so files found + if [ -n "${SITE_ARCH_REL}" ]; then + has_some_libperl_so=0 + files=0 + while read f; do + # No results presents a blank line from heredoc. + [ -z "${f}" ] && continue + files=$((files+1)) + found=`readelf -d $f | awk "BEGIN {libperl=1; rpath=10; runpath=100} + /NEEDED.*${LIBPERL}/ { libperl = 0 } + /RPATH.*perl.*CORE/ { rpath = 0 } + /RUNPATH.*perl.*CORE/ { runpath = 0 } + END {print libperl+rpath+runpath} + "` + # FIXME When 8.4 goes out of commission, replace the ;; + # with ;& in the case below. Also, change the logic on + # detecting if there was a file with libperl.so + if [ "$found" -ne "0" ]; then + case "$found" in + *1) + warn "${f} is not linked with ${LIBPERL}, not respecting lddlflags?" + ;; #;& + *1?) + has_some_libperl_so=1 + warn "${f} does not have a rpath to ${LIBPERL}, not respecting lddlflags?" + ;; #;& + 1??) + has_some_libperl_so=1 + warn "${f} does not have a runpath to ${LIBPERL}, not respecting lddlflags?" + ;; #;& + esac + else + has_some_libperl_so=1 + fi + # Use heredoc to avoid losing rc from find|while subshell + done <<-EOT + $(find ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL} -name '*.so') + EOT + + if [ $files -gt 0 -a $has_some_libperl_so -eq 0 ]; then + err "None of the .so in ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL} are linked with ${LIBPERL}, see above for the full list." + return 1 + else + return 0 + fi + fi +} + +checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl" ret=0 cd ${STAGEDIR} Index: Mk/Uses/perl5.mk =================================================================== --- Mk/Uses/perl5.mk +++ Mk/Uses/perl5.mk @@ -105,6 +105,8 @@ PERL= ${LOCALBASE}/bin/perl CONFIGURE_ENV+= ac_cv_path_PERL=${PERL} ac_cv_path_PERL_PATH=${PERL} +QA_ENV+= SITE_ARCH_REL=${SITE_ARCH_REL} LIBPERL=libperl.so.${PERL_VER} + # Define the want perl first if defined .if ${USE_PERL5:M5*} want_perl_sign= ${USE_PERL5:M5*:C|^[0-9.]+||} @@ -236,15 +238,15 @@ .if !target(do-configure) do-configure: @if [ -f ${SCRIPTDIR}/configure ]; then \ - cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ - ${SCRIPTDIR}/configure; \ + cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ + ${SCRIPTDIR}/configure; \ fi @cd ${CONFIGURE_WRKSRC} && \ - ${SETENV} ${CONFIGURE_ENV} \ - ${PERL5} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} + ${SETENV} ${CONFIGURE_ENV} \ + ${PERL5} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} .if !${_USE_PERL5:Mmodbuild*} @cd ${CONFIGURE_WRKSRC} && \ - ${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile + ${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile .endif # ! modbuild .endif # !target(do-configure) .endif # configure Index: lang/perl5.14/Makefile =================================================================== --- lang/perl5.14/Makefile +++ lang/perl5.14/Makefile @@ -61,7 +61,7 @@ HAS_CONFIGURE= yes CONFIGURE_SCRIPT=Configure CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \ - -Dlibperl=libperl.so.${PERL_VER} \ + -Dlibperl=libperl.so.${PERL_VERSION} \ -Darchlib=${PREFIX}/${_ARCH_LIB} \ -Dprivlib=${PREFIX}/${_PRIV_LIB} \ -Dman3dir=${PREFIX}/${MAN3PREFIX_REL}/man/man3 \ @@ -209,12 +209,22 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER} + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + # Keep the following two sync'ed + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|%%HOLDER%%|:N-L${WRKSRC}:N-L${PREFIX}/${_ARCH_LIB}/CORE:N-Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE:N-lperl|' \ + ${WRKSRC}/Makefile.SH .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -230,8 +240,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VER} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete Index: lang/perl5.14/files/patch-Makefile.SH =================================================================== --- lang/perl5.14/files/patch-Makefile.SH +++ lang/perl5.14/files/patch-Makefile.SH @@ -5,7 +5,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ $(SHRPLDFLAGS%%HOLDER%%) -Wl,-soname,$(LIBPERL:R) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix) Index: lang/perl5.16/Makefile =================================================================== --- lang/perl5.16/Makefile +++ lang/perl5.16/Makefile @@ -61,7 +61,7 @@ HAS_CONFIGURE= yes CONFIGURE_SCRIPT=Configure CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \ - -Dlibperl=libperl.so.${PERL_VER} \ + -Dlibperl=libperl.so.${PERL_VERSION} \ -Darchlib=${PREFIX}/${_ARCH_LIB} \ -Dprivlib=${PREFIX}/${_PRIV_LIB} \ -Dman3dir=${PREFIX}/${MAN3PREFIX_REL}/man/man3 \ @@ -209,12 +209,22 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER} + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + # Keep the following two sync'ed + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|%%HOLDER%%|:N-L${WRKSRC}:N-L${PREFIX}/${_ARCH_LIB}/CORE:N-Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE:N-lperl|' \ + ${WRKSRC}/Makefile.SH .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -230,8 +240,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VER} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete Index: lang/perl5.16/files/patch-Makefile.SH =================================================================== --- lang/perl5.16/files/patch-Makefile.SH +++ lang/perl5.16/files/patch-Makefile.SH @@ -5,7 +5,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ $(SHRPLDFLAGS%%HOLDER%%) -Wl,-soname,$(LIBPERL:R) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix) Index: lang/perl5.18/Makefile =================================================================== --- lang/perl5.18/Makefile +++ lang/perl5.18/Makefile @@ -78,7 +78,7 @@ HAS_CONFIGURE= yes CONFIGURE_SCRIPT=Configure CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \ - -Dlibperl=libperl.so.${PERL_VER} \ + -Dlibperl=libperl.so.${PERL_VERSION} \ -Darchlib=${PREFIX}/${_ARCH_LIB} \ -Dprivlib=${PREFIX}/${_PRIV_LIB} \ -Dman3dir=${PREFIX}/${MAN3PREFIX_REL}/man/man3 \ @@ -187,12 +187,22 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER} + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + # Keep the following two sync'ed + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|%%HOLDER%%|:N-L${WRKSRC}:N-L${PREFIX}/${_ARCH_LIB}/CORE:N-Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE:N-lperl|' \ + ${WRKSRC}/Makefile.SH .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -208,8 +218,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VER} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete Index: lang/perl5.18/files/patch-Makefile.SH =================================================================== --- lang/perl5.18/files/patch-Makefile.SH +++ lang/perl5.18/files/patch-Makefile.SH @@ -1,11 +1,11 @@ --- Makefile.SH.orig 2014-10-01 15:23:34 UTC +++ Makefile.SH -@@ -805,7 +808,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI +@@ -805,7 +805,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI true) $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ $(SHRPLDFLAGS%%HOLDER%%) -Wl,-soname,$(LIBPERL:R) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix) Index: lang/perl5.20/Makefile =================================================================== --- lang/perl5.20/Makefile +++ lang/perl5.20/Makefile @@ -79,7 +79,7 @@ HAS_CONFIGURE= yes CONFIGURE_SCRIPT=Configure CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \ - -Dlibperl=libperl.so.${PERL_VER} \ + -Dlibperl=libperl.so.${PERL_VERSION} \ -Darchlib=${PREFIX}/${_ARCH_LIB} \ -Dprivlib=${PREFIX}/${_PRIV_LIB} \ -Dman3dir=${PREFIX}/${MAN3PREFIX_REL}/man/man3 \ @@ -184,12 +184,22 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so + ${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER} + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + # Keep the following two sync'ed + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|%%HOLDER%%|:N-L${WRKSRC}:N-L${PREFIX}/${_ARCH_LIB}/CORE:N-Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE:N-lperl|' \ + ${WRKSRC}/Makefile.SH .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -205,8 +215,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VERSION} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VER} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${MKDIR} ${STAGEDIR}${SITE_ARCH}/machine Index: lang/perl5.20/files/patch-Makefile.SH =================================================================== --- lang/perl5.20/files/patch-Makefile.SH +++ lang/perl5.20/files/patch-Makefile.SH @@ -5,7 +5,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ $(SHRPLDFLAGS%%HOLDER%%) -Wl,-soname,$(LIBPERL:R) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix)