(svn r12876) -Fix [FS#1928]: gcc on FreeBSD does not support -dumpmachine. As gcc is not necessary for FreeBSD compiles we 'just' use g++ as that support -dumpmachine.
authorrubidium
Thu, 24 Apr 2008 20:07:12 +0000
changeset 9050 72e9db1a3b2d
parent 9049 21f20d9bc849
child 9051 d9469b3f0e05
(svn r12876) -Fix [FS#1928]: gcc on FreeBSD does not support -dumpmachine. As gcc is not necessary for FreeBSD compiles we 'just' use g++ as that support -dumpmachine.
config.lib
--- a/config.lib	Thu Apr 24 18:30:41 2008 +0000
+++ b/config.lib	Thu Apr 24 20:07:12 2008 +0000
@@ -419,11 +419,11 @@
 
 	detect_awk
 
+	detect_os
+
 	check_build
 	check_host
 
-	detect_os
-
 # We might enable universal builds always on OSX targets.. but currently we don't
 #	if [ "$enable_universal" = "1" ]  && [ "$os" != "OSX" ]; then
 	if [ "$enable_universal" = "1" ]; then
@@ -1347,13 +1347,26 @@
 }
 
 check_build() {
-	check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "gcc" "cc" "0" "-dumpmachine"
+	if [ "$os" = "FREEBSD" ]; then
+		# FreeBSD's C compiler does not support dump machine.
+		# However, removing C support is not possible because PSP must be linked with the C compiler.
+		check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CXX" "g++" "c++" "0" "-dumpmachine"
+	else
+		check_compiler "build system type" "cc_build" "$build" "$cc_build" "$CC" "gcc" "cc" "0" "-dumpmachine"
+	fi
 }
 
 check_host() {
 	# By default the host is the build
 	if [ -z "$host" ]; then host="$build"; fi
-	check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
+
+	if [ "$os" = "FREEBSD" ]; then
+		# FreeBSD's C compiler does not support dump machine.
+		# However, removing C support is not possible because PSP must be linked with the C compiler.
+		check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CXX" "g++" "c++" "0" "-dumpmachine"
+	else
+		check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
+	fi
 }
 
 check_cxx_build() {