aboutsummaryrefslogtreecommitdiff
path: root/cddl
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2020-08-11 16:46:54 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2020-08-11 16:46:54 +0000
commitfded98749a40d1adcdff10bceba9de6cf90b3097 (patch)
tree5f8477569f751d9e2592314b9464f847a81b3c20 /cddl
parentf57b27e3f85b468033c3c91c7f2f2e90aa2e8a04 (diff)
downloadsrc-fded98749a40d1adcdff10bceba9de6cf90b3097.tar.gz
src-fded98749a40d1adcdff10bceba9de6cf90b3097.zip
Fix libdtrace build with zsh as /bin/sh
When zsh runs in POSIX sh mode it does not support the -e flag to echo. Use printf instead of echo to avoid the "-e" characters being printed. Obtained from: CheriBSD Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D26026
Notes
Notes: svn path=/head/; revision=364124
Diffstat (limited to 'cddl')
-rwxr-xr-xcddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh15
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh33
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh37
-rwxr-xr-xcddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh15
4 files changed, 46 insertions, 54 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh
index c9fb9e04fe00..de4b86270efa 100755
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh
@@ -24,16 +24,15 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
set -e
-echo "\
-/*\n\
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n"
+printf "%s" "
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+"
pattern='^#define[ ]\(E[A-Z0-9]*\)[ ]*\([A-Z0-9]*\).*$'
replace='inline int \1 = \2;@#pragma D binding "1.0" \1'
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh
index cc3ef3cc9617..11b327cbff17 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh
@@ -24,37 +24,34 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
set -e
-BSDECHO=-e
+printf "%s" "
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
-echo ${BSDECHO} "\
-/*\n\
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n\
-\n\
#include <dt_errtags.h>
-\n\
-static const char *const _dt_errtags[] = {"
+
+static const char *const _dt_errtags[] = {
+"
pattern='^ \(D_[A-Z0-9_]*\),*'
replace=' "\1",'
sed -n "s/$pattern/$replace/p" || exit 1
-echo ${BSDECHO} "\
-};\n\
-\n\
-static const int _dt_ntag = sizeof (_dt_errtags) / sizeof (_dt_errtags[0]);\n\
-\n\
+printf "%s" "
+};
+
+static const int _dt_ntag = sizeof (_dt_errtags) / sizeof (_dt_errtags[0]);
+
const char *
dt_errtag(dt_errtag_t tag)
{
return (_dt_errtags[(tag > 0 && tag < _dt_ntag) ? tag : 0]);
-}"
+}
+"
exit 0
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh
index 5bb47cb1781f..c7c28e75364e 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh
@@ -24,33 +24,30 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
set -e
-BSDECHO=-e
+printf "%s" "
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <dtrace.h>
-echo ${BSDECHO} "\
-/*\n\
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n\
-\n\
-#include <dtrace.h>\n\
-\n\
/*ARGSUSED*/
-const char *\n\
-dtrace_subrstr(dtrace_hdl_t *dtp, int subr)\n\
-{\n\
- switch (subr) {"
+const char *
+dtrace_subrstr(dtrace_hdl_t *dtp, int subr)
+{
+ switch (subr) {
+"
nawk '
/^#define[ ]*DIF_SUBR_/ && $2 != "DIF_SUBR_MAX" {
printf("\tcase %s: return (\"%s\");\n", $2, tolower(substr($2, 10)));
}'
-echo ${BSDECHO} "\
- default: return (\"unknown\");\n\
- }\n\
-}"
+printf "%s" "
+ default: return (\"unknown\");
+ }
+}
+"
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh
index dce06a0e1797..2bd5ec92b43e 100755
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh
@@ -24,16 +24,15 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
set -e
-echo "\
-/*\n\
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n"
+printf "%s" "
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+"
pattern='^#define[ ]*_*\(SIG[A-Z0-9]*\)[ ]\{1,\}\([A-Z0-9]*\).*$'
replace='inline int \1 = \2;@#pragma D binding "1.0" \1'