configure.ac | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index 67599c0..3dae4d8 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,20 @@ AC_ARG_ENABLE(xpdf-headers, enable_xpdf_headers="no") AM_CONDITIONAL(ENABLE_XPDF_HEADERS, test x$enable_xpdf_headers = xyes) +dnl ##### Emulate cmake -DCMAKE_BUILD_TYPE=Release using options from cmake/modules/PopplerMacros.cmake + +AC_ARG_ENABLE(release-mode, + AC_HELP_STRING([--enable-release-mode], + [Build for a release with -O2 -DNDEBUG.]), + enable_release_mode=$enableval, + enable_release_mode="no") + +if test x"$enable_release_mode" = xyes; then + CFLAGS="-O2 -DNDEBUG $CFLAGS" + CPPFLAGS="-O2 -DNDEBUG $CPPFLAGS" + CXXFLAGS="-O2 -DNDEBUG $CXXFLAGS" +fi + AC_ARG_ENABLE(single-precision, [ --enable-single-precision use single precision arithmetic (instead of double precision) in the Splash backend], AC_DEFINE(USE_FLOAT, [1], [Use single precision arithmetic in the Splash backend])) @@ -966,6 +980,9 @@ if test x$enable_cms = xyes;then echo " with lcms2" fi fi +if test x$enable_release_mode = xyes;then + echo " release mode: $enable_release_mode" +fi echo " command line utils: $enable_utils" echo " test data dir: $TESTDATADIR" echo ""