$OpenBSD: patch-jdk_make_common_shared_Compiler-gcc_gmk,v 1.2 2009/01/04 23:25:16 kurt Exp $
--- jdk/make/common/shared/Compiler-gcc.gmk.orig	Thu Jul 17 03:43:08 2008
+++ jdk/make/common/shared/Compiler-gcc.gmk	Sat Aug  2 16:12:53 2008
@@ -53,20 +53,24 @@ ifeq ($(PLATFORM), windows)
 
 endif
 
-ifeq ($(PLATFORM), linux)
+ifneq (,$(findstring $(PLATFORM), linux bsd))
 
+ifeq ($(PLATFORM), linux)
   # Settings specific to Linux
-  CC             = $(COMPILER_PATH)gcc
-  CPP            = $(COMPILER_PATH)gcc -E
+  CC            ?= $(COMPILER_PATH)gcc
+  CPP            = $(CC) -E
   # statically link libstdc++ before C++ ABI is stablized on Linux
   STATIC_CXX     = true
+else
+  STATIC_CXX     = false
+endif
   ifeq ($(STATIC_CXX),true)
     # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
     # We need to use gcc to statically link the C++ runtime. gcc and g++ use
     # the same subprocess to compile C++ files, so it is OK to build using gcc.
-    CXX            = $(COMPILER_PATH)gcc
+    CXX            = $(CC)
   else
-    CXX            = $(COMPILER_PATH)g++
+    CXX           ?= $(COMPILER_PATH)g++
   endif
   ifneq ("$(findstring sparc,$(ARCH))", "")
     # sparc or sparcv9
