$OpenBSD: patch-configure,v 1.15 2012/10/29 11:07:29 dcoppa Exp $

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

Fix "--export-dynamic" linker flag

Fix linking with external libintl

--- configure.orig	Fri Oct 19 00:05:56 2012
+++ configure	Fri Oct 26 10:05:45 2012
@@ -26063,7 +26063,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"
       ;;
     *)
@@ -26074,7 +26074,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"
       ;;
     *)
@@ -26084,7 +26084,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"
       ;;
     *)
@@ -26337,7 +26337,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
     ;;
@@ -26528,13 +26528,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
@@ -38391,7 +38384,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"
       ;;
     *)
@@ -42499,7 +42492,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>
@@ -42656,8 +42649,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=
