Added profile support to configure/Makefile (--enable-profile). If you

know what this is, you'll know how to use it :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@996 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-02-01 13:53:25 +00:00
parent d91443ed89
commit a30149355a
2 changed files with 29 additions and 3 deletions

View File

@ -13,7 +13,7 @@
## See the file "license" for information on usage and redistribution of ## See the file "license" for information on usage and redistribution of
## this file, and for a DISCLAIMER OF ALL WARRANTIES. ## this file, and for a DISCLAIMER OF ALL WARRANTIES.
## ##
## $Id: Makefile,v 1.17 2006-01-15 21:02:22 stephena Exp $ ## $Id: Makefile,v 1.18 2006-02-01 13:53:25 stephena Exp $
## ##
## Based on code from ScummVM - Scumm Interpreter ## Based on code from ScummVM - Scumm Interpreter
## Copyright (C) 2002-2004 The ScummVM project ## Copyright (C) 2002-2004 The ScummVM project
@ -30,6 +30,7 @@ LDFLAGS :=
INCLUDES := INCLUDES :=
LIBS := LIBS :=
OBJS := OBJS :=
PROF :=
MODULES := MODULES :=
MODULE_DIRS := MODULE_DIRS :=
@ -47,7 +48,15 @@ ifdef CXXFLAGS
else else
CXXFLAGS:= -O2 CXXFLAGS:= -O2
endif endif
CXXFLAGS+= -Wall -Wno-multichar -Wunused -fomit-frame-pointer -fno-rtti CXXFLAGS+= -Wall -Wno-multichar -Wunused -fno-rtti
ifdef PROFILE
PROF:= -g -pg -fprofile-arcs -ftest-coverage
CXXFLAGS+= $(PROF)
else
CXXFLAGS+= -fomit-frame-pointer
endif
# Even more warnings... # Even more warnings...
#CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion #CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion
#CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor #CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor
@ -100,7 +109,7 @@ DEPFILES =
# The build rule for the Stella executable # The build rule for the Stella executable
$(EXECUTABLE): $(OBJS) $(EXECUTABLE): $(OBJS)
$(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@ $(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) $(PROF) -o $@
distclean: clean distclean: clean
$(RM_REC) $(DEPDIRS) $(RM_REC) $(DEPDIRS)

17
stella/configure vendored
View File

@ -26,6 +26,7 @@ _build_snapshot=yes
_build_joystick=yes _build_joystick=yes
_build_cheats=yes _build_cheats=yes
_build_static=no _build_static=no
_build_profile=no
# more defaults # more defaults
_ranlib=ranlib _ranlib=ranlib
@ -267,6 +268,8 @@ Optional Features:
--enable-shared build shared binary [enabled] --enable-shared build shared binary [enabled]
--enable-static build static binary (if possible) [disabled] --enable-static build static binary (if possible) [disabled]
--disable-static --disable-static
--enable-profile build binary with profiling info [disabled]
--disable-profile
Optional Libraries: Optional Libraries:
--with-zlib-prefix=DIR Prefix where zlib is installed (optional) --with-zlib-prefix=DIR Prefix where zlib is installed (optional)
@ -318,6 +321,8 @@ for ac_option in $@; do
--enable-shared) _build_static=no ;; --enable-shared) _build_static=no ;;
--enable-static) _build_static=yes ;; --enable-static) _build_static=yes ;;
--disable-static) _build_static=no ;; --disable-static) _build_static=no ;;
--enable-profile) _build_profile=yes ;;
--disable-profile) _build_profile=no ;;
--with-zlib-prefix=*) --with-zlib-prefix=*)
_prefix=`echo $ac_option | cut -d '=' -f 2` _prefix=`echo $ac_option | cut -d '=' -f 2`
ZLIB_CFLAGS="-I$_prefix/include" ZLIB_CFLAGS="-I$_prefix/include"
@ -742,6 +747,14 @@ else
echo echo
fi fi
if test "$_build_profile" = yes ; then
echo_n " Profiling enabled"
echo
else
echo_n " Profiling disabled"
echo
fi
# #
# Now, add the appropriate defines/libraries/headers # Now, add the appropriate defines/libraries/headers
@ -862,6 +875,9 @@ if test "$_build_cheats" = yes ; then
INCLUDES="$INCLUDES -I$CHEAT" INCLUDES="$INCLUDES -I$CHEAT"
fi fi
if test "$_build_profile" = no ; then
_build_profile=
fi
# 20051003 bkw: fix static Linux build. # 20051003 bkw: fix static Linux build.
# No guarantee this will work for anyone other than me, and no # No guarantee this will work for anyone other than me, and no
@ -909,6 +925,7 @@ PREFIX := $_prefix
BINDIR := $_bindir BINDIR := $_bindir
DOCDIR := $_docdir DOCDIR := $_docdir
DATADIR := $_datadir DATADIR := $_datadir
PROFILE := $_build_profile
$_make_def_HAVE_GCC3 $_make_def_HAVE_GCC3
#$_make_def_HAVE_NASM #$_make_def_HAVE_NASM