summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-05-18 21:37:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-05-18 21:37:04 +0000
commit720fa001cacf46d69069baa9b3b16f3742e844b3 (patch)
tree9fb7cacbb46d873bac6d1fa387fd2c20c58a7475 /configure
parent0b7460172a31b161a23c43a738e83e0f0ba1c374 (diff)
downloadmandoc-720fa001cacf46d69069baa9b3b16f3742e844b3.tar.gz
Various people (among others Maxim Belooussov and Carsten Kunze)
reported that the build system still assumed that ohash is only needed if sqlite3 is also in use, which is no longer true: The ohash library is now required no matter what. Rework sqlite3 and ohash library autodetection such that both work independently of each other. Provide LDADD for additional linker flags. Add some missing variables to configure.local.example.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure65
1 files changed, 33 insertions, 32 deletions
diff --git a/configure b/configure
index 21997fcc..e167056b 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
+# Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -36,7 +36,9 @@ OSNAME=
CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -`
CFLAGS="-g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings"
-DBLIB=
+LDADD=
+LD_OHASH=
+LD_SQLITE3=
STATIC="-static"
BUILD_DB=1
@@ -198,28 +200,32 @@ runtest vasprintf VASPRINTF || true
runtest wchar WCHAR || true
# --- sqlite3 ---
-DETECTLIB=
if [ ${BUILD_DB} -eq 0 ]; then
echo "BUILD_DB=0 (manual)" 1>&2
echo "BUILD_DB=0 (manual)" 1>&3
echo 1>&3
HAVE_SQLITE3=0
elif ismanual sqlite3 "${HAVE_SQLITE3}"; then
- DETECTLIB="-lsqlite3"
-elif [ -n "${DBLIB}" ]; then
- runtest sqlite3 SQLITE3 "${DBLIB}" || true
+ if [ -z "${LD_SQLITE3}" ]; then
+ LD_SQLITE3="-lsqlite3"
+ fi
+elif [ -n "${LD_SQLITE3}" ]; then
+ runtest sqlite3 SQLITE3 "${LD_SQLITE3}" || true
elif singletest sqlite3 SQLITE3 "-lsqlite3"; then
- DETECTLIB="-lsqlite3"
+ LD_SQLITE3="-lsqlite3"
elif runtest sqlite3 SQLITE3 \
"-I/usr/local/include -L/usr/local/lib -lsqlite3"; then
- DETECTLIB="-L/usr/local/lib -lsqlite3"
+ LD_SQLITE3="-L/usr/local/lib -lsqlite3"
CFLAGS="${CFLAGS} -I/usr/local/include"
fi
-if [ ${BUILD_DB} -gt 0 -a ${HAVE_SQLITE3} -eq 0 ]; then
- echo "BUILD_DB=0 (no sqlite3)" 1>&2
- echo "BUILD_DB=0 (no sqlite3)" 1>&3
- echo 1>&3
- BUILD_DB=0
+if [ ${HAVE_SQLITE3} -eq 0 ]; then
+ LD_SQLITE3=
+ if [ ${BUILD_DB} -gt 0 ]; then
+ echo "BUILD_DB=0 (no sqlite3)" 1>&2
+ echo "BUILD_DB=0 (no sqlite3)" 1>&3
+ echo 1>&3
+ BUILD_DB=0
+ fi
fi
# --- sqlite3_errstr ---
@@ -227,35 +233,30 @@ if [ ${BUILD_DB} -eq 0 ]; then
HAVE_SQLITE3_ERRSTR=1
elif ismanual sqlite3_errstr "${HAVE_SQLITE3_ERRSTR}"; then
:
-elif [ -n "${DBLIB}" ]; then
- runtest sqlite3_errstr SQLITE3_ERRSTR "${DBLIB}" || true
else
- runtest sqlite3_errstr SQLITE3_ERRSTR "${DETECTLIB}" || true
+ runtest sqlite3_errstr SQLITE3_ERRSTR "${LD_SQLITE3}" || true
fi
# --- ohash ---
-if [ ${BUILD_DB} -eq 0 ]; then
- HAVE_OHASH=1
-elif ismanual ohash "${HAVE_OHASH}"; then
+if ismanual ohash "${HAVE_OHASH}"; then
:
-elif [ -n "${DBLIB}" ]; then
- runtest ohash OHASH "${DBLIB}" || true
+elif [ -n "${LD_OHASH}" ]; then
+ runtest ohash OHASH "${LD_OHASH}" || true
elif singletest ohash OHASH; then
:
elif runtest ohash OHASH "-lutil"; then
- DETECTLIB="${DETECTLIB} -lutil"
+ LD_OHASH="-lutil"
fi
-
-# --- DBLIB ---
-if [ ${BUILD_DB} -eq 0 ]; then
- DBLIB="-lz"
-elif [ -z "${DBLIB}" ]; then
- DBLIB="${DETECTLIB} -lz"
- echo "DBLIB=\"${DBLIB}\"" 1>&2
- echo "DBLIB=\"${DBLIB}\"" 1>&3
- echo 1>&3
+if [ "${HAVE_OHASH}" -eq 0 ]; then
+ LD_OHASH=
fi
+# --- LDADD ---
+LDADD="${LDADD} ${LD_SQLITE3} ${LD_OHASH} -lz"
+echo "LDADD=\"${LDADD}\"" 1>&2
+echo "LDADD=\"${LDADD}\"" 1>&3
+echo 1>&3
+
# --- manpath ---
if ismanual manpath "${HAVE_MANPATH}"; then
:
@@ -426,7 +427,7 @@ BUILD_TARGETS = ${BUILD_TARGETS}
INSTALL_TARGETS = ${INSTALL_TARGETS}
CC = ${CC}
CFLAGS = ${CFLAGS}
-DBLIB = ${DBLIB}
+LDADD = ${LDADD}
STATIC = ${STATIC}
PREFIX = ${PREFIX}
BINDIR = ${BINDIR}