Skip to content

Commit e3b504e

Browse files
committed
tools/faust2appls/faust2jaqt: Setting -eou pipefaul bash options. Guarding all potentially undefined variables and defining OSCLIBS (formerly wrongly defined as OSCLIB), OSCDEFS, HTTPLIBS, HTTPDEFS, QRDEFS, POLYDEFS and MIDIDEFS.
These definitions should go into a separate LIBS/DEFS array and plainly be added to on demand.
1 parent 6a8c287 commit e3b504e

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tools/faust2appls/faust2jaqt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
# #
88
#####################################################################
99

10-
set -e
11-
1210
. faustpath
1311
. faustoptflags
1412

13+
set -euo pipefail
14+
1515
CXXFLAGS=("$MYGCCFLAGS")
1616

1717
ARCHFILE="$FAUSTARCH/jack-qt.cpp"
@@ -34,8 +34,14 @@ QMAKE=$(command -v qmake-qt5 || command -v qmake)
3434

3535
OSCINC=""
3636
QTDEFS=""
37-
OSCLIB=""
37+
OSCLIBS=""
38+
OSCDEFS=""
39+
HTTPLIBS=""
40+
HTTPDEFS=""
3841
POLY="POLY"
42+
QRDEFS=""
43+
POLYDEFS=""
44+
MIDIDEFS=""
3945
DEPLOY=""
4046
NVOICES=-1
4147
SOUNDFILE="0"
@@ -47,9 +53,9 @@ SPEC=""
4753
FILES=()
4854
OPTIONS=()
4955

50-
while [ "$1" ]
56+
while [ "${1:-}" ]
5157
do
52-
p=$1
58+
p="${1:-}"
5359

5460
if [ "$p" = "-help" ] || [ "$p" = "-h" ]; then
5561
echo "faust2jaqt [-httpd] [-qrcode] [-soundfile] [-resample] [-nvoices <num>] [-effect auto|<effect.dsp>] [-midi] [-osc] [additional Faust options (-vec -vs 8...)] <file.dsp>"
@@ -195,7 +201,11 @@ EndOfCode
195201
# compile c++ to binary
196202
(
197203
cd "$TMP"
198-
"$QMAKE" -project "QT += widgets printsupport network" "CONFIG+=warn_off" "$CLANGOPT" "INCLUDEPATH+=$CUR" "INCLUDEPATH+=$FAUSTINC /opt/local/include" "QMAKE_CXXFLAGS=${CXXFLAGS[*]} -Wno-unused-parameter $FAUSTTOOLSFLAGS" "QMAKE_LFLAGS=$LFLAGS" "LIBS+=$ARCHLIB $SOUNDFILELIBS $SAMPLERATELIBS $OSCLIBS $HTTPLIBS" "HEADERS+=$FAUSTINC/faust/gui/QTUI.h" "RESOURCES+= $FAUSTINC/faust/gui/Styles/Grey.qrc" "$OSCDEFS" "$HTTPDEFS" "$QRDEFS" "$POLYDEFS" "$MIDIDEFS" "$SOUNDFILEDEFS" "$SAMPLERATEDEFS"
204+
if [ -n "${FAUSTTOOLSFLAGS:-}" ]; then
205+
"$QMAKE" -project "QT += widgets printsupport network" "CONFIG+=warn_off" "${CLANGOPT:-}" "INCLUDEPATH+=$CUR" "INCLUDEPATH+=$FAUSTINC /opt/local/include" "QMAKE_CXXFLAGS=${CXXFLAGS[*]} -Wno-unused-parameter ${FAUSTTOOLSFLAGS:-}" "QMAKE_LFLAGS=$LFLAGS" "LIBS+=$ARCHLIB $SOUNDFILELIBS $SAMPLERATELIBS $OSCLIBS $HTTPLIBS" "HEADERS+=$FAUSTINC/faust/gui/QTUI.h" "RESOURCES+= $FAUSTINC/faust/gui/Styles/Grey.qrc" "$OSCDEFS" "$HTTPDEFS" "$QRDEFS" "$POLYDEFS" "$MIDIDEFS" "$SOUNDFILEDEFS" "$SAMPLERATEDEFS"
206+
else
207+
"$QMAKE" -project "QT += widgets printsupport network" "CONFIG+=warn_off" "${CLANGOPT:-}" "INCLUDEPATH+=$CUR" "INCLUDEPATH+=$FAUSTINC /opt/local/include" "QMAKE_CXXFLAGS=${CXXFLAGS[*]} -Wno-unused-parameter" "QMAKE_LFLAGS=$LFLAGS" "LIBS+=$ARCHLIB $SOUNDFILELIBS $SAMPLERATELIBS $OSCLIBS $HTTPLIBS" "HEADERS+=$FAUSTINC/faust/gui/QTUI.h" "RESOURCES+= $FAUSTINC/faust/gui/Styles/Grey.qrc" "$OSCDEFS" "$HTTPDEFS" "$QRDEFS" "$POLYDEFS" "$MIDIDEFS" "$SOUNDFILEDEFS" "$SAMPLERATEDEFS"
208+
fi
199209
if [ -n "$SPEC" ]; then
200210
"$QMAKE" "$SPEC" QMAKE_CFLAGS_ISYSTEM=-I
201211
else

0 commit comments

Comments
 (0)