haiku: non-x86 spins use a normal libstdc++ filename. Handle the differences. Fixes Bugzilla #3730.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
diff --git a/configure b/configure
index e6066bd..ad5874a 100755
--- a/configure
+++ b/configure
@@ -24031,7 +24031,32 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h
fi
# The Haiku platform requires special setup.
SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding -lstdc++.r4"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
+ # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
+ # other spins, like x86-64, use a more standard "libstdc++.so.*"
+ as_ac_File=`$as_echo "ac_cv_file_"/boot/system/lib/libstdc++.r4.so"" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"/boot/system/lib/libstdc++.r4.so\"" >&5
+$as_echo_n "checking for \"/boot/system/lib/libstdc++.r4.so\"... " >&6; }
+if eval \${$as_ac_File+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r ""/boot/system/lib/libstdc++.r4.so""; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+eval ac_res=\$$as_ac_File
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4"
+else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++"
+fi
+
;;
arm*-apple-darwin*|*-ios-*)
ARCH=ios
diff --git a/configure.in b/configure.in
index 0fa88c3..bb6b9ef 100644
--- a/configure.in
+++ b/configure.in
@@ -3534,7 +3534,10 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
fi
# The Haiku platform requires special setup.
SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding -lstdc++.r4"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
+ # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
+ # other spins, like x86-64, use a more standard "libstdc++.so.*"
+ AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++")
;;
arm*-apple-darwin*|*-ios-*)
ARCH=ios