* Rework the debugging flags to set the variables conditionally on either being

enabled.
* Fix some cut-and-paste-o's (dunno how I managed these)
* Move AC_SUBST* outside of the conditionally enabled blocks
* Fix typo.

Originally committed to SVN as r2746.
This commit is contained in:
Amar Takhar 2009-02-22 22:01:14 +00:00
parent 4960863be2
commit bf730cf96e
2 changed files with 31 additions and 33 deletions

View file

@ -14,7 +14,7 @@ AM_CXXFLAGS = -DAEGISUB -Iinclude @WX_CPPFLAGS@ @OPENMP_CXXFLAGS@ @LIBAVFORMAT_C
bin_PROGRAMS = aegisub-2.1
aegisub_2_1_LDADD = libresrc/libresrc.a $(libosxutil_lib)
aegisub_2_1_CPPFLAGS = @FREETYPE_CFLAGS@ @GCOV_FLAGS@
aegisub_2_1_CPPFLAGS = @FREETYPE_CFLAGS@
aegisub_2_1_LDFLAGS = @DEBUG_FLAGS@ @PROFILE_FLAGS@ @GL_LIBS@ @PTHREAD_LIBS@ @WX_LIBS@ @ICONV_LDFLAGS@ $(libosxutil_ldflags) @CCMALLOC_LDFLAGS@ @EFENCE_LDFLAGS@
LIBS += @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @CCMALLOC_LIBS@

View file

@ -1046,13 +1046,14 @@ fi
######################################################
AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable-debug (default: -g)])
if test -z "$DEBUG_FLAGS"; then
DEBUG_FLAGS="-g";
fi
AC_MSG_CHECKING([whether to turn on debugging])
AC_ARG_ENABLE(debug, [ --enable-debug enable debugging (default=no)])
if test "$enable_debug" = "yes"; then
if test -z "$DEBUG_FLAGS"; then
DEBUG_FLAGS="-g";
fi
AC_MSG_RESULT([yes ($DEBUG_FLAGS)])
CPPFLAGS="$DEBUG_FLAGS $CPPFLAGS"
msg_debug="($DEBUG_FLAGS)"
@ -1079,16 +1080,15 @@ fi
###########
AC_ARG_VAR([PROFILE_FLAGS], [Profile flag(s) to use with --enable-profile (default: -pg)])
if test -z "$PROFILE_FLAGS"; then
PROFILE_FLAGS="-pg";
fi
AC_MSG_CHECKING([whether to turn on profiling])
AC_ARG_ENABLE(profile, [ --enable-profile enable profiling (default=no)])
if test "$enable_profile" = "yes"; then
if test -z "$PROFILE_FLAGS"; then
PROFILE_FLAGS="-pg";
fi
AC_MSG_RESULT([yes ($PROFILE_FLAGS)])
CPPFLAGS="$PROFILE_FLAGS $CPPFLAGS"
AC_SUBST(PROFILE_FLAGS)
else
enable_profile="no"
AC_MSG_RESULT([no])
@ -1100,16 +1100,17 @@ fi
######
AC_ARG_VAR([GCOV_FLAGS], [gcov flag(s) to use with --enable-gcov (default: -ftest-coverage -fprofile-arcs)])
AC_MSG_CHECKING([whether to turn on gcov])
AC_ARG_ENABLE(gcov, [ --enable-gcov enable gcov (default=no)])
if test "$enable_gcov" = "yes"; then
if test -z "$GCOV_FLAGS"; then
GCOV_FLAGS="-fprofile-arcs -ftest-coverage";
fi
AC_MSG_CHECKING([whether to turn on gcov])
AC_ARG_ENABLE(profile, [ --enable-gcov enable gcov (default=no)])
if test "$enable_gcov" = "yes"; then
AC_MSG_RESULT([yes ($GCOV_FLAGS)])
CPPFLAGS="$GCOV_FLAGS $CPPFLAGS"
AC_SUBST(GCOV_FLAGS)
CFLAGS="$CFLAGS $GCOV_FLAGS"
CPPFLAGS="$CPPFLAGS $GCOV_FLAGS"
else
enable_gcov="no"
AC_MSG_RESULT([no])
@ -1122,20 +1123,19 @@ fi
################
AC_ARG_VAR([EFENCE_LDFLAGS], [Electric Fence ldflag(s) to use with --enable-profile (default: -lefence)])
if test -z "EFENCE_LDFLAGS"; then
EFENCE_LDFLAGS="-pg -fprofile-arcs -ftest-coverage";
fi
AC_MSG_CHECKING([whether turn on Electric Fence])
AC_ARG_ENABLE(profile, [ --enable-efence enable Electric Fence (default=no)])
AC_MSG_CHECKING([whether to turn on Electric Fence])
AC_ARG_ENABLE(efence, [ --enable-efence enable Electric Fence (default=no)])
if test "$enable_efence" = "yes"; then
if test -z "$EFENCE_LDFLAGS"; then
EFENCE_LDFLAGS="-lefence";
fi
AC_MSG_RESULT([yes ($EFENCE_LDFLAGS)])
CPPFLAGS="$EFENCE_LDFLAGS $CPPFLAGS"
AC_SUBST(EFENCE_LDFLAGS)
else
enable_efence="no"
AC_MSG_RESULT([no])
fi
AC_SUBST(EFENCE_LDFLAGS)
##########
# ccmalloc
@ -1144,25 +1144,23 @@ fi
AC_ARG_VAR([CCMALLOC_LIBS], [ccmalloc libs(s) to use with --enable-ccmalloc (default: $prefix/lib/ccmalloc-c++.o)])
AC_ARG_VAR([CCMALLOC_LDFLAGS], [ccmalloc ldflag(s) to use with --enable-ccmalloc (default: -lccmalloc)])
AC_MSG_CHECKING([whether to turn on ccmalloc])
AC_ARG_ENABLE(ccmalloc, [ --enable-ccmalloc enable ccmalloc (default=no)])
if test "$enable_ccmalloc" = "yes"; then
if test -z "$CCMALLOC_LIBS"; then
CCMALLOC_LIBS="$prefix/lib/ccmalloc-c++.o";
fi
if test -z "$CCMALLOC_LIBS"; then
if test -z "$CCMALLOC_LDFLAGS"; then
CCMALLOC_LDFLAGS="-lccmalloc";
fi
AC_MSG_CHECKING([whether to turn on ccmalloc])
AC_ARG_ENABLE(profile, [ --enable-ccmalloc enable ccmalloc (default=no)])
if test "$enable_ccmalloc" = "yes"; then
AC_MSG_RESULT([yes ($CCMALLOC_LIBS $CCMALLOC_LDFLAGS)])
CPPFLAGS="$CCMALLOC_LIBS $CCMALLOC_LDFLAGS $CPPFLAGS"
AC_SUBST(CCMALLOC_LDFLAGS)
AC_SUBST(CCMALLOC_LIBS)
else
enable_ccmalloc="no"
AC_MSG_RESULT([no])
fi
AC_SUBST(CCMALLOC_LDFLAGS)
AC_SUBST(CCMALLOC_LIBS)
if test "$enable_efence" = "yes" && test "$enable_ccmalloc" = "yes"; then
AC_MSG_FAILURE([Please enable Electric Fence _or_ ccmalloc otherwise strange things will happen.])