summaryrefslogtreecommitdiff
path: root/bsdLib.rules
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:26:55 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:26:55 +0000
commitea2a0b7d5958a702bdbcecc17c9c4dea8ce6def5 (patch)
treefd868165c6da4b6f2ad504733f27803878a9d9bb /bsdLib.rules
parent272f68b2bffd736cede856a96231afe237261c8d (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'bsdLib.rules')
-rw-r--r--bsdLib.rules135
1 files changed, 104 insertions, 31 deletions
diff --git a/bsdLib.rules b/bsdLib.rules
index 73e127c..3f80450 100644
--- a/bsdLib.rules
+++ b/bsdLib.rules
@@ -4,7 +4,7 @@ XCOMM $Xorg: bsdLib.rules,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
-XCOMM $XFree86: xc/config/cf/bsdLib.rules,v 3.20 2002/11/18 22:47:25 dawes Exp $
+XCOMM $XFree86: xc/config/cf/bsdLib.rules,v 3.27 2003/11/20 00:41:37 dawes Exp $
/*
* NetBSD/FreeBSD shared library rules
*/
@@ -158,7 +158,9 @@ LintLibReferences(varname,libname,libsource)
*
* Shared libraries depend on -lc. Since we don't have to worry
* about libc vs. libg, etc., this is a good idea. (This is actually
- * implied by using $(CC) to build the shared libraries.)
+ * implied by using $(CC) to build the shared libraries.) Adding it
+ * explicitly will break threaded applications on platforms that use
+ * libc_r for thread support.
*/
#ifndef HasSharedLibraries
@@ -169,7 +171,7 @@ LintLibReferences(varname,libname,libsource)
#endif
#ifndef BaseShLibReqs
-#define BaseShLibReqs /* -lc implied by $(CC) */
+#define BaseShLibReqs /* -lc */
#endif
#ifndef SharedDataSeparation
@@ -201,6 +203,10 @@ LintLibReferences(varname,libname,libsource)
#endif
#endif
+#ifndef HardCodeLibdirFlag
+#define HardCodeLibdirFlag -Wl,-rpath,$(USRLIBDIRPATH)
+#endif
+
#if !defined(ShlibGlobalsFlags)
#define ShlibGlobalsFlags -Wl,-Bsymbolic
#endif
@@ -210,31 +216,74 @@ LintLibReferences(varname,libname,libsource)
* NOTE: file must be executable, hence "INSTBINFLAGS"
*/
#ifndef FreeBSDArchitecture
-#ifndef InstallSharedLibrary
-#define InstallSharedLibrary(libname,rev,dest) @@\
-install:: Concat(lib,libname.so.rev) @@\
- MakeDir($(DESTDIR)dest) @@\
- $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
- @T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`;\ @@\
- set -x; $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T @@\
- @if $(SOSYMLINK); then (set -x; \ @@\
- $(RM) Concat($(DESTDIR)dest/lib,libname.so); \ @@\
- $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)); fi
-#endif /* InstallSharedLibrary */
+INSTALLMINORREV = true
#else
-/* FreeBSD version */
+INSTALLMINORREV = false
+#endif
+
#ifndef InstallSharedLibrary
#define InstallSharedLibrary(libname,rev,dest) @@\
install:: Concat(lib,libname.so.rev) @@\
MakeDir($(DESTDIR)dest) @@\
@T=`echo Concat(lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`;\ @@\
- set -x;\ @@\
- $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest/$$T;\ @@\
- if $(SOSYMLINK); then \ @@\
- $(RM) Concat($(DESTDIR)dest/lib,libname.so);\ @@\
- $(LN) $$T Concat($(DESTDIR)dest/lib,libname.so); fi
+ if $(INSTALLMINORREV); then \ @@\
+ INST=Concat(lib,libname.so.rev); \ @@\
+ LINK=$$T; \ @@\
+ else \ @@\
+ INST=$$T; \ @@\
+ fi; \ @@\
+ (set -x; \ @@\
+ $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) $$INST $(DESTDIR)dest); \ @@\
+ if [ X"$$LINK" != X ]; then (set -x; \ @@\
+ $(RM) $(DESTDIR)dest/$$LINK; \ @@\
+ $(LN) $$INST $(DESTDIR)dest/$$LINK); \ @@\
+ fi; \ @@\
+ if $(SOSYMLINK); then (set -x; \ @@\
+ $(RM) Concat($(DESTDIR)dest/lib,libname.so); \ @@\
+ $(LN) $$T Concat($(DESTDIR)dest/lib,libname.so)); \ @@\
+ fi
#endif /* InstallSharedLibrary */
-#endif /* FreeBSDArchitecture */
+
+#ifndef InstallSharedLibtoolLibrary
+
+#define SetRevisions(rev) V=`expr rev : '\([^:]*\)'`; \ @@\
+ R=`expr rev : '.*:\([^:]*\):'`; \ @@\
+ A=`expr rev : '.*:\([^:]*\)'`; \ @@\
+ REV=$$V; \ @@\
+ REVLIST=""; \ @@\
+ i=$$A; \ @@\
+ while [ $$i -gt 0 ]; do \ @@\
+ REVLIST="$$REVLIST `expr $$REV - $$i`"; \ @@\
+ i=`expr $$i - 1`; \ @@\
+ done
+
+#define InstallSharedLibtoolLibrary(libname,rev,dest) @@\
+install:: Concat(lib,libname.so) @@\
+ MakeDir($(DESTDIR)dest) @@\
+ @set +e; SetRevisions(rev); \ @@\
+ set -e; \ @@\
+ T=Concat(lib,libname.so.$$REV); \ @@\
+ if $(INSTALLMINORREV); then \ @@\
+ INST=$$T.0; \ @@\
+ LINK=$$T; \ @@\
+ else \ @@\
+ INST=$$T; \ @@\
+ fi; \ @@\
+ (set -x; \ @@\
+ $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) $$INST $(DESTDIR)dest); \ @@\
+ if [ X"$$LINK" != X ]; then (set -x; \ @@\
+ $(RM) $(DESTDIR)dest/$$LINK; \ @@\
+ $(LN) $$INST $(DESTDIR)dest/$$LINK); \ @@\
+ fi; \ @@\
+ for i in $$REVLIST; do (set -x; \ @@\
+ $(RM) Concat($(DESTDIR)dest/lib,libname.so.$$i); \ @@\
+ $(LN) Concat(lib,libname.so.$$REV) Concat($(DESTDIR)dest/lib,libname.so.$$i)); \ @@\
+ done; \ @@\
+ if $(SOSYMLINK); then (set -x; \ @@\
+ $(RM) Concat($(DESTDIR)dest/lib,libname.so); \ @@\
+ $(LN) Concat(lib,libname.so.$$REV) Concat($(DESTDIR)dest/lib,libname.so)); \ @@\
+ fi
+#endif /* InstallSharedLibtoolLibrary */
/*
* InstallSharedLibraryData - generate rules to install the shared library data
@@ -250,21 +299,14 @@ install:: Concat(lib,libname.so.rev) @@\
* the library gone for long periods.
*/
#ifndef SharedLibraryTarget
-#ifdef UseInstalled
-#define LinkBuildSonameLibrary(lib) true
-#else
-#define LinkBuildSonameLibrary(lib) (RemoveFile($(BUILDLIBDIR)/lib); \
- cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .)
-#endif
-
#define SharedLibraryTarget(libname,rev,solist,down,up) @@\
AllTarget(Concat(lib,libname.so.rev)) @@\
@@\
Concat(lib,libname.so.rev): solist @@\
$(RM) $@~ @@\
- @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \ @@\
- (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
- $(RM) $$SONAME; $(LN) $@ $$SONAME; \ @@\
+ @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; \ @@\
+ (set -x; cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
+ (set -x; $(RM) $$SONAME; $(LN) $@ $$SONAME); \ @@\
LinkBuildSonameLibrary($$SONAME) @@\
$(RM) $@ @@\
$(MV) $@~ $@ @@\
@@ -282,6 +324,37 @@ clean:: @@\
#endif /* SharedLibraryTarget */
+#ifndef SharedLibtoolLibraryTarget
+#define SharedLibtoolLibraryTarget(libname,rev,solist,down,up) @@\
+AllTarget(Concat(lib,libname.so)) @@\
+ @@\
+Concat(lib,libname.so): solist @@\
+ $(RM) $@~ @@\
+ @set +e; SetRevisions(rev); \ @@\
+ SONAME=$@.$$REV; \ @@\
+ set -e; \ @@\
+ (set -x; cd down; $(CC) -o up/$$SONAME~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
+ (set -x; $(RM) $$SONAME; $(MV) $$SONAME~ $$SONAME); \ @@\
+ LinkBuildSonameLibrary($$SONAME); \ @@\
+ if $(INSTALLMINORREV); then (set -x; \ @@\
+ $(RM) $$SONAME.0; \ @@\
+ $(LN) $$SONAME $$SONAME.0); \ @@\
+ fi; \ @@\
+ if $(SOSYMLINK); then (set -x; \ @@\
+ $(RM) $@; \ @@\
+ $(LN) $$SONAME $@); \ @@\
+ LinkBuildLibraryInline($@); \ @@\
+ fi @@\
+ @@\
+clean:: @@\
+ @set +e; SetRevisions(rev); \ @@\
+ set -xe; \ @@\
+ $(RM) Concat(lib,libname.so.$$REV); \ @@\
+ $(RM) Concat(lib,libname.so.$$REV.0) @@\
+ $(RM) Concat(lib,libname.so)
+
+#endif /* SharedLibtoolLibraryTarget */
+
/*
* SharedDepLibraryTarget - generate rules to create a shared library.
*/