]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - aclocal/libtirpc.m4
Make --enable-tirpc the default. If --enable-tirpc wasn't explicitly
[nfs-utils.git] / aclocal / libtirpc.m4
index af4c7d3c10d109535f91282db8420b81f76dc99b..9f0fde0a6cb93fad7a6c31824b293717223e52a9 100644 (file)
@@ -11,17 +11,29 @@ AC_DEFUN([AC_LIBTIRPC], [
   dnl if --enable-tirpc was specifed, the following components
   dnl must be present, and we set up HAVE_ macros for them.
 
-  if test "$enable_tirpc" = yes; then
+  if test "$enable_tirpc" != "no"; then
 
     dnl look for the library; add to LIBS if found
     AC_CHECK_LIB([tirpc], [clnt_tli_create], ,
-                 [AC_MSG_ERROR([libtirpc not found.])])
+                 [if test "$enable_tirpc" = "yes"; then
+                       AC_MSG_ERROR([libtirpc not found.])
+                 else
+                       AC_MSG_WARN([libtirpc not found. TIRPC disabled!])
+                       enable_tirpc="no"
+                 fi])
+  fi
 
+  if test "$enable_tirpc" != "no"; then
     dnl also must have the headers installed where we expect
     dnl look for headers; add -I compiler option if found
-    AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h], ,
-                     [AC_MSG_ERROR([libtirpc headers not found.])])
-    AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"])
+    AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h],
+                     AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"]),
+                     [if test "$enable_tirpc" = "yes"; then
+                        AC_MSG_ERROR([libtirpc headers not found.])
+                      else
+                        AC_MSG_WARN([libtirpc headers not found. TIRPC disabled!])
+                        enable_tirpc="no"
+                      fi])
 
   fi