Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

Commit

Permalink
Normalized build system to work on both linux and osx.
Browse files Browse the repository at this point in the history
  • Loading branch information
zenspider committed Apr 6, 2015
1 parent dc1700c commit 57a674b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/kernel/parser/parser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,21 @@ fi
case $OS in
"Linux" )
EXT=so
OSLDFLAGS="-Wl,--version-script=magparse.exp -Wl,--warn-unresolved-symbols -Wl,-Bdynamic,-hlibmagparse.${EXT} -lcrypt -lrt"
OSCCWARN="-Wformat"
OSCCINC=""
;;
"Darwin")
EXT=dylib
OSLDFLAGS="-Wl,-flat_namespace -Wl,-undefined -Wl,warning -Wl,-exported_symbols_list -Wl,magparse.osx.exp"
OSCCWARN=""
OSCCINC="-I/usr/local/Cellar/icu4c/54.1/include"
;;
esac

# TODO: probably need to push this into the above case for OS/compiler specifics
CCWARN="-Wchar-subscripts -Wcomment -Werror -Wformat -Wmissing-braces -Wmultichar -Wno-aggregate-return -Wno-unused-function -Wparentheses -Wreturn-type -Wshadow -Wsign-compare -Wsign-promo -Wswitch -Wsystem-headers -Wtrigraphs -Wtrigraphs -Wuninitialized -Wunused-label -Wunused-value -Wunused-variable -Wwrite-strings"
CCWARN="-Wchar-subscripts -Wcomment -Werror -Wmissing-braces -Wmultichar -Wno-aggregate-return -Wno-unused-function -Wparentheses -Wreturn-type -Wshadow -Wsign-compare -Wsign-promo -Wswitch -Wsystem-headers -Wtrigraphs -Wtrigraphs -Wuninitialized -Wunused-label -Wunused-value -Wunused-variable -Wwrite-strings $OSCCWARN"
CCDEF="-DFLG_FAST=1 -DNOT_JAVA_VM -D_GNU_SOURCE -D_REENTRANT"
CCINC="-I$GEMSTONE/include -I."
CCINC="-I$GEMSTONE/include -I. $OSCCINC"
CFLAGS="$CCDEF $CCINC $CCWARN -O3 -fPIC -fcheck-new -fmessage-length=0 -fno-exceptions -fno-strict-aliasing -g -m64 -pipe -pthread -x c++"

$CC $CFLAGS -c rubygrammar.c -o rubygrammar.o
Expand All @@ -67,7 +72,7 @@ fi
rm -f libmagparse.${EXT}

echo "Linking libmagparse.${EXT}"
LDFLAGS="-shared -Wl,--version-script=magparse.exp -Wl,--warn-unresolved-symbols -Wl,-Bdynamic,-hlibmagparse.${EXT} -lc -lcrypt -ldl -lm -lpthread -lrt -m64"
LDFLAGS="-shared -lc -ldl -lm -lpthread -m64 $OSLDFLAGS"

$CC $LDFLAGS rubyast.o rubygrammar.o -o libmagparse.${EXT}

Expand Down

0 comments on commit 57a674b

Please sign in to comment.