Bug#163892: C++ support in libGLU (patch, upstream problem)
Package: xfree86
Version: 4.2.1-1
Severity: normal
This patch defines a SharedDepCplusplusLibraryTarget for FreeBSD and
NetBSD. While the ELF section in bsdLib.rules is noted as having been
copied from the Linux version, this clearly predated the addition of C++
code and support, and the target appears to have never been added to the
BSD ruleset, making it impossible to compile cleanly using GCC 3.x (libGLU
is linked without a dependancy on libstdc++, and any attempt to compile a
normal C program which calls libGLU will fail).
Patch authored by Joel Baker <lucifer@lightbearer.com>, based on the rules
already present in lnxLib.rules.
--
***************************************************************************
Joel Baker System Administrator - lightbearer.com
lucifer@lightbearer.com http://users.lightbearer.com/lucifer/
This patch defines a SharedDepCplusplusLibraryTarget for FreeBSD and
NetBSD. While the ELF section in bsdLib.rules is noted as having been
copied from the Linux version, this clearly predated the addition of C++
code and support, and the target appears to have never been added to the
BSD ruleset, making it impossible to compile cleanly using GCC 3.x (libGLU
is linked without a dependancy on libstdc++, and any attempt to compile a
normal C program which calls libGLU will fail).
Patch authored by Joel Baker <lucifer@lightbearer.com>, based on the rules
already present in lnxLib.rules.
diff -ur xc-dist/config/cf/bsdLib.rules xc/config/cf/bsdLib.rules
--- xc-dist/config/cf/bsdLib.rules 2002-01-17 23:29:05.000000000 +0000
+++ xc/config/cf/bsdLib.rules 2002-10-09 01:26:13.000000000 +0000
@@ -306,6 +306,34 @@
#endif /* SharedDepLibraryTarget */
+/*
+ * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
+ */
+#ifndef SharedDepCplusplusLibraryTarget
+#define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up) @@\
+AllTarget(Concat(lib,libname.so.rev)) @@\
+ @@\
+Concat(lib,libname.so.rev): deplist @@\
+ $(RM) $@~ @@\
+ @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \ @@\
+ (cd down; $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
+ $(RM) $$SONAME; $(LN) $@ $$SONAME; \ @@\
+ LinkBuildSonameLibrary($$SONAME) @@\
+ $(RM) $@ @@\
+ $(MV) $@~ $@ @@\
+ $(RM) Concat(lib,libname.so) @@\
+ $(LN) $@ Concat(lib,libname.so) @@\
+ LinkBuildLibrary($@) @@\
+ LinkBuildLibrary(Concat(lib,libname.so)) @@\
+ @@\
+clean:: @@\
+ @SONAME=`echo Concat(lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`; \ @@\
+ set -x; $(RM) $$SONAME @@\
+ $(RM) Concat(lib,libname.so) @@\
+ $(RM) Concat(lib,libname.so.rev)
+
+#endif /* SharedDepCplusplusLibraryTarget */
+
#ifndef SharedDepModuleTarget
#define SharedDepModuleTarget(name,deps,solist) @@\
AllTarget(name) @@\
Reply to: