[poppler] configure.ac

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Jul 18 07:37:02 PDT 2015


 configure.ac |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

New commits:
commit 70f3c5ff0010775e5fcd590db1b8d475694fe3a4
Author: William Bader <williambader at hotmail.com>
Date:   Sat Jul 18 16:36:30 2015 +0200

    Updated patch to add configure --enable-build-type
    
    Bug #90796

diff --git a/configure.ac b/configure.ac
index 308715a..79329ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,55 @@ 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(build-type,
+              AC_HELP_STRING([--enable-build-type=@<:@relwithdebinfo/release/debug/debugfull/profile@:>@],
+                             [Build with options similar to 'cmake -DCMAKE_BUILD_TYPE=' values.]),
+              [enable_build_type=no;
+              case "$enableval" in
+              relwithdebinfo|release|debug|debugfull|profile) enable_build_type="$enableval" ;;
+              *) AC_MSG_ERROR([bad value $enableval for --enable-build-type option.
+                               Options are relwithdebinfo, release, debug, debugfull, and profile.]) ;;
+              esac],
+              enable_build_type=no)
+
+if test "x$GCC" = "xyes"; then
+    case "$enable_build_type" in
+    relwithdebinfo)
+        CFLAGS="-O2 -g $CFLAGS"
+        CXXFLAGS="-O2 -g $CXXFLAGS"
+        ;;
+    release)
+        CFLAGS="-O2 $CFLAGS -g0 -DNDEBUG"
+        CXXFLAGS="-O2 $CXXFLAGS -g0 -DNDEBUG"
+        ;;
+    debug)
+        CFLAGS="-O2 -g $CFLAGS -fno-reorder-blocks -fno-schedule-insns -fno-inline"
+        CXXFLAGS="-O2 -g $CXXFLAGS -fno-reorder-blocks -fno-schedule-insns -fno-inline"
+        ;;
+    debugfull)
+        CFLAGS="$CFLAGS -g3 -fno-inline"
+        CXXFLAGS="$CXXFLAGS -g3 -fno-inline"
+        ;;
+    profile)
+        CFLAGS="$CFLAGS -g3 -fno-inline -ftest-coverage -fprofile-arcs"
+        CXXFLAGS="$CXXFLAGS -g3 -fno-inline -ftest-coverage -fprofile-arcs"
+        LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage -lgcov"
+        ;;
+    *)
+        enable_build_type=no
+        ;;
+    esac
+else
+    case "$enable_build_type" in
+    relwithdebinfo|release|debug|debugfull|profile)
+        echo "  Warning: --enable-build-type ignored for non-gcc compiler."
+        ;;
+    esac
+    enable_build_type=no
+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]))
@@ -973,6 +1022,9 @@ if test x$enable_cms = xyes;then
         echo "      with lcms2"
     fi
 fi
+if test x$enable_build_type != xno;then
+        echo "  build type:         $enable_build_type"
+fi
 echo "  command line utils: $enable_utils"
 echo "  test data dir:      $TESTDATADIR"
 echo ""


More information about the poppler mailing list