Merge pull request #540 from tokkee/configure
authorMarc Fournier <marc.fournier@camptocamp.com>
Thu, 7 Aug 2014 13:42:22 +0000 (15:42 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Thu, 7 Aug 2014 13:42:22 +0000 (15:42 +0200)
configure: Fixed check for libsigrok and AM_PATH_GLIB_2_0.

1  2 
configure.ac

diff --combined configure.ac
@@@ -1207,9 -1207,10 +1207,9 @@@ if test "x$have_getmntent" = "xgen"; th
  fi
  
  # Check for htonll
 -AC_MSG_CHECKING([if have htonll defined])
 -
 -    have_htonll="no"
 -    AC_LINK_IFELSE([AC_LANG_PROGRAM(
 +AC_CACHE_CHECK([if have htonll defined],
 +                  [c_cv_have_htonll],
 +                  AC_LINK_IFELSE([AC_LANG_PROGRAM(
  [[[
  #include <sys/types.h>
  #include <netinet/in.h>
            return htonll(0);
  ]]]
      )],
 -    [
 -      have_htonll="yes"
 -      AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
 -    ])
 - 
 -AC_MSG_RESULT([$have_htonll])
 +    [c_cv_have_htonll="yes"],
 +    [c_cv_have_htonll="no"]
 +       )
 +)
 +if test "x$c_cv_have_htonll" = "xyes"
 +then
 +    AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
 +fi
  
  # Check for structures
  AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
@@@ -3826,18 -3825,20 +3826,20 @@@ AC_ARG_WITH(libsigrok, [AS_HELP_STRING(
                        with_libsigrok_ldflags="-L$withval/lib"
                fi
        fi
- ],[])
+ ],[with_libsigrok="yes"])
  
  # libsigrok has a glib dependency
  if test "x$with_libsigrok" = "xyes"
  then
-       if test -z "m4_ifdef([AM_PATH_GLIB_2_0], [yes], [])"
-       then
-               with_libsigrok="no (glib not available)"
-       else
-               AM_PATH_GLIB_2_0([2.28.0],
-                       [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
-       fi
+ m4_ifdef([AM_PATH_GLIB_2_0],
+       [
+        AM_PATH_GLIB_2_0([2.28.0],
+               [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
+       ],
+       [
+        with_libsigrok="no (glib not available)"
+       ]
+ )
  fi
  
  # libsigrok headers