--- configure.orig	2005-03-13 04:49:00.000000000 -0500
+++ configure	2022-01-14 16:36:24.000000000 -0500
@@ -9674,24 +9674,20 @@
       enable_shared_with_static_runtimes=yes
       ;;
 
-    darwin* | rhapsody*)
+    darwin1.* | rhapsody*)
       case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag='${wl}-undefined ${wl}suppress'
          ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
+       darwin*) # Darwin 1.3 on
+           case ${MACOSX_DEPLOYMENT_TARGET},$host in
+             10.[012],*|,*powerpc*-darwin[5-8]*)
                allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
                ;;
-             10.*)
+             *)
                allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
                ;;
            esac
-         fi
          ;;
       esac
       archive_cmds_need_lc=no
@@ -12658,24 +12654,20 @@
       ld_shlibs_CXX=no
     fi
   ;;
-      darwin* | rhapsody*)
+      darwin1.* | rhapsody*)
         case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
          ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
+       darwin*) # Darwin 1.3 on
+           case ${MACOSX_DEPLOYMENT_TARGET},$host in
+             10.[012],*|,*powerpc*-darwin[5-8]*)
                allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
                ;;
-             10.*)
+             *)
                allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
                ;;
            esac
-         fi
          ;;
         esac
       archive_cmds_need_lc_CXX=no
@@ -16656,24 +16648,20 @@
       enable_shared_with_static_runtimes_F77=yes
       ;;
 
-    darwin* | rhapsody*)
+    darwin1.* | rhapsody*)
       case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
          ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
+       darwin*) # Darwin 1.3 on
+           case ${MACOSX_DEPLOYMENT_TARGET},$host in
+             10.[012],*|,*powerpc*-darwin[5-8]*)
                allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
                ;;
-             10.*)
+             *)
                allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
                ;;
            esac
-         fi
          ;;
       esac
       archive_cmds_need_lc_F77=no
@@ -19069,24 +19057,20 @@
       enable_shared_with_static_runtimes_GCJ=yes
       ;;
 
-    darwin* | rhapsody*)
+    darwin1.* | rhapsody*)
       case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
          ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
+       darwin*) # Darwin 1.3 on
+           case ${MACOSX_DEPLOYMENT_TARGET},$host in
+             10.[012],*|,*powerpc*-darwin[5-8]*)
                allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
                ;;
-             10.*)
+             *)
                allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
                ;;
            esac
-         fi
          ;;
       esac
       archive_cmds_need_lc_GCJ=no
