Whamcloud - gitweb
LU-6484 build: autoconf checks cleanup 41/14541/6
authorDmitry Eremin <dmitry.eremin@intel.com>
Wed, 22 Apr 2015 19:37:29 +0000 (22:37 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 28 May 2015 22:05:45 +0000 (22:05 +0000)
Some of autoconf checks are not used any more and can be removed.
Some of them should be moved according new place of code.
Rrename LN_CONFIG_CDEBUG to LIBCFS_CONFIG_CDEBUG
fix AC_CHECK_HEADERS([netdb.h]) and AC_CHECK_FUNCS([gethostbyname])
fix caching for check LB_CONFIG_MPITESTS

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I988434d97051972b76b611e7b5a54835e8044734
Reviewed-on: http://review.whamcloud.com/14541
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
16 files changed:
config/lustre-build.m4
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/byteorder.h
libcfs/libcfs/module.c
libcfs/libcfs/util/nidstrings.c
lnet/autoconf/lustre-lnet.m4
lnet/utils/portals.c
lustre/autoconf/lustre-core.m4
lustre/tests/mmap_sanity.c
lustre/utils/gss/gss_util.c
lustre/utils/gss/gssd_proc.c
lustre/utils/gss/krb5_util.c
lustre/utils/gss/lgss_krb5_utils.c
lustre/utils/gss/lsupport.c
lustre/utils/gss/svcgssd_proc.c
lustre/utils/llog_reader.c

index d17fb4b..3963c3b 100644 (file)
@@ -647,7 +647,7 @@ LB_CONFIG_SERVERS
 AS_IF([test "x$enable_utils" = xno], [enable_tests="no"])
 
 m4_ifdef([LC_NODEMAP_PROC_DEBUG], [LC_NODEMAP_PROC_DEBUG])
 AS_IF([test "x$enable_utils" = xno], [enable_tests="no"])
 
 m4_ifdef([LC_NODEMAP_PROC_DEBUG], [LC_NODEMAP_PROC_DEBUG])
-LN_CONFIG_CDEBUG
+LIBCFS_CONFIG_CDEBUG
 LC_QUOTA
 
 LB_PATH_SNMP
 LC_QUOTA
 
 LB_PATH_SNMP
index a3b6142..2e80879 100644 (file)
@@ -1,9 +1,9 @@
 #
 #
-# LN_CONFIG_CDEBUG
+# LIBCFS_CONFIG_CDEBUG
 #
 # whether to enable various libcfs debugs (CDEBUG, ENTRY/EXIT, LASSERT, etc.)
 #
 #
 # whether to enable various libcfs debugs (CDEBUG, ENTRY/EXIT, LASSERT, etc.)
 #
-AC_DEFUN([LN_CONFIG_CDEBUG], [
+AC_DEFUN([LIBCFS_CONFIG_CDEBUG], [
 AC_MSG_CHECKING([whether to enable CDEBUG, CWARN])
 AC_ARG_ENABLE([libcfs_cdebug],
        AC_HELP_STRING([--disable-libcfs-cdebug],
 AC_MSG_CHECKING([whether to enable CDEBUG, CWARN])
 AC_ARG_ENABLE([libcfs_cdebug],
        AC_HELP_STRING([--disable-libcfs-cdebug],
@@ -30,7 +30,7 @@ AC_ARG_ENABLE([libcfs_assert],
 AC_MSG_RESULT([$enable_libcfs_assert])
 AS_IF([test x$enable_libcfs_assert = xyes],
        [AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])])
 AC_MSG_RESULT([$enable_libcfs_assert])
 AS_IF([test x$enable_libcfs_assert = xyes],
        [AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])])
-]) # LN_CONFIG_CDEBUG
+]) # LIBCFS_CONFIG_CDEBUG
 
 #
 # LIBCFS_CONFIG_PANIC_DUMPLOG
 
 #
 # LIBCFS_CONFIG_PANIC_DUMPLOG
@@ -376,26 +376,43 @@ AC_CHECK_FUNCS([strlcpy])
 # libcfs/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
 AC_CHECK_FUNCS([strlcat])
 
 # libcfs/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
 AC_CHECK_FUNCS([strlcat])
 
+# libcfs/include/libcfs/linux/linux-prim.h, ...
+AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
+
+# libcfs/include/libcfs/linux/linux-prim.h
+AC_CHECK_HEADERS([linux/random.h], [], [],
+                [#ifdef HAVE_LINUX_TYPES_H
+                 #include <linux/types.h>
+                 #endif
+                ])
+
+# libcfs/include/libcfs/linux/libcfs.h
+# libcfs/include/libcfs/byteorder.h
+# libcfs/libcfs/util/nidstrings.c
+AC_CHECK_HEADERS([netdb.h asm/types.h endian.h])
+AC_CHECK_FUNCS([gethostbyname])
+
 # --------  Check for required packages  --------------
 
 AC_MSG_NOTICE([LibCFS required packages checks
 ==============================================================================])
 
 # --------  Check for required packages  --------------
 
 AC_MSG_NOTICE([LibCFS required packages checks
 ==============================================================================])
 
-AC_MSG_CHECKING([whether to enable 'efence' debugging support])
-AC_ARG_ENABLE(efence,
-       AC_HELP_STRING([--enable-efence],
-               [use efence library]),
-       [], [enable_efence="no"])
-AC_MSG_RESULT([$enable_efence])
-AS_IF([test "$enable_efence" = yes], [
-       LIBEFENCE="-lefence"
-       AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
-], [
-       LIBEFENCE=""
+AC_MSG_CHECKING([whether to enable readline support])
+AC_ARG_ENABLE(readline,
+       AC_HELP_STRING([--disable-readline],
+               [disable readline support]),
+       [], [enable_readline="yes"])
+AC_MSG_RESULT([$enable_readline])
+
+LIBREADLINE=""
+AS_IF([test "x$enable_readline" = xyes], [
+       AC_CHECK_LIB([readline], [readline], [
+               LIBREADLINE="-lreadline"
+               AC_DEFINE(HAVE_LIBREADLINE, 1,
+                       [readline library is available])
+       ])
 ])
 ])
-AC_SUBST(LIBEFENCE)
-
-# -------- check for -lpthread support ----
+AC_SUBST(LIBREADLINE)
 
 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
 AC_ARG_ENABLE([libpthread],
 
 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
 AC_ARG_ENABLE([libpthread],
@@ -403,22 +420,18 @@ AC_ARG_ENABLE([libpthread],
                [disable libpthread]),
        [], [enable_libpthread="yes"])
 AC_MSG_RESULT([$enable_libpthread])
                [disable libpthread]),
        [], [enable_libpthread="yes"])
 AC_MSG_RESULT([$enable_libpthread])
+
+PTHREAD_LIBS=""
 AS_IF([test "x$enable_libpthread" = xyes], [
 AS_IF([test "x$enable_libpthread" = xyes], [
-       AC_CHECK_LIB([pthread], [pthread_create],
-               [ENABLE_LIBPTHREAD="yes"],
-               [ENABLE_LIBPTHREAD="no"])
-       AS_IF([test "$ENABLE_LIBPTHREAD" = yes], [
+       AC_CHECK_LIB([pthread], [pthread_create], [
                PTHREAD_LIBS="-lpthread"
                PTHREAD_LIBS="-lpthread"
-               AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
-       ], [
-               PTHREAD_LIBS=""
+               AC_DEFINE([HAVE_LIBPTHREAD], 1,
+                       [use libpthread for libcfs library])
        ])
        ])
-       AC_SUBST(PTHREAD_LIBS)
 ], [
        AC_MSG_WARN([Using libpthread for libcfs library is disabled explicitly])
 ], [
        AC_MSG_WARN([Using libpthread for libcfs library is disabled explicitly])
-       ENABLE_LIBPTHREAD="no"
 ])
 ])
-AC_SUBST(ENABLE_LIBPTHREAD)
+AC_SUBST(PTHREAD_LIBS)
 ]) # LIBCFS_CONFIGURE
 
 #
 ]) # LIBCFS_CONFIGURE
 
 #
index 6643cec..03c18f8 100644 (file)
@@ -30,7 +30,9 @@
 # include <asm/byteorder.h>
 #else /* __KERNEL__ */
 
 # include <asm/byteorder.h>
 #else /* __KERNEL__ */
 
-# include <endian.h>
+# ifdef HAVE_ENDIAN_H
+#  include <endian.h>
+# endif
 # include <byteswap.h>
 
 # define __swab16(x) bswap_16(x)
 # include <byteswap.h>
 
 # define __swab16(x) bswap_16(x)
index 449b885..62793ea 100644 (file)
@@ -39,9 +39,6 @@
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs_crypto.h>
 #include <lnet/lib-lnet.h>
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs_crypto.h>
 #include <lnet/lib-lnet.h>
-#include <lnet/lib-dlc.h>
-#include <lnet/lnet.h>
-#include <lnet/nidstr.h>
 
 static void
 kportal_memhog_free (struct libcfs_device_userstate *ldu)
 
 static void
 kportal_memhog_free (struct libcfs_device_userstate *ldu)
index fbc678b..3a9087f 100644 (file)
@@ -50,7 +50,7 @@
 #include <libcfs/util/string.h>
 #include <lnet/types.h>
 #include <lnet/nidstr.h>
 #include <libcfs/util/string.h>
 #include <lnet/types.h>
 #include <lnet/nidstr.h>
-#ifdef HAVE_GETHOSTBYNAME
+#ifdef HAVE_NETDB_H
 # include <netdb.h>
 #endif
 
 # include <netdb.h>
 #endif
 
index 2d2c2f0..861331d 100644 (file)
@@ -398,12 +398,10 @@ AS_IF([test "x$enable_gni" = xyes], [
                return rrc;
        ],[
                GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
                return rrc;
        ],[
                GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
-               GNILNDRCA="gnilndrca"
        ])
        EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
 ])
 AC_SUBST(GNICPPFLAGS)
        ])
        EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
 ])
 AC_SUBST(GNICPPFLAGS)
-AC_SUBST(GNILNDRCA)
 AC_SUBST(GNILND)
 ]) # LN_CONFIG_GNILND
 
 AC_SUBST(GNILND)
 ]) # LN_CONFIG_GNILND
 
@@ -487,58 +485,28 @@ AC_MSG_NOTICE([LNet core checks
 ==============================================================================])
 
 # lnet/utils/portals.c
 ==============================================================================])
 
 # lnet/utils/portals.c
-AC_CHECK_HEADERS([netdb.h netinet/tcp.h asm/types.h endian.h sys/ioctl.h])
-AC_CHECK_FUNCS([gethostbyname socket connect])
-
-# lnet/utils/debug.c
-AC_CHECK_HEADERS([linux/version.h])
+AC_CHECK_HEADERS([netdb.h])
+AC_CHECK_FUNCS([gethostbyname])
 
 # lnet/utils/wirecheck.c
 AC_CHECK_FUNCS([strnlen])
 
 # --------  Check for required packages  --------------
 
 
 # lnet/utils/wirecheck.c
 AC_CHECK_FUNCS([strnlen])
 
 # --------  Check for required packages  --------------
 
-#
-# LC_CONFIG_READLINE
-#
-# Build with readline
-#
-AC_MSG_CHECKING([whether to enable readline support])
-AC_ARG_ENABLE(readline,
-       AC_HELP_STRING([--disable-readline],
-               [disable readline support]),
-       [], [enable_readline="yes"])
-AC_MSG_RESULT([$enable_readline])
-
-# -------- check for readline if enabled ----
-
-LIBREADLINE=""
-AS_IF([test "x$enable_readline" = xyes], [
-       AC_CHECK_LIB([readline], [readline], [
-               LIBREADLINE="-lreadline"
-               AC_DEFINE(HAVE_LIBREADLINE, 1,
-                       [readline library is available])])
-])
-AC_SUBST(LIBREADLINE)
-
-# -------- enable acceptor libwrap (TCP wrappers) support? -------
-
-AC_MSG_CHECKING([if libwrap support is requested])
-AC_ARG_ENABLE([libwrap],
-       AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
-       [case "${enableval}" in
-               yes) enable_libwrap="yes" ;;
-               no)  enable_libwrap="no" ;;
-               *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
-       esac], [enable_libwrap="no"])
-AC_MSG_RESULT([$enable_libwrap])
-LIBWRAP=""
-AS_IF([test "x$enable_libwrap" = xyes], [
-       LIBWRAP="-lwrap"
-       AC_DEFINE(HAVE_LIBWRAP, 1,
-               [libwrap support is requested])
+AC_MSG_CHECKING([whether to enable 'efence' debugging support])
+AC_ARG_ENABLE(efence,
+       AC_HELP_STRING([--enable-efence],
+               [use efence library]),
+       [], [enable_efence="no"])
+AC_MSG_RESULT([$enable_efence])
+
+LIBEFENCE=""
+AS_IF([test "$enable_efence" = yes], [
+       LIBEFENCE="-lefence"
+       AC_DEFINE(HAVE_LIBEFENCE, 1,
+               [libefence support is requested])
 ])
 ])
-AC_SUBST(LIBWRAP)
+AC_SUBST(LIBEFENCE)
 
 LN_CONFIG_MAX_PAYLOAD
 LN_CONFIG_DLC
 
 LN_CONFIG_MAX_PAYLOAD
 LN_CONFIG_DLC
@@ -551,8 +519,7 @@ LN_CONFIG_DLC
 #
 AC_DEFUN([LN_CONDITIONALS], [
 AM_CONDITIONAL(BUILD_O2IBLND,    test x$O2IBLND = "xo2iblnd")
 #
 AC_DEFUN([LN_CONDITIONALS], [
 AM_CONDITIONAL(BUILD_O2IBLND,    test x$O2IBLND = "xo2iblnd")
-AM_CONDITIONAL(BUILD_GNILND,     test x$GNILND = "xgnilnd")
-AM_CONDITIONAL(BUILD_GNILND_RCA, test x$GNILNDRCA = "xgnilndrca")
+AM_CONDITIONAL(BUILD_GNILND,     test x$GNILND  = "xgnilnd")
 AM_CONDITIONAL(BUILD_DLC,        test x$USE_DLC = "xyes")
 ]) # LN_CONDITIONALS
 
 AM_CONDITIONAL(BUILD_DLC,        test x$USE_DLC = "xyes")
 ]) # LN_CONDITIONALS
 
index bd670ce..bc06446 100644 (file)
@@ -22,7 +22,9 @@
 #include <errno.h>
 #include <getopt.h>
 #include <limits.h>
 #include <errno.h>
 #include <getopt.h>
 #include <limits.h>
-#include <netdb.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
index 9a5d2b6..f30920b 100644 (file)
@@ -1807,9 +1807,9 @@ AC_ARG_ENABLE([mpitests],
                                MPI_Initialized(&flag);
                                return 0;
                        }
                                MPI_Initialized(&flag);
                                return 0;
                        }
-               ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"
-                       enable_mpitests=$lb_cv_mpi_tests])
+               ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
                ])
                ])
+               enable_mpitests=$lb_cv_mpi_tests
                CC=$oldcc
        fi
        AC_SUBST(MPICC_WRAPPER)
                CC=$oldcc
        fi
        AC_SUBST(MPICC_WRAPPER)
@@ -1941,20 +1941,19 @@ AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
 # maximum MDS thread count
 LC_MDS_MAX_THREADS
 
 # maximum MDS thread count
 LC_MDS_MAX_THREADS
 
+# lustre/utils/gss/gss_util.c
+# lustre/utils/gss/gssd_proc.c
+# lustre/utils/gss/krb5_util.c
+# lustre/utils/llog_reader.c
+# lustre/utils/create_iam.c
+# lustre/utils/libiam.c
+AC_CHECK_HEADERS([netdb.h endian.h])
+AC_CHECK_FUNCS([gethostbyname])
+
 # lustre/utils/llverdev.c
 AC_CHECK_HEADERS([blkid/blkid.h])
 
 # lustre/utils/llverdev.c
 AC_CHECK_HEADERS([blkid/blkid.h])
 
-# libcfs/include/libcfs/linux/linux-prim.h, ...
-AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
-
-# libcfs/include/libcfs/linux/linux-prim.h
-AC_CHECK_HEADERS([linux/random.h], [], [],
-                [#ifdef HAVE_LINUX_TYPES_H
-                 #include <linux/types.h>
-                 #endif
-                ])
-
-# utils/llverfs.c
+# lustre/utils/llverfs.c
 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
 
 SELINUX=""
 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
 
 SELINUX=""
index 29955cc..a999add 100644 (file)
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/time.h>
+#include <sys/mman.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <fcntl.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <netdb.h>
+#include <getopt.h>
 #include <string.h>
 #include <string.h>
-#include <sys/wait.h>
-#include <sys/time.h>
+#include <errno.h>
 
 char *dir = NULL, *dir2 = NULL;
 long page_size;
 
 char *dir = NULL, *dir2 = NULL;
 long page_size;
index fa4838b..d5974d0 100644 (file)
 #include <errno.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
 #include <ctype.h>
-#include <sys/file.h>
-#include <signal.h>
 #include <string.h>
 #include <string.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
 #include <sys/param.h>
 #include <sys/param.h>
-#include <netdb.h>
-#include <fcntl.h>
 #include <gssapi/gssapi.h>
 #if defined(HAVE_KRB5) && !defined(GSS_C_NT_HOSTBASED_SERVICE)
 #include <gssapi/gssapi_generic.h>
 #include <gssapi/gssapi.h>
 #if defined(HAVE_KRB5) && !defined(GSS_C_NT_HOSTBASED_SERVICE)
 #include <gssapi/gssapi_generic.h>
 #include "err_util.h"
 #include "gssd.h"
 #ifdef HAVE_UNISTD_H
 #include "err_util.h"
 #include "gssd.h"
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
 #endif
 #include <stdlib.h>
 #ifdef HAVE_COM_ERR_H
 #endif
 #include <stdlib.h>
 #ifdef HAVE_COM_ERR_H
-#include <com_err.h>
+# include <com_err.h>
 #endif
 #include "lsupport.h"
 
 #endif
 #include "lsupport.h"
 
index afc246a..e94f0fb 100644 (file)
@@ -60,7 +60,9 @@
 #include <unistd.h>
 #include <errno.h>
 #include <gssapi/gssapi.h>
 #include <unistd.h>
 #include <errno.h>
 #include <gssapi/gssapi.h>
-#include <netdb.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
 
 #include "gssd.h"
 #include "err_util.h"
 
 #include "gssd.h"
 #include "err_util.h"
index d4ee6c8..000f7c3 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <netdb.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
 #include <dirent.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <errno.h>
index ec6614f..0e34021 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <netdb.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
 #include <dirent.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <errno.h>
index 475f427..b8c7e8e 100644 (file)
@@ -59,7 +59,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <assert.h>
 #include <unistd.h>
 #include <errno.h>
 #include <assert.h>
-#ifdef HAVE_GETHOSTBYNAME
+#ifdef HAVE_NETDB_H
 # include <netdb.h>
 #endif
 #include <lnet/nidstr.h>
 # include <netdb.h>
 #endif
 #include <lnet/nidstr.h>
index 4983b23..5a9e816 100644 (file)
@@ -45,7 +45,9 @@
 #include <string.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <netdb.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
 
 #include "svcgssd.h"
 #include "gss_util.h"
 
 #include "svcgssd.h"
 #include "gss_util.h"
index 9794033..fed31ee 100644 (file)
@@ -39,7 +39,9 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <endian.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
 #include <unistd.h>
 #include <fcntl.h>
 
 #include <unistd.h>
 #include <fcntl.h>