subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1543187 - /subversion/trunk/build/generator/gen_base.py
Date Mon, 18 Nov 2013 22:04:01 GMT
Author: breser
Date: Mon Nov 18 22:04:01 2013
New Revision: 1543187

URL: http://svn.apache.org/r1543187
Log:
Fix swig bindings with out of tree builds when in release mode.

When ./autogen.sh is run with --release then we run SWIG to generate
the C files then rather than at build time.  We do this when building
tarballs.  Currently those source files are flagged in our build as
generated so they are expected to be under the build directory.  When
in source mode flag them as not generated so we look for them in the
source directory.

* build/gen_base.py
  (SWIGObject.__init__): Add a flag to specify if we're in release mode and to
    set the source_generated flag appropriately.
  (TargetSWIG.add_dependencies): Pass the release mode flag when creating a
    SWIGObject.

Modified:
    subversion/trunk/build/generator/gen_base.py

Modified: subversion/trunk/build/generator/gen_base.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_base.py?rev=1543187&r1=1543186&r2=1543187&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_base.py (original)
+++ subversion/trunk/build/generator/gen_base.py Mon Nov 18 22:04:01 2013
@@ -393,11 +393,16 @@ class ObjectFile(DependencyNode):
     self.source_generated = 0
 
 class SWIGObject(ObjectFile):
-  def __init__(self, filename, lang):
+  def __init__(self, filename, lang, release_mode):
     ObjectFile.__init__(self, filename)
     self.lang = lang
     self.lang_abbrev = lang_abbrev[lang]
-    self.source_generated = 1
+    # in release mode the sources are not generated by the build
+    # but rather by the packager
+    if release_mode:
+      self.source_generated = 0
+    else:
+      self.source_generated = 1
     ### hmm. this is Makefile-specific
     self.compile_cmd = '$(COMPILE_%s_WRAPPER)' % self.lang_abbrev.upper()
 
@@ -703,8 +708,10 @@ class TargetSWIG(TargetLib):
     self.filename = build_path_join(self.path, lib_filename)
 
     ifile = SWIGSource(ipath)
-    cfile = SWIGObject(build_path_join(self.path, cname), self.lang)
-    ofile = SWIGObject(build_path_join(self.path, oname), self.lang)
+    cfile = SWIGObject(build_path_join(self.path, cname), self.lang,
+                       self.gen_obj.release_mode)
+    ofile = SWIGObject(build_path_join(self.path, oname), self.lang,
+                       self.gen_obj.release_mode)
 
     # the .c file depends upon the .i file
     self.gen_obj.graph.add(DT_SWIG_C, cfile, ifile)



Mime
View raw message