]> sourceware.org Git - automake.git/commitdiff
2000-02-02 Assar Westerlund <assar@sics.se>
authorTom Tromey <tromey@redhat.com>
Wed, 2 Feb 2000 04:29:01 +0000 (04:29 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 2 Feb 2000 04:29:01 +0000 (04:29 +0000)
* automake.in (handle_single_transform_list): do not use $< which
is not handled by all non-GNU makes.  Instead do explicit sh code
testing for the file in this directory and srcdir.  Based on a
suggestion by Alexandre Oliva <oliva@lsd.ic.unicamp.br>

ChangeLog
Makefile.in
automake.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/target-cflags.test [new file with mode: 0755]

index c7fee91950e02caba2de49fc19e98f904b74f81c..82a57734b80b3a82ce439a21086fb2f753dca884 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-02-02  Assar Westerlund  <assar@sics.se>
+
+       * automake.in (handle_single_transform_list): do not use $< which
+       is not handled by all non-GNU makes.  Instead do explicit sh code
+       testing for the file in this directory and srcdir.  Based on a
+       suggestion by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
 2000-01-12  Tom Tromey  <tromey@cygnus.com>
 
        * m4/lispdir.m4: Added --with-lispdir argument processing.
index b897d512d37939fc077683a5bfeb77c0e2914def..3d18f6b5c3eb6550e545c6933560464c8fea28f3 100644 (file)
@@ -57,6 +57,8 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+
+@SET_MAKE@
 AMTAR = @AMTAR@
 AMTARFLAGS = @AMTARFLAGS@
 AWK = @AWK@
@@ -120,8 +122,8 @@ DIST_COMMON =  README $(dist_pkgdata_DATA) $(dist_script_DATA) AUTHORS \
 COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS README-alpha \
 THANKS TODO aclocal.in aclocal.m4 ansi2knr.1 ansi2knr.c automake.in \
 compile config.guess config.sub configure configure.in depcomp \
-elisp-comp install-sh mdate-sh missing mkinstalldirs stamp-vti \
-texinfo.tex version.texi ylwrap
+elisp-comp install-sh mdate-sh missing mkinstalldirs py-compile \
+stamp-vti texinfo.tex version.texi ylwrap
 
 
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -357,8 +359,6 @@ uninstall-dist_scriptDATA:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 
-@SET_MAKE@
-
 all-recursive install-data-recursive install-exec-recursive \
 installdirs-recursive install-recursive uninstall-recursive  \
 check-recursive installcheck-recursive info-recursive dvi-recursive:
@@ -480,6 +480,7 @@ distcheck: dist
 dist: distdir
        -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
          ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
          ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r $(distdir)
        $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
@@ -487,6 +488,7 @@ dist: distdir
 dist-all: distdir
        -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
          ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
          ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r $(distdir)
        $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
index 9a58889bacd8441e915c974413f8c5065019c957..5f666c18c9c64f778bdbc47d6bf0396256b74f3a 100755 (executable)
@@ -1361,10 +1361,11 @@ sub handle_single_transform_list
                    local ($xform);
                    ($xform = $object) =~ s,/,\\/,g;
                    $rule =~ s/\$\@/$xform/;
-                   # FIXME: we use $< in an explicit rule here.
-                   # We can't use $(srcdir)/<file> because we don't
-                   # actually know it is in srcdir.
-                   $rule .= ' $<';
+
+                   # We cannot use $< here since this is an explicit
+                   # rule and not all makes handle that.
+                   $rule .= " \`test -f $full || echo '\$(srcdir)/'\`$full";
+
                    # FIXME: handle .lo and .obj as well.
                    $output_rules .= "\t" . $rule . "\n";
                }
index f35fb488b29a1d4a800611b5774cc57a47b65f8d..cd89af489eca00f927d272e9856d62291a213aed 100644 (file)
@@ -1,3 +1,7 @@
+2000-02-02  Assar Westerlund  <assar@sics.se>
+
+       * target-cflags.test: new test case to target-specific CFLAGS
+
 2000-01-08  Tom Tromey  <tromey@cygnus.com>
 
        * ansi.test, texinfo.test, empty.test, insh2.test, texinfo8.test:
index 3162b9fb34315af106dbc42af7bcfdc904743800..38ba3ef311a84ab627b4f693acaa6e0ba4661099 100644 (file)
@@ -228,6 +228,7 @@ syntax.test \
 tags.test \
 tagsub.test \
 target.test \
+target-cflags.test \
 texinfo.test \
 texinfo2.test \
 texinfo3.test \
index 88b2ebd4988e66dfead5d5595956c56afc467d90..6f8896a607b999dd8001310c387370caf648610d 100644 (file)
@@ -57,6 +57,8 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+
+@SET_MAKE@
 AMTAR = @AMTAR@
 AMTARFLAGS = @AMTARFLAGS@
 AWK = @AWK@
@@ -295,6 +297,7 @@ syntax.test \
 tags.test \
 tagsub.test \
 target.test \
+target-cflags.test \
 texinfo.test \
 texinfo2.test \
 texinfo3.test \
diff --git a/tests/target-cflags.test b/tests/target-cflags.test
new file mode 100755 (executable)
index 0000000..fd412fd
--- /dev/null
@@ -0,0 +1,51 @@
+#! /bin/sh
+
+# Test to make sure target specific CFLAGS work
+# Assar Westerlund <assar@sics.se>
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(foo.c)
+AM_INIT_AUTOMAKE(target-cflags,0.0)
+AC_PROG_CC
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+bin_PROGRAMS = foo bar
+foo_CFLAGS   = -DFOO
+END
+
+cat > foo.c << 'END'
+#include <stdio.h>
+#ifdef FOO
+int main(void) {
+  return 0;
+}
+#endif
+END
+
+cat > bar.c << 'END'
+#ifndef FOO
+int main(void)
+{
+  return 0;
+}
+#endif
+END
+
+# Fail gracefully if no autoconf.
+(autoconf --version) > /dev/null 2>&1 || exit 0
+
+# Likewise for gcc.
+(gcc -v) > /dev/null 2>&1 || exit 0
+
+$ACLOCAL \
+   && autoconf \
+   && $AUTOMAKE -a \
+   && mkdir obj \
+   && (cd obj && ../configure && $MAKE && ./foo && ./bar) \
+   && ./configure && $MAKE && ./foo && ./bar
This page took 0.04777 seconds and 5 git commands to generate.