From 06c78d26d091d88a6f647125c12189a94edb6b29 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Tue, 2 Apr 2024 20:54:15 +0900 Subject: [PATCH] Remove Autotools+Ant build system There are some structural changes planned for the library, and having two parallel build systems would make that harder. We've carried both systems in parallel for two releases / 15 months, so it should be reasonably possible to drop the legacy one. On platforms with older Meson and Python >= 3.7, it's still possible to install OpenSlide Java by first upgrading Meson with `pip install --upgrade meson`. Closes: https://github.com/openslide/openslide-java/issues/45 Signed-off-by: Benjamin Gilbert --- .gitattributes | 5 -- .github/ISSUE_TEMPLATE/release.md | 2 +- .gitignore | 19 ----- Makefile.am | 65 --------------- README.md | 77 +---------------- acinclude.m4 | 43 ---------- build.xml | 50 ----------- configure.ac | 132 ------------------------------ m4/.gitignore | 1 - meson.build | 5 -- scripts/dist.py | 11 --- 11 files changed, 3 insertions(+), 407 deletions(-) delete mode 100644 .gitignore delete mode 100644 Makefile.am delete mode 100644 acinclude.m4 delete mode 100644 build.xml delete mode 100644 configure.ac delete mode 100644 m4/.gitignore delete mode 100644 scripts/dist.py diff --git a/.gitattributes b/.gitattributes index 508d29e..eb82635 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,3 @@ -# Shell scripts and Automake sources can't have CRLF line endings -configure.ac eol=lf -Makefile.am eol=lf -*.m4 eol=lf - # Don't include Git/GitHub metadata in release tarballs .gitattributes export-ignore .gitignore export-ignore diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 4e84b97..b4a5e11 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -1,7 +1,7 @@ # OpenSlide Java release process - [ ] Run test build and `meson dist` -- [ ] Update `CHANGELOG.md` and versions in `configure.ac` and `meson.build` +- [ ] Update `CHANGELOG.md` and version in `meson.build` - [ ] Create and push signed tag - [ ] Verify that GitHub Actions created a [GitHub release](https://github.com/openslide/openslide-java/releases) with release notes and a source tarball - [ ] [Update openslide-bin](https://github.com/openslide/openslide-bin/issues/new?labels=release&template=release.md) diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7873cdd..0000000 --- a/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -/aclocal.m4 -/autom4te.cache -/bin -/build-aux -/configure -/config.h -/config.h.in -/config.log -/config.status -/libtool -/stamp-h1 - -.deps -.libs -Makefile -Makefile.in -*.jar -*.la -*.lo diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 89f29cd..0000000 --- a/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -AM_CFLAGS = -Wall $(JNI_CFLAGS) $(OPENSLIDE_CFLAGS) -AM_CFLAGS += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -AM_LDFLAGS = -avoid-version -no-undefined $(OPENSLIDE_LIBS) $(JNI_LDFLAGS) - -if DLL -JNI_LA = openslide-jni.la -else -JNI_LA = libopenslide-jni.la -endif - -if USE_CROSS_HEADERS -CROSS_H = cross/jni.h cross/jni_md.h -endif - -export JAVA_HOME -export ANT_HOME - -pkglib_LTLIBRARIES = $(JNI_LA) -libopenslide_jni_la_SOURCES = openslide-jni.c $(CROSS_H) -openslide_jni_la_SOURCES = $(libopenslide_jni_la_SOURCES) -# Building without lib prefix requires -module. -# On the other hand, the JNI ABI on Mac OS X precludes it. -openslide_jni_la_LDFLAGS = -module $(AM_LDFLAGS) - -# Automake insists that DATA not go in pkglibdir -pkglibdatadir = $(pkglibdir) -pkglibdata_DATA = openslide.jar -JAVA_SRC = build.xml \ - org/openslide/AssociatedImage.java \ - org/openslide/OpenSlideDisposedException.java \ - org/openslide/OpenSlide.java \ - org/openslide/OpenSlideJNI.java \ - org/openslide/TestCLI.java \ - org/openslide/gui/Annotation.java \ - org/openslide/gui/DefaultAnnotation.java \ - org/openslide/gui/DefaultSelectionListModel.java \ - org/openslide/gui/Demo.java \ - org/openslide/gui/OpenSlideView.java \ - org/openslide/gui/SelectionListModel.java - -openslide.jar: $(JAVA_SRC) config.h - @"$(ANT)" -f "$(srcdir)/build.xml" -Dbuilddir="$(ANT_BUILDDIR)" \ - -Dopenslide.binding.version=$(PACKAGE_VERSION) \ - -Dopenslide.jni.path="$(JNI_EMBED_PATH)" - -mostlyclean-local: - @"$(ANT)" -f "$(srcdir)/build.xml" -Dbuilddir="$(ANT_BUILDDIR)" clean - -install-exec-hook: -if RENAME_JNI - source ./$(JNI_LA) && mv "$(DESTDIR)$(pkglibdir)/$$dlname" \ - "$(DESTDIR)$(pkglibdir)/$(JNI_SO)" -endif - rm -f "$(DESTDIR)$(pkglibdir)/$(JNI_LA)" \ - "$(DESTDIR)$(pkglibdir)/$(JNI_SO).a" - -uninstall-hook: - rm -f "$(DESTDIR)$(pkglibdir)/$(JNI_SO)" - -EXTRA_DIST = \ - CHANGELOG.md \ - README.md \ - $(JAVA_SRC) diff --git a/README.md b/README.md index c55c9a7..32e7ef8 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,7 @@ This is a Java binding to [OpenSlide](https://openslide.org/). -## Building with Meson - -This is the new method. - -### Build requirements +## Build requirements - JDK - Meson ≥ 0.62 @@ -15,7 +11,7 @@ This is the new method. - pkg-config -### Building +## Building ``` meson setup builddir @@ -24,75 +20,6 @@ meson install -C builddir ``` -## Building with Autotools and Ant - -This is the old method, and will eventually be removed. - - -### Build requirements - -- JDK -- Apache Ant -- OpenSlide ≥ 3.4.0 -- pkg-config - - -### Building on Linux or Mac OS X - -``` -./configure -make -make install -``` - -(If building from the Git repository, you will first need to install -autoconf, automake, libtool, and pkg-config and run `autoreconf -i`.) - - -### Cross-compiling for Windows with MinGW-w64 - -``` -PKG_CONFIG=pkg-config \ - PKG_CONFIG_PATH=/path/to/cross/compiled/openslide/lib/pkgconfig \ - ./configure --host=i686-w64-mingw32 --build=$(build-aux/config.guess) -make -make install -``` - -For a 64-bit JRE, substitute `--host=x86_64-w64-mingw32`. - - -### Building on Windows - -Ensure that the path to the openslide-java source tree does not contain -whitespace. - -Install Cygwin, selecting these additional packages: - -- `make` -- `pkg-config` -- `mingw64-i686-gcc-core` and/or `mingw64-x86_64-gcc-core` - -(Cygwin is only needed for the build environment; the resulting binaries -do not require Cygwin.) - -Also install a JDK and Apache Ant. - -Then: - -``` -./configure --prefix=/path/to/install/dir \ - --host=i686-w64-mingw32 --build=$(build-aux/config.guess) \ - PKG_CONFIG_PATH="/path/to/openslide/lib/pkgconfig" \ - JAVA_HOME="$(cygpath c:/Program\ Files/Java/jdk*)" \ - ANT_HOME="/path/to/ant/directory" -make -make install -``` - -For a 64-bit JRE, substitute `--host=x86_64-w64-mingw32`. - - ## License OpenSlide Java is released under the terms of the [GNU Lesser General Public diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 9dd948a..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,43 +0,0 @@ -# FIND_FILE([OUTPUT], [FILE_NAME], [SEARCH_PATHS]) -# The colon-delimited paths in SEARCH_PATHS are searched to determine -# whether they contain the file FILE_NAME. If so, OUTPUT is set to the -# directory containing the file. Otherwise, an error is produced. -# --------------------------------------------------------------------- -AC_DEFUN([FIND_FILE], [ - AC_MSG_CHECKING([for $2]) - $1= - ac__save_ifs="$IFS" - IFS=: - for ac__path in $3 - do - # IFS doesn't consolidate consecutive delimiters - ac__path=$(echo "$ac__path" | sed 's/:*$//') - if test -r "$ac__path/$2" ; then - IFS="$ac__save_ifs" - AC_MSG_RESULT([$ac__path]) - $1=$ac__path - break - fi - done - IFS="$ac__save_ifs" - if test "z$$1" = z ; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([cannot find $2 in $3]) - fi -]) - - -# JOIN_EACH([OUTPUT], [PATHS], [SUBDIR]) -# Append SUBDIR to each of the colon-delimited PATHS and put the result -# in OUTPUT. -# --------------------------------------------------------------------- -AC_DEFUN([JOIN_EACH], [ - $1= - ac__save_ifs="$IFS" - IFS=: - for dir in $2 - do - $1="$$1:$dir/$3" - done - IFS="$ac__save_ifs" -]) diff --git a/build.xml b/build.xml deleted file mode 100644 index 8128bb3..0000000 --- a/build.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index bab5ef9..0000000 --- a/configure.ac +++ /dev/null @@ -1,132 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.63]) -AC_INIT([OpenSlide Java], [0.12.4], [openslide-users@lists.andrew.cmu.edu]) -AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SRCDIR([openslide-jni.c]) -AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([1.11 foreign dist-xz]) -AM_SILENT_RULES([yes]) -LT_INIT([win32-dll disable-static]) - -# Checks for programs. - -PKG_PROG_PKG_CONFIG() -AC_PROG_CC - -# For distribution-packaged Ant, $ANT may not be $ANT_HOME/bin/ant. -# Use and pass through ANT_HOME if we receive it; otherwise, focus on ANT. -AC_ARG_VAR([ANT], [path to ant program]) -AC_ARG_VAR([ANT_HOME], [path to ant installation directory]) -if test "z$ANT" = z && test "z$ANT_HOME" != z ; then - ANT="$ANT_HOME/bin/ant" -fi -AC_PATH_PROG([ANT], [ant]) -if test "z$ANT" = z ; then - AC_MSG_ERROR([ant not found]) -fi - -# On Cygwin the JVM uses Windows paths. The ant wrapper script converts -# almost everything for us, but not the argument to -Dbuilddir. -AC_MSG_CHECKING([Ant build path]) -AS_CASE([$build], - [*-*-cygwin], [ANT_BUILDDIR="$(cygpath -w "$(pwd)")"], - [ANT_BUILDDIR="$(pwd)"] -) -AC_SUBST([ANT_BUILDDIR]) -AC_MSG_RESULT([$ANT_BUILDDIR]) - -# Checks for libraries. - -PKG_CHECK_MODULES([OPENSLIDE], [openslide >= 3.4.0]) - -# Checks for header files. - -AC_ARG_VAR([JAVA_HOME], [path to JDK]) -# Dynamic default for Mac OS X -if test -x /usr/libexec/java_home ; then - DEFAULT_JAVA_HOME=$(/usr/libexec/java_home 2>/dev/null) -fi -AC_ARG_WITH([java], [AS_HELP_STRING([--with-java], [path to JDK])], [], - [with_java="$JAVA_HOME:$DEFAULT_JAVA_HOME:/usr/lib/jvm/java"]) -AC_ARG_WITH([jni-headers], [AS_HELP_STRING([--with-jni-headers=PLATFORM], - [use JNI headers for PLATFORM. Specify "cross" to use bundled - Classpath headers.])], [], [with_jni_headers=guess]) -if test z$with_jni_headers = zguess ; then - if test $host = $build ; then - AS_CASE([$host], - [*-*-linux-gnu], [with_jni_headers=linux], - [*-*-mingw32], [with_jni_headers=win32], - [*-*-darwin*], [with_jni_headers=darwin], - [with_jni_headers=] - ) - else - with_jni_headers=cross - # If building with MinGW inside Cygwin, the native headers are - # available, so use them. - AS_CASE([$build], [*-*-cygwin], - AS_CASE([$host], [*-*-mingw32], [with_jni_headers=win32])) - fi -fi -if test z$with_jni_headers != zcross ; then - # Find jni.h - JOIN_EACH([include_paths], [$with_java], [include]) - FIND_FILE([jni_h_dir], [jni.h], [$include_paths]) - JAVA_HOME=$(dirname "$jni_h_dir") - # Find jni_md.h - JOIN_EACH([platform_include_paths], [$include_paths], [$with_jni_headers]) - FIND_FILE([jni_md_h_dir], [jni_md.h], - [$platform_include_paths:$include_paths]) - JNI_CFLAGS="\"-I$jni_h_dir\" \"-I$jni_md_h_dir\"" -else - # For cross builds, we don't have the OpenJDK jni_md.h for the target - # platform, so use our own copy of the GNU Classpath JNI headers instead. - # - # Don't set JAVA_HOME unless it was specified on the command line. - AC_MSG_CHECKING([whether to use bundled JNI headers]) - AC_MSG_RESULT([yes]) - JNI_CFLAGS='-I$(top_srcdir)/cross' -fi -AC_SUBST([JNI_CFLAGS]) -AM_CONDITIONAL([USE_CROSS_HEADERS], [test x$with_jni_headers = xcross]) - -# Checks for typedefs, structures, and compiler characteristics. - -AC_TYPE_INT64_T -AC_TYPE_UINT32_T - -# Get the filename extension for dynamic libraries. -# $module matters on Mac OS X. -module=no -eval dynlib_ext=$shrext_cmds -if test x$dynlib_ext = x.dylib ; then - # Mac OS X has a special file extension for JNI libraries - dynlib_ext=.jnilib -fi -AM_CONDITIONAL([RENAME_JNI], [test x$dynlib_ext = x.jnilib]) - -AC_MSG_CHECKING([JNI library name]) -if test x$dynlib_ext = x.dll ; then - AC_SUBST([JNI_SO], [openslide-jni.dll]) - # JNI uses stdcall without @ - AC_SUBST([JNI_LDFLAGS], [-Wl,--kill-at]) -else - AC_SUBST([JNI_SO], [libopenslide-jni$dynlib_ext]) -fi -AC_MSG_RESULT([$JNI_SO]) -AM_CONDITIONAL([DLL], [test x$dynlib_ext = x.dll]) - -AC_MSG_CHECKING([whether to embed library path in JAR]) -if test x$dynlib_ext != x.dll ; then - AC_SUBST([JNI_EMBED_PATH], [$libdir/$PACKAGE/$JNI_SO]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -# Checks for library functions. - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/m4/.gitignore b/m4/.gitignore deleted file mode 100644 index 72e8ffc..0000000 --- a/m4/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/meson.build b/meson.build index 15118f0..f513ae4 100644 --- a/meson.build +++ b/meson.build @@ -8,11 +8,6 @@ project( meson_version : '>=0.62', version : '0.12.4', ) -if not meson.is_subproject() - meson.add_dist_script( - 'scripts/dist.py' - ) -endif java_ver = '1.8' # options diff --git a/scripts/dist.py b/scripts/dist.py deleted file mode 100644 index 4ebb909..0000000 --- a/scripts/dist.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python3 - -import os -from pathlib import Path -import shutil -import subprocess - -base = Path(os.getenv('MESON_DIST_ROOT')) - -subprocess.run(['autoreconf', '-i'], cwd=base, check=True) -shutil.rmtree(base / 'autom4te.cache')