add a check in configure that libpopt is available
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 3 Jul 2010 10:16:44 +0000 (20:16 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 3 Jul 2010 10:16:44 +0000 (20:16 +1000)
config.h.in
configure.in

index 1d482c8bbb91956f0d764749892029f188cca7cb..c5a824c19b437fb89d3f714d065aae88798c918f 100644 (file)
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
index 70722c37d788773c5fee120fa8e36621075fc048..e64e24e9e0cee0464e6c93b5d6aebe564687e360 100644 (file)
@@ -75,6 +75,43 @@ if test x"$dbench_cv_HAVE___VA_COPY" = x"yes"; then
 fi
 fi
 
+#
+# Check that POPT is available
+#
+AC_MSG_CHECKING(whether libpopt is available)
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $GLIB_CFLAGS"
+LIBS="$GLIB_LIBS $LIBS -lpopt"
+AC_TRY_RUN([
+/*
+ * Just see if we can compile/link with popt
+ */
+#include <popt.h>
+
+int main(int argc, const char *argv[])
+{
+       struct poptOption popt_options[] = {
+               POPT_TABLEEND
+       };
+       poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
+
+       return 0;
+}
+], ac_cv_have_popt=yes, ac_cv_have_popt=no,
+   [echo $ac_n "compile with POPT. Assuming OK... $ac_c"
+    ac_cv_have_popt=yes])
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+if test "$ac_cv_have_popt" = yes ; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+  AC_MSG_NOTICE(You need libpopt to compile DBENCH. Install the libpopt-dev package.)
+  exit
+fi
+
+
 #
 # Check whether we have access to Linux SCSI Generic ioctl()
 #