changeset 1894:21c73df7873c

Build system support for BSD Authored by: Magnus Ihse Bursie <magnus.ihse.bursie@oracle.com>
author Greg Lewis <glewis@eyesbeyond.com>
date Sat, 16 Apr 2016 16:20:44 -0700
parents 0da8bee4aab1
children 38c88458172a
files Makefile common/autoconf/boot-jdk.m4 common/autoconf/build-performance.m4 common/autoconf/flags.m4 common/autoconf/help.m4 common/autoconf/hotspot.m4 common/autoconf/jdk-options.m4 common/autoconf/lib-cups.m4 common/autoconf/libraries.m4 common/autoconf/platform.m4 common/autoconf/spec.gmk.in common/autoconf/toolchain.m4 make/CompileJavaModules.gmk make/common/NativeCompilation.gmk
diffstat 14 files changed, 140 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Jan 28 09:42:59 2016 -0800
+++ b/Makefile	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,9 +28,23 @@
 ### It also performs some sanity checks on make.
 ###
 
-# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU Make.
+# This code will cause FreeBSD make to print an error message and abort, 
+# but GNU Make will treat it as a variable assignment
+.error ===You are not using GNU Make/gmake, this is a requirement. Check your path.===
+
+# The shell code below will be executed on /usr/ccs/bin/make on Solaris and 
+# by OpenBSD make, but not in GNU Make.
 # /usr/ccs/bin/make lacks basically every other flow control mechanism.
-.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU Make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
+.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU Make/gmake, this is a requirement. Check your path. 1>&2
+
+# This will make the rest of the file part of a conditional block on BSD make,
+# but GNU Make will treat it as an assignment.
+.if =GNU_ONLY
+
+# This will cause /usr/ccs/bin/make on Solaris to exit.
+.TEST_FOR_NON_GNUMAKE:sh=exit 1
+
+### Now we can be reasonably sure we're actually running GNU Make.
 
 # The .FEATURES variable is likely to be unique for GNU Make.
 ifeq ($(.FEATURES), )
@@ -62,3 +76,5 @@
 
 # ... and then we can include the real makefile
 include $(topdir)/make/Init.gmk
+
+.endif =GNU_ONLY
--- a/common/autoconf/boot-jdk.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/boot-jdk.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -223,6 +223,9 @@
     BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])])
   elif test "x$OPENJDK_TARGET_OS" = xlinux; then
     BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/lib/jvm])])
+  elif test "x$OPENJDK_TARGET_OS" = xbsd; then
+    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/pkg/java])])
+    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/local])])
   fi
 ])
 
--- a/common/autoconf/build-performance.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/build-performance.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,10 @@
     # Looks like a MacOSX system
     NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu`
     FOUND_CORES=yes
+  elif test -x /sbin/sysctl; then
+    # Looks like a BSD system
+    NUM_CORES=`/sbin/sysctl -n hw.ncpu`
+    FOUND_CORES=yes
   elif test "x$OPENJDK_BUILD_OS" = xaix ; then
     NUM_CORES=`/usr/sbin/prtconf | grep "^Number Of Processors" | awk '{ print [$]4 }'`
     FOUND_CORES=yes
@@ -79,6 +83,11 @@
     MEMORY_SIZE=`/usr/sbin/sysctl -n hw.memsize`
     MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
     FOUND_MEM=yes
+  elif test -x /sbin/sysctl; then
+    # Looks like a BSD system
+    MEMORY_SIZE=`/sbin/sysctl -n hw.physmem`
+    MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
+    FOUND_MEM=yes
   elif test "x$OPENJDK_BUILD_OS" = xwindows; then
     # Windows, but without cygwin
     MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-`
--- a/common/autoconf/flags.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/flags.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -257,8 +257,13 @@
     else
       # Default works for linux, might work on other platforms as well.
       SHARED_LIBRARY_FLAGS='-shared'
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
-      SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
+      if test "x$OPENJDK_TARGET_OS_ENV" = xbsd.netbsd; then
+        # -rpath $ORIGIN is broken on NetBSD.
+        SET_EXECUTABLE_ORIGIN=''
+      else
+        SET_EXECUTABLE_ORIGIN='-Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN[$]1'
+      fi
+      SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
     fi
@@ -278,8 +283,13 @@
       # Default works for linux, might work on other platforms as well.
       PICFLAG='-fPIC'
       SHARED_LIBRARY_FLAGS='-shared'
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
-      SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
+      if test "x$OPENJDK_TARGET_OS_ENV" = xbsd.netbsd; then
+        # -rpath $ORIGIN is broken on NetBSD.
+        SET_EXECUTABLE_ORIGIN=''
+      else
+        SET_EXECUTABLE_ORIGIN='-Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN[$]1'
+      fi
+      SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
     fi
--- a/common/autoconf/help.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/help.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
 [
-  AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
+  AC_CHECK_PROGS(PKGHANDLER, apt-get yum pkg port pkgutil pkgadd)
 ])
 
 AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
@@ -46,6 +46,8 @@
         apt_help     $MISSING_DEPENDENCY ;;
       yum)
         yum_help     $MISSING_DEPENDENCY ;;
+      pkg)
+        pkg_help     $MISSING_DEPENDENCY ;;
       port)
         port_help    $MISSING_DEPENDENCY ;;
       pkgutil)
@@ -141,6 +143,29 @@
   esac
 }
 
+pkg_help() {
+  case $1 in
+    openjdk)
+      PKGHANDLER_COMMAND="sudo pkg install openjdk8" ;;
+    cups)
+      PKGHANDLER_COMMAND="sudo pkg install cups-client" ;;
+    freetype)
+      PKGHANDLER_COMMAND="sudo pkg install freetype2" ;;
+    ffi)
+      PKGHANDLER_COMMAND="sudo pkg install libffi" ;;
+    x11)
+      PKGHANDLER_COMMAND="sudo pkg install libX11 libXrender libXext libXtst libXt" ;;
+    ccache)
+      PKGHANDLER_COMMAND="sudo pkg install ccache" ;;
+    unzip)
+      PKGHANDLER_COMMAND="sudo pkg install unzip" ;;
+    zip)
+      PKGHANDLER_COMMAND="sudo pkg install zip" ;;
+    make)      
+      PKGHANDLER_COMMAND="sudo pkg install gmake" ;;
+  esac
+}
+
 port_help() {
   PKGHANDLER_COMMAND=""
 }
--- a/common/autoconf/hotspot.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/hotspot.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -114,6 +114,7 @@
   AC_SUBST(JVM_VARIANT_ZEROSHARK)
   AC_SUBST(JVM_VARIANT_CORE)
 
+  AC_MSG_CHECKING([if servicability agent (jdk.hotspot.agent) should be built])
   INCLUDE_SA=true
   if test "x$JVM_VARIANT_ZERO" = xtrue ; then
     INCLUDE_SA=false
@@ -124,9 +125,17 @@
   if test "x$OPENJDK_TARGET_OS" = xaix ; then
     INCLUDE_SA=false
   fi
+  if test "x$OPENJDK_TARGET_OS_ENV" = xbsd.openbsd || test "x$OPENJDK_TARGET_OS_ENV" = xbsd.netbsd; then
+    INCLUDE_SA=false
+  fi
   if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
     INCLUDE_SA=false
   fi
+  if test "x$INCLUDE_SA" = xtrue; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+  fi
   AC_SUBST(INCLUDE_SA)
 
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
--- a/common/autoconf/jdk-options.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/jdk-options.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -243,7 +243,7 @@
 
   if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
 
-    if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
+    if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xbsd; then
       if test "x$OBJCOPY" = x; then
         # enabling of enable-debug-symbols and can't find objcopy
         # this is an error
@@ -278,7 +278,7 @@
     
   elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
 
-    if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
+    if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xbsd; then
       if test "x$OBJCOPY" = x; then
         # enabling of enable-debug-symbols and can't find objcopy
         # this is an error
--- a/common/autoconf/lib-cups.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/lib-cups.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -72,7 +72,6 @@
       AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], [
           CUPS_FOUND=yes
           CUPS_CFLAGS=
-          DEFAULT_CUPS=yes
       ])
     fi
     if test "x$CUPS_FOUND" = xno; then
@@ -82,13 +81,22 @@
       if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then
         # An SFW package seems to be installed!
         CUPS_FOUND=yes
-        CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include"
+        CUPS_PATH="$SYSROOT/opt/sfw/cups/include"
       elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then
         # A CSW package seems to be installed!
         CUPS_FOUND=yes
-        CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
+        CUPS_PATH="$SYSROOT/opt/csw/include"
+      elif test -s /usr/local/include/cups/cups.h; then
+        # Default FreeBSD/OpenBSD location
+        CUPS_FOUND=yes
+        CUPS_PATH="/usr/local/include"
+      elif test -s /usr/pkg/include/cups/cups.h; then
+        # Default NetBSD location
+        CUPS_FOUND=yes
+        CUPS_PATH="/usr/pkg/include"
       fi
-      AC_MSG_RESULT([$CUPS_FOUND])
+      AC_MSG_RESULT([$CUPS_FOUND, at $CUPS_PATH])
+      CUPS_CFLAGS="-I$CUPS_PATH"
     fi
     if test "x$CUPS_FOUND" = xno; then
       HELP_MSG_MISSING_DEPENDENCY([cups])
--- a/common/autoconf/libraries.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/libraries.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -169,6 +169,16 @@
   LIBDL="$LIBS"
   AC_SUBST(LIBDL)
   LIBS="$save_LIBS"
+  
+  # The iconv library
+  ICONV_LIBS=-liconv
+  if test "x$OPENJDK_TARGET_OS_ENV" = "xbsd.openbsd"; then
+    ICONV_CFLAGS="-I/usr/local/include"
+  else
+    ICONV_CFLAGS=
+  fi
+  AC_SUBST(ICONV_LIBS)
+  AC_SUBST(ICONV_CFLAGS)
 
   # Deprecated libraries, keep the flags for backwards compatibility
   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
--- a/common/autoconf/platform.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/platform.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -123,6 +123,14 @@
     *bsd*)
       VAR_OS=bsd
       VAR_OS_TYPE=unix
+      case "$1" in
+        *freebsd*)
+          VAR_OS_ENV=bsd.freebsd ;;
+        *openbsd*)
+          VAR_OS_ENV=bsd.openbsd ;;
+        *netbsd*)
+          VAR_OS_ENV=bsd.netbsd ;;
+      esac
       ;;
     *cygwin*)
       VAR_OS=windows
@@ -218,6 +226,11 @@
 
   AC_MSG_CHECKING([openjdk-target os-cpu])
   AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
+
+  if test "x$OPENJDK_TARGET_OS_ENV" != "x$OPENJDK_TARGET_OS"; then
+    AC_MSG_CHECKING([openjdk-target os-env])
+    AC_MSG_RESULT([$OPENJDK_TARGET_OS_ENV])
+  fi
 ])
 
 # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour
--- a/common/autoconf/spec.gmk.in	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/spec.gmk.in	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -282,6 +282,8 @@
 ALSA_CFLAGS:=@ALSA_CFLAGS@
 LIBFFI_LIBS:=@LIBFFI_LIBS@
 LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
+ICONV_LIBS:=@ICONV_LIBS@
+ICONV_CFLAGS:=@ICONV_CFLAGS@
 
 PACKAGE_PATH=@PACKAGE_PATH@
 
--- a/common/autoconf/toolchain.m4	Thu Jan 28 09:42:59 2016 -0800
+++ b/common/autoconf/toolchain.m4	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
 VALID_TOOLCHAINS_linux="gcc clang"
 VALID_TOOLCHAINS_solaris="solstudio"
 VALID_TOOLCHAINS_macosx="gcc clang"
+VALID_TOOLCHAINS_bsd="clang gcc"
 VALID_TOOLCHAINS_aix="xlc"
 VALID_TOOLCHAINS_windows="microsoft"
 
@@ -107,6 +108,10 @@
   # Use indirect variable referencing
   toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS
   VALID_TOOLCHAINS=${!toolchain_var_name}
+  if test "x$VALID_TOOLCHAINS" = x; then
+    # For portability, assume gcc and clang for unknown platforms
+    VALID_TOOLCHAINS="gcc clang"
+  fi
 
   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
     if test -n "$XCODEBUILD"; then
@@ -602,7 +607,7 @@
 
   # objcopy is used for moving debug symbols to separate files when
   # full debug symbols are enabled.
-  if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
+  if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xbsd; then
     BASIC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy])
     # Only call fixup if objcopy was found.
     if test -n "$OBJCOPY"; then
--- a/make/CompileJavaModules.gmk	Thu Jan 28 09:42:59 2016 -0800
+++ b/make/CompileJavaModules.gmk	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,9 +71,9 @@
       #
 endif
 
-ifeq ($(filter $(OPENJDK_TARGET_OS), solaris macosx aix), )
+ifeq ($(filter $(OPENJDK_TARGET_OS), solaris macosx bsd aix), )
   #
-  # only solaris, macosx and aix
+  # only solaris, macosx, bsd and aix
   #
   java.base_EXCLUDE_FILES += sun/nio/fs/PollingWatchService.java
 endif
--- a/make/common/NativeCompilation.gmk	Thu Jan 28 09:42:59 2016 -0800
+++ b/make/common/NativeCompilation.gmk	Sat Apr 16 16:20:44 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -700,7 +700,7 @@
         # symbol files to avoid unnecessary relinking on rebuild.
         $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
 
-      else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
+      else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris bsd), )
         $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
         # Setup the command line creating debuginfo files, to be run after linking.
         # It cannot be run separately since it updates the original target file