gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet-gtk] 01/02: use AS_CASE/AS_IF


From: gnunet
Subject: [GNUnet-SVN] [gnunet-gtk] 01/02: use AS_CASE/AS_IF
Date: Mon, 13 May 2019 10:52:03 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet-gtk.

commit ba59b0d0c40115ff3840bcb3068ff6f1f7deac84
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon May 13 10:48:21 2019 +0200

    use AS_CASE/AS_IF
---
 configure.ac | 141 ++++++++++++++++++++++++-----------------------------------
 1 file changed, 56 insertions(+), 85 deletions(-)

diff --git a/configure.ac b/configure.ac
index 11bf63ea..590ea81b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,10 +50,8 @@ AC_TYPE_UID_T
 
 CFLAGS="-Wall $CFLAGS"
 # use '-fno-strict-aliasing', but only if the compiler can take it
-if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
-then
- CFLAGS="-fno-strict-aliasing $CFLAGS"
-fi
+AS_IF([gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1],
+ [CFLAGS="-fno-strict-aliasing $CFLAGS"])
 
 # Default to unix configuration
 ENABLE_ON_UNIX=""
@@ -173,23 +171,20 @@ AC_MSG_CHECKING(for libextractor)
 AC_ARG_WITH(extractor,
    [  --with-extractor=PFX    base of libextractor installation],
    [AC_MSG_RESULT([$with_extractor])
-    case $with_extractor in
-      no)
-        ;;
-      yes)
+    AS_CASE([$with_extractor],
+      [no],[],
+      [yes],[
         AC_CHECK_HEADERS(extractor.h,
           AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
             extractor=1))
-        ;;
-      *)
+      ],[
         LDFLAGS="-L$with_extractor/lib $LDFLAGS"
         CPPFLAGS="-I$with_extractor/include $CPPFLAGS"
         AC_CHECK_HEADERS(extractor.h,
           AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
             EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH"
             extractor=1))
-        ;;
-    esac
+      ])
    ],
    [AC_MSG_RESULT([--with-extractor not specified])
     AC_CHECK_HEADERS(extractor.h,
@@ -198,14 +193,14 @@ AC_ARG_WITH(extractor,
 # restore LIBS
 LIBS=$SAVE_LIBS
 
-if test "$extractor" != 1
-then
+AS_IF([test "$extractor" != 1],
+[
  AM_CONDITIONAL(HAVE_LIBEXTRACTOR, false)
  AC_DEFINE([HAVE_LIBEXTRACTOR],[0],[Lacking libextractor])
-else
+],[
  AM_CONDITIONAL(HAVE_LIBEXTRACTOR, true)
  AC_DEFINE([HAVE_LIBEXTRACTOR],[1],[Have libextractor])
-fi
+])
 
 
 # test for libqrencode
@@ -215,28 +210,26 @@ AC_MSG_CHECKING(for libqrencode)
 AC_ARG_WITH(qrencode,
    [  --with-qrencode=PFX    Base of libqrencode installation],
    [AC_MSG_RESULT([$with_qrencode])
-    case $with_qrencode in
-      no)
-        ;;
-      yes)
+    AS_CASE([$with_qrencode],
+      [no],[],
+      [yes],[
         AC_CHECK_HEADERS(qrencode.h,qrencode=1)
-        ;;
-      *)
+      ],
+      [
         CPPFLAGS="-I$with_qrencode/include $CPPFLAGS"
         QR_CFLAGS="-I$with_qrencode/include"
         QR_LIBS="-L$with_qrencode/lib -lqrencode"
         AC_CHECK_HEADERS(qrencode.h,qrencode=1)
-        ;;
-    esac
+      ])
    ],
    [AC_MSG_RESULT([--with-qrencode not specified])
     AC_CHECK_HEADERS(qrencode.h,qrencode=1)])
 
-if test "$qrencode" != 1
-then
+AS_IF([test "$qrencode" != 1],
+[
 QR_LIBS=""
 QR_CFLAGS=""
-fi
+])
 
 AC_SUBST(QR_CFLAGS)
 AC_SUBST(QR_LIBS)
@@ -251,9 +244,10 @@ AM_PATH_GTK_3_0([3.22.0],,AC_MSG_ERROR([gnunet-gtk 
requires GTK 3.22]))
 # test for libunique
 AC_ARG_WITH([libunique], AC_HELP_STRING([--without-libunique], [disable 
libunique]))
 have_libunique=no
-if test x$with_libunique != xno; then
+AS_IF([test x$with_libunique != xno],
+[
   PKG_CHECK_MODULES([unique], [unique-3.0], AC_DEFINE(HAVE_LIBUNIQUE, 1, 
[Define if libunique is available]), AC_MSG_WARN([libunique would be nice to 
have]))
-fi
+])
 
 CFLAGS="$CFLAGS $GTK_CFLAGS"
 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
@@ -271,17 +265,10 @@ AC_MSG_CHECKING(for Glade core)
 AC_ARG_WITH(glade,
    [  --with-glade=PFX       Base of Glade installation (found with pkg-config 
if omitted)],
    [AC_MSG_RESULT([$with_glade])
-    case $with_glade in
-      no)
-        lookin=""
-        ;;
-      yes)
-        lookin="${prefix}"
-        ;;
-      *)
-        lookin="$with_glade"
-        ;;
-    esac
+    AS_CASE([$with_glade],
+      [no],[lookin=""],
+      [yes],[lookin="${prefix}"],
+      [lookin="$with_glade"])
    ],
    [
      AC_MSG_RESULT([--with-glade not specified])
@@ -289,8 +276,8 @@ AC_ARG_WITH(glade,
    ]
 )
 
-if test "x$glade" = "x0" -a ! "x$lookin" = "x"
-then
+AS_IF([test "x$glade" = "x0" -a ! "x$lookin" = "x"],
+[
   AC_MSG_CHECKING(for Glade3 in $lookin)
   backup_LIBS="$LIBS"
   backup_CFLAGS="$CFLAGS"
@@ -305,19 +292,16 @@ then
       AC_CHECK_LIB([gladeui-2], [glade_xml_node_new],
         glade=2)
     )
-  if test ! "x$glade" = "x0"
-  then
+  AS_IF([test ! "x$glade" = "x0"],[
     EXT_LIB_PATH="-L${lookin}/lib $EXT_LIB_PATH"
-  fi
+  ])
   LIBS="$backup_LIBS"
   CFLAGS="$backup_CFLAGS"
   CPPFLAGS="$backup_CPPFLAGS"
-fi
+])
 
-if test "x$glade" = "x0"
-then
-  AC_MSG_ERROR([gnunet-gtk requires Glade3 (library and headers)])
-fi
+AS_IF([test "x$glade" = "x0"],
+ [AC_MSG_ERROR([gnunet-gtk requires Glade3 (library and headers)])])
 
 AC_SUBST(GLADE_CFLAGS)
 AC_SUBST(GLADE_LIBS)
@@ -330,23 +314,20 @@ AC_MSG_CHECKING(for gnutls)
 AC_ARG_WITH(gnutls,
    [  --with-gnutls=PFX   base of gnutls installation],
    [AC_MSG_RESULT([$with_gnutls])
-    case $with_gnutls in
-      no)
-        ;;
-      yes)
+    AS_CASE([$with_gnutls],
+      [no],[],
+      [yes],[
         AC_CHECK_HEADERS([gnutls/abstract.h],
             AC_CHECK_LIB([gnutls], [gnutls_pubkey_import],
             gnutls=1))
-        ;;
-      *)
+      ],[
         LDFLAGS="-L$with_gnutls/lib $LDFLAGS"
         CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
         AC_CHECK_HEADERS([gnutls/abstract.h],
             AC_CHECK_LIB([gnutls], [gnutls_pubkey_import],
               EXT_LIB_PATH="-L$with_gnutls/lib $EXT_LIB_PATH"
               gnutls=1))
-        ;;
-    esac
+      ])
    ],
    [AC_MSG_RESULT([--with-gnutls not specified])
     AC_CHECK_HEADERS([gnutls/abstract.h],
@@ -361,21 +342,21 @@ AC_DEFINE_UNQUOTED([HAVE_GNUTLS], $gnutls, [We have 
GnuTLS])
 # -D_FORTIFY_SOURCE=2 -fstack-protector-all
 AC_ARG_ENABLE(gcc-hardening,
    AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
-[if test x$enableval = xyes; then
+[AS_IF([test x$enableval = xyes],[
     CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
     CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
     CFLAGS="$CFLAGS --param ssp-buffer-size=1"
     LDFLAGS="$LDFLAGS -pie"
-fi])
+])])
 
 
 # Linker hardening options
 # Currently these options are ELF specific - you can't use this with MacOSX
 AC_ARG_ENABLE(linker-hardening,
   AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups),
-[if test x$enableval = xyes; then
+[AS_IF([test x$enableval = xyes],[
    LDFLAGS="$LDFLAGS -z relro -z now"
-fi])
+ ])])
 
 
 extra_logging=GNUNET_NO
@@ -401,17 +382,10 @@ AC_MSG_CHECKING(for GNUnet core)
 AC_ARG_WITH(gnunet,
    [  --with-gnunet=PFX       Base of GNUnet installation],
    [AC_MSG_RESULT([$with_gnunet])
-    case $with_gnunet in
-      no)
-        lookin=""
-        ;;
-      yes)
-        lookin="${prefix}"
-        ;;
-      *)
-        lookin="$with_gnunet"
-        ;;
-    esac
+    AS_CASE([$with_gnunet],
+      [no],[lookin=""].
+      [yes],[lookin="${prefix}"],
+      [lookin="$with_gnunet"])
    ],
    [
      AC_MSG_RESULT([--with-gnunet not specified])
@@ -427,8 +401,8 @@ AC_ARG_WITH(gnunet,
    ]
 )
 
-if test "x$gnunet" = "x0" -a ! "x$lookin" = "x"
-then
+AS_IF([test "x$gnunet" = "x0" -a ! "x$lookin" = "x"],
+[
   AC_MSG_CHECKING(for GNUnet util library in $lookin)
   backup_LIBS="$LIBS"
   backup_CFLAGS="$CFLAGS"
@@ -458,12 +432,10 @@ then
   LIBS="$backup_LIBS"
   CFLAGS="$backup_CFLAGS"
   CPPFLAGS="$backup_CPPFLAGS"
-fi
+])
 
-if test "x$gnunet" = "x0"
-then
-  AC_MSG_ERROR([gnunet-gtk requires GNUnet])
-fi
+AS_IF([test "x$gnunet" = "x0"],
+ [AC_MSG_ERROR([gnunet-gtk requires GNUnet])])
 
 AC_SUBST(GNUNET_CFLAGS)
 AC_SUBST(GNUNET_LIBS)
@@ -522,11 +494,10 @@ AC_SUBST(GNUNET_PEERINFO_GTK_YEARFROM, [2010], [year of 
the first release])
 AC_SUBST(GNUNET_STATISTICS_GTK_YEARFROM, [2010], [year of the first release])
 AC_SUBST(GNUNET_SETUP_GTK_YEARFROM, [2010], [year of the first release])
 
-if test -n "$SOURCE_DATE_EPOCH"; then
-       thisyear=$(date --utc --date="@SOURCE_DATE_EPOCH" +%Y)
-else
-       thisyear=$(date +%Y)
-fi
+AS_IF([test -n "$SOURCE_DATE_EPOCH"],
+      [thisyear=$(date --utc --date="@SOURCE_DATE_EPOCH" +%Y)],
+      [thisyear=$(date +%Y)])
+
 AC_SUBST(GNUNET_FS_GTK_YEARTO, ${thisyear}, [year of the most current release])
 AC_SUBST(GNUNET_PEERINFO_GTK_YEARTO, ${thisyear}, [year of the most current 
release])
 AC_SUBST(GNUNET_STATISTICS_GTK_YEARTO, ${thisyear}, [year of the most current 
release])

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]