/usr/bin/xapian-config is in libxapian-dev 1.4.5-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | #!/bin/sh
# xapian-config. Generated from xapian-config.in by configure.
#
# Copyright (C) 2002,2003,2004,2005,2006,2007,2009,2010,2012,2014,2015 Olly Betts
#
# 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 2 of the
# License, 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, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA
PROG_NAME=xapian-config
PROG_DESC="report information about the installed version of xapian"
# ${prefix} and ${exec_prefix} are used in some @-substitutions, and
# ${prefix} is usually used in the exec_prefix @-substitution.
prefix="/usr"
exec_prefix="${prefix}"
# Show usage information and exit with the specified exit status.
show_usage() {
cat <<EOF
Usage: $PROG_NAME OPTION...
Options:
--cxxflags output all preprocessor and C++ compiler flags
--libs output all linker flags
--ltlibs output linker flags for linking using GNU libtool
--static make other options report values for static linking
--swigflags output preprocessor flags for use with SWIG
--help output this help and exit
--version output version information and exit
Report bugs to <https://xapian.org/bugs>.
EOF
exit "$1"
}
# This script requires at least one argument.
[ 0 != "$#" ] || show_usage 1 1>&2
need_explicit_dependencies()
{
# For static libraries, we need to explicitly link with dependency_libs
# on all platforms. For shared libraries, it depends on the platform.
# xapian-config --static means static libraries.
[ no = "$static" ] || return 0 # "true"
# If the .la file hasn't been installed, assume there are shared libraries.
if [ -f "/usr/lib/x86_64-linux-gnu/libxapian.la" ] ; then
# If "$dlname" is empty, we only have static libraries.
extract_dlname "/usr/lib/x86_64-linux-gnu/libxapian.la"
[ -n "$dlname" ] || return 0 # "true"
fi
# Vanilla libtool set this to either "yes" or "unknown" and then handles
# both of these the same way, but our configure forces this to "no" on
# platforms where we know that is appropriate.
[ no != "no" ] || return 1 # "false"
return 0 # "true"
}
# Any extra ldflags needed.
set_F_to_extra_ldflags() {
F=
[ -n "" ] && F=" "
}
# -L option required (if any).
set_L_to_library_path() {
L=
[ /usr/lib != "/usr/lib/x86_64-linux-gnu" ] && L="-L/usr/lib/x86_64-linux-gnu "
}
set_I() {
# Adding -I/usr/include to CXXFLAGS causes problems with certain
# versions of GCC on some platforms where GCC generates "fixed"
# versions of vendor supplied include headers at install time.
# Normally these are used instead of those in /usr/include, but if
# you explicitly pass -I/usr/include you get the non-fixed
# versions. More recent GCC versions simply ignore -I/usr/include
# but we want to support older versions too.
case "${prefix}/include" in
/usr/include|/usr/include/c++) I= ;;
*) I="-I${prefix}/include" ;;
esac
}
set_I_swig() {
I="-I${prefix}/include"
}
# Extract dlname from a libtool .la file.
extract_dlname() {
dlname=
# Need to quote ^ for Solaris /bin/sh.
assignment=`grep '^dlname=' "$1" 2>/dev/null`
eval "$assignment"
}
# Extract dependency_libs recursively from a libtool .la file, converting
# .la references into appropriate -L and -l options.
extract_dependency_libs() {
deps=
# Multiple whitespace (space or tab).
mws='[ ][ ]*'
la='\(/[^ ]*\)\(/lib\)\([^ ]*\).la'
pat='\(.* \)'"$la"'\( .*\)'
extract_dependency_libs_ "$1"
dependency_libs=`echo "$deps"|sed 's/ */ /g;s/^ //;s/ $//'`
}
# Internal helper function for extract_dependency_libs.
extract_dependency_libs_() {
dependency_libs=
# Need to quote ^ for Solaris /bin/sh.
assignment=`grep '^dependency_libs=' "$1" 2>/dev/null`
eval "$assignment"
dependency_libs=`echo " $dependency_libs "|sed "s/$mws/ /g"`
while true ; do
file=`echo "$dependency_libs"|sed "s,$pat"',\2\3\4.la,'`
case $file in
*.la)
# Replace "/path/to/libfoo.la" with "-L/path/to -lfoo".
deps="$deps "`echo "$dependency_libs"|sed "s,$pat"',\1-L\2 -l\4,'`
# Put the trailing part in $1 which is a local variable.
set "`echo "$dependency_libs"|sed "s,$pat"',\5,'`"
# And expand any dependency libs from libfoo.la.
extract_dependency_libs_ "$file"
# Set dependency_libs to the trailing part, ready for the
# next pass of the loop which checks for more .la files.
dependency_libs=$1
;;
*)
deps=$deps$dependency_libs
break
;;
esac
done
}
builddir=`echo "$0"|sed 's![^/]*$!!'`
xo_lib_xapian=no
static=no
actions=
while [ 0 != "$#" ] ; do
arg=$1
shift
case $arg in
--help)
echo "$PROG_NAME - $PROG_DESC"
echo
show_usage 0
;;
--version)
echo "$PROG_NAME - xapian-core 1.4.5"
exit 0
;;
--cxxflags|--swigflags|--libs|--ltlibs)
actions="$actions $arg"
;;
--static)
static=yes
;;
--from-xo-lib-xapian)
# Top Secret option which allows us to give a more helpful error
# message if we're asked to link with an uninstalled libxapian
# and libtool isn't in use.
xo_lib_xapian=yes
;;
-*)
echo "$0: Unrecognized option: $arg" 1>&2
show_usage 1 1>&2
;;
*)
show_usage 1 1>&2
;;
esac
done
for arg in $actions ; do
case $arg in
--cxxflags)
set_I
F=
[ -n "" ] && F=" "
echo "$I$F"
;;
--swigflags)
set_I_swig
echo "$I"
;;
--libs)
set_F_to_extra_ldflags
set_L_to_library_path
D=
if need_explicit_dependencies ; then
extract_dependency_libs "/usr/lib/x86_64-linux-gnu/libxapian.la"
[ -n "$dependency_libs" ] && D=" $dependency_libs"
fi
echo "$F$L-lxapian$D"
;;
--ltlibs)
set_F_to_extra_ldflags
# If we need to pull in dependency_libs, we need libxapian.la.
# Otherwise just use the appropriate -L and -l options.
# Upstream libtool currently never sets link_all_deplibs_CXX=no.
# Some Linux distros patch libtool to return no, and some have an
# unhelpful policy of not packaging .la files in an attempt to work
# around this. So avoiding using libtool here gives more consistent
# behaviour.
if need_explicit_dependencies ; then
if [ -f "/usr/lib/x86_64-linux-gnu/libxapian.la" ]; then
echo "${F}/usr/lib/x86_64-linux-gnu/libxapian.la"
continue
fi
echo "$0: Can't find libxapian.la to link against." 1>&2
exit 1
fi
set_L_to_library_path
echo "$F$L-lxapian"
;;
esac
done
exit 0
|