diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2014-12-17 13:21:56 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2014-12-17 13:21:56 +0000 |
commit | 64835f0cdc52b538b4d0bca8a163eaa4b2c88377 (patch) | |
tree | 4202a3b2243a0e4544eabc8d5f6b2ecccb217330 /Mk | |
parent | 6bc46658858388f64b55ac80567c3bd2274750a8 (diff) |
Notes
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Scripts/qa.sh | 51 | ||||
-rw-r--r-- | Mk/Uses/perl5.mk | 12 |
2 files changed, 57 insertions, 6 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index 32eda0b051f7..7a82dcaa6394 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -206,7 +206,56 @@ libtool() { 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} diff --git a/Mk/Uses/perl5.mk b/Mk/Uses/perl5.mk index 01b8e1512ddc..921dbc2fafba 100644 --- a/Mk/Uses/perl5.mk +++ b/Mk/Uses/perl5.mk @@ -105,6 +105,8 @@ PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION} 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 @@ MAN3PREFIX?= ${SITE_PERL} .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 |