From 1c69f318d65482a8df3fecf3a323bc7c7f98cb98 Mon Sep 17 00:00:00 2001 From: ericm Date: Mon, 29 Mar 2004 06:02:28 +0000 Subject: [PATCH] liblustre: - support VPATH build (still some unclean stuff in liblustre build) --- lnet/archdep.m4 | 5 +++++ lustre/liblustre/Makefile.am | 38 ++++++++++++++++++-------------------- lustre/liblustre/tests/Makefile.am | 25 ++++++++++++------------- lustre/portals/archdep.m4 | 5 +++++ 4 files changed, 40 insertions(+), 33 deletions(-) diff --git a/lnet/archdep.m4 b/lnet/archdep.m4 index 31d1dfd..aec9e82 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -171,6 +171,8 @@ KINCFLAGS="$CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE \ -I\$(top_srcdir)/portals/include" if test $host_cpu != "lib" ; then KINCFLAGS="$KINCFLAGS -I$LINUX/include -I$LINUX/include" +else + KINCFLAGS="$KINCFLAGS -I\$(top_srcdir)/utils -I\$(top_srcdir)/portals/unals" fi CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS" @@ -342,6 +344,9 @@ AC_SUBST(SCIMACNAL) CFLAGS="$KCFLAGS" CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac $with_ib" +if test $host_cpu == "lib" ; then +CPPFLAGS="$CPPFLAGS -fPIC -D_LARGEFILE64_SOURCE=1 -g" +fi AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) AC_SUBST(MOD_LINK) diff --git a/lustre/liblustre/Makefile.am b/lustre/liblustre/Makefile.am index b87f90b..438ebb4 100644 --- a/lustre/liblustre/Makefile.am +++ b/lustre/liblustre/Makefile.am @@ -3,29 +3,27 @@ DEFS= SUBDIRS = . tests -LL_CFLAGS = -g -Wall -I$(top_srcdir)/utils -I$(top_srcdir)/portals/include \ - -I$(top_srcdir)/portals/unals -I$(SYSIO)/include -fPIC +LL_CFLAGS = -I$(SYSIO)/include -CPPFLAGS = $(HAVE_EFENCE) -D_LARGEFILE64_SOURCE=1 LIBS = $(LIBEFENCE) LUSTRE_LIBS = libllite.a \ - $(top_srcdir)/lov/liblov.a \ - $(top_srcdir)/obdecho/libobdecho.a \ - $(top_srcdir)/osc/libosc.a \ - $(top_srcdir)/mdc/libmdc.a \ - $(top_srcdir)/ptlrpc/libptlrpc.a \ - $(top_srcdir)/obdclass/liblustreclass.a \ - $(top_srcdir)/lvfs/liblvfs.a - -PTL_LIBS = $(top_srcdir)/portals/utils/libuptlctl.a \ - $(top_srcdir)/portals/unals/libtcpnal.a \ - $(top_srcdir)/portals/portals/libportals.a - -SYSIO_LIBS = $(SYSIO)/drivers/native/libsysio_native.a \ - $(SYSIO)/drivers/sockets/libsysio_sockets.a \ - $(SYSIO)/src/libsysio.a \ - $(SYSIO)/dev/stdfd/libsysio_stdfd.a + $(top_builddir)/lov/liblov.a \ + $(top_builddir)/obdecho/libobdecho.a \ + $(top_builddir)/osc/libosc.a \ + $(top_builddir)/mdc/libmdc.a \ + $(top_builddir)/ptlrpc/libptlrpc.a \ + $(top_builddir)/obdclass/liblustreclass.a \ + $(top_builddir)/lvfs/liblvfs.a + +PTL_LIBS = $(top_builddir)/portals/utils/libuptlctl.a \ + $(top_builddir)/portals/unals/libtcpnal.a \ + $(top_builddir)/portals/portals/libportals.a + +SYSIO_LIBS = $(SYSIO)/drivers/native/libsysio_native.a \ + $(SYSIO)/drivers/sockets/libsysio_sockets.a \ + $(SYSIO)/src/libsysio.a \ + $(SYSIO)/dev/stdfd/libsysio_stdfd.a lib_LIBRARIES = liblustre.a noinst_LIBRARIES = libllite.a @@ -38,7 +36,7 @@ liblustre_a_SOURCES = llite_lib.c super.c namei.c rw.c file.c dir.c liblustre_a_CFLAGS = $(LL_CFLAGS) liblustre.a : $(LUSTRE_LIBS) $(PTL_LIBS) $(SYSIO_LIBS) - $(shell ./genlib.sh $(SYSIO) $(AR) $(LINK)) + $(shell $(top_srcdir)/liblustre/genlib.sh $(SYSIO) $(AR) $(LINK)) include $(top_srcdir)/Rules diff --git a/lustre/liblustre/tests/Makefile.am b/lustre/liblustre/tests/Makefile.am index 77d62b2..813c5e9 100644 --- a/lustre/liblustre/tests/Makefile.am +++ b/lustre/liblustre/tests/Makefile.am @@ -1,14 +1,7 @@ ## Liblustre excecutables & libraries Makefile DEFS= -AM_CFLAGS := -g -Wall -I$(top_srcdir)/utils -I$(top_srcdir)/portals/include \ - -I$(top_srcdir)/portals/unals -I$(SYSIO)/include \ - -I/opt/lam/include -L/opt/lam/lib - -KFLAGS:= -CPPFLAGS = $(HAVE_EFENCE) -D_LARGEFILE64_SOURCE=1 -LIBS = $(LIBEFENCE) - +LL_CFLAGS = -I$(SYSIO)/include LLIB_EXEC= ../liblustre.a -lpthread @@ -24,27 +17,33 @@ bin_PROGRAMS = $(def_tests) endif echo_test_SOURCES = echo_test.c ../../utils/parser.c ../../utils/obd.c ../../utils/lustre_cfg.c +echo_test_CFLAGS = $(LL_CFLAGS) echo_test_LDADD = ../liblsupport.a $(LIBREADLINE) -lpthread -echo_test_DEPENDENCIES=$(top_srcdir)/liblustre/liblsupport.a +echo_test_DEPENDENCIES=$(top_builddir)/liblustre/liblsupport.a sanity_SOURCES = sanity.c +sanity_CFLAGS = $(LL_CFLAGS) sanity_LDADD := ./libtestcommon.a $(LLIB_EXEC) -sanity_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a ./libtestcommon.a +sanity_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a ./libtestcommon.a recovery_small_SOURCES = recovery_small.c +recovery_small_CFLAGS = $(LL_CFLAGS) recovery_small_LDADD := ./libtestcommon.a $(LLIB_EXEC) -recovery_small_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a +recovery_small_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a replay_single_SOURCES = replay_single.c +replay_single_CFLAGS = $(LL_CFLAGS) replay_single_LDADD := ./libtestcommon.a $(LLIB_EXEC) -replay_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a +replay_single_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a replay_ost_single_SOURCES = replay_ost_single.c +replay_ost_single_CFLAGS = $(LL_CFLAGS) replay_ost_single_LDADD := ./libtestcommon.a $(LLIB_EXEC) -replay_ost_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a +replay_ost_single_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a if MPITESTS test_lock_cancel_SOURCES = test_lock_cancel.c +test_lock_cancel_CFLAGS = $(LL_CFLAGS) -I/opt/lam/include -L/opt/lam/lib test_lock_cancel_LDADD := $(LLIB_EXEC) -lmpi -llam endif diff --git a/lustre/portals/archdep.m4 b/lustre/portals/archdep.m4 index 31d1dfd..aec9e82 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -171,6 +171,8 @@ KINCFLAGS="$CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE \ -I\$(top_srcdir)/portals/include" if test $host_cpu != "lib" ; then KINCFLAGS="$KINCFLAGS -I$LINUX/include -I$LINUX/include" +else + KINCFLAGS="$KINCFLAGS -I\$(top_srcdir)/utils -I\$(top_srcdir)/portals/unals" fi CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS" @@ -342,6 +344,9 @@ AC_SUBST(SCIMACNAL) CFLAGS="$KCFLAGS" CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac $with_ib" +if test $host_cpu == "lib" ; then +CPPFLAGS="$CPPFLAGS -fPIC -D_LARGEFILE64_SOURCE=1 -g" +fi AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) AC_SUBST(MOD_LINK) -- 1.8.3.1