+printf "Checking for bash-completion (>= 1.90)... "
+if pkg-config --atleast-version=1.90 bash-completion; then
+ printf "Yes.\n"
+else
+ printf "No (will not install bash completion).\n"
+ WITH_BASH=0
+fi
+
+if [ -z "${EMACSLISPDIR}" ]; then
+ if pkg-config --exists emacs; then
+ EMACSLISPDIR=$(pkg-config emacs --variable sitepkglispdir)
+ else
+ EMACSLISPDIR='$(prefix)/share/emacs/site-lisp'
+ fi
+fi
+
+if [ -z "${EMACSETCDIR}" ]; then
+ if pkg-config --exists emacs; then
+ EMACSETCDIR=$(pkg-config emacs --variable sitepkglispdir)
+ else
+ EMACSETCDIR='$(prefix)/share/emacs/site-lisp'
+ fi
+fi
+
+printf "Checking if emacs is available... "
+if emacs --quick --batch > /dev/null 2>&1; then
+ printf "Yes.\n"
+ have_emacs=1
+else
+ printf "No (so will not byte-compile emacs code)\n"
+ have_emacs=0
+fi
+
+printf "Checking if doxygen is available... "
+if command -v doxygen > /dev/null; then
+ printf "Yes.\n"
+ have_doxygen=1
+else
+ printf "No (so will not install api docs)\n"
+ have_doxygen=0
+fi
+
+printf "Checking if sphinx is available and supports nroff output... "
+if command -v sphinx-build > /dev/null && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
+ printf "Yes.\n"
+ have_sphinx=1
+else
+ printf "No (so will not install man pages).\n"
+ have_sphinx=0
+fi
+
+libdir_in_ldconfig=0
+
+printf "Checking which platform we are on... "
+uname=`uname`
+if [ $uname = "Darwin" ] ; then
+ printf "Mac OS X.\n"
+ platform=MACOSX
+ linker_resolves_library_dependencies=0
+elif [ $uname = "SunOS" ] ; then
+ printf "Solaris.\n"
+ platform=SOLARIS
+ linker_resolves_library_dependencies=0
+elif [ $uname = "FreeBSD" ] ; then
+ printf "FreeBSD.\n"
+ platform=FREEBSD
+ linker_resolves_library_dependencies=0
+elif [ $uname = "OpenBSD" ] ; then
+ printf "OpenBSD.\n"
+ platform=OPENBSD
+ linker_resolves_library_dependencies=0
+elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
+ printf "$uname\n"
+ platform="$uname"
+ linker_resolves_library_dependencies=1
+
+ printf "Checking for $libdir_expanded in ldconfig... "
+ ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
+ # Separate ldconfig_paths only on newline (not on any potential
+ # embedded space characters in any filenames). Note, we use a
+ # literal newline in the source here rather than something like:
+ #
+ # IFS=$(printf '\n')
+ #
+ # because the shell's command substitution deletes any trailing newlines.
+ IFS="
+"
+ for path in $ldconfig_paths; do
+ if [ "$path" = "$libdir_expanded" ]; then
+ libdir_in_ldconfig=1
+ fi
+ done
+ IFS=$DEFAULT_IFS
+ if [ "$libdir_in_ldconfig" = '0' ]; then
+ printf "No (will set RPATH)\n"
+ else
+ printf "Yes\n"
+ fi