[2635] in Release_Engineering
shared library patches for Imake configs
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Tue Jun 11 19:53:47 1991
Date: Tue, 11 Jun 91 16:53:12 -0700
From: "Jonathan I. Kamens" <jik@cats.UCSC.EDU>
To: rel-eng@ATHENA.MIT.EDU
These patches do two things:
1. They change the way shared libraries are handled, so that it is
closer to how the X Imakefiles do things, and so that (I think) it
will be easier to support shared libraries on multiple platforms.
It's more customizable on a per-platform basis, which is important
since different platforms do shared libraries so differently.
2. It introduces some rudimentary support for sun workstations in
site.def.
*** 1.20 1991/06/11 01:08:58
--- Imake.rules 1991/06/11 23:21:48
***************
*** 4,9 ****
--- 4,11 ----
* create_dir(dir) - Create a directory hierarchy
* AnsiCC() - Specify desire for ANSI compiling
* ProfiledObjectRule() - Build profiled objects/libraries
+ * SharedObjectRule() - Build shared objects/libraries
+ * ProfiledSharedObjectRule() - Build both profiled and shared
* SpecialObject(obj,depends,options) - Build a special object
*
* cmd_table(tbl) - build a command table module (tbl.ct)
***************
*** 17,22 ****
--- 19,26 ----
* SimpleLibrary(base,objs,destdir) - Build/install a library (simple)
* build_library(base,objs) - Build a library
* install_library(base,dir) - Install a library
+ * build_shared_library(base,objs,rev) - Build a shared library
+ * install_shared_library(base,dir,rev) - Install a shared library
*
* SimpleLint(base,srcs) - Build/install a lint library
*
***************
*** 84,96 ****
done
#define ProfiledObjectRule() @@\
! .c.o: @@\
$(RM) $@ profiled/$@ @@\
$(CC) ProfCcFlags -c $(CFLAGS) $*.c @@\
mv $*.o profiled/$*.o @@\
$(CC) -c $(CFLAGS) $*.c @@\
all:: profiled all-prof @@\
! install:: inst-prof @@\
profiled: @@\
-mkdir $@ @@\
clean:: @@\
--- 88,100 ----
done
#define ProfiledObjectRule() @@\
! .c.o: @@\
$(RM) $@ profiled/$@ @@\
$(CC) ProfCcFlags -c $(CFLAGS) $*.c @@\
mv $*.o profiled/$*.o @@\
$(CC) -c $(CFLAGS) $*.c @@\
all:: profiled all-prof @@\
! install:: profiled inst-prof @@\
profiled: @@\
-mkdir $@ @@\
clean:: @@\
***************
*** 98,108 ****
all-prof inst-prof::
#define SharedObjectRule() @@\
all:: shared all-shared @@\
! install:: inst-shared @@\
shared: @@\
-mkdir $@ @@\
! all-prof inst-prof::
#define AnsiCC() @@\
CC=AnsiCcCmd @@\
--- 102,137 ----
all-prof inst-prof::
#define SharedObjectRule() @@\
+ .c.o: @@\
+ $(RM) $@ shared/$@ @@\
+ $(CC) SharedCcFlags -c $(CFLAGS) $*.c @@\
+ mv $*.o shared/$*.o @@\
+ $(CC) -c $(CFLAGS) $*.c @@\
all:: shared all-shared @@\
! install:: shared inst-shared @@\
shared: @@\
-mkdir $@ @@\
! clean:: @@\
! $(RM) -r shared @@\
! all-shared inst-shared::
!
! #define ProfiledSharedObjectRule() @@\
! .c.o: @@\
! $(RM) $@ profiled/$@ shared/$@ @@\
! $(CC) ProfCcFlags -c $(CFLAGS) $*.c @@\
! mv $*.o profiled/$*.o @@\
! $(CC) SharedCcFlags -c $(CFLAGS) $*.c @@\
! mv $*.o shared/$*.o @@\
! $(CC) -c $(CFLAGS) $*.c @@\
! all:: profiled shared all-prof all-shared @@\
! install:: profiled shared inst-prof inst-shared @@\
! profiled: @@\
! -mkdir $@ @@\
! shared: @@\
! -mkdir $@ @@\
! clean:: @@\
! $(RM) -r profiled shared @@\
! all-prof inst-prof all-shared inst-shared::
#define AnsiCC() @@\
CC=AnsiCcCmd @@\
***************
*** 126,131 ****
--- 155,164 ----
clean:: @@\
$(RM) tbl/**/.c
+ #ifndef build_shared_library
+ #define build_shared_library(base,objs,rev)
+ #endif
+
#define build_library(base,objs) @@\
all:: lib/**/base.a @@\
lib/**/base.a:: objs @@\
***************
*** 135,143 ****
lib/**/base/**/_p.a: objs @@\
cd profiled; ar cru ../lib/**/base/**/_p.a objs @@\
$(RANLIB) lib/**/base/**/_p.a @@\
! all-shared:: lib/**/base/**/_s.a @@\
! lib/**/base/**/_s.a: objs @@\
! $(MKSHLIB) $@ objs
#define install_library(base,dir) @@\
install:: lib/**/base.a @@\
--- 168,178 ----
lib/**/base/**/_p.a: objs @@\
cd profiled; ar cru ../lib/**/base/**/_p.a objs @@\
$(RANLIB) lib/**/base/**/_p.a @@\
! build_shared_library(base,objs,)
!
! #ifndef install_shared_library
! #define install_shared_library(base,objs,rev)
! #endif
#define install_library(base,dir) @@\
install:: lib/**/base.a @@\
***************
*** 148,157 ****
$(RM) $(DESTDIR)dir/lib/**/base/**/_p.a @@\
$(INSTALL) -m 0644 lib/**/base/**/_p.a $(DESTDIR)dir @@\
$(RANLIB) $(DESTDIR)dir/lib/**/base/**/_p.a @@\
! inst-shared:: lib/**/base/*/_s.a @@\
! $(RM) $(DESTDIR)dir/lib/**/base/**/$(SHLIB_EXT).a @@\
! $(INSTALL) -m 0644 lib/**/base/**/_s.a $(DESTDIR)dir/$(SHLIB_DIR)lib/**/base/**/$(SHLIB_EXT).a @@\
! $(RANLIB) $(DESTDIR)dir/lib/**/base/**/$(SHLIB_EXT).a
#define SimpleLibrary(base,objs,dir) @@\
build_library(base,objs) @@\
--- 183,189 ----
$(RM) $(DESTDIR)dir/lib/**/base/**/_p.a @@\
$(INSTALL) -m 0644 lib/**/base/**/_p.a $(DESTDIR)dir @@\
$(RANLIB) $(DESTDIR)dir/lib/**/base/**/_p.a @@\
! install_shared_library(base,objs,)
#define SimpleLibrary(base,objs,dir) @@\
build_library(base,objs) @@\
*** 1.18 1991/05/27 14:33:12
--- Imake.tmpl 1991/06/11 23:17:11
***************
*** 97,102 ****
--- 97,105 ----
#ifndef ProfCcFlags
#define ProfCcFlags -p
#endif
+ #ifndef SharedCcFlags
+ #define SharedCcFlags
+ #endif
#ifndef LdFlags
#define LdFlags
#endif
***************
*** 109,120 ****
#ifndef LintFlags
#define LintFlags $(DEFINES) -I$(ATHINCDIR)
#endif
- #ifndef ShlibExt
- #define ShlibExt _s
- #endif
- #ifndef ShlibDir
- #define ShlibDir
- #endif
SHELL=/bin/sh
MAKESHELL=/bin/sh
--- 112,117 ----
***************
*** 153,160 ****
CFLAGS=$(CDEBUG) CcFlags $(DEFINES) -I$(ATHINCDIR)
LDFLAGS=LdFlags $(CFLAGS) -L$(ATHLIBDIR)
LDLIBS=LdLibs
- SHLIB_EXT=ShlibExt
- SHLIB_DIR=ShlibDir
#include "Imake.rules"
--- 150,155 ----
*** 1.9 1991/05/27 14:33:13
--- site.def 1991/06/11 23:16:26
***************
*** 46,53 ****
#define ABinDir /usr/athena/bin
#define AIncDir /usr/athena/include
#define AManDir /usr/athena/man
- #define ShlibExt
- #define ShlibDir ../lib.shared/
#else
#define CcFlags LintFlags -q
#define AnsiCcCmd cc -qro
--- 46,51 ----
***************
*** 62,65 ****
--- 60,85 ----
*/
#ifdef _AUX_SOURCE
#define RanLibCmd true
+ #endif
+
+
+ /*
+ * SunOS on a SPARCstation
+ */
+ #if defined(sparc) && defined(sun)
+ #define AManDir /usr/man
+ #define AIncDir /usr/include
+ #define ALibDir /usr/lib
+ #define ARBinDir /sbin/athena
+ #define AnsiCcCmd gcc
+ #define AnsiLdCmd gcc
+ #define ProfCcFlags -pg
+ #define SharedCcFlags -pic
+ #define build_shared_library(base,objs,rev) @@\
+ all-shared:: lib/**/base/**/.so/**/rev @@\
+ lib/**/base/**/.so/**/rev: objs @@\
+ (cd shared; ld -assert pure-text -o ../lib/**/base/**/.so/**/rev objs)
+ #define install_shared_library(base,dir,rev) @@\
+ inst-shared:: lib/**/base/**/.so/**/rev @@\
+ $(INSTALL) -c -m 644 lib/**/base/**/.so/**/rev $(DESTDIR)/**/dir/lib/**/base/**/.so/**/rev
#endif