$OpenBSD: patch-jdk_src_share_demo_jvmti_compiledMethodLoad_sample_makefile_txt,v 1.1 2011/01/11 15:47:50 kurt Exp $
--- jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt.orig	Tue Oct 26 10:46:44 2010
+++ jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt	Tue Oct 26 10:46:50 2010
@@ -38,6 +38,7 @@
 #       gnumake JDK=<java_home> OSNAME=solaris [OPT=true] [LIBARCH=sparcv9]
 #       gnumake JDK=<java_home> OSNAME=linux   [OPT=true]
 #       gnumake JDK=<java_home> OSNAME=win32   [OPT=true]
+#       gnumake JDK=<java_home> OSNAME=bsd     [OPT=true]
 #
 ########################################################################
 
@@ -118,6 +119,29 @@ ifeq ($(OSNAME), win32)
     LIBRARIES=
     # Building a shared library
     LINK_SHARED=link -dll -out:$@
+endif
+
+# BSD GNU C Compiler
+ifeq ($(OSNAME), bsd)
+    # GNU Compiler options needed to build it
+    COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer
+    # Options that help find errors
+    COMMON_FLAGS+= -W -Wall  -Wno-unused -Wno-parentheses
+    ifeq ($(OPT), true)
+        CFLAGS=-O2 $(COMMON_FLAGS)
+    else
+        CFLAGS=-g $(COMMON_FLAGS)
+    endif
+    # Object files needed to create library
+    OBJECTS=$(SOURCES:%.c=%.o)
+    # Library name and options needed to build it
+    # XXX: Needs to be fixed for MacOS X
+    LIBRARY=lib$(LIBNAME).so
+    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
+    # Libraries we are dependent on
+    LIBRARIES=-lc
+    # Building a shared library
+    LINK_SHARED=$(LINK.c) -shared -o $@
 endif
 
 # Common -I options
