mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [kbuild] Possibility to sanely link against off-directory .so
@ 2002-11-06 18:52 Petr Baudis
  2002-11-06 21:29 ` Sam Ravnborg
  0 siblings, 1 reply; 15+ messages in thread
From: Petr Baudis @ 2002-11-06 18:52 UTC (permalink / raw)
  To: mec; +Cc: zippel, kbuild-devel, linux-kernel

  Hello,

  this patch (against 2.5.46) introduces two special variables which make it
actually possible to have .so as the only product of build in some directory
and to link something against .so being built in another directory. The
variable host-cshlib-extra makes it possible to explicitly mention shared
objects to be built and the variable $(<foo>-linkobjs) allows user to specify
additional objects to link <foo> against, while not creating any dependencies
of <foo> on the objects.

  The changes are minimal while dramatically extending possibilities for
messing with the shared objects and they should have no unwanted side-effects,
and it appears to actually work for me. Please apply.

 scripts/Makefile.build |    6 ++++++
 scripts/Makefile.lib   |    2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

  Kind regards,
                                Petr Baudis

diff -ru linux/scripts/Makefile.build linux+pasky/scripts/Makefile.build
--- linux/scripts/Makefile.build	Tue Nov  5 19:29:20 2002
+++ linux+pasky/scripts/Makefile.build	Wed Nov  6 19:39:52 2002
@@ -197,6 +197,11 @@
 # libkconfig.so as the executable conf.
 # Note: Shared libraries consisting of C++ files are not supported  
 #
+# host-progs     := mconf
+# mconf-objs     := mconf.o
+# mconf-linkobjs := ../lxdialog/liblxdialog.so
+# Will link mconf.o against ../lxdialog/liblxdialog.so, but will not attempt
+# to build ../lxdialog/liblxdialog.so nor will make mconf depend on it.
 
 # Create executable from a single .c file
 # host-csingle -> Executable
@@ -212,6 +217,7 @@
 quiet_cmd_host-cmulti	= HOSTLD  $@
       cmd_host-cmulti	= $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
 			  $(addprefix $(obj)/,$($(@F)-objs)) \
+			  $(addprefix $(obj)/,$($(@F)-linkobjs)) \
 			  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 $(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
 	$(call if_changed,host-cmulti)
diff -ru linux/scripts/Makefile.lib linux+pasky/scripts/Makefile.lib
--- linux/scripts/Makefile.lib	Fri Nov  1 22:22:07 2002
+++ linux+pasky/scripts/Makefile.lib	Wed Nov  6 19:07:47 2002
@@ -78,7 +78,7 @@
 
 # Shared libaries (only .c supported)
 # Shared libraries (.so) - all .so files referenced in "xxx-objs"
-host-cshlib	:= $(sort $(filter %.so, $(host-cobjs)))
+host-cshlib	:= $(host-cshlib-extra) $(sort $(filter %.so, $(host-cobjs)))
 # Remove .so files from "xxx-objs"
 host-cobjs	:= $(filter-out %.so,$(host-cobjs))
 

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-11-07 18:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 18:52 [PATCH] [kbuild] Possibility to sanely link against off-directory .so Petr Baudis
2002-11-06 21:29 ` Sam Ravnborg
2002-11-06 22:03   ` Petr Baudis
2002-11-07 10:00     ` Peter Samuelson
2002-11-07 10:57       ` Roman Zippel
2002-11-07 11:47         ` Peter Samuelson
2002-11-07 12:09           ` Roman Zippel
2002-11-07 12:37             ` Peter Samuelson
2002-11-07 13:04               ` Roman Zippel
2002-11-07 13:22                 ` Peter Samuelson
2002-11-07 13:45                   ` Roman Zippel
2002-11-07 13:59                     ` Peter Samuelson
2002-11-07 15:24                   ` Petr Baudis
2002-11-07 16:20                     ` [kbuild-devel] " Kenn Humborg
2002-11-07 18:52                     ` Peter Samuelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®