Skip to content

Commit

Permalink
tools/faust2appls/faust2jaqt: Setting -eou pipefaul bash options. Gua…
Browse files Browse the repository at this point in the history
…rding 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.
  • Loading branch information
dvzrv committed Dec 13, 2019
1 parent 6a8c287 commit e3b504e
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tools/faust2appls/faust2jaqt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
# #
#####################################################################

set -e

. faustpath
. faustoptflags

set -euo pipefail

CXXFLAGS=("$MYGCCFLAGS")

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

OSCINC=""
QTDEFS=""
OSCLIB=""
OSCLIBS=""
OSCDEFS=""
HTTPLIBS=""
HTTPDEFS=""
POLY="POLY"
QRDEFS=""
POLYDEFS=""
MIDIDEFS=""
DEPLOY=""
NVOICES=-1
SOUNDFILE="0"
Expand All @@ -47,9 +53,9 @@ SPEC=""
FILES=()
OPTIONS=()

while [ "$1" ]
while [ "${1:-}" ]
do
p=$1
p="${1:-}"

if [ "$p" = "-help" ] || [ "$p" = "-h" ]; then
echo "faust2jaqt [-httpd] [-qrcode] [-soundfile] [-resample] [-nvoices <num>] [-effect auto|<effect.dsp>] [-midi] [-osc] [additional Faust options (-vec -vs 8...)] <file.dsp>"
Expand Down Expand Up @@ -195,7 +201,11 @@ EndOfCode
# compile c++ to binary
(
cd "$TMP"
"$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"
if [ -n "${FAUSTTOOLSFLAGS:-}" ]; then
"$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"
else
"$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"
fi
if [ -n "$SPEC" ]; then
"$QMAKE" "$SPEC" QMAKE_CFLAGS_ISYSTEM=-I
else
Expand Down

0 comments on commit e3b504e

Please sign in to comment.