diff options
Diffstat (limited to 'src/third_party/wiredtiger/dist/s_tags')
-rw-r--r-- | src/third_party/wiredtiger/dist/s_tags | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/dist/s_tags b/src/third_party/wiredtiger/dist/s_tags new file mode 100644 index 00000000000..908b5eb7e0d --- /dev/null +++ b/src/third_party/wiredtiger/dist/s_tags @@ -0,0 +1,44 @@ +#! /bin/sh + +# Build tags file. +# +t=__a.c +trap 'rm -f $t; exit 0' 0 1 2 3 13 15 + +# Skip this when building release packages +test -n "$WT_RELEASE_BUILD" && exit 0 + +# We require ctags which may not be installed. +type ctags > /dev/null 2>&1 || { + echo 'skipped: ctags not found' > $t + exit 0 +} + +# Test to see what flags this ctags binary supports. +# Use the -d, -t and -w flags to ctags if available. +flags="" +echo "f() { int a; }" > $t +for i in -d -t -w --language-force=C; do + if ctags $i $t 2>/dev/null; then + flags="$i $flags" + fi +done + +# Generate a tags file for the build directory +(cd ../build_posix +rm -f tags +ctags $flags ../src/include/*.in ../src/*/*.[chi] 2>/dev/null) + +# Put the shared tags file in the include directory, it's at the same level in +# the tree as the other source files. +(cd ../src/include +rm -f tags +ctags $flags ../include/*.in ../*/*.[chi] 2>/dev/null) + +# Link to the tags file from standard build and source directories. +dirs="`python -c 'import dist; dist.print_source_dirs()'` ../src/os_win" +for i in $dirs; do + if ! expr "$i" : ".*/include" > /dev/null; then + (cd $i && rm -f tags && ln -s ../include/tags .) + fi +done |