summaryrefslogtreecommitdiff
path: root/ham
diff options
context:
space:
mode:
authordbj <dbj>2015-01-27 08:19:22 +0000
committerdbj <dbj>2015-01-27 08:19:22 +0000
commit36b374bd28474e557034c58d45548780b1ffad58 (patch)
tree006cf33a8df2a31b81d5556fbe493923b3e30f3f /ham
parentb00e0fda9247ad555261db47f9f29699f7a164d8 (diff)
downloadpkgsrc-36b374bd28474e557034c58d45548780b1ffad58.tar.gz
add awk script to fixup 0b constants not handled by all compilers
Diffstat (limited to 'ham')
-rw-r--r--ham/freedv/Makefile6
-rw-r--r--ham/freedv/fixbinconst.mk38
2 files changed, 43 insertions, 1 deletions
diff --git a/ham/freedv/Makefile b/ham/freedv/Makefile
index f0f9e64a919..df1f84f40bd 100644
--- a/ham/freedv/Makefile
+++ b/ham/freedv/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2014/09/10 12:16:15 joerg Exp $
+# $NetBSD: Makefile,v 1.4 2015/01/27 08:19:22 dbj Exp $
#
VERSION= 0.97.0.1696
@@ -27,6 +27,10 @@ CONFIGURE_DIRS=build
BUILD_DIRS=${CONFIGURE_DIRS}
CMAKE_ARG_PATH=..
+.include "fixbinconst.mk"
+SUBST_STAGE.fixbinconst= pre-configure
+SUBST_FILES.fixbinconst+= src/varicode_table.h
+
pre-configure:
${MKDIR} ${WRKSRC}/build
diff --git a/ham/freedv/fixbinconst.mk b/ham/freedv/fixbinconst.mk
new file mode 100644
index 00000000000..92371cbb84d
--- /dev/null
+++ b/ham/freedv/fixbinconst.mk
@@ -0,0 +1,38 @@
+# $NetBSD: fixbinconst.mk,v 1.1 2015/01/27 08:19:22 dbj Exp $
+
+# A hack to fix up single byte binary constants
+
+SUBST_CLASSES+= fixbinconst
+SUBST_SED.fixbinconst+= -e 's/0[bB]0000/0b0/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]0001/0b1/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]0010/0b2/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]0011/0b3/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]0100/0b4/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]0101/0b5/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]0110/0b6/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]0111/0b7/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1000/0b8/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1001/0b9/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1010/0ba/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1011/0bb/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1100/0bc/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1101/0bd/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1110/0be/g'
+SUBST_SED.fixbinconst+= -e 's/0[bB]1111/0bf/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0000/0x\10/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0001/0x\11/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0010/0x\12/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0011/0x\13/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0100/0x\14/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0101/0x\15/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0110/0x\16/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)0111/0x\17/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1000/0x\18/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1001/0x\19/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1010/0x\1a/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1011/0x\1b/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1100/0x\1c/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1101/0x\1d/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1110/0x\1e/g'
+SUBST_SED.fixbinconst+= -e 's/0b\([0-9a-f]\)1111/0x\1f/g'
+SUBST_MESSAGE.fixbinconst= Fixing unportable binary constants