[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Specify -no-undefined flag to libtool where appropriate, thereby permitting shared lib build on Cygwin.

From: Max Bowsher <maxb_at_ukf.net>
Date: 2004-03-31 12:33:23 CEST

[[[
Specify -no-undefined flag to libtool where appropriate,
thereby permitting shared lib build on Cygwin.

* build.conf (libsvn_test): Add "undefined-lib-symbols = yes".
  (libsvn_test_fs): Correct "libs". Add "undefined-lib-symbols = yes".

* gen_base.py (TargetLib): Read "undefined-lib-symbols" from config file.

* gen_make.py (Generator.write): Act on "undefined-lib-symbols"
    to emit "-no-undefined" where appropriate.
]]]

Index: build.conf
===================================================================
--- build.conf (revision 9243)
+++ build.conf (working copy)
@@ -451,6 +451,7 @@
 install = test
 libs = libsvn_delta libsvn_subr aprutil apriconv apr
 msvc-static = yes
+undefined-lib-symbols = yes

 # shared utils for writing fs tests
 [libsvn_test_fs]
@@ -458,8 +459,14 @@
 path = subversion/tests
 sources = fs-helpers.c
 install = fs-test
-libs = libsvn_fs libsvn_repos
+libs = libsvn_fs libsvn_repos libsvn_delta libsvn_subr libsvn_test apr
 msvc-static = yes
+# this lib does not actually have linktime undefined symbols, but as it
depends
+# on libsvn_test, which does, and libtool refuses to link shared libs with
+# static libs, we have to ensure that if libsvn_test is forced static due
to
+# the platform not supporting link-time undefined symbols in shared libs,
then
+# this lib is forced static too.
+undefined-lib-symbols = yes

 # tests for *public* fs API (svn_fs.h)
 [fs-test]
Index: build/generator/gen_base.py
===================================================================
--- build/generator/gen_base.py (revision 9243)
+++ build/generator/gen_base.py (working copy)
@@ -460,6 +460,9 @@
     tfile = '%s-%s%s' % (name, cfg.version, extmap['lib', 'target'])
     self.filename = os.path.join(self.path, tfile)

+ # Is a library referencing symbols which are undefined at link time.
+ self.undefined_lib_symbols = options.get('undefined-lib-symbols') ==
'yes'
+
     self.msvc_static = options.get('msvc-static') == 'yes' # is a static
lib
     self.msvc_fake = options.get('msvc-fake') == 'yes' # has fake target

Index: build/generator/gen_make.py
===================================================================
--- build/generator/gen_make.py (revision 9243)
+++ build/generator/gen_make.py (working copy)
@@ -118,7 +118,7 @@
           '%s_DEPS = %s %s\n'
           '%s_OBJECTS = %s\n'
           '%s: $(%s_DEPS)\n'
- '\tcd %s && %s -o %s $(%s_OBJECTS) %s $(LIBS)\n\n'
+ '\tcd %s && %s -o %s %s $(%s_OBJECTS) %s $(LIBS)\n\n'
           % (targ_varname, target_ob.add_deps, string.join(objects + deps),

              targ_varname, objnames,
@@ -126,6 +126,8 @@
              target_ob.filename, targ_varname,

              path, target_ob.link_cmd,
os.path.basename(target_ob.filename),
+ (isinstance(target_ob, gen_base.TargetLib) and not
+ target_ob.undefined_lib_symbols) and "-no-undefined" or "",
              targ_varname, string.join(gen_base.unique(libs)))
           )

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 31 12:33:47 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.