Disable run of ldconfig if crosscompiling too
[deb_libnfs.git] / configure.ac
index 8b9979681d2e348b942161053c175d2247372c89..363e6716824fdf244b2bc316248b1f97502ea13e 100644 (file)
@@ -14,12 +14,18 @@ if test "${libdir}" = '${exec_prefix}/lib'; then
 fi
 
 is_solaris="no"
+is_darwin="no"
 install="/usr/bin/install"
 ldconfig="ldconfig"
 
 case `uname` in
   Linux*)
     ;;
+  Darwin*)
+    libdir='${exec_prefix}/lib'
+    ldconfig='echo no ldconfig on darwin'
+    is_darwin="yes"
+    ;;
   AIX*)
     ;;
   SunOS)
@@ -47,6 +53,21 @@ if test ! -z "$LOGDIR"; then
 fi
 AC_SUBST(LOGDIR)
 
+AC_ARG_WITH([examples],
+              [  --without-examples  Disable build of examples],
+             [ENABLE_EXAMPLES="no"],
+             [ENABLE_EXAMPLES="yes"]
+             )
+AC_SUBST(ENABLE_EXAMPLES)
+
+AC_ARG_WITH([ldconfig],
+           [  --without-ldconfig  Disable call of ldconfig on make install],
+           [ldconfig='echo ldconfig disabled'])
+
+if test x"$cross_compiling" = xyes; then
+  ldconfig='echo crosscompiling: ldconfig disabled'
+fi
+
 AC_CONFIG_HEADER(config.h)
 
 EXTRA_OBJ=""
@@ -63,43 +84,10 @@ libnfs_cv_HAVE_SOCK_SIN_LEN=yes,libnfs_cv_HAVE_SOCK_SIN_LEN=no)])
 if test x"$libnfs_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
     AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
 fi
-
-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 libnfs. Install the libpopt-dev package.)
-  exit
-fi
-
 AC_SUBST(libdir)
 AC_SUBST(install)
 AC_SUBST(ldconfig)
+AC_SUBST(is_darwin)
 #AC_SUBST(LIBNFS_LDFLAGS)
 
 AC_OUTPUT(Makefile)