]> granicus.if.org Git - strace/commitdiff
Makefile.am: pass D variable to shell scripts' environment
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 18 Feb 2019 23:01:01 +0000 (00:01 +0100)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 22 Feb 2019 12:14:52 +0000 (13:14 +0100)
And set -x if D is set to 1, so the commands called by various shell scripts
are easier to see during debugging.

* Makefile.am (bpf_attr_check.c, sen.h, mpers-m%.stamp, $(srcdir)/CREDITS): Pass
D variable in the environment to the shell script call.
* gen_bpf_attr_check.sh: Set -x if D is set to 1.
* generate_mpers_am.sh: Likewise.
* generate_sen.sh: Likewise.
* maint/gen-contributors-list.sh: Likewise.
* mpers.sh: Likewise.
* mpers_test.sh: Likewise.

Makefile.am
gen_bpf_attr_check.sh
generate_mpers_am.sh
generate_sen.sh
maint/gen-contributors-list.sh
mpers.sh
mpers_test.sh

index 0e26296f0ecd3687a18bda91306bb826342d5ff1..de994b1c6219f97c31227c0636ea9df199ad5a13 100644 (file)
@@ -927,6 +927,7 @@ $(srcdir)/.version:
        $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
 
 bpf_attr_check.c: $(srcdir)/bpf_attr.h $(srcdir)/gen_bpf_attr_check.sh
+       D="$(D)" \
        $(srcdir)/gen_bpf_attr_check.sh $< > $@-t && mv $@-t $@
 
 strace_SOURCES_c = \
@@ -946,6 +947,7 @@ syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
 
 sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
        for f in $^; do cat -- $$f; done | \
+               D="$(D)" \
                $(srcdir)/generate_sen.sh > $@
 
 dist-hook:
@@ -1037,6 +1039,7 @@ libmpers_CFLAGS = $(strace_CFLAGS)
 
 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
        for f in $^; do \
+               D="$(D)" \
                READELF="$(READELF)" \
                CC="$(CC)" \
                CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
@@ -1155,6 +1158,8 @@ $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
                   $(srcdir)/Makefile.in $(srcdir)/.version
        $(AM_V_GEN)                                                     \
        (                                                               \
+         D="$(D)";                                                     \
+         export D;                                                     \
          cd $(srcdir);                                                 \
          sed '/^##/,$$d' CREDITS.in;                                   \
          sed -n '1,/^##>/d; s/   */\t/; s/^./&/p' CREDITS.in           \
index 36e3350fa75dd57a87adef20905e1e79cfb5ed1e..686027e9ecb575a94b32c1478360a87d717272cc 100755 (executable)
@@ -4,6 +4,8 @@
 #
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
+[ "x${D:-0}" != x1 ] || set -x
+
 input="$1"
 shift
 
index 7cd53438e17b562773c89a4988689d7f49b572eb..b35bcc6a3d35fba0c4808e5877b5b60776444f6b 100755 (executable)
@@ -5,6 +5,8 @@
 #
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
+[ "x${D:-0}" != x1 ] || set -x
+
 list="$(sed -r -n '/^strace_SOURCES[[:space:]]*=/,/^[[:space:]]*# end of strace_SOURCES/ s/^[[:space:]]*([[:alnum:]][^.]*\.c)[[:space:]]*\\$/\1/p' Makefile.am |
        xargs -r grep -Elx '#[[:space:]]*include[[:space:]]+MPERS_DEFS' |
        tr '\n' ' ')"
index 39c967728060bbc25f9dda49feeaa82dc907ca06..ef35fd5b339fd4f0ec4268fdf0dcfba9ff4b64f8 100755 (executable)
@@ -5,6 +5,8 @@
 #
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
+[ "x${D:-0}" != x1 ] || set -x
+
 echo 'enum {'
 echo 'SEN_printargs = 0,'
     sed -r -n '/printargs/! s/.*SEN\(([^)]+)\).*/\1/p' |
index 479f08c79617ab19bd480b025eee2c1558f066dd..8dfca4a97b1f64e741f90641a4d0a20b24e0195d 100755 (executable)
@@ -5,6 +5,8 @@
 #
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
+[ "x${D:-0}" != x1 ] || set -x
+
 print_help()
 {
        cat <<__EOF__
index 5f451cce2d97599cf7ff6c459a29b21ac2aa376d..7d226e0785ac47ba2752a4110c335fec217defb5 100755 (executable)
--- a/mpers.sh
+++ b/mpers.sh
@@ -6,6 +6,8 @@
 #
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
+[ "x${D:-0}" != x1 ] || set -x
+
 export LC_ALL=C
 
 MPERS_AWK="${0%/*}/mpers.awk"
index dc1868e3522f7ed5f491721a7a3ed177ff4d0a07..32e39af44ddea6afeb60569f8dc310cb6d6c28b2 100755 (executable)
@@ -7,6 +7,8 @@
 #
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
+[ "x${D:-0}" != x1 ] || set -x
+
 mpers_name="$1"; shift
 mpers_cc_flags="$1"; shift
 size="$(printf %s "$mpers_name" |tr -cd '[0-9]')"