libbsd (again)

From: Peter Piwowarski <peterjpiwowarski_at_gmail.com>
Date: Mon Sep 07 2015 - 19:19:17 CEST
After discussing the matter with sndio's sponsor in Debian, I've decided it still makes sense to link sndio with libbsd in the Debian package; should that patch still get merged? Updated diff against 1.0.1 (to be carried in Debian packaging for that version) follows.

--- sndio-1.0.1.orig/configure
+++ sndio-1.0.1/configure
@@ -20,6 +20,7 @@ Usage: configure [options]
 --disable-sun			disable sun audio backend
 --enable-rmidi			enable character device midi backend [$rmidi]
 --disable-rmidi			disable character device midi backend
+--use-libbsd			use the system's libbsd rather than bsd-compat/*
 END
 }
 
@@ -33,6 +34,7 @@ sun=no					# do we want sun support ?
 rmidi=no				# do we want support for raw char dev ?
 precision=16				# aucat/sndiod arithmetic precision
 user=_sndio				# non-privileged user for sndio daemon
+libbsd=no				# use libbsd?
 unset vars				# variables passed as arguments
 unset bindir				# path where to install binaries
 unset datadir				# path where to install doc
@@ -117,6 +119,9 @@ for i; do
 			exit 1
 		fi
 		shift;;
+	--use-libbsd)
+		libbsd=yes
+		shift;;
 	CC=*|CFLAGS=*|LDFLAGS=*)
 		vars="$vars$i$nl"
 		shift;;
@@ -158,6 +163,15 @@ if [ $rmidi = yes ]; then
 	defs="$defs -DUSE_RMIDI"
 fi
 
+#
+# if using libbsd, add corresponding parameters
+#
+if [ $libbsd = yes ]; then
+	# no arc4random as libbsd has a questionable implementation
+	defs="$defs -DHAVE_STRLCPY -DHAVE_STRLCAT -DHAVE_STRTONUM"
+	ldadd="$ldadd -lbsd"
+fi
+
 for f in Makefile aucat/Makefile midicat/Makefile sndiod/Makefile \
 libsndio/Makefile \
 examples/Makefile \
@@ -190,6 +204,7 @@ precision................ $precision
 alsa..................... $alsa
 sun...................... $sun
 rmidi.................... $rmidi
+libbsd................... $libbsd
 
 Do "make && make install" to compile and install sndio
 
Received on Mon, 7 Sep 2015 13:19:17 -0400

This archive was generated by hypermail 2.1.8 : Wed Nov 08 2017 - 16:31:34 CET