mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r29127] Moved the --enable-build-mode check in configure.ac to after the
platform-specific build information so the debug and production flags are not clobbered. Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1 autotools serial (production & debug)
This commit is contained in:
parent
944e932662
commit
6731dca11f
108
configure.ac
108
configure.ac
@ -157,60 +157,6 @@ AC_MSG_RESULT([done])
|
||||
AC_SUBST([UNAME_INFO])
|
||||
UNAME_INFO=`uname -a`
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Determine build mode (debug, production, clean).
|
||||
## This has to be done early since the build mode is referred to
|
||||
## frequently.
|
||||
##
|
||||
AC_MSG_CHECKING([build mode])
|
||||
AC_ARG_ENABLE([build-mode],
|
||||
[AS_HELP_STRING([--enable-build-mode=(debug|production|clean)],
|
||||
[Sets the build mode. Debug turns on symbols, API
|
||||
tracing, asserts, and debug optimization,
|
||||
as well as several other minor configure options
|
||||
that aid in debugging.
|
||||
Production turns high optimizations on.
|
||||
Clean turns nothing on and disables optimization
|
||||
(i.e.: a 'clean slate' configuration).
|
||||
All these settings can be overridden by using
|
||||
specific configure flags.
|
||||
[default=debug]
|
||||
])],
|
||||
[BUILD_MODE=$enableval])
|
||||
|
||||
## Set the default
|
||||
## Depends on branch, set via script at branch creation time
|
||||
if test "X-$BUILD_MODE" = X- ; then
|
||||
BUILD_MODE=debug
|
||||
fi
|
||||
|
||||
## Allow this variable to be substituted in
|
||||
## other files (src/libhdf5.settings.in, etc.)
|
||||
AC_SUBST([BUILD_MODE])
|
||||
|
||||
case "X-$BUILD_MODE" in
|
||||
X-clean)
|
||||
AC_MSG_RESULT([clean])
|
||||
;;
|
||||
X-debug)
|
||||
AC_DEFINE([DEBUG_BUILD], [1], [Define if this is a debug build.])
|
||||
H5_CFLAGS="$H5_CFLAGS $DEBUG_CFLAGS"
|
||||
H5_CPPFLAGS="$H5_CPPFLAGS $DEBUG_CPPFLAGS"
|
||||
H5_CXXFLAGS="$H5_CXXFLAGS $DEBUG_CXXFLAGS"
|
||||
H5_FCFLAGS="$H5_FCFLAGS $DEBUG_FCFLAGS"
|
||||
AC_MSG_RESULT([debug])
|
||||
;;
|
||||
X-production)
|
||||
H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS"
|
||||
H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS"
|
||||
H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS"
|
||||
H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS"
|
||||
AC_MSG_RESULT([production])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unrecognized build mode: $BUILD_MODE. Use debug, production, or clean.])
|
||||
esac
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Some platforms have broken basename, and/or xargs programs. Check
|
||||
## that it actually does what it's supposed to do. Catch this early
|
||||
@ -320,6 +266,60 @@ while test -n "$hname"; do
|
||||
test "$hname_tmp" = "$hname" && break
|
||||
done
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Determine build mode (debug, production, clean).
|
||||
## This has to be done early since the build mode is referred to
|
||||
## frequently.
|
||||
##
|
||||
AC_MSG_CHECKING([build mode])
|
||||
AC_ARG_ENABLE([build-mode],
|
||||
[AS_HELP_STRING([--enable-build-mode=(debug|production|clean)],
|
||||
[Sets the build mode. Debug turns on symbols, API
|
||||
tracing, asserts, and debug optimization,
|
||||
as well as several other minor configure options
|
||||
that aid in debugging.
|
||||
Production turns high optimizations on.
|
||||
Clean turns nothing on and disables optimization
|
||||
(i.e.: a 'clean slate' configuration).
|
||||
All these settings can be overridden by using
|
||||
specific configure flags.
|
||||
[default=debug]
|
||||
])],
|
||||
[BUILD_MODE=$enableval])
|
||||
|
||||
## Set the default
|
||||
## Depends on branch, set via script at branch creation time
|
||||
if test "X-$BUILD_MODE" = X- ; then
|
||||
BUILD_MODE=debug
|
||||
fi
|
||||
|
||||
## Allow this variable to be substituted in
|
||||
## other files (src/libhdf5.settings.in, etc.)
|
||||
AC_SUBST([BUILD_MODE])
|
||||
|
||||
case "X-$BUILD_MODE" in
|
||||
X-clean)
|
||||
AC_MSG_RESULT([clean])
|
||||
;;
|
||||
X-debug)
|
||||
AC_DEFINE([DEBUG_BUILD], [1], [Define if this is a debug build.])
|
||||
H5_CFLAGS="$H5_CFLAGS $DEBUG_CFLAGS"
|
||||
H5_CPPFLAGS="$H5_CPPFLAGS $DEBUG_CPPFLAGS"
|
||||
H5_CXXFLAGS="$H5_CXXFLAGS $DEBUG_CXXFLAGS"
|
||||
H5_FCFLAGS="$H5_FCFLAGS $DEBUG_FCFLAGS"
|
||||
AC_MSG_RESULT([debug])
|
||||
;;
|
||||
X-production)
|
||||
H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS"
|
||||
H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS"
|
||||
H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS"
|
||||
H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS"
|
||||
AC_MSG_RESULT([production])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unrecognized build mode: $BUILD_MODE. Use debug, production, or clean.])
|
||||
esac
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Some built-in configure checks can only see CFLAGS (not AM_CFLAGS), so
|
||||
## we need to add this in so configure works as intended. We will need to
|
||||
|
Loading…
Reference in New Issue
Block a user