From f75ee32e7269fd462a47e839ba97a2bee6d0791e Mon Sep 17 00:00:00 2001 From: Nina Didenko Date: Tue, 5 Nov 2019 20:45:44 +0300 Subject: [PATCH] sym2num: don't hardcode path to cpp --- cde/programs/dtprintinfo/Imakefile | 2 +- cde/programs/dtprintinfo/sym2num | 15 +-------------- cde/programs/localized/templates/header2.tmpl | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/cde/programs/dtprintinfo/Imakefile b/cde/programs/dtprintinfo/Imakefile index 382ac172..de5f0365 100644 --- a/cde/programs/dtprintinfo/Imakefile +++ b/cde/programs/dtprintinfo/Imakefile @@ -72,7 +72,7 @@ ComplexCplusplusProgramTarget(dtprintinfo) dtprintinfo_msg.h dtprintinfo.msg: dtprintinfo.msg.src rm -f dtprintinfo_msg.h dtprintinfo.msg - $(SYM2NUM_CMD) dtprintinfo dtprintinfo.msg.src> dtprintinfo.msg + CPP="$(CPP)" $(SYM2NUM_CMD) dtprintinfo dtprintinfo.msg.src> dtprintinfo.msg dtprintinfo_cat.h: dtprintinfo.msg.src rm -f dtprintinfo_cat.h diff --git a/cde/programs/dtprintinfo/sym2num b/cde/programs/dtprintinfo/sym2num index 0f554d86..e9fe6eb4 100755 --- a/cde/programs/dtprintinfo/sym2num +++ b/cde/programs/dtprintinfo/sym2num @@ -53,21 +53,8 @@ awk '/^\$set/ { SET_NAME=$2; SET_COUNT++; MES_COUNT=0; # There are two differences between sym2num and mkcatdefs: sym2num # does not create a $delset line, and sym2num converts all symbols # to numbers, even those in comment statements. -if [[ -f /usr/ccs/lib/cpp ]] #IBM & SUN -then - cpp_path=/usr/ccs/lib -elif [[ -f /usr/libexec/cpp ]] #BSD -then - cpp_path=/usr/libexec -elif [[ -f /usr/bin/cpp ]] #BSD -then - cpp_path=/usr/bin -elif [[ -f /lib/cpp ]] #HP -then - cpp_path=/lib -fi ( cat ${inc_file} | sed -n /define/p ; cat ${SOURCE_FILE} ) | \ - ${cpp_path}/cpp -P | sed -e '/^$/d' -e 's/^\$$/\$ /' \ + ${CPP:-/lib/cpp} -P | sed -e '/^$/d' -e 's/^\$$/\$ /' \ -e 's/\"\"$/\"/' -e 's/XDQUOTE/\"/' -e "s/XSQUOTE/\'/" \ -e 's/^\([1-9][0-9]*\)[ ]*[\"]*\(\"\)\(.*\)/\1 \2\3/' diff --git a/cde/programs/localized/templates/header2.tmpl b/cde/programs/localized/templates/header2.tmpl index 9128f8f6..828a8700 100644 --- a/cde/programs/localized/templates/header2.tmpl +++ b/cde/programs/localized/templates/header2.tmpl @@ -55,7 +55,7 @@ dtprintinfo.cat: dtprintinfo.msg @@\ export LANG; \ @@\ LC_COLLATE=C; \ @@\ export LC_COLLATE; \ @@\ - $(SYM2NUM_CMD) $(@:.cat=) $(@:.cat=.msg) > tmp.msg; \ @@\ + CPP="$(CPP)" $(SYM2NUM_CMD) $(@:.cat=) $(@:.cat=.msg) > tmp.msg; \ @@\ $(GENCAT) $@ tmp.msg; \ @@\ rm -f tmp.msg $(@:.cat=_msg.h) \ @@\ ) @@\ -- 2.25.1