libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

319-gary-refactor-m4sh-rules


From: Gary V. Vaughan
Subject: 319-gary-refactor-m4sh-rules
Date: Tue, 6 Mar 2007 11:33:50 -0800 (PST)
User-agent: mailnotify/0.7

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This makes code sharing with forthcoming func_version test cases easier.

Okay to commit?

  Index: ChangeLog
  from  Gary V. Vaughan  <address@hidden>
        Factorize make rules used for m4sh sources:

        * Makefile.am (EXTRA_DIST, libtoolize, libtool):  No need to
        explicitly name $(srcdir) in dependencies, VPATH will look there
        automatically.
        (SUFFIXES, .m4sh.in, .m4sh.sh): New suffix rules...
        ($(srcdir)/tests/defs, $(srcdir)/$(auxdir)/ltmain.sh): ...factored
        out from here...
        ($(srcdir)/tests/defs.in): ...and here.
        * Makefile.maint (.SUFFIXES): Add explicitly for bootstrap, as
        bootstrap's quick-n-dirty Makefile doesn't have the correct
        syntax.
        (.in.tmp): New suffix rule...
        ($(srcdir)/commit, $(srcdir)/mailnotify): ...factored out from
        here.

  Index: Makefile.am
  ===================================================================
  RCS file: /sources/libtool/libtool/Makefile.am,v
  retrieving revision 1.213
  diff -u -u -r1.213 Makefile.am
  --- Makefile.am 27 Feb 2007 21:59:33 -0000 1.213
  +++ Makefile.am 6 Mar 2007 19:31:29 -0000
  @@ -56,7 +56,7 @@
   # The libtool distributor and the standalone libtool script.
   bin_SCRIPTS = libtoolize libtool
   
  -libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
  +libtoolize: libtoolize.in $(top_builddir)/config.status
        rm -f libtoolize.tmp libtoolize
        $(timestamp); \
        input="libtoolize.m4sh"; \
  @@ -77,8 +77,7 @@
        rm -f libtoolize.in; \
        $(M4SH) -B $(auxdir) libtoolize.m4sh > libtoolize.in
   
  -libtool: $(top_builddir)/config.status $(srcdir)/$(auxdir)/ltmain.sh \
  -         $(srcdir)/stamp-vcl
  +libtool: $(top_builddir)/config.status $(auxdir)/ltmain.sh stamp-vcl
        cd $(top_builddir) && $(SHELL) ./config.status $@
   
   .PHONY: configure-subdirs
  @@ -121,6 +120,27 @@
          *) TIMESTAMP="" ;; \
        esac
   
  +# Where a .in file must be distributed (since the installer may not have
  +# autom4te installed), the rule below will generate it:
  +SUFFIXES = .m4sh .in .sh
  +.m4sh.in: $(sh_files) Makefile.am
  +     rm -f "$@"
  +     $(M4SH) -B $(srcdir)/$(auxdir) "$<" > "$@"
  +
  +# Otherwise, many of the M4SH generated files are distributed with the
  +# substitutions already performed, in which case the rule below generates
  +# that distributed file directly from the source:
  +.m4sh.sh: $(sh_files) Makefile.am
  +     @echo "Creating $@ from $<:"
  +     rm -f "$@"
  +     $(M4SH) -B $(srcdir)/$(auxdir) "$<" > "address@hidden"
  +     $(timestamp); input=`echo "$<" | sed 's,^.*/,,g'`; \
  +     $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
  +             -e "s,@package_revision\@,$$1,g" \
  +             "address@hidden" > "$@"
  +     rm -f "address@hidden"
  +     chmod a-w "$@"
  +
   sh_files     = $(auxdir)/general.m4sh $(auxdir)/getopt.m4sh
   EXTRA_DIST     += bootstrap $(srcdir)/libtoolize.in $(auxdir)/ltmain.m4sh \
                  $(auxdir)/mkstamp $(sh_files) stamp-vcl \
  @@ -180,22 +200,8 @@
   ##           should make this rule depend on Makefile but that will break
   ##           distcheck (at least) by rebuilding ltmain.sh in the source
   ##           tree whenever config.status regenerates the Makefile.
  -EXTRA_DIST += $(srcdir)/$(auxdir)/ltmain.sh
  -$(srcdir)/$(auxdir)/ltmain.sh: $(sh_files) $(auxdir)/ltmain.m4sh 
configure.ac \
  -                             $(srcdir)/stamp-vcl
  -     $(timestamp); \
  -     cd $(srcdir); \
  -     rm -f $(auxdir)/ltmain.in $(auxdir)/ltmain.tmp \
  -         $(auxdir)/ltmain.sh; \
  -     $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \
  -         > $(auxdir)/ltmain.in; \
  -     input="ltmain.m4sh"; \
  -     $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
  -             -e "s,@package_revision\@,$$1,g" \
  -             $(auxdir)/ltmain.in > $(auxdir)/ltmain.tmp; \
  -     rm -f $(auxdir)/ltmain.in; \
  -     chmod a-w $(auxdir)/ltmain.tmp; \
  -     mv -f $(auxdir)/ltmain.tmp $(auxdir)/ltmain.sh
  +EXTRA_DIST += $(auxdir)/ltmain.sh
  +$(srcdir)/$(auxdir)/ltmain.sh: $(sh_files) configure.ac $(srcdir)/stamp-vcl
   
   $(srcdir)/libltdl/Makefile.am: $(srcdir)/libltdl/Makefile.inc
        cd $(srcdir); \
  @@ -588,19 +594,12 @@
   # The defs script shouldn't be recreated whenever the Makefile is
   # regenerated since the source tree can be read-only.
   check-recursive: tests/defs
  -tests/defs: $(srcdir)/tests/defs.in
  -     rm -f tests/defs.tmp tests/defs; \
  +$(srcdir)/tests/defs: tests/defs.in
  +     rm -f tests/defs.tmp tests/defs
        input="defs.m4sh"; \
  -     $(edit) $(srcdir)/tests/defs.in > tests/defs.tmp; \
  +     $(edit) $(srcdir)/tests/defs.in > tests/defs.tmp
        mv -f tests/defs.tmp tests/defs
   
  -# Use `$(srcdir)/tests' for the benefit of non-GNU makes: this is
  -# how defs.in appears in our dependencies.
  -$(srcdir)/tests/defs.in: $(auxdir)/general.m4sh tests/defs.m4sh Makefile.am
  -     cd $(srcdir); \
  -     rm -f tests/defs.in; \
  -     $(M4SH) -B $(auxdir) tests/defs.m4sh > tests/defs.in
  -
   # We need to remove any files that the above tests created.
   clean-local-legacy:
        -cd tests; \
  Index: Makefile.maint
  ===================================================================
  RCS file: /sources/libtool/libtool/Makefile.maint,v
  retrieving revision 1.14
  diff -u -u -r1.14 Makefile.maint
  --- Makefile.maint 26 Feb 2007 07:44:23 -0000 1.14
  +++ Makefile.maint 6 Mar 2007 19:31:29 -0000
  @@ -32,29 +32,27 @@
   
   TEXI2HTML = texi2html
   
  -$(srcdir)/commit: $(srcdir)/$(auxdir)/mailnotify clcommit.m4sh
  -     $(timestamp); \
  -     cd $(srcdir); \
  -     rm -f commit commit.in commit.tmp; \
  -     $(M4SH) -B $(auxdir) clcommit.m4sh > commit.in; \
  -     input="clcommit.m4sh"; \
  -     $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" commit.in > commit.tmp; \
  -     chmod a+x commit.tmp; \
  -     chmod a-w commit.tmp; \
  -     mv -f commit.tmp commit; \
  -     rm -f commit.in
  +.SUFFIXES: .m4sh .in .sh .tmp
   
  -$(srcdir)/$(auxdir)/mailnotify: $(auxdir)/mailnotify.m4sh
  +.in.tmp:
  +     @_src=`echo "$<" | $(SED) 's,.*/,,g'`; \
  +     _dest=`echo "$@" | $(SED) 's,.*/,,g'`; \
  +     echo "rm -f $$_dest"; \
  +     rm -f "$$_dest"; \
        $(timestamp); \
  -     cd $(srcdir)/$(auxdir); \
  -     rm -f mailnotify mailnotify.in mailnotify.tmp; \
  -     $(M4SH) -B . mailnotify.m4sh > mailnotify.in; \
  -     input="mailnotify.m4sh"; \
  -     $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
  -             mailnotify.in > mailnotify.tmp; \
  -     chmod a+x mailnotify.tmp; \
  -     chmod a-w mailnotify.tmp; \
  -     mv -f mailnotify.tmp mailnotify; \
  +     input=`echo "$$_src" | $(SED) 's,\.in$$,.m4sh,'`; \
  +     test -f "$_src" || _src="$<"; \
  +     echo $(edit) -e 's,@TIMESTAMP\@,$$TIMESTAMP,g' "$$_src > $$_dest"; \
  +     $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" "$$_src" > "$$_dest"; \
  +     echo "chmod a+x $$_dest; chmod a-w $$_dest"; \
  +     chmod a+x "$$_dest"; chmod a-w "$$_dest"
  +
  +$(srcdir)/commit: $(auxdir)/mailnotify clcommit.tmp
  +     mv -f clcommit.tmp $(srcdir)/commit;
  +     rm -f clcommit.in
  +
  +$(srcdir)/$(auxdir)/mailnotify: $(auxdir)/mailnotify.tmp
  +     mv -f mailnotify.tmp $(srcdir)/$(auxdir)/mailnotify; \
        rm -f mailnotify.in
   
   .PHONY: cvs-release
  Index: bootstrap
  ===================================================================
  RCS file: /sources/libtool/libtool/bootstrap,v
  retrieving revision 1.80
  diff -u -u -r1.80 bootstrap
  --- bootstrap 26 Feb 2007 07:44:23 -0000 1.80
  +++ bootstrap 6 Mar 2007 19:31:29 -0000
  @@ -119,7 +119,7 @@
   # Whip up a dirty Makefile:
   makes='Makefile.am libltdl/Makefile.inc'
   rm -f Makefile
  -$SED '/^if /,/^endif$/d;/^else$/,/^endif$/d;/^include /d' $makes > Makefile
  +$SED -e '/^if /,/^endif$/d;/^else$/,/^endif$/d;/^include /d' $makes > 
Makefile
   
   # Building distributed files from configure is bad for automake, so we
   # generate them here, and have Makefile rules to keep them up to date.
_________________________________________________________
This patch notification generated by vcsapply version 1.0
http://savannah.gnu.org/projects/cvs-utils
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFF7cIdFRMICSmD1gYRAktMAJkBVr5rWAv7k/9lllCtl6eH+TtUyACgy5vT
P6MmcXSMc4NMeeygsZ4TQ1E=
=u/Ha
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]