X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=aclocal%2Flibtirpc.m4;h=9f0fde0a6cb93fad7a6c31824b293717223e52a9;hp=b1f366989315bfc8e55e320e780ef0d7e41e186a;hb=b3e190c4adfc9ec47567c968bd000d282d07b05e;hpb=d271666403a87e60bbdee85372b6dcf35c2975ed diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4 index b1f3669..9f0fde0 100644 --- a/aclocal/libtirpc.m4 +++ b/aclocal/libtirpc.m4 @@ -2,18 +2,38 @@ dnl Checks for TI-RPC library and headers dnl AC_DEFUN([AC_LIBTIRPC], [ + AC_ARG_WITH([tirpcinclude], + [AC_HELP_STRING([--with-tirpcinclude=DIR], + [use TI-RPC headers in DIR])], + [tirpc_header_dir=$withval], + [tirpc_header_dir=/usr/include/tirpc]) + 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 - AC_CHECK_HEADERS([tirpc/netconfig.h], , - [AC_MSG_ERROR([libtirpc headers not found.])]) + dnl look for headers; add -I compiler option if found + 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