2 # Copyright (C) 2010-2013 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Stress test on canonicalization.
19 required='cc libtool libtoolize'
22 cat >> configure.ac << 'END'
25 AC_PROG_RANLIB dnl: for static libraries
26 AC_PROG_LIBTOOL dnl: for libtool libraries
27 AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
31 if touch ,foo-bar libb.az+baz lib~zardoz,,; then
32 rm -f ,foo-bar libb.az+baz lib~zardoz,,
34 skip_ "cannot create regular files with \"tricky\" names"
37 cat > Makefile.am << 'END'
38 noinst_PROGRAMS = dummy_static dummy_dynamic ,foo-bar
39 noinst_LIBRARIES = libb.az+baz.a
40 noinst_LTLIBRARIES = lib~zardoz,,.la
42 dummy_static_SOURCES = dummy.c lib.h
43 dummy_dynamic_SOURCES = $(dummy_static_SOURCES)
45 dummy_static_LDADD = $(noinst_LIBRARIES)
46 dummy_dynamic_LDADD = $(noinst_LTLIBRARIES)
48 _foo_bar_SOURCES = foobar.c
49 libb_az_baz_a_SOURCES = libs.c
50 lib_zardoz___la_SOURCES = libd.c
55 test -f ./,foo-bar$(EXEEXT)
56 test -f ./dummy_static$(EXEEXT)
57 test -f ./dummy_dynamic$(EXEEXT)
62 ./,foo-bar | grep 'Hello, FooBar!'
63 ./dummy_static | grep 'Hello from Static!'
64 ./dummy_dynamic | grep 'Hello from Dynamic!'
65 endif !CROSS_COMPILING
68 cat > foobar.c << 'END'
72 printf("Hello, FooBar!\n");
77 cat > dummy.c << 'END'
82 printf("Hello from %s!\n", dummy_func());
87 echo 'const char *dummy_func(void);' > lib.h
88 echo 'const char *dummy_func(void) { return "Dynamic"; }' > libd.c
89 echo 'const char *dummy_func(void) { return "Static"; }' > libs.c