makefiles/CompileNativeLibraries.gmk

Print this page




   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 defalt: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include NativeCompilation.gmk
  31 
  32 # Setup the java compilers for the JDK build.
  33 include Setup.gmk
  34 
  35 # Copy files (can now depend on $(COPY_FILES))
  36 include CopyFiles.gmk
  37 
  38 # Prepare the find cache. Only used if running on windows.
  39 $(eval $(call FillCacheFind,$(JDK_TOPDIR)/src))
  40 
  41 # Build tools
  42 include Tools.gmk
  43 
  44 # Include the javah generated headers.
  45 CFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
  46 CXXFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers


2461 else ifneq ($(OPENJDK_TARGET_OS), windows)
2462         LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
2463 else
2464         LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
2465 endif
2466 
2467 LIBSPLASHSCREEN_LDFLAGS_SUFFIX:=
2468 
2469 ifneq ($(USE_EXTERNAL_LIBZ),true)
2470         LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
2471         LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
2472 endif
2473 
2474 ifeq ($(OPENJDK_TARGET_OS), macosx)
2475         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
2476                                   -framework ApplicationServices \
2477                                   -framework Foundation \
2478                                   -framework Cocoa \
2479                                   -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
2480                                   -framework JavaNativeFoundation
2481 else ifneq ($(OPENJDK_TARGET_OS), windows)
2482         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
2483 else # OPENJDK_TARGET_OS
2484         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
2485 endif # OPENJDK_TARGET_OS





2486 
2487 $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\
2488                 LIBRARY:=splashscreen,\
2489                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2490                 SRC:=$(LIBSPLASHSCREEN_DIRS),\
2491                 EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\
2492                 LANG:=C,\
2493                 OPTIMIZATION:=LOW, \
2494                 CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS),\
2495                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
2496                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2497                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2498                 LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS),\
2499                 LDFLAGS_SUFFIX_solaris:=-lc,\
2500                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2501                 RC_FLAGS:=$(RC_FLAGS)\
2502                           -D "JDK_FNAME=splashscreen.dll" \
2503                           -D "JDK_INTERNAL_NAME=splashscreen" \
2504                           -D "JDK_FTYPE=0x2L",\
2505                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsplashscreen,\


2842   endif
2843 
2844   ifeq ($(OPENJDK_TARGET_CPU), sparc)
2845         LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
2846   endif
2847 
2848   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
2849         LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
2850   endif
2851 
2852   ifeq ($(OPENJDK_TARGET_CPU), x86_64)
2853         LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
2854   endif
2855 
2856   ifeq ($(OPENJDK_TARGET_CPU), arm)
2857         LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
2858   endif
2859 
2860   ifeq ($(OPENJDK_TARGET_CPU), ppc)
2861         LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC




2862   endif
2863 endif
2864 
2865 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
2866 
2867 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND,\
2868                 LIBRARY:=jsound,\
2869                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2870                 SRC:=$(LIBJSOUND_SRC_DIRS),\
2871                 INCLUDE_FILES:=$(LIBJSOUND_SRC_FILES),\
2872                 LANG:=$(LIBJSOUND_LANG),\
2873                 OPTIMIZATION:=LOW, \
2874                 CFLAGS:=$(CFLAGS_JDKLIB) \
2875                         $(LIBJSOUND_CFLAGS), \
2876                 CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
2877                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \
2878                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
2879                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2880                 LDFLAGS_macosx:=-framework CoreAudio -framework CoreFoundation \
2881                                 -framework CoreServices -framework AudioUnit $(LIBCXX) \




   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 default: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include NativeCompilation.gmk
  31 
  32 # Setup the java compilers for the JDK build.
  33 include Setup.gmk
  34 
  35 # Copy files (can now depend on $(COPY_FILES))
  36 include CopyFiles.gmk
  37 
  38 # Prepare the find cache. Only used if running on windows.
  39 $(eval $(call FillCacheFind,$(JDK_TOPDIR)/src))
  40 
  41 # Build tools
  42 include Tools.gmk
  43 
  44 # Include the javah generated headers.
  45 CFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
  46 CXXFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers


2461 else ifneq ($(OPENJDK_TARGET_OS), windows)
2462         LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
2463 else
2464         LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
2465 endif
2466 
2467 LIBSPLASHSCREEN_LDFLAGS_SUFFIX:=
2468 
2469 ifneq ($(USE_EXTERNAL_LIBZ),true)
2470         LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
2471         LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
2472 endif
2473 
2474 ifeq ($(OPENJDK_TARGET_OS), macosx)
2475         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
2476                                   -framework ApplicationServices \
2477                                   -framework Foundation \
2478                                   -framework Cocoa \
2479                                   -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
2480                                   -framework JavaNativeFoundation
2481 else ifeq ($(OPENJDK_TARGET_OS), windows)


2482         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
2483 else ifeq ($(OPENJDK_TARGET_OS), solaris)
2484         # Solaris still uses OPENWIN_LIB ..
2485         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
2486 else    # .. all other Unixes can use X_LIBS
2487         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
2488 endif
2489 
2490 $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\
2491                 LIBRARY:=splashscreen,\
2492                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2493                 SRC:=$(LIBSPLASHSCREEN_DIRS),\
2494                 EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\
2495                 LANG:=C,\
2496                 OPTIMIZATION:=LOW, \
2497                 CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS),\
2498                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
2499                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2500                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2501                 LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS),\
2502                 LDFLAGS_SUFFIX_solaris:=-lc,\
2503                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2504                 RC_FLAGS:=$(RC_FLAGS)\
2505                           -D "JDK_FNAME=splashscreen.dll" \
2506                           -D "JDK_INTERNAL_NAME=splashscreen" \
2507                           -D "JDK_FTYPE=0x2L",\
2508                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsplashscreen,\


2845   endif
2846 
2847   ifeq ($(OPENJDK_TARGET_CPU), sparc)
2848         LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
2849   endif
2850 
2851   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
2852         LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
2853   endif
2854 
2855   ifeq ($(OPENJDK_TARGET_CPU), x86_64)
2856         LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
2857   endif
2858 
2859   ifeq ($(OPENJDK_TARGET_CPU), arm)
2860         LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
2861   endif
2862 
2863   ifeq ($(OPENJDK_TARGET_CPU), ppc)
2864         LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC
2865   endif
2866 
2867   ifeq ($(OPENJDK_TARGET_CPU), ppc64)
2868        LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64
2869   endif
2870 endif
2871 
2872 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
2873 
2874 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND,\
2875                 LIBRARY:=jsound,\
2876                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2877                 SRC:=$(LIBJSOUND_SRC_DIRS),\
2878                 INCLUDE_FILES:=$(LIBJSOUND_SRC_FILES),\
2879                 LANG:=$(LIBJSOUND_LANG),\
2880                 OPTIMIZATION:=LOW, \
2881                 CFLAGS:=$(CFLAGS_JDKLIB) \
2882                         $(LIBJSOUND_CFLAGS), \
2883                 CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
2884                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \
2885                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
2886                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2887                 LDFLAGS_macosx:=-framework CoreAudio -framework CoreFoundation \
2888                                 -framework CoreServices -framework AudioUnit $(LIBCXX) \