pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk mk: Create a fake <soundcard.h> on illumos to help ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/42866749213b
branches:  trunk
changeset: 376866:42866749213b
user:      nia <nia%pkgsrc.org@localhost>
date:      Thu Apr 14 06:17:40 2022 +0000

description:
mk: Create a fake <soundcard.h> on illumos to help OSSv4 apps compile.

diffstat:

 mk/oss.builtin.mk |  22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 96799199cf1a -r 42866749213b mk/oss.builtin.mk
--- a/mk/oss.builtin.mk Thu Apr 14 05:39:05 2022 +0000
+++ b/mk/oss.builtin.mk Thu Apr 14 06:17:40 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: oss.builtin.mk,v 1.6 2019/06/30 21:28:28 rillig Exp $
+# $NetBSD: oss.builtin.mk,v 1.7 2022/04/14 06:17:40 nia Exp $
 
 BUILTIN_PKG:=  oss
 
@@ -71,10 +71,19 @@
 .  endif
 
 # Many OSS-aware programs expect <soundcard.h> to be found as either
-# <sys/soundcard.h> or <machine/soundcard.h>, so create a dummy version.
+# <sys/soundcard.h> or <machine/soundcard.h>, so create a dummy version
+# if only <soundcard.h> exists (needed for OSSv4 on Linux and similar?
+# Definitely not needed on BSD or Solaris!)
+#
 # Also include <sys/ioctl.h> prior to including <soundcard.h> since we
 # need definitions for _IOWR and friends.
 #
+# illumos provides <sys/soundcard.h>, but no <soundcard.h>, so
+# we also need to create <soundcard.h> if it doesn't exist in order
+# to compile OSSv4 programs.
+#
+# What a mess!
+#
 BUILDLINK_TARGETS+=    buildlink-oss-soundcard-h
 .PHONY: buildlink-oss-soundcard-h
 buildlink-oss-soundcard-h:
@@ -96,6 +105,13 @@
                ${ECHO_BUILDLINK_MSG} "Creating $${mach_soundcard_h}."; \
                ${MKDIR} `${DIRNAME} $${mach_soundcard_h}`;             \
                ${LN} -s $${sys_soundcard_h} $${mach_soundcard_h};      \
-       fi
+       fi;                                                             \
+       soundcard_h=${BUILDLINK_DIR}/include/soundcard.h;               \
+       sys_soundcard_h=${BUILDLINK_PREFIX.oss}/include/sys/soundcard.h; \
+       if ${TEST} ! -f $${soundcard_h} -a -f $${sys_soundcard_h}; then \
+               ${ECHO_BUILDLINK_MSG} "Creating $${soundcard_h}.";      \
+               ${MKDIR} `${DIRNAME} $${soundcard_h}`;                  \
+               ${LN} -s $${sys_soundcard_h} $${soundcard_h};           \
+       fi;                                                             \
 
 .endif # CHECK_BUILTIN.oss



Home | Main Index | Thread Index | Old Index