[eog] Modernize configure.ac



commit 2ad01250cb10a76a3d4c1c12141d4fefdc012437
Author: Felix Riemann <friemann gnome org>
Date:   Fri Oct 18 23:44:15 2013 +0200

    Modernize configure.ac
    
    - Require libtool 2.2
      Nobody seems to use libtool 1.x anymore, allows dropping more deprecated
      libtool macros
    - AC_HELP_STRING -> AS_HELP_STRING
    - AC_TRY_CPP/LINK -> AC_PREPROC/LINK
    - Try making the indentation more consistent

 configure.ac |  147 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 73 insertions(+), 74 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8d534c6..a65cd1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,8 +32,8 @@ GNOME_COMPILE_WARNINGS
 GNOME_DEBUG_CHECK
 
 # Disable building static archives by default
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
 
 AC_PROG_CC
 AM_PROG_CC_C_O
@@ -50,10 +50,11 @@ AC_CHECK_FUNCS(strptime)
 # Support for nl_langinfo (_NL_MEASUREMENT_MEASUREMENT) (optional)
 # ****************************************************************
 AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
-AC_TRY_LINK([#include <langinfo.h>], [
-char c;
-c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
-], have_langinfo_measurement=yes, have_langinfo_measurement=no)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+                                [[
+  char c;
+  c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));]])],
+               [have_langinfo_measurement=yes], [have_langinfo_measurement=no])
 AC_MSG_RESULT($have_langinfo_measurement)
 if test "$have_langinfo_measurement" = "yes"; then
   AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
@@ -112,18 +113,17 @@ EOG_MODULES="gtk+-3.0 >= $GTK_REQUIRED \
 GOBJECT_INTROSPECTION_CHECK([0.9.3])
 
 if test "$found_introspection" = "yes"; then
-       have_introspection=yes
-       AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
+  have_introspection=yes
+  AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
 else
-       have_introspection=no
+  have_introspection=no
 fi
 
 # ***************
 # libm (required)
 # ***************
 
-AC_CHECK_LIBM
-AC_SUBST(LIBM)
+LT_LIB_M
 
 # ***************
 # ZLIB (required)
@@ -131,13 +131,14 @@ AC_SUBST(LIBM)
 
 have_zlib=yes
 AC_CHECK_HEADERS([zlib.h],
-       [AC_CHECK_LIB([z], [inflate],
-               [AC_CHECK_LIB([z], [crc32], [], [have_zlib=no])],
-               [have_zlib=no])],
-       [have_zlib=no])
+                [AC_CHECK_LIB([z], [inflate],
+                              [AC_CHECK_LIB([z], [crc32], [],
+                                            [have_zlib=no])],
+                              [have_zlib=no])],
+                [have_zlib=no])
 
 if test x$have_zlib = xno; then
-       AC_MSG_ERROR([No sufficient zlib library found on your system.])
+  AC_MSG_ERROR([No sufficient zlib library found on your system.])
 fi
 
 # ***************
@@ -146,13 +147,13 @@ fi
 
 LIBEXIF_REQUIRED=0.6.14
 
-AC_ARG_WITH([libexif], AC_HELP_STRING([--without-libexif], [disable EXIF support]))
+AC_ARG_WITH([libexif], AS_HELP_STRING([--without-libexif], [disable EXIF support]))
 have_exif=no
 if test x$with_libexif != xno; then
-    PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_REQUIRED, have_exif=yes, have_exif=no)
-    if test "x$have_exif" = "xyes"; then
-        AC_CHECK_HEADER([libexif/exif-data.h],[],[have_exif=no])
-    fi
+  PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_REQUIRED, have_exif=yes, have_exif=no)
+  if test "x$have_exif" = "xyes"; then
+    AC_CHECK_HEADER([libexif/exif-data.h],[],[have_exif=no])
+  fi
 fi
 if test "x$have_exif" = "xyes"; then
   AC_DEFINE(HAVE_EXIF, 1, [EXIF Support.])
@@ -165,10 +166,10 @@ AM_CONDITIONAL([HAVE_EXIF], [test "x$have_exif" = "xyes"])
 # Little CMS (optional)
 # *********************
 
-AC_ARG_WITH([cms], AC_HELP_STRING([--without-cms], [disable colour management support]))
+AC_ARG_WITH([cms], AS_HELP_STRING([--without-cms], [disable colour management support]))
 have_lcms=no
 if test x$with_cms != xno; then
-    PKG_CHECK_MODULES(LCMS, lcms2, have_lcms=yes, have_lcms=no)
+  PKG_CHECK_MODULES(LCMS, lcms2, have_lcms=yes, have_lcms=no)
 fi
 if test "x$have_lcms" = "xyes"; then
   AC_DEFINE(HAVE_LCMS, 1, [Little CMS Support.])
@@ -180,10 +181,10 @@ AM_CONDITIONAL([HAVE_LCMS], [test "x$have_lcms" = "xyes"])
 # *********************
 # Exempi (optional)
 # *********************
-AC_ARG_WITH(xmp, AC_HELP_STRING([--without-xmp], [disable special XMP support]))
+AC_ARG_WITH(xmp, AS_HELP_STRING([--without-xmp], [disable special XMP support]))
 have_exempi=no
 if test x$with_xmp != xno; then
-    PKG_CHECK_MODULES(EXEMPI, exempi-2.0 >= $EXEMPI_REQUIRED, have_exempi=yes, have_exempi=no)
+  PKG_CHECK_MODULES(EXEMPI, exempi-2.0 >= $EXEMPI_REQUIRED, have_exempi=yes, have_exempi=no)
 fi
 if test "x$have_exempi" = "xyes"; then
   AC_DEFINE(HAVE_EXEMPI,1, [XMP support.])
@@ -208,59 +209,57 @@ AC_SUBST([EOG_DOC_EXIF_STOP])
 # Jpeg (semi-optional)
 # ********************
 
-AC_ARG_WITH(libjpeg, AC_HELP_STRING([--without-libjpeg], [disable special JPEG support]))
-  have_jpeg=no
-  have_libjpeg_80=no
-  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
-    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
-      have_jpeg=yes,
-      have_jpeg=no
-      AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
-    if test "$have_jpeg" = yes; then
-      AC_MSG_CHECKING([for jpeglib.h])
-      AC_TRY_CPP(
-[#include <stdio.h>
+AC_ARG_WITH(libjpeg, AS_HELP_STRING([--without-libjpeg], [disable special JPEG support]))
+have_jpeg=no
+have_libjpeg_80=no
+if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
+  AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
+    have_jpeg=yes,
+    have_jpeg=no
+    AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
+  if test "$have_jpeg" = yes; then
+    AC_MSG_CHECKING([for jpeglib.h])
+    AC_PREPROC_IFELSE([AC_LANG_SOURCE(
+                                      [[
+#include <stdio.h>
 #undef PACKAGE
 #undef VERSION
 #undef HAVE_STDLIB_H
-#include <jpeglib.h>],
-        have_jpeg=yes,
-        have_jpeg=no)
-      AC_MSG_RESULT($have_jpeg)
-      if test "$have_jpeg" = yes; then
-        LIBJPEG='-ljpeg'
-       AC_DEFINE(HAVE_JPEG, 1, [Jpeg Support.])
-        AC_DEFINE(HAVE_LIBJPEG, 1, [libjpeg is Present.])
-        AC_CHECK_LIB(jpeg, jpeg_simple_progression,
-          AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Jpeg Progressive Saving Support.]),
-          AC_MSG_WARN(JPEG library does not support progressive saving.))
+#include <jpeglib.h>
+                                       ]])],
+                      [have_jpeg=yes], [have_jpeg=no])
+    AC_MSG_RESULT($have_jpeg)
+    if test "$have_jpeg" = "yes"; then
+      LIBJPEG='-ljpeg'
+      AC_DEFINE(HAVE_JPEG, 1, [Jpeg Support.])
+      AC_DEFINE(HAVE_LIBJPEG, 1, [libjpeg is Present.])
+      AC_CHECK_LIB(jpeg, jpeg_simple_progression,
+        AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Jpeg Progressive Saving Support.]),
+        AC_MSG_WARN(JPEG library does not support progressive saving.))
        AC_MSG_CHECKING([[libjpeg version is 8 or greater]])
        AC_PREPROC_IFELSE([ AC_LANG_SOURCE(
-                         [[
+                                          [[
 #include <stdio.h>
 #include <jpeglib.h>
 #if JPEG_LIB_VERSION < 80
 #error "wrong version"
-#endif
-int main(int c, char**v) { return 0; }
-                         ]]) ],
+#endif                                    ]])],
                          [AC_MSG_RESULT(yes)
                           have_libjpeg_80=yes],
                          [AC_MSG_RESULT(no)
                           have_libjpeg_80=no])
-
-      else
-          AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
-      fi
+    else
+      AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
     fi
   fi
+fi
 
-  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
-     AC_MSG_ERROR([
+if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
+  AC_MSG_ERROR([
 *** Checks for JPEG loader failed. You can build without it by passing
 *** --without-libjpeg to configure but some programs using GTK+ may
 *** not work properly])
-  fi
+fi
 AC_SUBST(LIBJPEG)
 AM_CONDITIONAL(ENABLE_JPEG, test x$have_jpeg = xyes)
 AM_CONDITIONAL(HAVE_LIBJPEG_80, test "x$have_libjpeg_80" = xyes)
@@ -278,10 +277,10 @@ PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= $LIBXML2_REQUIRED])
 
 LIBRSVG_REQUIRED=2.36.2
 
-AC_ARG_WITH([librsvg], AC_HELP_STRING([--without-librsvg], [disable RSVG support]))
+AC_ARG_WITH([librsvg], AS_HELP_STRING([--without-librsvg], [disable RSVG support]))
 have_rsvg=no
 if test x$with_librsvg != xno; then
-    PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= $LIBRSVG_REQUIRED, have_rsvg=yes, have_rsvg=no)
+  PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= $LIBRSVG_REQUIRED, have_rsvg=yes, have_rsvg=no)
 fi
 if test "x$have_rsvg" = "xyes"; then
   AC_DEFINE(HAVE_RSVG, 1, [RSVG Support.])
@@ -306,19 +305,19 @@ AC_SUBST(EOG_LIBS)
 gdk_target=`$PKG_CONFIG --variable=targets gdk-3.0`
 
 if test "x$have_lcms" = "xyes" || test "$gdk_target" = "x11"; then
-       PKG_CHECK_MODULES(X11, [x11], have_x11=yes, have_x11=no)
-
-       if test "x$have_x11" != "xyes"; then
-               # Fallback for X11 releases without .pc-files
-               AC_PATH_XTRA
-               if test x$no_x = xyes ; then
-                       AC_MSG_ERROR([X development libraries (libX11) not found])
-               else
-                       X11_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
-                       AC_SUBST(X11_LIBS)
-                       have_x11=yes
-               fi
-       fi
+  PKG_CHECK_MODULES(X11, [x11], have_x11=yes, have_x11=no)
+
+  if test "x$have_x11" != "xyes"; then
+    # Fallback for X11 releases without .pc-files
+    AC_PATH_XTRA
+    if test x$no_x = xyes ; then
+      AC_MSG_ERROR([X development libraries (libX11) not found])
+    else
+      X11_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
+      AC_SUBST(X11_LIBS)
+      have_x11=yes
+    fi
+  fi
 fi
 
 # *********


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]