diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-06-06 10:27:46 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-05-15 15:52:30 +0200 |
commit | 020fb48db730a5661fa8fa38229b439d79fd5217 (patch) | |
tree | 1920dea1d85141189e61d825fd395ab49c3b4e1a /t/lex-line.sh | |
parent | 83609bfeee6b69ac4d1257bfdafd4f9e04a4d5e3 (diff) | |
download | automake-020fb48db730a5661fa8fa38229b439d79fd5217.tar.gz |
subdir-objects: enable unconditionally
See automake bug#13378.
The fact that Automake-generated Makefiles places compiled object files
in the current directory by default, also when the corresponding source
file is in a subdirectory, is basically an historical accident, due to
the fact that the 'subdir-objects' option had only been introduced in
April 1999, starting with commit 'user-dep-gen-branchpoint-56-g88b5959',
and never made the default, likely to avoid backwards-compatibility
issues.
Since we believe the behaviour enabled by the 'subdir-objects' is the
only natural and most useful one, we make it the only only one available,
simplifying the Automake implementation and APIs a little in the process.
This change is basically an adjusted backport of Automake-NG commit
'v1.12.1-313-g14fe163' of 2012-06-07, "[ng] subdir-objects: enable
unconditionally".
* NEWS: Update.
* doc/automake.texi (Program and Library Variables): The output
object files are no longer placed in the current directory by
default, but rather in the same directory of the source file.
(LIBOBJS): Now the $(LIBOBJS) and $(ALLOCA) variables can also
be used outside of the directory where their sources lie.
(List of Automake options): Report the 'subdir-objects' option
as a no-op, existing only for compatibility with older versions
of Automake.
Other related minor adjustments.
* bin/automake.in (LANG_PROCESS): Remove, it's no longer needed.
(handle_languages): Don't test whether option 'subdir-objects'
is set (just assume it is), and do not use the '%SUBDIROBJ%'
transform when processing '.am' fragments.
(lang_sub_obj): Delete, it would just return 'LANG_SUBDIR'
unconditionally now.
(lang_lex_rewrite): Adjust. Don't test whether the option
'subdir-objects' is set (just assume it is).
(lang_yacc_rewrite): Likewise.
(handle_single_transform): Likewise. Remove an obsolete
comment. Add a proper "FIXME" comments about a fragment
of code that might have become dead code now.
(handle_LIBOBJS_or_ALLOCA): Simplify assuming that the option
'subdir-objects' is always set. Accordingly, there's no need
to warn anymore if '$(LIBOBJS)' or '$(ALLOCA)' are used outside
the '$config_libobj_dir' directory (as specified by autoconf
macro 'AC_CONFIG_LIBOBJ_DIR').
* lib/am/depend2.am: Assume the '?SUBDIROBJ?' Automake time
conditional is always true, and remove its uses accordingly.
* t/compile_f_c_cxx.sh: Adjust.
* t/cscope.tap: Likewise.
* t/depcomp8a.sh: Likewise.
* t/depcomp8b.sh: Likewise.
* t/libtool3.sh: Likewise.
* t/ltlibsrc.sh: Likewise.
* t/pr401.sh: Likewise.
* t/pr401b.sh: Likewise.
* t/pr401c.sh: Likewise.
* t/subobj.sh: Likewise.
* t/lex-line.sh: Likewise.
* t/yacc-line.sh: Likewise.
* t/yacc5.sh: Likewise.
* t/vala-libs.sh: Likewise.
* t/fort4.sh: Likewise, and extend a bit.
* t/fort5.sh: Likewise.
* t/gcj.sh: Likewise.
* t/subpkg.sh: Likewise.
* t/subpkg-yacc.sh: Likewise.
* t/xsource.sh: Likewise.
* t/libobj20a.sh: Remove as obsolete.
* t/libobj20b.sh: Adjust heading comments.
* t/libobj20c.sh: Likewise.
* t/subobj4.sh: Remove as obsolete.
* t/sourcefile-in-subdir.sh: Likewise.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/lex-line.sh')
-rwxr-xr-x | t/lex-line.sh | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/t/lex-line.sh b/t/lex-line.sh index 258f6af56..ec9fcd3f7 100755 --- a/t/lex-line.sh +++ b/t/lex-line.sh @@ -15,15 +15,13 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Check that automake lex support ensures that lex-generated C -# files use correct "#line" directives. Try also with the -# 'subdir-object' option enabled. +# files use correct "#line" directives. # See also sister test 'yacc-line.sh'. required='cc lex' . test-init.sh cat >> configure.ac << 'END' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AC_PROG_LEX AC_OUTPUT @@ -32,7 +30,6 @@ END mkdir dir sub sub/dir cat > Makefile.am << 'END' -SUBDIRS = sub bin_PROGRAMS = foo bar LDADD = $(LEXLIB) bar_LFLAGS = -v @@ -43,19 +40,6 @@ zardoz.@OBJEXT@: zardoz.c bar-quux.@OBJEXT@: bar-quux.c END -cat > sub/Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects -noinst_PROGRAMS = foo bar -## We already used $(LEXLIB) above, so try @LEXLIB@ now. -LDADD = @LEXLIB@ -foo_LFLAGS = -v -foo_SOURCES = zardoz.l -bar_SOURCES = dir/quux.l -## Avoid spurious failures with Solaris make. -foo-zardoz.@OBJEXT@: foo-zardoz.c -dir/quux.@OBJEXT@: dir/quux.c -END - cat > zardoz.l << 'END' %{ #define YY_NO_UNISTD_H 1 @@ -79,10 +63,8 @@ int yywrap (void) END cp zardoz.l dir/quux.l -cp zardoz.l sub/zardoz.l -cp zardoz.l sub/dir/quux.l -c_outputs='zardoz.c bar-quux.c sub/foo-zardoz.c sub/dir/quux.c' +c_outputs='zardoz.c dir/bar-quux.c' $ACLOCAL $AUTOCONF @@ -104,7 +86,7 @@ for vpath in : false; do $MAKE # For debugging, - ls -l . sub sub/dir + ls -l . dir $EGREP 'line|\.l' $c_outputs grep '#.*line.*build.*\.l' $c_outputs && exit 1 @@ -118,14 +100,10 @@ for vpath in : false; do grep "#.*\.l.*\.l" $c_outputs && exit 1 if $vpath; then grep '#.*line.*"\.\./zardoz\.l"' zardoz.c - grep '#.*line.*"\.\./dir/quux\.l"' bar-quux.c - grep '#.*line.*"\.\./\.\./sub/zardoz\.l"' sub/foo-zardoz.c - grep '#.*line.*"\.\./\.\./sub/dir/quux\.l"' sub/dir/quux.c + grep '#.*line.*"\.\./dir/quux\.l"' dir/bar-quux.c else grep '#.*line.*"zardoz\.l"' zardoz.c - grep '#.*line.*"dir/quux\.l"' bar-quux.c - grep '#.*line.*"zardoz\.l"' sub/foo-zardoz.c - grep '#.*line.*"dir/quux\.l"' sub/dir/quux.c + grep '#.*line.*"dir/quux\.l"' dir/bar-quux.c fi cd $srcdir |