Check compiler before adding clang-specific CFLAGS

This commit is contained in:
Quinn Evans 2015-10-03 13:39:17 -06:00
parent 8418abd91e
commit 55d447f30b
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,11 @@
#!/bin/sh
BUILD_COBOL=1
BUILD_C=1
if cc -v 2>&1 | grep 'clang' >/dev/null; then
CLANG=1
fi
args=`getopt dCc $*`
if [ $? -ne 0 ]; then
echo 'Usage: sh gnu-cobol.sh [-d]'
@ -32,6 +37,6 @@ if [ $BUILD_C ]; then
fi
if [ $BUILD_COBOL ]; then
${COBC:-cobc} ${DEBUG:+-fdebugging-line} -std=mvs -x WOPO-CNF.COB PRINTCNF.COB
${COBC:-cobc} ${DEBUG:+-fdebugging-line} -std=mvs -A "-fbracket-depth=512" -x WOPO.COB IRC-MSG.COB PRINTCNF.COB DECASCII.COB ENCASCII.COB DECSTR.COB ENCSTR.COB BF-RUN.COB channel.o
${COBC:-cobc} ${DEBUG:+-fdebugging-line} ${CLANG:+-A "-fbracket-depth=512"} -std=mvs -x WOPO.COB IRC-MSG.COB PRINTCNF.COB DECASCII.COB ENCASCII.COB DECSTR.COB ENCSTR.COB BF-RUN.COB channel.o
fi