diff --git a/src/configure b/src/configure index 07f44037e..399331564 100755 --- a/src/configure +++ b/src/configure @@ -717,7 +717,6 @@ CORE_LIBS FASL_LIBS GMP_LDFLAGS GMP_CFLAGS -DEBUG_CFLAGS ECL_CFLAGS buildir ecldir @@ -798,6 +797,8 @@ enable_hpack enable_asmapply enable_smallcons enable_gengc +with_debug_cflags +with_profile_cflags with_x ' ac_precious_vars='build_alias @@ -1503,6 +1504,10 @@ Optional Packages: allow for IEEE signed zeros (default=YES). --with-ieee-fp={yes|no} full IEEE floating point system, including denormals (default=YES). Implies signed-zero and fpe + --with-debug-cflags add debug flags to the compiler invocation + (yes,no,actual flags,default=YES) + --with-profile-cflags add profiling flags to the compiler invocation + (yes,no,actual flags,default=NO) --with-x use the X Window System Some influential environment variables: @@ -2121,7 +2126,6 @@ else fi - # Check whether --enable-opcode8 was given. if test "${enable_opcode8+set}" = set; then enableval=$enable_opcode8; opcode8=${enableval} @@ -2321,6 +2325,25 @@ else fi + + +# Check whether --with-debug-cflags was given. +if test "${with_debug_cflags+set}" = set; then + withval=$with_debug_cflags; +else + with_debug_cflags="no" +fi + + + +# Check whether --with-profile-cflags was given. +if test "${with_profile_cflags+set}" = set; then + withval=$with_profile_cflags; +else + with_profile_cflags="no" +fi + + ecldir="${libdir}/ecl-${PACKAGE_VERSION}" test -z "${docdir}" && docdir="${datadir}/doc/ecl-${PACKAGE_VERSION}" @@ -2328,7 +2351,7 @@ test -z "${docdir}" && docdir="${datadir}/doc/ecl-${PACKAGE_VERSION}" boehm_configure_flags="" - TARGETS='bin/ecl$(EXE)' + TARGETS='bin/ecl$(EXE)' SUBDIRS=c LSP_FEATURES='*features*' @@ -4792,6 +4815,21 @@ if test "$ac_res" != no; then fi +if test "$with_debug_cflags" = "yes"; then + with_debug_cflags="-g" +fi +if test "$with_debug_cflags" != "no"; then + CFLAGS="$with_debug_cflags $CFLAGS" + LDFLAGS="$with_debug_cflags $LDFLAGS" +fi +if test "$with_profile_cflags" = "yes"; then + with_profile_cflags="-pg" +fi +if test "$with_profile_cflags" != "no"; then + CFLAGS="$with_profile_cflags $CFLAGS" + LDFLAGS="$with_profile_cflags $LDFLAGS" +fi + if test "${enable_threads}" = "auto"; then { $as_echo "$as_me:$LINENO: checking for threads support" >&5 $as_echo_n "checking for threads support... " >&6; } diff --git a/src/configure.in b/src/configure.in index 9291fc84c..b9e436d79 100644 --- a/src/configure.in +++ b/src/configure.in @@ -100,12 +100,6 @@ AC_ARG_WITH(__thread, [(supported by NPTL-aware glibc and maybe Windows)] ), [], [with___thread=auto]) -dnl AC_ARG_ENABLE(debug, -dnl AS_HELP_STRING( [--enable-debug], -dnl [enable various debugging features] -dnl [(default=NO)]), -dnl [DEBUG_CFLAGS="-g -O0"; CFLAGS="$CFLAGS -g -O0"],[]) - AC_ARG_ENABLE(opcode8, AS_HELP_STRING( [--enable-opcode8], [interpreter uses 8-bit codes] @@ -234,6 +228,24 @@ AC_ARG_ENABLE(gengc, [(no|yes, default=NO)]), [], [enable_gengc=no] ) +dnl AC_ARG_ENABLE(debug, +dnl AS_HELP_STRING( [--enable-debug], +dnl [enable various debugging features] +dnl [(default=NO)]), +dnl [DEBUG_CFLAGS="-g -O0"; CFLAGS="$CFLAGS -g -O0"],[]) + +AC_ARG_WITH(debug-cflags, + AS_HELP_STRING( [--with-debug-cflags], + [add debug flags to the compiler invocation] + [(yes,no,actual flags,default=YES)]), + [],[with_debug_cflags="no"]) + +AC_ARG_WITH(profile-cflags, + AS_HELP_STRING( [--with-profile-cflags], + [add profiling flags to the compiler invocation] + [(yes,no,actual flags,default=NO)]), + [],[with_profile_cflags="no"]) + dnl ----------------------------------------------------------------------- dnl Installation directories ecldir="${libdir}/ecl-${PACKAGE_VERSION}" @@ -248,7 +260,6 @@ boehm_configure_flags="" AC_EXEEXT dnl Guess whether .exe is needed for executables AC_SUBST(buildir) dnl For top-level Makefile.in AC_SUBST(ECL_CFLAGS) dnl Similar, but specific to ECL (see src/util/ecl-config) -AC_SUBST(DEBUG_CFLAGS) dnl Additional flags when debugging AC_SUBST(GMP_CFLAGS) dnl CFLAGS needed for compiling with system GMP library AC_SUBST(GMP_LDFLAGS) dnl LDFLAGS needed for compiling with system GMP library AC_SUBST(FASL_LIBS) dnl Libraries to link into all ecl code but not @@ -310,6 +321,24 @@ LIBS="${LIBS} -lm" AC_CHECK_LIB(sun, getpwnam) # on IRIX adds -lsun AC_ISC_POSIX +dnl ---------------------------------------------------------------------- +dnl Profiling & debug flags +dnl +if test "$with_debug_cflags" = "yes"; then + with_debug_cflags="-g" +fi +if test "$with_debug_cflags" != "no"; then + CFLAGS="$with_debug_cflags $CFLAGS" + LDFLAGS="$with_debug_cflags $LDFLAGS" +fi +if test "$with_profile_cflags" = "yes"; then + with_profile_cflags="-pg" +fi +if test "$with_profile_cflags" != "no"; then + CFLAGS="$with_profile_cflags $CFLAGS" + LDFLAGS="$with_profile_cflags $LDFLAGS" +fi + dnl ---------------------------------------------------------------------- dnl Native thread support if test "${enable_threads}" = "auto"; then