From 044df506c1e1e7ace4e39a1e268f458965f6845b Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 26 May 1995 02:17:43 +0000 Subject: [PATCH] Add support building shared libraries git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5885 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/ChangeLog | 4 ++++ src/lib/crypto/Makefile.in | 34 +++++++++++++++++++++++-------- src/lib/crypto/configure.in | 3 +++ src/lib/crypto/crc32/ChangeLog | 4 ++++ src/lib/crypto/crc32/Makefile.in | 10 ++++++++- src/lib/crypto/crc32/configure.in | 1 + src/lib/crypto/des/ChangeLog | 4 ++++ src/lib/crypto/des/Makefile.in | 10 ++++++++- src/lib/crypto/des/configure.in | 1 + src/lib/crypto/md4/ChangeLog | 4 ++++ src/lib/crypto/md4/Makefile.in | 10 ++++++++- src/lib/crypto/md4/configure.in | 1 + src/lib/crypto/md5/ChangeLog | 4 ++++ src/lib/crypto/md5/Makefile.in | 10 ++++++++- src/lib/crypto/md5/configure.in | 1 + src/lib/crypto/os/ChangeLog | 4 ++++ src/lib/crypto/os/Makefile.in | 28 +++++++++++++++++++++++-- src/lib/crypto/os/configure.in | 1 + 18 files changed, 120 insertions(+), 14 deletions(-) diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog index a54982194..2a4150932 100644 --- a/src/lib/crypto/ChangeLog +++ b/src/lib/crypto/ChangeLog @@ -1,3 +1,7 @@ +Thu May 25 22:15:18 1995 Theodore Y. Ts'o (tytso@dcl) + + * configure.in, Makefile.in: Add support for shared libraries. + Thu Apr 13 15:49:16 1995 Keith Vetter (keithv@fusion.com) * *.[ch]: removed unneeded INTERFACE from non-api functions. diff --git a/src/lib/crypto/Makefile.in b/src/lib/crypto/Makefile.in index 9a026d40b..f3ab8c2e7 100644 --- a/src/lib/crypto/Makefile.in +++ b/src/lib/crypto/Makefile.in @@ -6,6 +6,10 @@ CFLAGS = $(CCOPTS) $(DEFS) -I$(srcdir)/crc32 -I$(srcdir)/des -I$(srcdir)/md4 -I$ TST=if test -n "`cat DONE`" ; then +.c.o: + $(CC) $(CFLAGS) -c $(srcdir)/$*.c +@SHARED_RULE@ + OBJS= cryptoconf.$(OBJEXT) \ des_crc.$(OBJEXT) \ des_md5.$(OBJEXT) \ @@ -16,21 +20,34 @@ SRCS= $(srcdir)/cryptoconf.c \ $(srcdir)/des_md5.c \ $(srcdir)/raw_des.c +LIB_SUBDIRS= des md4 md5 crc32 os . +LIBUPDATE= $(BUILDTOP)/util/libupdate +LIBDONE= ./des/DONE ./md4/DONE ./md5/DONE ./crc32/DONE ./os/DONE ./DONE + all:: all-$(WHAT) -all-unix:: +all-unix:: shared + +shared: + mkdir shared + # FIXME, need to build the library too... all-mac:: $(OBJS) all-windows:: $(OBJS) -libcrypto.a: ./des/DONE ./md4/DONE ./md5/DONE ./crc32/DONE ./os/DONE $(OBJS) - (cd des; $(TST) $(ARADD) ../$@ `cat DONE` ; fi) - (cd crc32; $(TST) $(ARADD) ../$@ `cat DONE` ; fi) - (cd md4; $(TST) $(ARADD) ../$@ `cat DONE` ; fi) - (cd md5; $(TST) $(ARADD) ../$@ `cat DONE` ; fi) - (cd os; $(TST) $(ARADD) ../$@ `cat DONE` ; fi) - $(ARADD) $@ $(OBJS) +libcrypto.a: $(LIBDONE) + if test -f $@ ; then \ + for i in $(LIB_SUBDIRS) ; \ + do \ + $(LIBUPDATE) $@ $$i/DONE $$i ; \ + done ; \ + else \ + for i in $(LIB_SUBDIRS) ; \ + do \ + $(LIBUPDATE) --force $@ $$i/DONE $$i ; \ + done ; \ + fi $(RANLIB) $@ libcrypto.lib: @@ -44,6 +61,7 @@ clean:: clean-$(WHAT) clean-unix:: $(RM) libcrypto.a + $(RM) shared/* clean-windows:: $(RM) crypto.lib crypto.bak diff --git a/src/lib/crypto/configure.in b/src/lib/crypto/configure.in index e4cc97542..93b4e30e2 100644 --- a/src/lib/crypto/configure.in +++ b/src/lib/crypto/configure.in @@ -7,10 +7,13 @@ AC_PROG_ARCHIVE AC_PROG_ARCHIVE_ADD AC_PROG_RANLIB AC_PROG_INSTALL +V5_SHARED_LIB_OBJS +SubdirLibraryRule([${OBJS}]) MAKE_SUBDIRS("making",all) MAKE_SUBDIRS("cleaning",clean) MAKE_SUBDIRS("checking",check) AppendRule([all:: libcrypto.a]) +V5_MAKE_SHARED_LIB(libcrypto) KRB_INCLUDE WITH_KRB5ROOT V5_AC_OUTPUT_MAKEFILE diff --git a/src/lib/crypto/crc32/ChangeLog b/src/lib/crypto/crc32/ChangeLog index a0b358fa2..a1fa14f8c 100644 --- a/src/lib/crypto/crc32/ChangeLog +++ b/src/lib/crypto/crc32/ChangeLog @@ -1,3 +1,7 @@ +Thu May 25 22:15:49 1995 Theodore Y. Ts'o (tytso@dcl) + + * configure.in, Makefile.in: Add support for shared libraries. + Thu Apr 13 15:49:16 1995 Keith Vetter (keithv@fusion.com) * *.[ch]: removed unneeded INTERFACE from non-api functions. diff --git a/src/lib/crypto/crc32/Makefile.in b/src/lib/crypto/crc32/Makefile.in index fdcefce1f..84e905217 100644 --- a/src/lib/crypto/crc32/Makefile.in +++ b/src/lib/crypto/crc32/Makefile.in @@ -4,11 +4,18 @@ CFLAGS = $(CCOPTS) $(DEFS) ##DOSLIBNAME=..\crypto.lib ##DOS!include $(BUILDTOP)\config\windows.in +.c.o: + $(CC) $(CFLAGS) -c $(srcdir)/$*.c +@SHARED_RULE@ + OBJS= crc.$(OBJEXT) SRCS= $(srcdir)/crc.c $(srcdir)/crctest.c -all:: $(OBJS) +all:: shared $(OBJS) + +shared: + mkdir shared crctest: crctest.$(OBJEXT) $(OBJS) $(RM) crctest @@ -22,3 +29,4 @@ check:: crctest$(EXEEXT) clean:: $(RM) crctest$(EXEEXT) crctest.$(OBJEXT) + $(RM) shared/* diff --git a/src/lib/crypto/crc32/configure.in b/src/lib/crypto/crc32/configure.in index f5e1ec7be..872efe65f 100644 --- a/src/lib/crypto/crc32/configure.in +++ b/src/lib/crypto/crc32/configure.in @@ -2,6 +2,7 @@ AC_INIT(configure.in) WITH_CCOPTS AC_SET_BUILDTOP CONFIG_RULES +V5_SHARED_LIB_OBJS SubdirLibraryRule([${OBJS}]) KRB_INCLUDE V5_AC_OUTPUT_MAKEFILE diff --git a/src/lib/crypto/des/ChangeLog b/src/lib/crypto/des/ChangeLog index e731379a9..de5697a74 100644 --- a/src/lib/crypto/des/ChangeLog +++ b/src/lib/crypto/des/ChangeLog @@ -1,3 +1,7 @@ +Thu May 25 22:16:02 1995 Theodore Y. Ts'o (tytso@dcl) + + * configure.in, Makefile.in: Add support for shared libraries. + Fri May 12 02:46:13 1995 Mark Eichin * key_sched.c (mit_des_key_sched): *always* fill in the schedule, diff --git a/src/lib/crypto/des/Makefile.in b/src/lib/crypto/des/Makefile.in index d874fc77e..45f91ec52 100644 --- a/src/lib/crypto/des/Makefile.in +++ b/src/lib/crypto/des/Makefile.in @@ -15,6 +15,10 @@ OTHERSRCS=$(srcdir)/f_cbc.c $(srcdir)/f_cksum.c \ OTHEROBJS=f_cbc.$(OBJEXT) f_cksum.$(OBJEXT) f_sched.$(OBJEXT) f_ecb.$(OBJEXT) f_parity.$(OBJEXT) f_tables.$(OBJEXT) +.c.o: + $(CC) $(CFLAGS) -c $(srcdir)/$*.c +@SHARED_RULE@ + OBJS= cbc_cksum.$(OBJEXT) \ cs_entry.$(OBJEXT) \ finish_key.$(OBJEXT) \ @@ -41,7 +45,10 @@ SRCS= $(srcdir)/cs_entry.c \ $(srcdir)/weak_key.c \ $(OTHERSRCS) -all:: $(OBJS) +all:: shared $(OBJS) + +shared: + mkdir shared includes:: depend @@ -71,3 +78,4 @@ check-windows:: clean:: $(RM) destest$(EXEEXT) verify$(EXEEXT) destest.$(OBJEXT) verify.$(OBJEXT) + $(RM) shared/* diff --git a/src/lib/crypto/des/configure.in b/src/lib/crypto/des/configure.in index 02ee60867..275255710 100644 --- a/src/lib/crypto/des/configure.in +++ b/src/lib/crypto/des/configure.in @@ -3,6 +3,7 @@ WITH_CCOPTS AC_SET_BUILDTOP CONFIG_RULES WITH_NETLIB +V5_SHARED_LIB_OBJS SubdirLibraryRule([${OBJS}]) KRB_INCLUDE V5_AC_OUTPUT_MAKEFILE diff --git a/src/lib/crypto/md4/ChangeLog b/src/lib/crypto/md4/ChangeLog index 3b84efff8..02d869348 100644 --- a/src/lib/crypto/md4/ChangeLog +++ b/src/lib/crypto/md4/ChangeLog @@ -1,3 +1,7 @@ +Thu May 25 22:16:14 1995 Theodore Y. Ts'o (tytso@dcl) + + * configure.in, Makefile.in: Add support for shared libraries. + Thu Apr 20 11:39:15 1995 * rsa-md4.h: removed unneeded #include of wordsize.h diff --git a/src/lib/crypto/md4/Makefile.in b/src/lib/crypto/md4/Makefile.in index c2cb995c2..50f2b8470 100644 --- a/src/lib/crypto/md4/Makefile.in +++ b/src/lib/crypto/md4/Makefile.in @@ -5,11 +5,18 @@ CFLAGS = $(CCOPTS) $(DEFS) -I$(srcdir)/../des -I"$(srcdir)" ##DOSLIBNAME=..\crypto.lib ##DOS!include $(BUILDTOP)\config\windows.in +.c.o: + $(CC) $(CFLAGS) -c $(srcdir)/$*.c +@SHARED_RULE@ + OBJS= md4.$(OBJEXT) md4glue.$(OBJEXT) md4crypto.$(OBJEXT) SRCS= $(srcdir)/md4.c $(srcdir)/md4glue.c $(srcdir)/md4crypto.c -all:: $(OBJS) +all:: shared $(OBJS) + +shared: + mkdir shared t_mddriver.c: $(srcdir)/../md5/t_mddriver.c $(CP) $(srcdir)/../md5/t_mddriver.c t_mddriver.c @@ -30,3 +37,4 @@ check:: t_mddriver$(EXEEXT) clean:: $(RM) t_mddriver$(EXEEXT) t_mddriver.$(OBJEXT) t_mddriver.c + $(RM) shared/* diff --git a/src/lib/crypto/md4/configure.in b/src/lib/crypto/md4/configure.in index f5e1ec7be..872efe65f 100644 --- a/src/lib/crypto/md4/configure.in +++ b/src/lib/crypto/md4/configure.in @@ -2,6 +2,7 @@ AC_INIT(configure.in) WITH_CCOPTS AC_SET_BUILDTOP CONFIG_RULES +V5_SHARED_LIB_OBJS SubdirLibraryRule([${OBJS}]) KRB_INCLUDE V5_AC_OUTPUT_MAKEFILE diff --git a/src/lib/crypto/md5/ChangeLog b/src/lib/crypto/md5/ChangeLog index dd52074f8..0ed77d12d 100644 --- a/src/lib/crypto/md5/ChangeLog +++ b/src/lib/crypto/md5/ChangeLog @@ -1,3 +1,7 @@ +Thu May 25 22:16:26 1995 Theodore Y. Ts'o (tytso@dcl) + + * configure.in, Makefile.in: Add support for shared libraries. + Thu Apr 13 15:49:16 1995 Keith Vetter (keithv@fusion.com) * *.[ch]: removed unneeded INTERFACE from non-api functions. diff --git a/src/lib/crypto/md5/Makefile.in b/src/lib/crypto/md5/Makefile.in index f07c86a6a..4a72f33c0 100644 --- a/src/lib/crypto/md5/Makefile.in +++ b/src/lib/crypto/md5/Makefile.in @@ -4,11 +4,18 @@ CFLAGS = $(CCOPTS) $(DEFS) -I$(srcdir)/../des ##DOSLIBNAME=..\crypto.lib ##DOS!include $(BUILDTOP)\config\windows.in +.c.o: + $(CC) $(CFLAGS) -c $(srcdir)/$*.c +@SHARED_RULE@ + OBJS= md5.$(OBJEXT) md5glue.$(OBJEXT) md5crypto.$(OBJEXT) SRCS= $(srcdir)/md5.c $(srcdir)/md5glue.c $(srcdir)/md5crypto.c -all:: $(OBJS) +all:: shared $(OBJS) + +shared: + mkdir shared t_mddriver: t_mddriver.o md5.o $(CC) $(CFLAGS) $(LDFLAGS) -o t_mddriver t_mddriver.o md5.o @@ -21,3 +28,4 @@ check:: t_mddriver$(EXEEXT) clean:: $(RM) t_mddriver$(EXEEXT) t_mddriver.$(OBJEXT) + $(RM) shared/* diff --git a/src/lib/crypto/md5/configure.in b/src/lib/crypto/md5/configure.in index f5e1ec7be..872efe65f 100644 --- a/src/lib/crypto/md5/configure.in +++ b/src/lib/crypto/md5/configure.in @@ -2,6 +2,7 @@ AC_INIT(configure.in) WITH_CCOPTS AC_SET_BUILDTOP CONFIG_RULES +V5_SHARED_LIB_OBJS SubdirLibraryRule([${OBJS}]) KRB_INCLUDE V5_AC_OUTPUT_MAKEFILE diff --git a/src/lib/crypto/os/ChangeLog b/src/lib/crypto/os/ChangeLog index 465ec902b..49f2e13d7 100644 --- a/src/lib/crypto/os/ChangeLog +++ b/src/lib/crypto/os/ChangeLog @@ -1,3 +1,7 @@ +Thu May 25 22:16:35 1995 Theodore Y. Ts'o (tytso@dcl) + + * configure.in, Makefile.in: Add support for shared libraries. + Thu Apr 13 15:49:16 1995 Keith Vetter (keithv@fusion.com) * *.[ch]: removed unneeded INTERFACE from non-api functions. diff --git a/src/lib/crypto/os/Makefile.in b/src/lib/crypto/os/Makefile.in index a056d70d3..9c63c7976 100644 --- a/src/lib/crypto/os/Makefile.in +++ b/src/lib/crypto/os/Makefile.in @@ -6,24 +6,48 @@ CFLAGS = $(CCOPTS) $(DEFS) LIBOBJS = @LIBOBJS@ +.c.o: + $(CC) $(CFLAGS) -c $(srcdir)/$*.c +@SHARED_RULE@ + OBJS= rnd_confoun.$(OBJEXT) localaddr.$(OBJEXT) ustime.$(OBJEXT) $(LIBOBJS) SRCS= rnd_confoun.c all:: all-$(WHAT) -all-unix:: $(OBJS) + +all-unix:: shared $(OBJS) + all-mac:: $(OBJS) + all-windows: rnd_confoun.obj +shared: + mkdir shared + + localaddr.c: $(SRCTOP)$(S)lib$(S)krb5$(S)os$(S)localaddr.c -$(LN) $(SRCTOP)$(S)lib$(S)krb5$(S)os$(S)localaddr.c $@ ustime.c: $(SRCTOP)$(S)lib$(S)krb5$(S)os$(S)ustime.c -$(LN) $(SRCTOP)$(S)lib$(S)krb5$(S)os$(S)ustime.c $@ - memmove.c: $(SRCTOP)$(S)lib$(S)krb5$(S)posix$(S)memmove.c -$(LN) $(SRCTOP)$(S)lib$(S)krb5$(S)posix$(S)memmove.c $@ +localaddr.o: localaddr.c + $(CC) $(CFLAGS) -c $*.c +@SHARED_RULE_LOCAL@ + +ustime.o: ustime.c + $(CC) $(CFLAGS) -c $*.c +@SHARED_RULE_LOCAL@ + +memmove.o: memmove.c + $(CC) $(CFLAGS) -c $*.c +@SHARED_RULE_LOCAL@ + + clean:: $(RM) ustime.c localaddr.c memmove.c + $(RM) shared/* diff --git a/src/lib/crypto/os/configure.in b/src/lib/crypto/os/configure.in index 4ce58eb8e..7a6e366ed 100644 --- a/src/lib/crypto/os/configure.in +++ b/src/lib/crypto/os/configure.in @@ -2,6 +2,7 @@ AC_INIT(configure.in) WITH_CCOPTS AC_SET_BUILDTOP CONFIG_RULES +V5_SHARED_LIB_OBJS SubdirLibraryRule([${OBJS}]) KRB_INCLUDE AC_LN_S -- 2.26.2