use system libjpeg, libpng, lcms2 and pcsc-lite
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Fri, 18 Sep 2015 13:09:30 +0000 (15:09 +0200)
committerJacek Konieczny <j.konieczny@eggsoft.pl>
Fri, 18 Sep 2015 13:09:30 +0000 (15:09 +0200)
patches borrowed from Debian

openjdk8.spec
system-lcms.patch [new file with mode: 0644]
system-libjpeg.patch [new file with mode: 0644]
system-libpng.patch [new file with mode: 0644]
system-pcsclite.patch [new file with mode: 0644]

index 27a49306c5b6976f70387533bb0a6e228be838b5..a040bbb804a7843e90904f267dd0423f9a3edf28 100644 (file)
@@ -2,7 +2,7 @@
 # TODO:
 #      - fix BuildRequires
 #      - fix build with system giflib
-#      - use other system libs (libjpeg, liblcms, libsctp)
+#      - use other system libs (libsctp?)
 #      - build alternative VM for x32
 #      - include icedtea-sound?
 #      - port PLD-specific changes from icedtea7?
@@ -52,11 +52,14 @@ Patch0:             adjust-mflags.patch
 Patch1:                format_strings.patch
 Patch2:                CompileDemos.patch
 Patch3:                libpath.patch
+Patch4:                system-libjpeg.patch
+Patch5:                system-libpng.patch
+Patch6:                system-lcms.patch
+Patch7:                system-pcsclite.patch
 URL:           http://openjdk.java.net/
 BuildRequires: alsa-lib-devel
 BuildRequires: ant
 BuildRequires: autoconf
-BuildRequires: automake
 BuildRequires: bash
 %{?with_cacerts:BuildRequires: ca-certificates-update}
 BuildRequires: cups-devel
@@ -66,8 +69,11 @@ BuildRequires:       gawk
 #BuildRequires:        giflib-devel >= 5.1
 BuildRequires: glibc-misc
 %buildrequires_jdk
+BuildRequires: lcms2-devel
 BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
 BuildRequires: lsb-release
+BuildRequires: pcsc-lite-devel
 BuildRequires: pkgconfig
 BuildRequires: rpmbuild(macros) >= 1.557
 BuildRequires: unzip
@@ -411,6 +417,10 @@ done
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 # Make sure we have /proc mounted - otherwise idlc will fail later.
@@ -419,6 +429,10 @@ if [ ! -f /proc/self/stat ]; then
        exit 1
 fi
 
+cd common/autoconf
+%{__autoconf} -o generated-configure.sh
+cd ../..
+
 mkdir -p build-bin
 export JAVA_HOME=%{java_home}
 export PATH="$JAVA_HOME/bin:$PATH"
@@ -431,6 +445,10 @@ chmod a+x configure
        --with-extra-cxxflags="%{rpmcxxflags}" \
        --with-extra-ldflags="%{rpmldflags}" \
        --with-giflib=bundled \
+       --with-libjpeg=system \
+       --with-libpng=system \
+       --with-lcms=system \
+       --with-libpcsclite=system \
        --with-zlib=system
 
 specdir="$(dirname build/*-release/spec.gmk)"
@@ -748,11 +766,11 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libj2pkcs11.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjaas_unix.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjava.so
-%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjpeg.so
-%attr(755,root,root) %{jredir}/lib/%{jre_arch}/liblcms.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsctp.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libsunec.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjava_crw_demo.so
+%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjavajpeg.so
+%attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjavalcms.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjawt.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjdwp.so
 %attr(755,root,root) %{jredir}/lib/%{jre_arch}/libjsdt.so
diff --git a/system-lcms.patch b/system-lcms.patch
new file mode 100644 (file)
index 0000000..67a1baa
--- /dev/null
@@ -0,0 +1,102 @@
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
+--- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4        2015-09-18 13:16:52.000000000 +0200
++++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4     2015-09-18 13:18:24.000000000 +0200
+@@ -666,6 +666,46 @@
+   ###############################################################################
+   #
++  # Check for the lcms2 library
++  #
++
++  AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms],
++      [use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
++
++  AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile,
++               [ LCMS_FOUND=yes ],
++               [ LCMS_FOUND=no ])
++
++  AC_MSG_CHECKING([for which lcms to use])
++
++  DEFAULT_LCMS=bundled
++
++  #
++  # If user didn't specify, use DEFAULT_LCMS
++  #
++  if test "x${with_lcms}" = "x"; then
++      with_lcms=${DEFAULT_LCMS}
++  fi
++
++  if test "x${with_lcms}" = "xbundled"; then
++      USE_EXTERNAL_LCMS=false
++      AC_MSG_RESULT([bundled])
++  elif test "x${with_lcms}" = "xsystem"; then
++      if test "x${LCMS_FOUND}" = "xyes"; then
++          USE_EXTERNAL_LCMS=true
++          AC_MSG_RESULT([system])
++      else
++          AC_MSG_RESULT([system not found])
++          AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
++      fi
++  else
++      AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'])
++  fi
++
++  AC_SUBST(USE_EXTERNAL_LCMS)
++
++  ###############################################################################
++  #
+   # Check for the png library
+   #
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk
+--- jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk     2015-09-18 13:16:52.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk  2015-09-18 13:18:24.000000000 +0200
+@@ -667,8 +667,8 @@
+ ##########################################################################################
+ # TODO: Update awt lib path when awt is converted
+-$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
+-    LIBRARY := lcms, \
++$(eval $(call SetupNativeCompilation,BUILD_LIBJAVALCMS, \
++    LIBRARY := javalcms, \
+     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
+     SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
+     LANG := C, \
+@@ -686,19 +686,19 @@
+     LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
+     LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
+     LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
+-    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
++    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm -llcms2, \
+     LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\
+     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
+     RC_FLAGS := $(RC_FLAGS) \
+-        -D "JDK_FNAME=lcms.dll" \
+-        -D "JDK_INTERNAL_NAME=lcms" \
++        -D "JDK_FNAME=javalcms.dll" \
++        -D "JDK_INTERNAL_NAME=javalcms" \
+         -D "JDK_FTYPE=0x2L", \
+-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
++    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavalcms, \
+     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+-BUILD_LIBRARIES += $(BUILD_LIBLCMS)
++BUILD_LIBRARIES += $(BUILD_LIBJAVALCMS)
+-$(BUILD_LIBLCMS): $(BUILD_LIBAWT)
++$(BUILD_LIBJAVALCMS): $(BUILD_LIBAWT)
+ ##########################################################################################
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java
+--- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java 2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java      2015-09-18 13:18:24.000000000 +0200
+@@ -207,7 +207,7 @@
+                          * disposer frameworks
+                          */
+                         System.loadLibrary("awt");
+-                        System.loadLibrary("lcms");
++                        System.loadLibrary("javalcms");
+                         return null;
+                     }
+                 });
diff --git a/system-libjpeg.patch b/system-libjpeg.patch
new file mode 100644 (file)
index 0000000..37294ca
--- /dev/null
@@ -0,0 +1,364 @@
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/generated-configure.sh jdk8u-jdk8u66-b02/common/autoconf/generated-configure.sh
+--- jdk8u-jdk8u66-b02.orig/common/autoconf/generated-configure.sh      2015-07-17 09:35:23.000000000 +0200
++++ jdk8u-jdk8u66-b02/common/autoconf/generated-configure.sh   2015-09-18 13:13:58.000000000 +0200
+@@ -1065,6 +1065,7 @@
+ with_alsa
+ with_alsa_include
+ with_alsa_lib
++with_libjpeg
+ with_giflib
+ with_zlib
+ with_stdc__lib
+@@ -1838,6 +1839,8 @@
+                           headers under PATH/include)
+   --with-alsa-include     specify directory for the alsa include files
+   --with-alsa-lib         specify directory for the alsa library
++  --with-libjpeg          use libjpeg from build system or OpenJDK source
++                          (system, bundled) [bundled]
+   --with-giflib           use giflib from build system or OpenJDK source
+                           (system, bundled) [bundled]
+   --with-zlib             use zlib from build system or OpenJDK source
+@@ -8092,6 +8095,11 @@
+     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
+   fi
++  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
++    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
++      as_fn_error $? "You cannot build a client JVM for a 64-bit machine." "$LINENO" 5
++    fi
++  fi
+   if test "x$JVM_VARIANT_KERNEL" = xtrue; then
+     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
+   fi
+@@ -34837,10 +34845,43 @@
+   # Check for the jpeg library
+   #
+-  USE_EXTERNAL_LIBJPEG=true
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5
+-$as_echo_n "checking for main in -ljpeg... " >&6; }
+-if ${ac_cv_lib_jpeg_main+:} false; then :
++
++# Check whether --with-libjpeg was given.
++if test "${with_libjpeg+set}" = set; then :
++  withval=$with_libjpeg;
++fi
++
++
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libjpeg to use" >&5
++$as_echo_n "checking for which libjpeg to use... " >&6; }
++
++  # default is bundled
++  DEFAULT_LIBJPEG=bundled
++
++  #
++  # if user didn't specify, use DEFAULT_LIBJPEG
++  #
++  if test "x${with_libjpeg}" = "x"; then
++    with_libjpeg=${DEFAULT_LIBJPEG}
++  fi
++
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libjpeg}" >&5
++$as_echo "${with_libjpeg}" >&6; }
++
++  if test "x${with_libjpeg}" = "xbundled"; then
++    USE_EXTERNAL_LIBJPEG=false
++  elif test "x${with_libjpeg}" = "xsystem"; then
++    ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
++if test "x$ac_cv_header_jpeglib_h" = xyes; then :
++
++else
++   as_fn_error $? "--with-libjpeg=system specified, but jpeglib.h not found!" "$LINENO" 5
++fi
++
++
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5
++$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; }
++if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+@@ -34848,27 +34889,33 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-
++/* Override any GCC internal prototype to avoid an error.
++   Use char because int might match the return type of a GCC
++   builtin and then its argument prototype would still apply.  */
++#ifdef __cplusplus
++extern "C"
++#endif
++char jpeg_CreateDecompress ();
+ int
+ main ()
+ {
+-return main ();
++return jpeg_CreateDecompress ();
+   ;
+   return 0;
+ }
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+-  ac_cv_lib_jpeg_main=yes
++  ac_cv_lib_jpeg_jpeg_CreateDecompress=yes
+ else
+-  ac_cv_lib_jpeg_main=no
++  ac_cv_lib_jpeg_jpeg_CreateDecompress=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5
+-$as_echo "$ac_cv_lib_jpeg_main" >&6; }
+-if test "x$ac_cv_lib_jpeg_main" = xyes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5
++$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; }
++if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then :
+   cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBJPEG 1
+ _ACEOF
+@@ -34876,13 +34923,16 @@
+   LIBS="-ljpeg $LIBS"
+ else
+-   USE_EXTERNAL_LIBJPEG=false
+-      { $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5
+-$as_echo "$as_me: Will use jpeg decoder bundled with the OpenJDK source" >&6;}
+-
++   as_fn_error $? "--with-libjpeg=system specified, but no libjpeg found" "$LINENO" 5
+ fi
++    USE_EXTERNAL_LIBJPEG=true
++  else
++    as_fn_error $? "Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'" "$LINENO" 5
++  fi
++
++
+   ###############################################################################
+   #
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
+--- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4        2015-07-17 09:35:23.000000000 +0200
++++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4     2015-09-18 13:13:58.000000000 +0200
+@@ -595,11 +595,36 @@
+   # Check for the jpeg library
+   #
+-  USE_EXTERNAL_LIBJPEG=true
+-  AC_CHECK_LIB(jpeg, main, [],
+-      [ USE_EXTERNAL_LIBJPEG=false
+-      AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
+-  ])
++  AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg],
++      [use libjpeg from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
++
++  AC_MSG_CHECKING([for which libjpeg to use])
++
++  # default is bundled
++  DEFAULT_LIBJPEG=bundled
++
++  #
++  # if user didn't specify, use DEFAULT_LIBJPEG
++  #
++  if test "x${with_libjpeg}" = "x"; then
++    with_libjpeg=${DEFAULT_LIBJPEG}
++  fi
++
++  AC_MSG_RESULT(${with_libjpeg})
++
++  if test "x${with_libjpeg}" = "xbundled"; then
++    USE_EXTERNAL_LIBJPEG=false
++  elif test "x${with_libjpeg}" = "xsystem"; then
++    AC_CHECK_HEADER(jpeglib.h, [],
++        [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])])
++    AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [],
++        [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
++
++    USE_EXTERNAL_LIBJPEG=true
++  else
++    AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
++  fi
++
+   AC_SUBST(USE_EXTERNAL_LIBJPEG)
+   ###############################################################################
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk
+--- jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk     2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk  2015-09-18 13:13:58.000000000 +0200
+@@ -702,21 +702,24 @@
+ ##########################################################################################
++BUILD_LIBJAVAJPEG_DIR := $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
++
+ ifdef OPENJDK
+-  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
++  BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
+ else
+-  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
+-  BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
+-  BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
++  BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
++  BUILD_LIBJAVAJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
++  BUILD_LIBJAVAJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJAVAJPEG_CLOSED_SRC)
+ endif
+-BUILD_LIBJPEG_REORDER :=
++BUILD_LIBJAVAJPEG_REORDER :=
+ ifeq ($(OPENJDK_TARGET_OS), solaris)
+   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
+-    BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
++    BUILD_LIBJAVAJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
+   endif
+ endif
++
+ # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
+ # or 'vfork'": this warning indicates that some variable is placed to
+ # a register by optimized compiler and it's value might be lost on longjmp().
+@@ -728,37 +731,50 @@
+ #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
+ #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
+ #  ifeq ($(CC_43_OR_NEWER), 1)
+-#    BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
++#    BUILD_LIBJAVAJPEG_CFLAGS_linux += -Wno-clobbered
+ #  endif
+ #endif
+-$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
+-    LIBRARY := jpeg, \
++ifeq ($(USE_EXTERNAL_LIBJPEG), true)
++  LIBJPEG_LIBS := -ljpeg
++  BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
++      imageIOJPEG.c \
++      jpegdecoder.c
++  BUILD_LIBJAVAJPEG_HEADERS :=
++else
++  LIBJPEG_LIBS :=
++  BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
++  BUILD_LIBJAVAJPEG_HEADERS := -I$(BUILD_LIBJAVAJPEG_DIR)
++endif
++
++$(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
++    LIBRARY := javajpeg, \
+     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
+-    SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
+-        $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
++    SRC := $(BUILD_LIBJAVAJPEG_CLOSED_SRC) \
++        $(BUILD_LIBJAVAJPEG_DIR), \
++    INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
+     LANG := C, \
+     OPTIMIZATION := HIGHEST, \
+     CFLAGS := $(CFLAGS_JDKLIB) \
+-        $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
+-        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
+-    MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
++        $(BUILD_LIBJAVAJPEG_CLOSED_INCLUDES) \
++        $(BUILD_LIBJAVAJPEG_HEADERS), \
++    MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
+     LDFLAGS := $(LDFLAGS_JDKLIB) \
+         $(call SET_SHARED_LIBRARY_ORIGIN), \
+     LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
+-    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
++    LDFLAGS_SUFFIX := $(LIBJPEG_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
+     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
+     RC_FLAGS := $(RC_FLAGS) \
+-        -D "JDK_FNAME=jpeg.dll" \
+-        -D "JDK_INTERNAL_NAME=jpeg" \
++        -D "JDK_FNAME=javajpeg.dll" \
++        -D "JDK_INTERNAL_NAME=javajpeg" \
+         -D "JDK_FTYPE=0x2L", \
+-    REORDER := $(BUILD_LIBJPEG_REORDER), \
++    REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
+     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
+     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+-$(BUILD_LIBJPEG): $(BUILD_LIBJAVA)
++$(BUILD_LIBJAVAJPEG): $(BUILD_LIBJAVA)
+-BUILD_LIBRARIES += $(BUILD_LIBJPEG)
++BUILD_LIBRARIES += $(BUILD_LIBJAVAJPEG)
+ ##########################################################################################
+@@ -1198,6 +1214,13 @@
+     GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
+   endif
++  ifeq ($(USE_EXTERNAL_LIBJPEG), true)
++    LIBJPEG_LDFLAGS := -ljpeg
++  else
++    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
++    LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
++  endif
++
+   ifneq ($(OPENJDK_TARGET_OS), macosx)
+     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
+   else
+@@ -1258,11 +1281,13 @@
+       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
+       LANG := C, \
+       OPTIMIZATION := LOW, \
+-      CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
++      CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
++                $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS), \
+       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
+       LDFLAGS := $(LDFLAGS_JDKLIB) \
+           $(call SET_SHARED_LIBRARY_ORIGIN), \
+-      LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \
++      LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) \
++                        $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS), \
+       LDFLAGS_SUFFIX_solaris := -lc, \
+       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
+       RC_FLAGS := $(RC_FLAGS) \
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
+--- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java     2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java  2015-09-18 13:13:58.000000000 +0200
+@@ -89,7 +89,7 @@
+         java.security.AccessController.doPrivileged(
+             new java.security.PrivilegedAction<Void>() {
+                 public Void run() {
+-                    System.loadLibrary("jpeg");
++                    System.loadLibrary("javajpeg");
+                     return null;
+                 }
+             });
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
+--- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java     2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java  2015-09-18 13:13:58.000000000 +0200
+@@ -177,7 +177,7 @@
+         java.security.AccessController.doPrivileged(
+             new java.security.PrivilegedAction<Void>() {
+                 public Void run() {
+-                    System.loadLibrary("jpeg");
++                    System.loadLibrary("javajpeg");
+                     return null;
+                 }
+             });
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java
+--- jdk8u-jdk8u66-b02.orig/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java   2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java        2015-09-18 13:13:58.000000000 +0200
+@@ -56,7 +56,7 @@
+         java.security.AccessController.doPrivileged(
+             new java.security.PrivilegedAction<Void>() {
+                 public Void run() {
+-                    System.loadLibrary("jpeg");
++                    System.loadLibrary("javajpeg");
+                     return null;
+                 }
+             });
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+--- jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c       2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c    2015-09-18 13:13:58.000000000 +0200
+@@ -51,7 +51,7 @@
+ /* headers from the JPEG library */
+ #include <jpeglib.h>
+-#include "jerror.h"
++#include <jerror.h>
+ #undef MAX
+ #define MAX(a,b)        ((a) > (b) ? (a) : (b))
diff --git a/system-libpng.patch b/system-libpng.patch
new file mode 100644 (file)
index 0000000..e8259b4
--- /dev/null
@@ -0,0 +1,115 @@
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
+--- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4        2015-09-18 13:13:58.000000000 +0200
++++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4     2015-09-18 13:16:52.000000000 +0200
+@@ -666,6 +666,47 @@
+   ###############################################################################
+   #
++  # Check for the png library
++  #
++
++  AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng],
++     [use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
++
++  AC_CHECK_LIB(png, png_sig_cmp,
++               [ LIBPNG_FOUND=yes ],
++               [ LIBPNG_FOUND=no ])
++
++  AC_MSG_CHECKING([for which libpng to use])
++
++  # default is bundled
++  DEFAULT_LIBPNG=bundled
++
++  #
++  # if user didn't specify, use DEFAULT_LIBPNG
++  #
++  if test "x${with_libpng}" = "x"; then
++      with_libpng=${DEFAULT_libpng}
++  fi
++
++
++  if test "x${with_libpng}" = "xbundled"; then
++      USE_EXTERNAL_LIBPNG=false
++      AC_MSG_RESULT([bundled])
++  elif test "x${with_libpng}" = "xsystem"; then
++      if test "x${LIBPNG_FOUND}" = "xyes"; then
++          USE_EXTERNAL_LIBPNG=true
++          AC_MSG_RESULT([system])
++      else
++          AC_MSG_RESULT([system not found])
++          AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!])
++      fi
++  else
++      AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'])
++  fi
++  AC_SUBST(USE_EXTERNAL_LIBPNG)
++
++  ###############################################################################
++  #
+   # Check for the zlib library
+   #
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in
+--- jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in 2015-07-17 09:35:23.000000000 +0200
++++ jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in      2015-09-18 13:16:52.000000000 +0200
+@@ -563,6 +563,7 @@
+ ENABLE_JFR=@ENABLE_JFR@
+ ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
+ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
++USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
+ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
+ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
+ LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk
+--- jdk8u-jdk8u66-b02.orig/jdk/make/lib/Awt2dLibraries.gmk     2015-09-18 13:13:58.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/make/lib/Awt2dLibraries.gmk  2015-09-18 13:16:52.000000000 +0200
+@@ -1204,7 +1204,6 @@
+ ifndef BUILD_HEADLESS_ONLY
+   LIBSPLASHSCREEN_DIRS := \
+     $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
+-    $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
+     $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
+   ifeq ($(USE_EXTERNAL_LIBGIF), true)
+@@ -1221,6 +1220,13 @@
+     LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
+   endif
++  ifeq ($(USE_EXTERNAL_LIBPNG), true)
++    LIBPNG_LDFLAGS := -lpng
++  else
++    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/image/libpng
++    LIBPNG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/libpng
++  endif
++
+   ifneq ($(OPENJDK_TARGET_OS), macosx)
+     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
+   else
+@@ -1282,12 +1288,12 @@
+       LANG := C, \
+       OPTIMIZATION := LOW, \
+       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
+-                $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS), \
++                $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(LIBPNG_CFLAGS), \
+       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
+       LDFLAGS := $(LDFLAGS_JDKLIB) \
+           $(call SET_SHARED_LIBRARY_ORIGIN), \
+       LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) \
+-                        $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS), \
++                        $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS) $(LIBPNG_LDFLAGS), \
+       LDFLAGS_SUFFIX_solaris := -lc, \
+       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
+       RC_FLAGS := $(RC_FLAGS) \
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
+--- jdk8u-jdk8u66-b02.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c        2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c     2015-09-18 13:16:52.000000000 +0200
+@@ -25,8 +25,7 @@
+ #include "splashscreen_impl.h"
+-#include "../libpng/png.h"
+-
++#include <png.h>
+ #include <setjmp.h>
+ #define SIG_BYTES 8
diff --git a/system-pcsclite.patch b/system-pcsclite.patch
new file mode 100644 (file)
index 0000000..dd487a5
--- /dev/null
@@ -0,0 +1,186 @@
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4 jdk8u-jdk8u66-b02/common/autoconf/libraries.m4
+--- jdk8u-jdk8u66-b02.orig/common/autoconf/libraries.m4        2015-09-18 13:18:24.000000000 +0200
++++ jdk8u-jdk8u66-b02/common/autoconf/libraries.m4     2015-09-18 13:19:49.000000000 +0200
+@@ -747,6 +747,53 @@
+   ###############################################################################
+   #
++  # Check for the pcsclite library
++  #
++
++  AC_ARG_WITH(libpcsclite, [AS_HELP_STRING([--with-libpcsclite],
++      [use libpcsclite from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
++
++  AC_CHECK_LIB(pcsclite, SCardConnect,
++      [ LIBPCSCLITE_FOUND=yes ],
++      [ LIBPCSCLITE_FOUND=no ])
++
++  AC_MSG_CHECKING([for which libpcsclite to use])
++
++  DEFAULT_LIBPCSCLITE=bundled
++
++  if test "x${LIBPCSCLITE_FOUND}" != "xyes"; then
++    #
++    # If we don't find any system...set default to bundled
++    #
++    DEFAULT_LIBPCSCLITE=bundled
++  fi
++
++  #
++  # If user didn't specify, use DEFAULT_PCSC
++  #
++  if test "x${with_libpcsclite}" = "x"; then
++    with_libpcsclite=${DEFAULT_LIBPCSCLITE}
++  fi
++
++  if test "x${with_libpcsclite}" = "xbundled"; then
++    USE_EXTERNAL_LIBPCSCLITE=false
++    AC_MSG_RESULT([bundled])
++  elif test "x${with_libpcsclite}" = "xsystem"; then
++    if test "x${LIBPCSCLITE_FOUND}" = "xyes"; then
++      USE_EXTERNAL_LIBPCSCLITE=true
++      AC_MSG_RESULT([system])
++    else
++      AC_MSG_RESULT([system not found])
++      AC_MSG_ERROR([--with-libpcsclite=system specified, but no libpcsclite found!])
++    fi
++  else
++    AC_MSG_ERROR([Invalid value for --with-libpcsclite: ${with_libpcsclite}, use 'system' or 'bundled'])
++  fi
++
++  AC_SUBST(USE_EXTERNAL_LIBPCSCLITE)
++
++  ###############################################################################
++  #
+   # Check for the zlib library
+   #
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in
+--- jdk8u-jdk8u66-b02.orig/common/autoconf/spec.gmk.in 2015-09-18 13:16:52.000000000 +0200
++++ jdk8u-jdk8u66-b02/common/autoconf/spec.gmk.in      2015-09-18 13:19:49.000000000 +0200
+@@ -565,6 +565,7 @@
+ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
+ USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
+ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
++USE_EXTERNAL_LIBPCSCLITE:=@USE_EXTERNAL_LIBPCSCLITE@
+ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
+ LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
+ MSVCR_DLL:=@MSVCR_DLL@
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/make/lib/SecurityLibraries.gmk jdk8u-jdk8u66-b02/jdk/make/lib/SecurityLibraries.gmk
+--- jdk8u-jdk8u66-b02.orig/jdk/make/lib/SecurityLibraries.gmk  2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/make/lib/SecurityLibraries.gmk       2015-09-18 13:19:49.000000000 +0200
+@@ -75,11 +75,11 @@
+     CFLAGS := $(CFLAGS_JDKLIB) \
+         -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
+         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio \
+-        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio/MUSCLE, \
++        -I/usr/include/PCSC -DUSE_SYSTEM_LIBPCSCLITE, \
+     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pcsc/mapfile-vers, \
+     LDFLAGS := $(LDFLAGS_JDKLIB) \
+         $(call SET_SHARED_LIBRARY_ORIGIN), \
+-    LDFLAGS_SUFFIX_posix := $(LIBDL), \
++    LDFLAGS_SUFFIX_posix := -lpcsclite $(LIBDL), \
+     LDFLAGS_SUFFIX_windows := winscard.lib, \
+     LDFLAGS_SUFFIX_solaris := -lc, \
+     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c
+--- jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c   2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c        2015-09-18 13:19:49.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include "pcsc_md.h"
++#ifndef USE_SYSTEM_LIBPCSCLITE
+ void *hModule;
+ FPTR_SCardEstablishContext scardEstablishContext;
+ FPTR_SCardConnect scardConnect;
+@@ -47,6 +48,7 @@
+ FPTR_SCardBeginTransaction scardBeginTransaction;
+ FPTR_SCardEndTransaction scardEndTransaction;
+ FPTR_SCardControl scardControl;
++#endif
+ /*
+  * Throws a Java Exception by name
+@@ -75,7 +77,9 @@
+     throwByName(env, "java/io/IOException", msg);
+ }
++#ifndef USE_SYSTEM_LIBPCSCLITE
+ void *findFunction(JNIEnv *env, void *hModule, char *functionName) {
++    return NULL;
+     void *fAddress = dlsym(hModule, functionName);
+     if (fAddress == NULL) {
+         char errorMessage[256];
+@@ -85,9 +89,11 @@
+     }
+     return fAddress;
+ }
++#endif
+ JNIEXPORT void JNICALL Java_sun_security_smartcardio_PlatformPCSC_initialize
+         (JNIEnv *env, jclass thisClass, jstring jLibName) {
++#ifndef USE_SYSTEM_LIBPCSCLITE
+     const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL);
+     if (libName == NULL) {
+         throwNullPointerException(env, "PCSC library name is null");
+@@ -141,4 +147,5 @@
+ #else
+     scardControl          = (FPTR_SCardControl)         findFunction(env, hModule, "SCardControl132");
+ #endif // __APPLE__
++#endif
+ }
+diff -durN -x '*.orig' jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h
+--- jdk8u-jdk8u66-b02.orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h   2015-07-23 16:17:35.000000000 +0200
++++ jdk8u-jdk8u66-b02/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.h        2015-09-18 13:19:49.000000000 +0200
+@@ -23,6 +23,8 @@
+  * questions.
+  */
++#ifndef USE_SYSTEM_LIBPCSCLITE
++
+ typedef LONG (*FPTR_SCardEstablishContext)(ULONG dwScope,
+                 const void *pvReserved1,
+                 const void *pvReserved2,
+@@ -110,3 +112,41 @@
+ extern FPTR_SCardBeginTransaction scardBeginTransaction;
+ extern FPTR_SCardEndTransaction scardEndTransaction;
+ extern FPTR_SCardControl scardControl;
++
++#else
++
++#define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \
++    (SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext))
++
++#define CALL_SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols) \
++    (SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols))
++
++#define CALL_SCardDisconnect(hCard, dwDisposition) \
++    (SCardDisconnect(hCard, dwDisposition))
++
++#define CALL_SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen) \
++    (SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen))
++
++#define CALL_SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders) \
++    (SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders))
++
++#define CALL_SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
++                            pioRecvPci, pbRecvBuffer, pcbRecvLength) \
++    (SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \
++                            pioRecvPci, pbRecvBuffer, pcbRecvLength))
++
++#define CALL_SCardListReaders(hContext, mszGroups, mszReaders, pcchReaders) \
++    (SCardListReaders(hContext, mszGroups, mszReaders, pcchReaders))
++
++#define CALL_SCardBeginTransaction(hCard) \
++    (SCardBeginTransaction(hCard))
++
++#define CALL_SCardEndTransaction(hCard, dwDisposition) \
++    (SCardEndTransaction(hCard, dwDisposition))
++
++#define CALL_SCardControl(hCard, dwControlCode, pbSendBuffer, cbSendLength, \
++            pbRecvBuffer, pcbRecvLength, lpBytesReturned) \
++    (SCardControl(hCard, dwControlCode, pbSendBuffer, cbSendLength, \
++            pbRecvBuffer, pcbRecvLength, lpBytesReturned))
++
++#endif
This page took 0.087987 seconds and 4 git commands to generate.