More tweaks to deal with parallel builds
authorTom Yu <tlyu@mit.edu>
Thu, 13 Feb 2003 00:23:45 +0000 (00:23 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 13 Feb 2003 00:23:45 +0000 (00:23 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15185 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/generic/ChangeLog
src/lib/gssapi/generic/Makefile.in
src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/Makefile.in

index b6b55340abe2adfbbc28c67b6560a9e47587e762..3eb27c5fd84e83ef726908744877fee62a3a2c29 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-12  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in: Remove stamp rules.  Explicitly creates header
+       directory if needed.
+       (gssapi.h): Tweak to avoid race conditions.
+
 2003-02-11  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in (gssapi-include): New rules to avoid coding
index c7e01765e6bb750224c8f48f75f2bfc9dfbfdaf4..8ac282f374c3feae07d9edc5a85215b140f6fdc5 100644 (file)
@@ -20,14 +20,16 @@ EHDRDIR= $(BUILDTOP)$(S)include$(S)gssapi
 HDRS=  $(EHDRDIR)$(S)gssapi.h \
        $(EHDRDIR)$(S)gssapi_generic.h
 
-EHDRDIRSTAMP=$(EHDRDIR)/stamp
-##DOS##EHDRDIRSTAMP=
+MK_EHDRDIR=if test -d $(EHDRDIR); then :; else (set -x; mkdir $(EHDRDIR)); fi
+##DOS##MK_EHDRDIR=rem
 
 gssapi-include: $(EHDRDIR)$(S)gssapi.h
 
-$(EHDRDIR)$(S)gssapi.h: gssapi.h $(EHDRDIRSTAMP)
+$(EHDRDIR)$(S)gssapi.h: gssapi.h
+       @$(MK_EHDRDIR)
        $(CP) gssapi.h $@
-$(EHDRDIR)$(S)gssapi_generic.h: $(srcdir)$(S)gssapi_generic.h $(EHDRDIRSTAMP)
+$(EHDRDIR)$(S)gssapi_generic.h: $(srcdir)$(S)gssapi_generic.h
+       @$(MK_EHDRDIR)
        $(CP) $(srcdir)$(S)gssapi_generic.h $@
 
 $(OUTPRE)gssapi_err_generic.$(OBJEXT): gssapi_err_generic.c
@@ -35,14 +37,16 @@ gssapi_err_generic.h: gssapi_err_generic.et
 gssapi_err_generic.c: gssapi_err_generic.et
 
 gssapi.h: gssapi.hin
-       $(RM) $@
-       echo "/* This is the gssapi.h prologue. */" >> $@
-       echo "/* It contains some choice pieces of autoconf.h */" >> $@
-       grep SIZEOF $(BUILDTOP)/include/krb5/autoconf.h >> $@
-       grep 'HAVE_.*_H' $(BUILDTOP)/include/krb5/autoconf.h >> $@
-       grep 'USE_.*_H' $(BUILDTOP)/include/krb5/autoconf.h >> $@
-       echo "/* End of gssapi.h prologue. */" >> $@
-       cat $(srcdir)/gssapi.hin >> $@
+       @echo "Creating gssapi.h" ; \
+       h=gss$$$$; $(RM) $$h; \
+       (echo "/* This is the gssapi.h prologue. */"; \
+       echo "/* It contains some choice pieces of autoconf.h */"; \
+       grep SIZEOF $(BUILDTOP)/include/krb5/autoconf.h; \
+       grep 'HAVE_.*_H' $(BUILDTOP)/include/krb5/autoconf.h; \
+       grep 'USE_.*_H' $(BUILDTOP)/include/krb5/autoconf.h; \
+       echo "/* End of gssapi.h prologue. */"; \
+       cat $(srcdir)/gssapi.hin )> $$h && \
+       (set -x; $(MV) $$h $@) ; e=$$?; $(RM) $$h; exit $$e
 
 #if HasHashLibrary
 # UTIL_VALIDATE_SRC= $(srcdir)/util_validate.c
@@ -102,7 +106,6 @@ EXPORTED_BUILT_HEADERS= gssapi.h
 
 $(OBJS): $(EXPORTED_HEADERS) $(ETHDRS)
 
-all-unix:: includes-unix
 all-unix:: $(EXPORTED_HEADERS) $(ETHDRS) $(HDRS)
 all-unix:: all-libobjs
 
@@ -115,12 +118,6 @@ all-windows:: $(HDRS)
 win-create-ehdrdir:
        if not exist $(EHDRDIR)\nul mkdir $(EHDRDIR)
 
-$(EHDRDIR)/stamp:
-       @if test -d $(EHDRDIR); then :; \
-               else (set -x; mkdir $(EHDRDIR)) fi; touch $@
-
-includes-unix: $(EHDRDIR)$(S)stamp
-
 clean-unix:: clean-libobjs
        $(RM) $(ETHDRS) $(ETSRCS) $(HDRS) $(EXPORTED_BUILT_HEADERS)
 
index 21f5609b695307abee8973c608e975655e467f7c..ed42bba435c3546c833b34fb51a2c27805b910bf 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-12  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (includes): Delete gssapi_krb5.h rule.
+       ($(GSSAPI_KRB5_HDR)): Add command to create header directory if
+       needed.
+
 2003-02-09  Ezra Peisach  <epeisach@bu.edu>
 
        * init_sec_context.c (make_ap_req_v1): Unsigned/signed cleanup.
index a7782e7399a599628364483b61092a5b64f3d5d6..dd6a0953c23d8986b7966edd5c84c244bc7a19c9 100644 (file)
@@ -174,21 +174,16 @@ all-windows:: $(EHDRDIR) $(GSSAPI_KRB5_HDR) $(SRCS) $(HDRS)
 ##DOS##$(EHDRDIR):
 ##DOS##        mkdir $(EHDRDIR)
 
+MK_EHDRDIR=if test -d $(EHDRDIR); then :; else (set -x; mkdir $(EHDRDIR)); fi
+##DOS##MK_EHDRDIR=rem
+
 $(GSSAPI_KRB5_HDR): gssapi_krb5.h
+       @$(MK_EHDRDIR)
        $(CP) gssapi_krb5.h "$@"
 
 all-unix:: $(SRCS) $(HDRS) includes
 all-unix:: all-libobjs
 
-includes:: gssapi_krb5.h
-       if cmp $(srcdir)/gssapi_krb5.h \
-       $(BUILDTOP)/include/gssapi/gssapi_krb5.h >/dev/null 2>&1; then :; \
-       else \
-               (set -x; $(RM) $(BUILDTOP)/include/gssapi/gssapi_krb5.h; \
-                $(CP) $(srcdir)/gssapi_krb5.h \
-                       $(BUILDTOP)/include/gssapi/gssapi_krb5.h) ; \
-       fi
-
 clean-unix::
        $(RM) $(BUILDTOP)/include/gssapi/gssapi_krb5.h