Improve 64-bit compiler and platform checks.

Ensure core dumps are enabled during testing.
This commit is contained in:
Moinak Ghosh 2012-12-17 18:37:27 +05:30
parent fb30b5c295
commit 25bb54e3bc
2 changed files with 18 additions and 7 deletions

View file

@ -266,7 +266,7 @@ $(PROG): $(OBJS)
$(LINK) -o $@ $(OBJS) $(LDLIBS) $(LINK) -o $@ $(OBJS) $(LDLIBS)
test: all test: all
(cd test; sh ./run_test.sh) 2>&1 | tee test.log (cd test; ulimit -c unlimited; sh ./run_test.sh) 2>&1 | tee test.log
clean: clean:
$(RM) $(PROG) $(OBJS) $(BAKFILES) $(RM) $(PROG) $(OBJS) $(BAKFILES)

15
config
View file

@ -82,17 +82,28 @@ fi
gcc -v 2>&1 | grep lto > /dev/null gcc -v 2>&1 | grep lto > /dev/null
[ $? -eq 0 ] && lto_flag="-flto" [ $? -eq 0 ] && lto_flag="-flto"
# Check bitness of system # Check bitness of system/toolchain
bitness=`./tst` bitness=`./tst`
rm -f tst tst.c
if [ $bitness -lt 8 ] if [ $bitness -lt 8 ]
then then
# Hmmm maybe default compilation is 32-bit. Re-try with m64 flag.
gcc -m64 tst.c -o tst
if [ $? -ne 0 ]
then
rm -f tst tst.c
echo "ERROR:" echo "ERROR:"
echo "Only 64-bit platforms are supported." echo "Only 64-bit platforms are supported."
echo "" echo ""
exit 1 exit 1
fi fi
# If m64 compilation succeeds we assume platform to be 64-bit capable but
# explicit flag is reqd.
# Instead of setting another variable lets cheat by plugging m64 into lto_flag!
lto_flag="${lto_flag} -m64"
fi
rm -f tst tst.c
while [ "${arg1}" != "" ] while [ "${arg1}" != "" ]
do do
case "$arg1" in case "$arg1" in