$OpenBSD: patch-configure,v 1.19 2014/05/20 11:02:12 dcoppa Exp $

Use GNU readline instead of our base readline

Unbreak build on powerpc (relocation truncated to fit: R_PPC_GOT16...)

Fix "--export-dynamic" linker flag

Fix linking with external libintl

--- configure.orig	Fri May  2 11:10:27 2014
+++ configure	Fri May  2 11:20:00 2014
@@ -20899,12 +20899,12 @@ done
   ## don't use the cached value as we need to rebuild LIBS
   unset ac_cv_lib_readline_rl_callback_read_char
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_read_char in -lreadline" >&5
-$as_echo_n "checking for rl_callback_read_char in -lreadline... " >&6; }
+$as_echo_n "checking for rl_callback_read_char in -lereadline... " >&6; }
 if ${ac_cv_lib_readline_rl_callback_read_char+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline  $LIBS"
+LIBS="-lereadline  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -20939,7 +20939,7 @@ if test "x$ac_cv_lib_readline_rl_callback_read_char" =
 #define HAVE_LIBREADLINE 1
 _ACEOF
 
-  LIBS="-lreadline $LIBS"
+  LIBS="-lereadline $LIBS"
 
 fi
 
@@ -21066,13 +21066,13 @@ fi
 
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_read_char in -lreadline" >&5
-$as_echo_n "checking for rl_callback_read_char in -lreadline... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_read_char in -lereadline" >&5
+$as_echo_n "checking for rl_callback_read_char in -lereadline... " >&6; }
 if ${ac_cv_lib_readline_rl_callback_read_char+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline  $LIBS"
+LIBS="-lereadline  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -21107,7 +21107,7 @@ if test "x$ac_cv_lib_readline_rl_callback_read_char" =
 #define HAVE_LIBREADLINE 1
 _ACEOF
 
-  LIBS="-lreadline $LIBS"
+  LIBS="-lereadline $LIBS"
 
 fi
 
@@ -26240,7 +26240,7 @@ if test "${GCC}" = yes; then
 ## has 32k and so can use -fpic.
 ## However, although the gcc docs do not mention it, it seems s390/s390x
 ## also supports and needs -fPIC
-    sparc*|ppc64|powerpc64|s390*)
+    sparc*|ppc64|powerpc*|s390*)
       cpicflags="-fPIC"
       ;;
     *)
@@ -26251,7 +26251,7 @@ if test "${GCC}" = yes; then
 fi
 if test "${G77}" = yes; then
   case "${host_cpu}" in
-    sparc*|ppc64|powerpc64|s390*)
+    sparc*|ppc64|powerpc*|s390*)
       fpicflags="-fPIC"
       ;;
     *)
@@ -26261,7 +26261,7 @@ if test "${G77}" = yes; then
 fi
 if test "${GXX}" = yes; then
   case "${host_cpu}" in
-    sparc*|ppc64|powerpc64|s390*)
+    sparc*|ppc64|powerpc*|s390*)
       cxxpicflags="-fPIC"
       ;;
     *)
@@ -26517,7 +26517,7 @@ $as_echo "$as_me: WARNING: Use of flat namespace is re
   openbsd*)
     ## looks like ${wl} is not defined here.  Perhaps in libtool code?
     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
-      main_ldflags="${wl}-export-dynamic"
+      main_ldflags="${wl}--export-dynamic"
       shlib_ldflags="-shared -fPIC"
     fi
     ;;
@@ -26720,13 +26720,6 @@ case "${host_os}" in
       LAPACK_LDFLAGS="+s"
     fi
     ;;
-  openbsd*)
-    PACKAGE_VERSION_MAJOR=`echo "${PACKAGE_VERSION}" | \
-      sed -e "s/\.//" -e "s/\..*$//"`
-    PACKAGE_VERSION_MINOR=`echo "${PACKAGE_VERSION}" | \
-      sed -e "s/.*\.\([^.][^.]*$\)/\1/"`
-    DYLIB_EXT=".so.${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}"
-    ;;
 esac
 
 if test -z "${DYLIB_LD}"; then
@@ -38731,7 +38724,7 @@ fi
 ## use this to pick out gfortran (even though it is unreliable).
 if test "${ac_cv_fc_compiler_gnu}" = yes; then
   case "${host_cpu}" in
-    sparc*|ppc64|powerpc64|s390*)
+    sparc*|ppc64|powerpc*|s390*)
       fcpicflags="-fPIC"
       ;;
     *)
@@ -42485,7 +42478,7 @@ else
   gt_save_CPPFLAGS="$CPPFLAGS"
             CPPFLAGS="$CPPFLAGS $INCINTL"
             gt_save_LIBS="$LIBS"
-            LIBS="$LIBS $LIBINTL"
+	    LIBS="$LIBS $LTLIBINTL"
                         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <libintl.h>
@@ -42642,8 +42635,8 @@ $as_echo "$gt_source" >&6; }
       if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
 $as_echo_n "checking how to link with libintl... " >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
-$as_echo "$LIBINTL" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTLIBINTL" >&5
+$as_echo "$LTLIBINTL" >&6; }
 
   for element in $INCINTL; do
     haveit=
