2 # Copyright (C) 2012-2017 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 # Test to make sure tags are processed also for files with non-standard
18 # extensions. See automake bug#12372.
23 cat >> configure.ac
<<'END'
25 AC_CONFIG_FILES([sub/Makefile])
26 # Fake linking. Help avoid possible spurious errors from make
27 # or from the linker; errors that are irrelevant to this test.
28 AC_SUBST([LINK], ['echo $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@'])
32 cat > Makefile.am
<<'END'
35 sed -e 's/\[/{/' -e 's/\]/}/' $(srcdir)/$*.pc >$*.c
36 $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $*.c
40 foo_SOURCES = foo-main.pc barbar.c
45 cat > sub
/Makefile.am
<<'END'
48 sed -e 's/@/a/g' $(srcdir)/$*.pc >$*.c
49 $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $*.c
53 zap_SOURCES = zardoz.pc
56 echo 'int main(void) [ return bar(1); ]' > foo-main.pc
57 echo 'int bar(int x) { return !x; }' > barbar.c
58 echo 'int m@in(void) { return 0; }' > sub
/zardoz.pc
66 # Exuberant Ctags (at least version 5.8) doesn't generate any tags
67 # for file extensions it doesn't recognize. This can be fixed by
68 # using the '--langmap' option. But we must be careful, because
69 # etags from Emacs (at least version 23.4) doesn't recognize that
71 if etags
--help |
grep '.*--langmap'; then
72 run_make ETAGSFLAGS
="--langmap=c:+.pc"
79 $FGREP foo-main.pc TAGS
81 $FGREP zardoz.pc sub
/TAGS