config.status
config.status.lineno
configure.lineno
+cscope.files
+cscope.in.out
+cscope.out
+cscope.po.out
tags
TAGS
+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.
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)
&& $(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)
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 \
* 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:
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
. "\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');
$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";
}
}
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 \
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)
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'`; \
ctags: CTAGS
CTAGS:
-cscopelist:
+cscope cscopelist:
# To be appended to the command running the test. Handle the stdout
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)
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'`; \
ctags: CTAGS
CTAGS:
-cscopelist:
+cscope cscopelist:
distdir: $(DISTFILES)
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
.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%
ctags: CTAGS
CTAGS:
-cscopelist:
+cscope cscopelist:
distdir: $(DISTFILES)
confvar.test \
confvar2.test \
copy.test \
+cscope.test \
+cscope2.test \
+cscope3.test \
ctarget1.test \
cxx.test \
cxx2.test \
confvar.test \
confvar2.test \
copy.test \
+cscope.test \
+cscope2.test \
+cscope3.test \
ctarget1.test \
cxx.test \
cxx2.test \
ctags: CTAGS
CTAGS:
-cscopelist:
+cscope cscopelist:
# To be appended to the command running the test. Handle the stdout
--- /dev/null
+#! /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
+
+:
--- /dev/null
+#! /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
+
+:
--- /dev/null
+#! /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
+
+: