cat > configure.ac << END
AC_INIT([$me], [1.0])
m4_include([am-init-automake.m4])
-AC_PROG_CC
AC_CONFIG_FILES([Makefile])
+AM_CONDITIONAL([NEVERTRUE], [false)]
# Other similar tests do not use AC_OUTPUT, so we use it here,
# for completeness and for better coverage.
AC_OUTPUT
cat > Makefile.am <<END
include automake-options.am
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+if NEVERTRUE
+AUTOMAKE_OPTIONS = no-dependencies
+endif
END
rm -rf autom4te*.cache
echo 'AM_INIT_AUTOMAKE' > am-init-automake.m4
$ACLOCAL
AUTOMAKE_fails -Werror -Wall --foreign
-grep '^Makefile\.am:3:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+grep "^Makefile\\.am:3:.*AUTOMAKE_OPTIONS.*conditional" stderr
rm -rf autom4te*.cache
: > automake-options.am
. test-init.sh
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
# We want (almost) complete control over automake options.
AUTOMAKE="$am_original_AUTOMAKE -Werror"
ko ()
{
AUTOMAKE_fails $*
- grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+ grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
}
-echo AC_PROG_CC >> configure.ac
-
cat > Makefile.am <<END
AUTOMAKE_OPTIONS = ## For later editing by 'set_am_opts'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
END
$ACLOCAL
. test-init.sh
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
# We want (almost) complete control over automake options.
AUTOMAKE="$am_original_AUTOMAKE -Werror"
ko ()
{
AUTOMAKE_fails $*
- grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+ grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
}
# Files required in gnu strictness.
touch README INSTALL NEWS AUTHORS ChangeLog COPYING
-echo AC_PROG_CC >> configure.ac
-
cat > Makefile.am <<END
AUTOMAKE_OPTIONS = ## For later editing by 'set_warnings'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
END
$ACLOCAL
. test-init.sh
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
# We want (almost) complete control over automake options.
AUTOMAKE="$am_original_AUTOMAKE -Werror"
-echo AC_PROG_CC >> configure.ac
$ACLOCAL
cat > Makefile.am <<END
AUTOMAKE_OPTIONS = ## For later editing by 'set_am_opts'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
END
set_am_opts ()
set_am_opts 'gnu' Makefile.am
AUTOMAKE_fails
-grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
:
. test-init.sh
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
# We want complete control over automake options.
AUTOMAKE=$am_original_AUTOMAKE
ko ()
{
AUTOMAKE_run $*
- grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+ grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
test $(wc -l <stderr) -eq 1
}
# Files required in gnu strictness.
touch README INSTALL NEWS AUTHORS ChangeLog COPYING
-echo AC_PROG_CC >> configure.ac
$ACLOCAL
cat > Makefile.am <<END
AUTOMAKE_OPTIONS = ## For later editing by 'set_am_opts'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
END
ko --foreign -Wportability
AC_OUTPUT
END
-mkdir sub
+mkdir aux sub sub/aux || skip_ "cannot create directories named 'aux'"
# These two Makefile contain the same errors, but have different
# warnings disabled.
cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects -Wno-unsupported
+AUTOMAKE_OPTIONS = -Wno-unsupported
if COND_FALSE
AUTOMAKE_OPTIONS += no-dependencies
endif
-bin_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
-SUBDIRS = sub
+SUBDIRS = sub aux
END
cat > sub/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects -Wno-portability
+AUTOMAKE_OPTIONS = -Wno-portability
if COND_FALSE
AUTOMAKE_OPTIONS += no-dependencies
endif
-bin_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
END
$ACLOCAL
AUTOMAKE_fails
-# The expected diagnostic is
+# The expected diagnostic is:
# automake: warnings are treated as errors
-# Makefile.am:6: warning: compiling 'sub/foo.c' in subdir requires 'AM_PROG_CC_C_O' in 'configure.ac'
+# Makefile.am:5: warning: name 'aux' is reserved on W32 and DOS platforms
# sub/Makefile.am:1: warning: 'AUTOMAKE_OPTIONS' cannot have conditional contents
-grep '^Makefile\.am:.*sub/foo\.c.*AM_PROG_CC_C_O' stderr
-grep '^sub/Makefile.am:.*AUTOMAKE_OPTIONS' stderr
-grep '^sub/Makefile\.am:.*AM_PROG_CC_C_O' stderr && exit 1
-grep '^Makefile\.am:.*AUTOMAKE_OPTIONS' stderr && exit 1
-# Only two lines of warnings.
+grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
+grep "^sub/Makefile\\.am:.*AUTOMAKE_OPTIONS.*conditional" stderr
+grep "^Makefile\\.am:.*AUTOMAKE_OPTIONS" stderr && exit 1
+grep "^sub/Makefile\\.am:.*'aux'" stderr && exit 1
+# Only two lines of warnings proper.
test $(grep -v 'warnings are treated as errors' stderr | wc -l) -eq 2
rm -rf autom4te*.cache