]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fixups and tests for cscope functionality.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 26 Sep 2009 08:48:45 +0000 (10:48 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 26 Sep 2009 08:48:45 +0000 (10:48 +0200)
It seems cscope is not able to take into account relative
file names of included cscope.files files, but it is able to
canonicalize file names containing '../' sequences.
This patch makes the cscope references relative again, and
fixes some corner cases.

* .gitignore: Ignore files generated by `make cscope'.
* NEWS: Reword a bit.
* THANKS: Update.
* automake.in (handle_tags): Use $(am__cd).  Provide default
empty rule for the `cscope' target, for empty sources.
* lib/am/tags.am (cscopelist): Construct relative path to files
in $(srcdir) if $(srcdir) is relative.
[TOPDIR_P] (cscope): Do not depend on cscope-clean.  Only invoke
$(CSCOPE) if cscope.files is nonemtpy.
(clean-cscope): Rename from ...
(cscopeclean): ... this.
(cscope.files): Depend on clean-cscope.
(distclean-tags) [!TOPDIR_P]: No need to remove cscope files
here.
* tests/cscope.test, tests/cscope2.test, tests/cscope3.test: New
tests.
* tests/Makefile.am: Adjust.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
18 files changed:
.gitignore
ChangeLog
Makefile.in
NEWS
THANKS
automake.in
doc/Makefile.in
lib/Automake/Makefile.in
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
lib/am/tags.am
m4/Makefile.in
tests/Makefile.am
tests/Makefile.in
tests/cscope.test [new file with mode: 0755]
tests/cscope2.test [new file with mode: 0755]
tests/cscope3.test [new file with mode: 0755]

index 81e5a98ef7a034374b39aceb37b790aff42b9e18..716ef8b30b1447bd845032e625a79c3266b2a72e 100644 (file)
@@ -7,5 +7,9 @@ config.log
 config.status
 config.status.lineno
 configure.lineno
+cscope.files
+cscope.in.out
+cscope.out
+cscope.po.out
 tags
 TAGS
index f72ad9ea034d061e580581c34542b40406e55aae..e425420a42e145aa2a0f0874faa698aebcf3650c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2009-09-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fixups and tests for cscope functionality.
+       It seems cscope is not able to take into account relative
+       file names of included cscope.files files, but it is able to
+       canonicalize file names containing '../' sequences.
+       This patch makes the cscope references relative again, and
+       fixes some corner cases.
+       * NEWS: Reword a bit.
+       * THANKS: Update.
+       * automake.in (handle_tags): Use $(am__cd).  Provide default
+       empty rule for the `cscope' target, for empty sources.
+       * lib/am/tags.am (cscopelist): Construct relative path to files
+       in $(srcdir) if $(srcdir) is relative.
+       [TOPDIR_P] (cscope): Do not depend on cscope-clean.  Only invoke
+       $(CSCOPE) if cscope.files is nonemtpy.
+       (clean-cscope): Rename from ...
+       (cscopeclean): ... this.
+       (cscope.files): Depend on clean-cscope.
+       (distclean-tags) [!TOPDIR_P]: No need to remove cscope files
+       here.
+       * tests/cscope.test, tests/cscope2.test, tests/cscope3.test: New
+       tests.
+       * tests/Makefile.am: Adjust.
+
 2009-09-25  Debarshi Ray  <rishi@gnu.org>
 
        New target to generate cscope database.
index b1ab663d94b89315a9cbc26c9bfbcd5f88264301..2e1b412939b5393076fa916fc47053d67cc6f523 100644 (file)
@@ -442,7 +442,7 @@ ctags-recursive:
        done
 cscopelist-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
        done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -507,28 +507,32 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
-cscope: cscopeclean cscope.files
-       $(CSCOPE) -b -q $(CSCOPEFLAGS) $(AM_CSCOPEFLAGS) \
-         -i cscope.files $(CSCOPE_ARGS)
+cscope: cscope.files
+       test ! -s cscope.files \
+         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
 
-cscopeclean:
+clean-cscope:
        -rm -f cscope.files
 
-cscope.files: cscopelist-recursive cscopelist
+cscope.files: clean-cscope cscopelist-recursive cscopelist
 
 cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
        list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
        for i in $$list; do \
-         if test -f "$$i"; \
-           then echo \"$(subdir)/$$i\"; \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
          else \
-           echo \"$(abs_srcdir)/$$i\"; \
+           echo "$$sdir/$$i"; \
          fi; \
        done >> $(top_builddir)/cscope.files
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
-       cscope.po.out cscope.files
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
        $(am__remove_distdir)
@@ -822,8 +826,8 @@ uninstall-am: uninstall-binSCRIPTS
        install-exec-am install-strip tags-recursive uninstall-am
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am am--refresh check check-am clean clean-generic \
-       cscope cscopeclean cscopelist cscopelist-recursive ctags \
+       all all-am am--refresh check check-am clean clean-cscope \
+       clean-generic cscope cscopelist cscopelist-recursive ctags \
        ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
        dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
        distclean distclean-generic distclean-tags distcleancheck \
diff --git a/NEWS b/NEWS
index 4c63fa971d1584807ce3407e234c426a7a1d6d65..ef608da39bf2fef448f544907f33eb10d3106139 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ New in 1.11.0a:
 
 * New targets:
 
-  - New `cscope' target (builds cscope database).
+  - New `cscope' target to build a cscope database for the source tree.
 
 Bugs fixed in 1.11.0a:
 
diff --git a/THANKS b/THANKS
index 7b8664a23009731b5723608559bc80123aad67b8..54615bec58f20d2bc71e87b9628c4a71af414de7 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -64,6 +64,7 @@ danbp                 danpb@nospam.postmaster.co.uk
 Daniel Jacobowitz      drow@false.org
 Daniel Kahn Gillmor    dkg@fifthhorseman.net
 Daniel Richard G.      danielg@teragram.com
+Debarshi Ray           rishi@gnu.org
 Dave Brolley           brolley@redhat.com
 Dave Morrison          dave@bnl.gov
 David A. Swierczek     swiercze@mr.med.ge.com
index b0a8951bf6564224beacc2a4553e9967a30c01f8..84ed8bc73a779e544f2a61e93d11f196f5e29755 100755 (executable)
@@ -3753,7 +3753,7 @@ sub handle_tags
                          . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
                          # Never fail here if a subdir fails; it
                          # isn't important.
-                         . "\t  test \"\$\$subdir\" = . || (cd \$\$subdir"
+                         . "\t  test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
                          . " && \$(MAKE) \$(AM_MAKEFLAGS) cscopelist); \\\n"
                          . "\tdone\n");
        push (@cscope_deps, 'cscopelist-recursive');
@@ -3799,7 +3799,7 @@ sub handle_tags
        $output_rules .= "tags: TAGS\nTAGS:\n\n";
        # Ditto ctags and cscope.
        $output_rules .= "ctags: CTAGS\nCTAGS:\n\n";
-       $output_rules .= "cscopelist:\n\n";
+       $output_rules .= "cscope cscopelist:\n\n";
     }
 }
 
index f39bbed19a49d8344f9138daee70b98a876ef5ad..8b776607dd135ebb5567da61a286c6fd469a1bb0 100644 (file)
@@ -535,17 +535,20 @@ GTAGS:
 
 cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
        list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
        for i in $$list; do \
-         if test -f "$$i"; \
-           then echo \"$(subdir)/$$i\"; \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
          else \
-           echo \"$(abs_srcdir)/$$i\"; \
+           echo "$$sdir/$$i"; \
          fi; \
        done >> $(top_builddir)/cscope.files
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
-       cscope.po.out cscope.files
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
        @list='$(MANS)'; if test -n "$$list"; then \
index 65d23b557fa696145512b8d959d5fe6258a5e679..db148df699b94f8f9574bfc6458818c3b36666d1 100644 (file)
@@ -389,7 +389,7 @@ ctags-recursive:
        done
 cscopelist-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
        done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -456,17 +456,20 @@ GTAGS:
 
 cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
        list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
        for i in $$list; do \
-         if test -f "$$i"; \
-           then echo \"$(subdir)/$$i\"; \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
          else \
-           echo \"$(abs_srcdir)/$$i\"; \
+           echo "$$sdir/$$i"; \
          fi; \
        done >> $(top_builddir)/cscope.files
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
-       cscope.po.out cscope.files
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
index e217e3fee462ae413df6a57310dff3f9dd9a717b..7bc886fb24b425767ac010c949a76a6bd9868459 100644 (file)
@@ -274,7 +274,7 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
-cscopelist:
+cscope cscopelist:
 
 
 # To be appended to the command running the test.  Handle the stdout
index 27fc1e2910a7fbdb93519cbef945c57869171c50..78564c99b037fb49fe691ec739ec10983c9877b4 100644 (file)
@@ -364,7 +364,7 @@ ctags-recursive:
        done
 cscopelist-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
        done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -431,17 +431,20 @@ GTAGS:
 
 cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
        list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
        for i in $$list; do \
-         if test -f "$$i"; \
-           then echo \"$(subdir)/$$i\"; \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
          else \
-           echo \"$(abs_srcdir)/$$i\"; \
+           echo "$$sdir/$$i"; \
          fi; \
        done >> $(top_builddir)/cscope.files
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
-       cscope.po.out cscope.files
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
index 616237b940e10e746f7189e54c20c1f291bce79c..4189f297de9075d0226f5d3d49ccf7c863da4f2f 100644 (file)
@@ -269,7 +269,7 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
-cscopelist:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
index 142748bed38e941939d841e846258eba4e59913c..7fa75c9517371f58d9a62d80b708f5ba62bc3c62 100644 (file)
@@ -141,28 +141,32 @@ GTAGS:
 if %?TOPDIR_P%
 
 CSCOPE = cscope
-.PHONY: cscope cscopeclean
+.PHONY: cscope clean-cscope
 AM_RECURSIVE_TARGETS += cscope
 
-cscope: cscopeclean cscope.files
-       $(CSCOPE) -b -q $(CSCOPEFLAGS) $(AM_CSCOPEFLAGS) \
-         -i cscope.files $(CSCOPE_ARGS)
+cscope: cscope.files
+       test ! -s cscope.files \
+         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
 
-cscopeclean:
+clean-cscope:
        -rm -f cscope.files
 
-cscope.files: %CSCOPEDIRS% cscopelist
+cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
 
 endif %?TOPDIR_P%
 
 .PHONY: cscopelist
 cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
        list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
        for i in $$list; do \
-         if test -f "$$i"; \
-           then echo \"$(subdir)/$$i\"; \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
          else \
-           echo \"$(abs_srcdir)/$$i\"; \
+           echo "$$sdir/$$i"; \
          fi; \
        done >> $(top_builddir)/cscope.files
 
@@ -174,5 +178,7 @@ cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
 .PHONY distclean-am: distclean-tags
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
-       cscope.po.out cscope.files
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+if %?TOPDIR_P%
+       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+endif %?TOPDIR_P%
index a7edbd3627f292b98c0235d30a7cf4e37d10b088..0c7bf7d5e5a8c2a1e8404ed6039b4d3fc70b7487 100644 (file)
@@ -266,7 +266,7 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
-cscopelist:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
index 62529a6b50dd633b02aca46de906bf9ab9b196bc..e97468984bcb619ba41927a2b79da3a8f5139ed6 100644 (file)
@@ -208,6 +208,9 @@ confsub.test \
 confvar.test \
 confvar2.test \
 copy.test \
+cscope.test \
+cscope2.test \
+cscope3.test \
 ctarget1.test \
 cxx.test \
 cxx2.test \
index 9cd1666cf8cc384dbcecc32168d7abf2dd3f2105..9e9fb97c67190e95d884073f2c07d67b0f8a2790 100644 (file)
@@ -442,6 +442,9 @@ confsub.test \
 confvar.test \
 confvar2.test \
 copy.test \
+cscope.test \
+cscope2.test \
+cscope3.test \
 ctarget1.test \
 cxx.test \
 cxx2.test \
@@ -1020,7 +1023,7 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
-cscopelist:
+cscope cscopelist:
 
 
 # To be appended to the command running the test.  Handle the stdout
diff --git a/tests/cscope.test b/tests/cscope.test
new file mode 100755 (executable)
index 0000000..5beee5b
--- /dev/null
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test cscope functionality.
+
+required=
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_FC
+AM_PROG_GCJ
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+mkdir sub sub/subsub
+
+cat >Makefile.am <<'END'
+SUBDIRS = sub
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c bar.cpp baz.f90
+lisp_LISP = foo.el
+EXTRA_DIST = foo.el
+END
+
+cat >sub/Makefile.am <<'END'
+bin_PROGRAMS = bar
+bar_SOURCES = subsub/dist.c
+nodist_bar_SOURCES = subsub/gen.c
+subsub/gen.c:
+       $(MKDIR_P) subsub
+       echo 'int generated_subsub () { return 0; }' > $@
+CLEANFILES = subsub/gen.c
+END
+
+echo 'int foo_func () { return 0; }' > foo.c
+echo 'int main () { return 0; }' > bar.cpp
+cat > baz.f90 <<'END'
+      subroutine baz
+      end
+END
+: >foo.el
+echo 'int main () { return 0; }' > sub/subsub/dist.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+mkdir build
+cd build
+../configure || Exit 77
+
+$MAKE -n cscope
+
+: ${CSCOPE=cscope}
+( $CSCOPE --version ) >/dev/null 2>&1 || Exit 77
+
+$MAKE cscope 2>stderr
+cat stderr >&2
+grep 'cannot find file' stderr && Exit 1
+
+test -f cscope.files
+$FGREP foo.c cscope.files
+$FGREP bar.cpp cscope.files
+$FGREP sub/subsub/dist.c cscope.files
+$FGREP sub/subsub/gen.c cscope.files
+
+cp cscope.files cscope.files1
+$MAKE cscope
+diff cscope.files cscope.files1
+
+$MAKE distclean
+test ! -f cscope.files
+test ! -f cscope.out
+test ! -f cscope.in.out
+test ! -f cscope.po.out
+
+
+`pwd`/../configure || Exit 77
+
+$MAKE cscope 2>stderr
+cat stderr >&2
+grep 'cannot find file' stderr && Exit 1
+$MAKE distclean
+
+cd ..
+./configure
+$MAKE distcheck
+
+:
diff --git a/tests/cscope2.test b/tests/cscope2.test
new file mode 100755 (executable)
index 0000000..801457f
--- /dev/null
@@ -0,0 +1,36 @@
+#! /bin/sh
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The `cscope' target should not fail if there are no sources.
+
+required=
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+: >Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE cscope
+
+:
diff --git a/tests/cscope3.test b/tests/cscope3.test
new file mode 100755 (executable)
index 0000000..04e85c3
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The `cscope' target should not fail if there are no sources in a subdir.
+# In practice this means `cscope' should not be invoked if cscope.files
+# is empty.
+
+required=cscope
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+mkdir sub
+echo 'SUBDIRS = sub' >Makefile.am
+: >sub/Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE cscope
+
+: