$NetBSD: patch-configure,v 1.10 2022/07/31 12:07:23 wiz Exp $

Remove install program overrides on Darwin
Tweak SEARCH_LIB.
Don't call install_name_tool on symlinks
Avoid -Werror.
Fix png library name.

--- configure.orig	2020-05-02 14:03:18.000000000 +0000
+++ configure
@@ -19327,15 +19327,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 fi
 
 fi
-case "${host}" in
-
-                *-*-darwin* )
-        INSTALL_PROGRAM="cp -fp"
-        INSTALL_DATA="cp -fp"
-        ;;
-    *)
-        ;;
-esac
 
 
 if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then
@@ -21778,7 +21769,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_std_libfullpath" >&5
 $as_echo "$wx_cv_std_libfullpath" >&6; }
 
-SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` $wx_cv_std_libfullpath"
+SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` $wx_cv_std_libfullpath @PREFIX@/lib"
 
 if test "$build" != "$host" -a "$GCC" = yes; then
                     if cross_root=`$CC -print-prog-name=ld 2>/dev/null`; then
@@ -22454,13 +22445,13 @@ fi
 
 
         if test "$ac_cv_header_png_h" = "yes"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5
-$as_echo_n "checking for png_sig_cmp in -lpng... " >&6; }
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng16" >&5
+$as_echo_n "checking for png_sig_cmp in -lpng16... " >&6; }
 if ${ac_cv_lib_png_png_sig_cmp+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng -lz -lm $LIBS"
+LIBS="-lpng16 -lz -lm $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22491,7 +22482,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5
 $as_echo "$ac_cv_lib_png_png_sig_cmp" >&6; }
 if test "x$ac_cv_lib_png_png_sig_cmp" = xyes; then :
-  PNG_LINK=" -lpng -lz"
+  PNG_LINK=" -lpng16 -lz"
 fi
 
         fi
@@ -28844,7 +28835,7 @@ for dep in \${libnames} ; do
     changes="\${changes} -change \${4}/\${dep} \${3}/\${dep}"
 done
 for i in \${libnames} ; do
-    ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${1}/\${i}
+    [ -h \${1}/\${i} ] || ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${1}/\${i}
 done
 EOF
             chmod +x change-install-names
@@ -35158,9 +35149,6 @@ if ac_fn_cxx_try_compile "$LINENO"; then
 else
 
                                                                                                                                                                         CFLAGS_OLD="$CFLAGS"
-                        if test "$GCC" = yes ; then
-                            CFLAGS="-Werror $CFLAGS"
-                        fi
 
                         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -39056,7 +39044,8 @@ fi
       *-*-solaris2* )
         SONAME_FLAG="-h "
         USE_SOVERSION=1
-        USE_SOVERSOLARIS=1
+        USE_SOVERLINUX=1
+        USE_SOTWOSYMLINKS=1
       ;;
 
       *-*-darwin* )
