[java-atk-wrapper] Make modular jar configure-time option



commit 0c4d79db08a8982e0f69596613582fb0ee3b8866
Author: Fridrich Štrba <fridrich strba bluewin ch>
Date:   Fri Aug 24 10:10:46 2018 +0200

    Make modular jar configure-time option

 configure.ac                                | 16 ++++++++++++++--
 wrapper/Makefile.am                         | 16 +++++++++++++++-
 wrapper/org/GNOME/Accessibility/Makefile.am |  7 ++++++-
 3 files changed, 35 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 31067ba..df12ca4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,11 +38,22 @@ PKG_CHECK_MODULES(JAW, [
 LIB_ATK_WRAPPER_LD_FLAGS="-avoid-version -no-undefined"
 AC_SUBST(LIB_ATK_WRAPPER_LD_FLAGS)
 
+AC_ARG_ENABLE([modular-jar],
+            [AS_HELP_STRING([--enable-modular-jar],
+            [Build modular java-atk-wrapper jar])],
+            [enable_modular_jar="$enableval"],
+            [enable_modular_jar=no])
+AS_IF([test "enable_modular_jar" = "xyes"], [
+  JAVA_REQUIRED=9.0.0
+], [
+  JAVA_REQUIRED=1.7.0
+])
+JAVA_ERROR_MESSAGE="Java $JAVA_REQUIRED or later is required to build java-access-bridge"
+AM_CONDITIONAL([MODULAR_JAR], [test "x$enable_modular_jar" = "xyes"])
+
 # java wrapper
 
 AM_CONDITIONAL(USER, test `whoami` = "root")
-JAVA_REQUIRED=9.0.0
-JAVA_ERROR_MESSAGE="Java $JAVA_REQUIRED or later is required to build java-access-bridge"
 
 AC_ARG_VAR([JAVA_HOME],[Java Runtime Environment location])
 AC_ARG_VAR([JDK_SRC],[JDK installation path])
@@ -206,6 +217,7 @@ Build configuration:
 
        Prefix:                                 ${prefix}
        Source code location:                   ${srcdir}
+       Modular jar:                            ${enable_modular_jar}
        Compiler:                               ${CC}
        JDK src:                                ${JDK_SRC}
        JAVA home:                              ${JAVA_HOME}
diff --git a/wrapper/Makefile.am b/wrapper/Makefile.am
index c08479e..3a56460 100644
--- a/wrapper/Makefile.am
+++ b/wrapper/Makefile.am
@@ -1,4 +1,9 @@
-SUBDIRS=org META-INF
+SUBDIRS=org
+
+if MODULAR_JAR
+  SUBDIRS += META-INF
+endif
+
 JARFILES=@JAW_JAR_NAME@
 ALL_CLASSES=org/GNOME/Accessibility/*.class
 DEP_CLASSES=$(wildcard $(ALL_CLASSES))
@@ -11,12 +16,21 @@ properties_DATA = accessibility.properties
 EXTRA_DIST = $(properties_DATA) \
             manifest.txt module-info.java
 
+if MODULAR_JAR
+
 module-info.class : $(srcdir)/module-info.java
        $(JAVAC) -cp $(top_builddir)/wrapper -sourcepath $(top_srcdir)/wrapper:$(top_builddir)/wrapper 
$(JAVACFLAGS) -d $(top_builddir)/wrapper $<
 
 $(JARFILES) : $(DEP_CLASSES) module-info.class
        $(JAR) cfm $(JARFILES) $(srcdir)/manifest.txt org/GNOME/Accessibility/*.class module-info.class -C 
$(srcdir) META-INF/services/javax.accessibility.AccessibilityProvider
 
+else
+
+$(JARFILES) : $(DEP_CLASSES)
+       $(JAR) cfm $(JARFILES) $(srcdir)/manifest.txt org/GNOME/Accessibility/*.class
+
+endif
+
 install-data-local : all-local
        $(mkinstalldirs) $(DESTDIR)$(propertiesdir) $(DESTDIR)$(java_atk_wrapperdir)
        $(INSTALL_DATA) $(srcdir)/$(properties_DATA) $(DESTDIR)$(propertiesdir)/
diff --git a/wrapper/org/GNOME/Accessibility/Makefile.am b/wrapper/org/GNOME/Accessibility/Makefile.am
index 7f1ea85..6d21b65 100644
--- a/wrapper/org/GNOME/Accessibility/Makefile.am
+++ b/wrapper/org/GNOME/Accessibility/Makefile.am
@@ -1,4 +1,9 @@
-JAVA_SRC=$(wildcard $(srcdir)/*.java)
+JAVA_SRC=$(filter-out $(srcdir)/AtkProvider.java, $(wildcard $(srcdir)/*.java))
+
+if MODULAR_JAR
+  JAVA_SRC += $(srcdir)/AtkProvider.java
+endif
+
 CLASSES=$(patsubst %.java,%.class,$(JAVA_SRC))
 BUILD_CLASSES=$(patsubst $(srcdir)%,$(builddir)%,$(CLASSES)) $(builddir)/AtkWrapper.class
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]