pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/boost-libs



Module Name:    pkgsrc
Committed By:   thor
Date:           Fri Apr 23 16:17:28 UTC 2021

Modified Files:
        pkgsrc/devel/boost-libs: Makefile
Added Files:
        pkgsrc/devel/boost-libs/files: test-backtrace.sh

Log Message:
devel/boost-libs: smarter check for libbacktrace indepentent of distro

This just does a quick compile/link to actually see if libbacktrace is
present in the current toolchain, not resorting to assumptions based on
Linux distro. In theory, it should work on any system, but I kept the
Linux condition in place.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 pkgsrc/devel/boost-libs/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/boost-libs/files/test-backtrace.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/boost-libs/Makefile
diff -u pkgsrc/devel/boost-libs/Makefile:1.85 pkgsrc/devel/boost-libs/Makefile:1.86
--- pkgsrc/devel/boost-libs/Makefile:1.85       Wed Apr 21 12:09:50 2021
+++ pkgsrc/devel/boost-libs/Makefile    Fri Apr 23 16:17:27 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.85 2021/04/21 12:09:50 adam Exp $
+# $NetBSD: Makefile,v 1.86 2021/04/23 16:17:27 thor Exp $
 
 BOOST_PACKAGE=         libs
 BOOST_COMMENT=         (binary libraries)
@@ -48,9 +48,9 @@ PLIST.longdbl=                yes
 .endif
 
 # libboost_stacktrace_backtrace requires libbacktrace.
-# FIXME: The condition needs to be refined for non-Debian/Ubuntu
-# platforms shipped with libbacktrace.
-.if ${OPSYS} == "Linux" && (exists(/etc/debian_version) || exists(/etc/devuan_version))
+# FIXME: Test on non-Linux. It should just work.
+TEST_BACKTRACE_CMD=    sh ${FILESDIR}/test-backtrace.sh '${CXX} ${CXXFLAGS} ${CPPFLAGS}'
+.if ${OPSYS} == "Linux" && ${TEST_BACKTRACE_CMD:sh} == "yes"
 PLIST.backtrace=       yes
 .endif
 

Added files:

Index: pkgsrc/devel/boost-libs/files/test-backtrace.sh
diff -u /dev/null pkgsrc/devel/boost-libs/files/test-backtrace.sh:1.1
--- /dev/null   Fri Apr 23 16:17:28 2021
+++ pkgsrc/devel/boost-libs/files/test-backtrace.sh     Fri Apr 23 16:17:27 2021
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Given a compiler command, test if libbacktrace is available.
+# It is shipped with GCC, sometimes, and not in the official
+# places.
+
+set -e
+
+cc=$1; shift
+dir=$(mktemp -d "${TMPDIR:-/tmp}/conftest.XXXXXX")
+cd "$dir"
+cat > test.c <<EOT
+#include <backtrace.h>
+int main()
+{
+  return 0;
+}
+EOT
+$cc -o test test.c -lbacktrace 2>/dev/null  &&
+echo yes ||
+echo no
+cd
+rm -rf "$dir"



Home | Main Index | Thread Index | Old Index