From fdd5596593050d22feef05ecba6ba53c65cb3397 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Wed, 22 Apr 2015 22:37:29 +0300 Subject: [PATCH] LU-6484 build: autoconf checks cleanup 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 Change-Id: I988434d97051972b76b611e7b5a54835e8044734 Reviewed-on: http://review.whamcloud.com/14541 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- config/lustre-build.m4 | 2 +- libcfs/autoconf/lustre-libcfs.m4 | 67 +++++++++++++++++++++++--------------- libcfs/include/libcfs/byteorder.h | 4 ++- libcfs/libcfs/module.c | 3 -- libcfs/libcfs/util/nidstrings.c | 2 +- lnet/autoconf/lustre-lnet.m4 | 65 +++++++++--------------------------- lnet/utils/portals.c | 4 ++- lustre/autoconf/lustre-core.m4 | 25 +++++++------- lustre/tests/mmap_sanity.c | 16 ++++----- lustre/utils/gss/gss_util.c | 13 ++------ lustre/utils/gss/gssd_proc.c | 4 ++- lustre/utils/gss/krb5_util.c | 4 ++- lustre/utils/gss/lgss_krb5_utils.c | 4 ++- lustre/utils/gss/lsupport.c | 2 +- lustre/utils/gss/svcgssd_proc.c | 4 ++- lustre/utils/llog_reader.c | 4 ++- 16 files changed, 101 insertions(+), 122 deletions(-) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index d17fb4b..3963c3b 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -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]) -LN_CONFIG_CDEBUG +LIBCFS_CONFIG_CDEBUG LC_QUOTA LB_PATH_SNMP diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index a3b6142..2e80879 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -1,9 +1,9 @@ # -# LN_CONFIG_CDEBUG +# LIBCFS_CONFIG_CDEBUG # # 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], @@ -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])]) -]) # LN_CONFIG_CDEBUG +]) # LIBCFS_CONFIG_CDEBUG # # 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/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 + #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 ==============================================================================]) -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], @@ -403,22 +420,18 @@ AC_ARG_ENABLE([libpthread], [disable libpthread]), [], [enable_libpthread="yes"]) AC_MSG_RESULT([$enable_libpthread]) + +PTHREAD_LIBS="" 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" - 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]) - ENABLE_LIBPTHREAD="no" ]) -AC_SUBST(ENABLE_LIBPTHREAD) +AC_SUBST(PTHREAD_LIBS) ]) # LIBCFS_CONFIGURE # diff --git a/libcfs/include/libcfs/byteorder.h b/libcfs/include/libcfs/byteorder.h index 6643cec..03c18f8 100644 --- a/libcfs/include/libcfs/byteorder.h +++ b/libcfs/include/libcfs/byteorder.h @@ -30,7 +30,9 @@ # include #else /* __KERNEL__ */ -# include +# ifdef HAVE_ENDIAN_H +# include +# endif # include # define __swab16(x) bswap_16(x) diff --git a/libcfs/libcfs/module.c b/libcfs/libcfs/module.c index 449b885..62793ea 100644 --- a/libcfs/libcfs/module.c +++ b/libcfs/libcfs/module.c @@ -39,9 +39,6 @@ #include #include #include -#include -#include -#include static void kportal_memhog_free (struct libcfs_device_userstate *ldu) diff --git a/libcfs/libcfs/util/nidstrings.c b/libcfs/libcfs/util/nidstrings.c index fbc678b..3a9087f 100644 --- a/libcfs/libcfs/util/nidstrings.c +++ b/libcfs/libcfs/util/nidstrings.c @@ -50,7 +50,7 @@ #include #include #include -#ifdef HAVE_GETHOSTBYNAME +#ifdef HAVE_NETDB_H # include #endif diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 2d2c2f0..861331d 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -398,12 +398,10 @@ AS_IF([test "x$enable_gni" = xyes], [ return rrc; ],[ GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1" - GNILNDRCA="gnilndrca" ]) EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" ]) AC_SUBST(GNICPPFLAGS) -AC_SUBST(GNILNDRCA) AC_SUBST(GNILND) ]) # LN_CONFIG_GNILND @@ -487,58 +485,28 @@ AC_MSG_NOTICE([LNet core checks ==============================================================================]) # 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 -------------- -# -# 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 @@ -551,8 +519,7 @@ LN_CONFIG_DLC # 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 diff --git a/lnet/utils/portals.c b/lnet/utils/portals.c index bd670ce..bc06446 100644 --- a/lnet/utils/portals.c +++ b/lnet/utils/portals.c @@ -22,7 +22,9 @@ #include #include #include -#include +#ifdef HAVE_NETDB_H +# include +#endif #include #include #include diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 9a5d2b6..f30920b 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1807,9 +1807,9 @@ AC_ARG_ENABLE([mpitests], 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) @@ -1941,20 +1941,19 @@ AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"], # 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]) -# 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 - #endif - ]) - -# utils/llverfs.c +# lustre/utils/llverfs.c AC_CHECK_HEADERS([ext2fs/ext2fs.h]) SELINUX="" diff --git a/lustre/tests/mmap_sanity.c b/lustre/tests/mmap_sanity.c index 29955cc..a999add 100644 --- a/lustre/tests/mmap_sanity.c +++ b/lustre/tests/mmap_sanity.c @@ -34,20 +34,18 @@ * Lustre is a trademark of Sun Microsystems, Inc. */ +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include #include -#include -#include -#include +#include #include -#include -#include +#include char *dir = NULL, *dir2 = NULL; long page_size; diff --git a/lustre/utils/gss/gss_util.c b/lustre/utils/gss/gss_util.c index fa4838b..d5974d0 100644 --- a/lustre/utils/gss/gss_util.c +++ b/lustre/utils/gss/gss_util.c @@ -61,17 +61,8 @@ #include #include #include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include #include #if defined(HAVE_KRB5) && !defined(GSS_C_NT_HOSTBASED_SERVICE) #include @@ -81,11 +72,11 @@ #include "err_util.h" #include "gssd.h" #ifdef HAVE_UNISTD_H -#include +# include #endif #include #ifdef HAVE_COM_ERR_H -#include +# include #endif #include "lsupport.h" diff --git a/lustre/utils/gss/gssd_proc.c b/lustre/utils/gss/gssd_proc.c index afc246a..e94f0fb 100644 --- a/lustre/utils/gss/gssd_proc.c +++ b/lustre/utils/gss/gssd_proc.c @@ -60,7 +60,9 @@ #include #include #include -#include +#ifdef HAVE_NETDB_H +# include +#endif #include "gssd.h" #include "err_util.h" diff --git a/lustre/utils/gss/krb5_util.c b/lustre/utils/gss/krb5_util.c index d4ee6c8..000f7c3 100644 --- a/lustre/utils/gss/krb5_util.c +++ b/lustre/utils/gss/krb5_util.c @@ -107,7 +107,9 @@ #include #include #include -#include +#ifdef HAVE_NETDB_H +# include +#endif #include #include #include diff --git a/lustre/utils/gss/lgss_krb5_utils.c b/lustre/utils/gss/lgss_krb5_utils.c index ec6614f..0e34021 100644 --- a/lustre/utils/gss/lgss_krb5_utils.c +++ b/lustre/utils/gss/lgss_krb5_utils.c @@ -115,7 +115,9 @@ #include #include #include -#include +#ifdef HAVE_NETDB_H +# include +#endif #include #include #include diff --git a/lustre/utils/gss/lsupport.c b/lustre/utils/gss/lsupport.c index 475f427..b8c7e8e 100644 --- a/lustre/utils/gss/lsupport.c +++ b/lustre/utils/gss/lsupport.c @@ -59,7 +59,7 @@ #include #include #include -#ifdef HAVE_GETHOSTBYNAME +#ifdef HAVE_NETDB_H # include #endif #include diff --git a/lustre/utils/gss/svcgssd_proc.c b/lustre/utils/gss/svcgssd_proc.c index 4983b23..5a9e816 100644 --- a/lustre/utils/gss/svcgssd_proc.c +++ b/lustre/utils/gss/svcgssd_proc.c @@ -45,7 +45,9 @@ #include #include #include -#include +#ifdef HAVE_NETDB_H +# include +#endif #include "svcgssd.h" #include "gss_util.h" diff --git a/lustre/utils/llog_reader.c b/lustre/utils/llog_reader.c index 9794033..fed31ee 100644 --- a/lustre/utils/llog_reader.c +++ b/lustre/utils/llog_reader.c @@ -39,7 +39,9 @@ #include #include #include -#include +#ifdef HAVE_ENDIAN_H +# include +#endif #include #include -- 1.8.3.1