Search
lxdream.org :: lxdream :: r909:b4a21af8ce8c
lxdream 0.9.1
released Jun 29
Download Now
changeset909:b4a21af8ce8c
parent908:a00debcf2600
child910:661367ef919d
authornkeynes
dateThu Oct 30 23:56:59 2008 +0000 (15 years ago)
Add --enable-profiled configure option for convenience (and enable fastcall only on fully optimized builds)
config.h.in
configure
configure.in
src/lxdream.h
1.1 --- a/config.h.in Thu Oct 30 05:50:21 2008 +0000
1.2 +++ b/config.h.in Thu Oct 30 23:56:59 2008 +0000
1.3 @@ -46,6 +46,9 @@
1.4 /* Have exception stack-frame information */
1.5 #undef HAVE_EXCEPTIONS
1.6
1.7 +/* Use fast register-passing calling conventions */
1.8 +#undef HAVE_FASTCALL
1.9 +
1.10 /* Define if the GNU gettext() function is already present or preinstalled. */
1.11 #undef HAVE_GETTEXT
1.12
2.1 --- a/configure Thu Oct 30 05:50:21 2008 +0000
2.2 +++ b/configure Thu Oct 30 23:56:59 2008 +0000
2.3 @@ -805,6 +805,7 @@
2.4 enable_strict_warn
2.5 enable_translator
2.6 enable_optimized
2.7 +enable_profiled
2.8 enable_trace
2.9 enable_watch
2.10 enable_sh4stats
2.11 @@ -1473,6 +1474,7 @@
2.12 --disable-translator Disable the SH4 translator (Enabled by default)
2.13 --disable-optimized Disable compile-time optimizations (Enabled by
2.14 default)
2.15 + --enable-profiled Enable profiling build (implies disable-optimized)
2.16 --enable-trace Enable generation of IO traces (warning: hurts
2.17 performance)
2.18 --enable-watch Enable watchpoints in the debugger (warning: hurts
2.19 @@ -6575,6 +6577,13 @@
2.20 enable_optimized=yes
2.21 fi
2.22
2.23 +# Check whether --enable-profiled was given.
2.24 +if test "${enable_profiled+set}" = set; then
2.25 + enableval=$enable_profiled; if test "$enableval" == "yes"; then
2.26 + enable_profiled=yes;
2.27 + fi
2.28 +fi
2.29 +
2.30 # Check whether --enable-trace was given.
2.31 if test "${enable_trace+set}" = set; then
2.32 enableval=$enable_trace; if test "$enableval" == "yes"; then
2.33 @@ -6638,11 +6647,25 @@
2.34
2.35
2.36
2.37 -if test "x$enable_optimized" = "xyes"; then
2.38 - CFLAGS="-g -O2"
2.39 +if test "x$enable_profiled" = "xyes"; then
2.40 + CFLAGS="-g -pg -fprofile-arcs"
2.41 + LDFLAGS="$LDFLAGS -pg";
2.42 +elif test "x$enable_optimized" = "xyes"; then
2.43 + CFLAGS="-g -O2 -fexceptions -fomit-frame-pointer"
2.44 +
2.45 +cat >>confdefs.h <<\_ACEOF
2.46 +#define HAVE_EXCEPTIONS 1
2.47 +_ACEOF
2.48 +
2.49 +
2.50 +cat >>confdefs.h <<\_ACEOF
2.51 +#define HAVE_FASTCALL 1
2.52 +_ACEOF
2.53 +
2.54 else
2.55 CFLAGS="-g3"
2.56 fi
2.57 +
2.58 if test "x$GCC" = "xyes"; then
2.59 CFLAGS="$CFLAGS -fno-strict-aliasing"
2.60 fi
2.61 @@ -6865,14 +6888,6 @@
2.62 _ACEOF
2.63
2.64 fi
2.65 -if test "x$enable_optimized" = "xyes"; then
2.66 - CFLAGS="$CFLAGS -fexceptions -fomit-frame-pointer"
2.67 -
2.68 -cat >>confdefs.h <<\_ACEOF
2.69 -#define HAVE_EXCEPTIONS 1
2.70 -_ACEOF
2.71 -
2.72 -fi
2.73
2.74
2.75
3.1 --- a/configure.in Thu Oct 30 05:50:21 2008 +0000
3.2 +++ b/configure.in Thu Oct 30 23:56:59 2008 +0000
3.3 @@ -28,6 +28,11 @@
3.4 AC_ARG_ENABLE( optimized,
3.5 AS_HELP_STRING( [--disable-optimized], [Disable compile-time optimizations (Enabled by default)]),
3.6 [true], [enable_optimized=yes] )
3.7 +AC_ARG_ENABLE( profiled,
3.8 + AS_HELP_STRING( [--enable-profiled], [Enable profiling build (implies disable-optimized)]),
3.9 + [if test "$enableval" == "yes"; then
3.10 + enable_profiled=yes;
3.11 + fi] )
3.12 AC_ARG_ENABLE( trace,
3.13 AS_HELP_STRING( [--enable-trace], [Enable generation of IO traces (warning: hurts performance)]),
3.14 [if test "$enableval" == "yes"; then
3.15 @@ -55,11 +60,17 @@
3.16
3.17 dnl ------------
3.18
3.19 -if test "x$enable_optimized" = "xyes"; then
3.20 - CFLAGS="-g -O2"
3.21 -else
3.22 +if test "x$enable_profiled" = "xyes"; then
3.23 + CFLAGS="-g -pg -fprofile-arcs"
3.24 + LDFLAGS="$LDFLAGS -pg";
3.25 +elif test "x$enable_optimized" = "xyes"; then
3.26 + CFLAGS="-g -O2 -fexceptions -fomit-frame-pointer"
3.27 + AC_DEFINE(HAVE_EXCEPTIONS, [1], [Have exception stack-frame information])
3.28 + AC_DEFINE(HAVE_FASTCALL, [1], [Use fast register-passing calling conventions])
3.29 +else
3.30 CFLAGS="-g3"
3.31 fi
3.32 +
3.33 if test "x$GCC" = "xyes"; then
3.34 CFLAGS="$CFLAGS -fno-strict-aliasing"
3.35 fi
3.36 @@ -91,10 +102,6 @@
3.37 if test "x$HAVE_COCOA" = 'xyes' -a "x$with_gtk" = "xno"; then
3.38 AC_DEFINE(OSX_BUNDLE, [1], [Generating a bundled application])
3.39 fi
3.40 -if test "x$enable_optimized" = "xyes"; then
3.41 - CFLAGS="$CFLAGS -fexceptions -fomit-frame-pointer"
3.42 - AC_DEFINE(HAVE_EXCEPTIONS, [1], [Have exception stack-frame information])
3.43 -fi
3.44
3.45 dnl ----------- Check for mandatory dependencies --------------
3.46 dnl Check for libpng (required)
4.1 --- a/src/lxdream.h Thu Oct 30 05:50:21 2008 +0000
4.2 +++ b/src/lxdream.h Thu Oct 30 23:56:59 2008 +0000
4.3 @@ -91,11 +91,6 @@
4.4 const char *get_sysconf_path();
4.5 const char *get_locale_path();
4.6
4.7 -/* Use fast (regparam) calling conventions for core code - for now just turn it
4.8 - * on always, but define the macro in case we need to remove it for some platforms
4.9 - */
4.10 -#define HAVE_FASTCALL 1
4.11 -
4.12 #ifdef HAVE_FASTCALL
4.13 #define FASTCALL __attribute__((regparm(3)))
4.14 #else
.