if LINUX
all-am: modules
-modules: ldiskfs-sources lustre-sources
+modules: undef.h ldiskfs-sources lustre-sources
$(MAKE) CC="$(CC)" $(CROSS_VARS) -C $(LINUX_OBJ) \
-f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -Iarch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -I$$(srctree)/arch/$$(SRCARCH)/include/uapi -Iarch/$$(SRCARCH)/include/generated/uapi -I$$(srctree)/include/uapi -Iinclude/generated/uapi -include $(CONFIG_INCLUDE)' \
endif # MODULES
-dist-hook:
+undef.h: config.h.in
+ grep -v config.h.in config.h.in > $@
+
+dist-hook: undef.h
find $(distdir) -name .deps -o \
-name CVS -o \
-name .svn -o \
EXTRA_DIST = @PACKAGE_TARNAME@.spec \
build/Makefile \
build/Rules.in \
- build/gen_filelist.sh
+ build/gen_filelist.sh \
+ config.h.in \
+ undef.h
rpm-local:
@(if test -z "$(RPMBUILD)"; then \
# However, one cannot really run "make debs" without having done a
# configure first, so we could use the easier method of digging the
# version out of the config.h file.
-debs:
+debs: undef.h
lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
if [ "$$lversion" != "$$cversion" ]; then \
../lustre_$${VER}_*.changes ../lustre_$${VER}.tar.gz \
../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
-EXTRA_DIST += config.h.in
-
if USES_DPKG
EXTRA_DIST += debian/*
endif
AC_MSG_RESULT([yes])
compatrdma_found=true
AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
- EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -include ${O2IBPATH}/include/linux/compat-2.6.h"
+ EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
fi
fi
fi
- LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
- linux_kthread_worker, [
- #include <linux/kthread.h>
- ],[
- struct kthread_work *kth_wrk __attribute__ ((unused));
- flush_kthread_work(kth_wrk);
- ],[
- AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
- if test -z "$COMPAT_AUTOCONF"; then
- EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
- fi
- ])
-
AC_MSG_CHECKING([whether to use any OFED backport headers])
if test -n "$BACKPORT_INCLUDES"; then
AC_MSG_RESULT([yes])
LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
openib_gen2_support, [
#ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <linux/version.h>
AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
fi
fi
+
+ LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
+ linux_kthread_worker, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+ #include <linux/kthread.h>
+ ],[
+ struct kthread_work *kth_wrk __attribute__ ((unused));
+ flush_kthread_work(kth_wrk);
+ ],[
+ AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
+ if test -z "$COMPAT_AUTOCONF"; then
+ EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
+ fi
+ ])
fi
])
+AC_SUBST(EXTRA_OFED_CONFIG)
AC_SUBST(EXTRA_OFED_INCLUDE)
AC_SUBST(O2IBLND)
AC_SUBST(O2IBPATH)
LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
rdma_create_id_4args, [
#ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <rdma/rdma_cm.h>
LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
ib_cq_init_attr, [
#ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <rdma/ib_verbs.h>
LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
sk_sleep, [
#ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <net/sock.h>
EXTRA_KCFLAGS="-Werror"
LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
tcp_sendpage_socket, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
#include <linux/net.h>
#include <net/tcp.h>
],[
EXTRA_KCFLAGS="-Werror"
LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
sk_data_ready, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
#include <linux/net.h>
#include <net/sock.h>
],[