summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorTom Lane2012-12-18 21:22:13 +0000
committerTom Lane2012-12-18 21:23:33 +0000
commit2666a6d0b934b19d4a691b93a64c7d3208acad43 (patch)
treebed9ef89050d6231e3cb7fe8d4f77d07488402b7 /configure.in
parent1a5f04dd7eed0ac27cc5da9520ef55e16531bca6 (diff)
Ignore libedit/libreadline while probing for standard functions.
Some versions of libedit expose bogus definitions of setproctitle(), optreset, and perhaps other symbols that we don't want configure to pick up on. There was a previous report of similar problems with strlcpy(), which we addressed in commit 59cf88da91bc88978b05275ebd94ac2d980c4047, but the problem has evidently grown in scope since then. In hopes of not having to deal with it again in future, rearrange configure's tests for supplied functions so that we ignore libedit/libreadline except when probing specifically for functions we expect them to provide. Per report from Christoph Berg, though this is slightly more aggressive than his proposed patch.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in31
1 files changed, 16 insertions, 15 deletions
diff --git a/configure.in b/configure.in
index 2dee4b392b1..fece090eeb6 100644
--- a/configure.in
+++ b/configure.in
@@ -1202,6 +1202,13 @@ PGAC_VAR_INT_TIMEZONE
AC_FUNC_ACCEPT_ARGTYPES
PGAC_FUNC_GETTIMEOFDAY_1ARG
+# Some versions of libedit contain strlcpy(), setproctitle(), and other
+# symbols that that library has no business exposing to the world. Pending
+# acquisition of a clue by those developers, ignore libedit (including its
+# possible alias of libreadline) while checking for everything else.
+LIBS_including_readline="$LIBS"
+LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
+
AC_CHECK_FUNCS([cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat readlink setproctitle setsid sigprocmask symlink sync_file_range towlower utime utimes wcstombs wcstombs_l])
AC_REPLACE_FUNCS(fseeko)
@@ -1316,11 +1323,6 @@ else
AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break])
fi
-# Some versions of libedit contain strlcpy(); so disregard that library while
-# checking for these standard libc functions.
-pgac_save_LIBS="$LIBS"
-LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
-
AC_REPLACE_FUNCS([crypt fls getopt getrusage inet_aton random rint srandom strerror strlcat strlcpy])
case $host_os in
@@ -1338,9 +1340,6 @@ case $host_os in
;;
esac
-
-LIBS="$pgac_save_LIBS"
-
# System's version of getaddrinfo(), if any, may be used only if we found
# a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
# (Note: the AC_REPLACE_FUNCS probe fails on Windows, where the available
@@ -1394,13 +1393,6 @@ else
AC_SUBST(have_win32_dbghelp,no)
fi
-if test "$with_readline" = yes; then
- PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
- AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
- AC_CHECK_FUNCS([append_history history_truncate_file])
-fi
-
-
dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro
dnl (especially on GNU libc)
dnl See also comments in c.h.
@@ -1451,6 +1443,15 @@ if test x"$pgac_cv_gcc_int_atomics" = x"yes"; then
AC_DEFINE(HAVE_GCC_INT_ATOMICS, 1, [Define to 1 if you have __sync_lock_test_and_set(int *) and friends.])
fi
+# Lastly, restore full LIBS list and check for readline/libedit symbols
+LIBS="$LIBS_including_readline"
+
+if test "$with_readline" = yes; then
+ PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
+ AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
+ AC_CHECK_FUNCS([append_history history_truncate_file])
+fi
+
#
# Pthreads