apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Mark Vandenberg <jay...@gmail.com>
Subject [patch 03/17] build conf
Date Sat, 15 Apr 2006 01:41:21 GMT
The changes to gen-build.py permit any platform to inherit files from the 
platforms specified in the second parameter in MAKE_PLATFORMS.

This patch needs more work before it is committed.

Index: build.conf
===================================================================
--- build.conf.orig
+++ build.conf
@@ -24,3 +24,24 @@ headers = include/*.h
 
 # we have a recursive makefile for the test files (for now)
 # test/*.c
+
+[win32]
+
+inherit =
+  filepath_util
+  fullrw
+  fileacc
+  copy
+  tempdir
+  mktemp
+  errorcodes
+  getopt
+  inet_pton
+  inet_ntop
+  sockaddr
+  select
+  apr_pools # the empty memory/win32 directory makes this necessary
+  global_mutex
+  version
+  otherchild
+
Index: build/gen-build.py
===================================================================
--- build/gen-build.py.orig
+++ build/gen-build.py
@@ -29,6 +29,7 @@ MAKE_PLATFORMS = [
   ('beos', 'unix'),
   ('os2', 'unix'),
   ('os390', 'unix'),
+  ('win32', 'unix'),
   ]
 # note: MAKE_PLATFORMS is an ordered set. we want to generate unix symbols
 #       first, so that the later platforms can reference them.
@@ -66,8 +67,29 @@ def main():
     group = [ '$(OBJECTS_all)' ]
 
     for subdir in string.split(parser.get('options', 'platform_dirs')):
+      try:
+        inherit = string.split(parser.get(platform, 'inherit'))
+      except ConfigParser.NoSectionError:
+        inherit = None;
+
+      inherited_files = []
+      inherited_objects = []
+      if inherit:
+        path = '%s/%s' % (subdir, parent)
+        if os.path.exists(path):
+          for file in inherit:
+            file = '%s/%s.c' % (path,file)
+            if os.path.isfile(file):
+              inherited_files.append(file)
+        if inherited_files:
+          inherited_objects, _unused = write_objects(f, legal_deps, h_deps, inherited_files)
+          inherited_symname = 'OBJECTS_%s_%s_inherit' % (subdir, platform)
+          f.write('\n%s = %s\n\n' % (inherited_symname, string.join(inherited_objects)))
+          group.append('$(%s)' % inherited_symname)
+
       path = '%s/%s' % (subdir, platform)
-      if not os.path.exists(path):
+
+      if not inherited_files and not os.path.exists(path):
         # this subdir doesn't have a subdir for this platform, so we'll
         # use the parent-platform's set of symbols
         if parent:
@@ -164,7 +186,8 @@ def resolve_deps(header_deps):
 def get_files(patterns):
   files = [ ]
   for pat in string.split(patterns):
-    files.extend(glob.glob(pat))
+    for file in glob.glob(pat):
+      files.extend([file.replace('\\','/')])
   return files
 
 

--

Mime
View raw message