Whamcloud - gitweb
b=3041
authorjacob <jacob>
Thu, 1 Apr 2004 03:34:59 +0000 (03:34 +0000)
committerjacob <jacob>
Thu, 1 Apr 2004 03:34:59 +0000 (03:34 +0000)
b=3058

Clean up the autoconf and automake bits:

 * now liblustre and kernel modules can be built in the same tree
use --disable-modules, --disable-liblustre to disable those
bits
 * 2.6 modules are now built as .ko, and lconf can deal with them
 * fixes for builddir != srcdir

lnet/Rules.linux [deleted file]
lustre/portals/Rules.linux [deleted file]
lustre/utils/lconf.in [moved from lustre/utils/lconf with 99% similarity]

diff --git a/lnet/Rules.linux b/lnet/Rules.linux
deleted file mode 100644 (file)
index 232a248..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# included in Linux kernel directories
-# Rules for module building
-
-if LINUX25
-
-basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g' | sed -e 's/^.*\///g')
-AM_CPPFLAGS= -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2  -DKBUILD_MODNAME=$(MODULE) -DKBUILD_BASENAME=$(basename)
-
-$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE)_tmp.o $($(MODULE)_OBJECTS)
-       rm -f $(MODULE)_tmp.c
-       $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(MODULE)_tmp.o
-       $(COMPILE) -UKBUILD_BASENAME -DKBUILD_BASENAME=$(MODULE) -c $(MODULE)_tmp.mod.c
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $(MODULE)_tmp.o $(MODULE)_tmp.mod.o
-
-else
-
-$(MODULE).o: $($(MODULE)_OBJECTS)
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $($(MODULE)_OBJECTS)
-
-endif
-
-tags:
-       rm -f $(top_srcdir)/TAGS
-       rm -f $(top_srcdir)/tags
-       find $(top_srcdir)/../portals/ -name '*.[hc]' | xargs etags -a
-       find $(top_srcdir) -name '*.[hc]' | grep -v ".orig" | xargs etags -a
-       find $(top_srcdir)/../portals/ -name '*.[hc]' | xargs ctags -a
-       find $(top_srcdir) -name '*.[hc]' | grep -v ".orig" | xargs ctags -a
diff --git a/lustre/portals/Rules.linux b/lustre/portals/Rules.linux
deleted file mode 100644 (file)
index 232a248..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# included in Linux kernel directories
-# Rules for module building
-
-if LINUX25
-
-basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g' | sed -e 's/^.*\///g')
-AM_CPPFLAGS= -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2  -DKBUILD_MODNAME=$(MODULE) -DKBUILD_BASENAME=$(basename)
-
-$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE)_tmp.o $($(MODULE)_OBJECTS)
-       rm -f $(MODULE)_tmp.c
-       $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(MODULE)_tmp.o
-       $(COMPILE) -UKBUILD_BASENAME -DKBUILD_BASENAME=$(MODULE) -c $(MODULE)_tmp.mod.c
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $(MODULE)_tmp.o $(MODULE)_tmp.mod.o
-
-else
-
-$(MODULE).o: $($(MODULE)_OBJECTS)
-       $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $($(MODULE)_OBJECTS)
-
-endif
-
-tags:
-       rm -f $(top_srcdir)/TAGS
-       rm -f $(top_srcdir)/tags
-       find $(top_srcdir)/../portals/ -name '*.[hc]' | xargs etags -a
-       find $(top_srcdir) -name '*.[hc]' | grep -v ".orig" | xargs etags -a
-       find $(top_srcdir)/../portals/ -name '*.[hc]' | xargs ctags -a
-       find $(top_srcdir) -name '*.[hc]' | grep -v ".orig" | xargs ctags -a
similarity index 99%
rename from lustre/utils/lconf
rename to lustre/utils/lconf.in
index ac22336..3c7e588 100755 (executable)
@@ -35,11 +35,11 @@ if sys.version[0] == '1':
 else:
     from fcntl import F_GETFL, F_SETFL
 
-PYMOD_DIR = "/usr/lib/lustre/python"
+PYMOD_DIR = "@PYMOD_DIR@"
 
 def development_mode():
     base = os.path.dirname(sys.argv[0])
-    if os.access(base+"/Makefile.am", os.R_OK):
+    if os.access(base+"/Makefile", os.R_OK):
         return 1
     return 0
 
@@ -699,13 +699,14 @@ def do_find_file(base, mod):
                 return module
 
 def find_module(src_dir, dev_dir, modname):
-    mod = '%s.o' % (modname)
-    module = src_dir +'/'+ dev_dir +'/'+ mod
-    try: 
-       if os.access(module, os.R_OK):
-            return module
-    except OSError:
-        pass
+    modbase = src_dir +'/'+ dev_dir +'/'+ modname
+    for modext in '.ko', '.o':
+        module = modbase + modext
+        try: 
+            if os.access(module, os.R_OK):
+                return module
+        except OSError:
+            pass
     return None
 
 # is the path a block device?
@@ -2352,6 +2353,7 @@ def setupModulePath(cmd, portals_dir = PORTALS_DIR):
     base = os.path.dirname(cmd)
     if development_mode():
         if not config.lustre:
+            debug('using objdir module paths')            
             config.lustre = (os.path.join(base, ".."))
         # normalize the portals dir, using command line arg if set
         if config.portals: