From f1d1370c05213b696643301416657fe066213c72 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 21 Feb 2008 13:27:44 +0000 Subject: [PATCH] Branch b1_6 b=14844 i=adilger i=deen fix compile issue on PPC. add configure check for asm-ppc/segment.h. --- lnet/autoconf/lustre-lnet.m4 | 47 ++++++++++++++++++++++------------ lnet/include/libcfs/linux/kp30.h | 4 ++- lnet/klnds/qswlnd/qswlnd.h | 4 ++- lnet/klnds/socklnd/socklnd_lib-linux.h | 4 ++- lnet/libcfs/linux/linux-debug.c | 4 ++- lnet/libcfs/linux/linux-proc.c | 4 ++- 6 files changed, 45 insertions(+), 22 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 5325bc3..9415370 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -6,7 +6,7 @@ AC_DEFUN([LN_CONFIG_MAX_PAYLOAD], [AC_MSG_CHECKING([for non-default maximum LNET payload]) AC_ARG_WITH([max-payload-mb], - AC_HELP_STRING([--with-max-payload-mb=MBytes], + AC_HELP_STRING([--with-max-payload-mb=MBytes], [set maximum lnet payload in MBytes]), [ AC_MSG_RESULT([$with_max_payload_mb]) @@ -82,7 +82,7 @@ if test x$enable_libcfs_assert = xyes; then AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF]) fi ]) - + # # LN_CONFIG_AFFINITY # @@ -106,7 +106,7 @@ else cpumask_t m; #else unsigned long m; - #endif + #endif set_cpus_allowed(&t, m); ],[ AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support]) @@ -125,7 +125,7 @@ fi AC_DEFUN([LN_CONFIG_PORTALS], [AC_MSG_CHECKING([for portals]) AC_ARG_WITH([portals], - AC_HELP_STRING([--with-portals=path], + AC_HELP_STRING([--with-portals=path], [set path to portals]), [ case $with_portals in @@ -135,7 +135,6 @@ AC_ARG_WITH([portals], ENABLEPORTALS=1 ;; esac - ], [ ENABLEPORTALS=0 ]) @@ -545,11 +544,11 @@ else #include #include ],[ - struct rdma_cm_id *cm_id; + struct rdma_cm_id *cm_id; struct rdma_conn_param conn_param; struct ib_device_attr device_attr; struct ib_qp_attr qp_attr; - struct ib_pool_fmr pool_fmr; + struct ib_pool_fmr pool_fmr; enum ib_cm_rej_reason rej_reason; cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); @@ -632,7 +631,7 @@ elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \ *) AC_MSG_ERROR([internal error]);; esac else - case $ENABLEOPENIB in + case $ENABLEOPENIB in 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";; 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";; *) AC_MSG_RESULT([no]) @@ -646,7 +645,7 @@ else #include #include ],[ - struct ib_device_properties dev_props; + struct ib_device_properties dev_props; struct ib_cm_active_param cm_active_params; tTS_IB_CLIENT_QUERY_TID tid; int enum1 = IB_QP_ATTRIBUTE_STATE; @@ -709,7 +708,7 @@ if test -n "$CIBPATH"; then #include #include ],[ - struct ib_device_properties dev_props; + struct ib_device_properties dev_props; struct ib_cm_active_param cm_active_params; tTS_IB_CLIENT_QUERY_TID tid; int enum1 = TS_IB_QP_ATTRIBUTE_STATE; @@ -834,7 +833,7 @@ else EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS" LB_LINUX_TRY_COMPILE([ - #include + #include #include #ifdef __BIG_ENDIAN # define CPU_BE 1 @@ -844,7 +843,7 @@ else # define CPU_BE 0 # define CPU_LE 1 #endif - #include + #include #include #include ],[ @@ -873,7 +872,7 @@ if test -n "$VIBLND"; then EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS" AC_MSG_CHECKING([if Voltaire still uses void * sg addresses]) LB_LINUX_TRY_COMPILE([ - #include + #include #include #ifdef __BIG_ENDIAN # define CPU_BE 1 @@ -883,7 +882,7 @@ if test -n "$VIBLND"; then # define CPU_BE 0 # define CPU_LE 1 #endif - #include + #include #include #include ],[ @@ -1059,7 +1058,7 @@ AC_DEFINE(HAVE_TASKLIST_LOCK, 1, ]) # 2.6.19 API changes -# kmem_cache_destroy(cachep) return void instead of +# kmem_cache_destroy(cachep) return void instead of # int AC_DEFUN([LN_KMEM_CACHE_DESTROY_INT], [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int]) @@ -1083,7 +1082,7 @@ AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER], [AC_MSG_CHECKING([panic_notifier_list is atomic]) LB_LINUX_TRY_COMPILE([ #include - #include + #include ],[ struct atomic_notifier_head panic_notifier_list; ],[ @@ -1095,7 +1094,7 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.20 API change INIT_WORK use 2 args and not +# 2.6.20 API change INIT_WORK use 2 args and not # store data inside AC_DEFUN([LN_3ARGS_INIT_WORK], [AC_MSG_CHECKING([check INIT_WORK want 3 args]) @@ -1169,6 +1168,18 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# asm/segment.h does not exist on all architectures. +# e.g. the file is empty for ia64 and does not exist for PPC. +AC_DEFUN([LC_SEGMENT_H], + [LB_CHECK_FILE([$LINUX/include/asm/segment.h], + [AC_MSG_CHECKING([if asm/segment.h is present]) + LB_LINUX_TRY_COMPILE([#include ], [], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SEGMENT_H, 1, + [asm/segment.h exists])], + [AC_MSG_RESULT([no])])]) +]) # LC_SEGMENT_H + # # LN_PROG_LINUX # @@ -1208,6 +1219,8 @@ LN_2ARGS_REGISTER_SYSCTL LN_KMEM_CACHE # 2.6.23 LN_KMEM_CACHE_CREATE_DTOR +# PPC/PPC64 support +LC_SEGMENT_H ]) # diff --git a/lnet/include/libcfs/linux/kp30.h b/lnet/include/libcfs/linux/kp30.h index fb1ae3e..e84a913 100644 --- a/lnet/include/libcfs/linux/kp30.h +++ b/lnet/include/libcfs/linux/kp30.h @@ -23,7 +23,9 @@ # include # include # include -# include +# ifdef HAVE_SEGMENT_H +# include +# endif # include # include # include diff --git a/lnet/klnds/qswlnd/qswlnd.h b/lnet/klnds/qswlnd/qswlnd.h index bf3adc5..ebdee83 100644 --- a/lnet/klnds/qswlnd/qswlnd.h +++ b/lnet/klnds/qswlnd/qswlnd.h @@ -59,7 +59,9 @@ #include #include #include -#include +#ifdef HAVE_SEGMENT_H +# include +#endif #define DEBUG_SUBSYSTEM S_LND diff --git a/lnet/klnds/socklnd/socklnd_lib-linux.h b/lnet/klnds/socklnd/socklnd_lib-linux.h index 5c4179e..e7a687d 100644 --- a/lnet/klnds/socklnd/socklnd_lib-linux.h +++ b/lnet/klnds/socklnd/socklnd_lib-linux.h @@ -34,7 +34,9 @@ #include #include #include -#include +#ifdef HAVE_SEGMENT_H +# include +#endif #include #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) diff --git a/lnet/libcfs/linux/linux-debug.c b/lnet/libcfs/linux/linux-debug.c index 6b4244c..689b55f 100644 --- a/lnet/libcfs/linux/linux-debug.c +++ b/lnet/libcfs/linux/linux-debug.c @@ -45,7 +45,9 @@ #include #include #include -#include +#ifdef HAVE_SEGMENT_H +# include +#endif #include #include diff --git a/lnet/libcfs/linux/linux-proc.c b/lnet/libcfs/linux/linux-proc.c index 3be3bee..f39e599 100644 --- a/lnet/libcfs/linux/linux-proc.c +++ b/lnet/libcfs/linux/linux-proc.c @@ -48,7 +48,9 @@ #include #include #include -#include +#ifdef HAVE_SEGMENT_H +# include +#endif #include #include -- 1.8.3.1