X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=aclocal%2Flibtirpc.m4;h=19b8361794854d0b616db61891e68aa1074cc7d3;hp=af4c7d3c10d109535f91282db8420b81f76dc99b;hb=768ab6039b53d767158c50bcc5fceb2ec2516a8a;hpb=336f8bca825416082d62ef38314f3e0b7e8f5cc2 diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4 index af4c7d3..19b8361 100644 --- a/aclocal/libtirpc.m4 +++ b/aclocal/libtirpc.m4 @@ -11,18 +11,41 @@ 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.])]) + dnl look for the library + AC_CHECK_LIB([tirpc], [clnt_tli_create], [:], + [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 + dnl now set $LIBTIRPC accordingly + if test "$enable_tirpc" != "no"; then + AC_DEFINE([HAVE_LIBTIRPC], 1, + [Define to 1 if you have and wish to use libtirpc.]) + LIBTIRPC="-ltirpc" + else + LIBTIRPC="" fi + AC_SUBST(LIBTIRPC) + ])dnl