summaryrefslogtreecommitdiff
blob: 126fce904a8ffe33b33bebbdb7303cf1ccffd28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From f8c1cada7f01826b15a82b20600b8df7562fa2ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=B6kt=C3=BCrk=20Y=C3=BCksek?= <gokturk@gentoo.org>
Date: Wed, 28 Nov 2018 21:33:46 -0500
Subject: [PATCH v1] Allow --enable-offline to accept a directory argument for
 jar libs

Allow the hardcoded default_jar_location in build.xml to
/usr/share/java to be changed using the argument provided to
--enable-offline. Note that this changes the behavior of the switch
from "anything other than yes or no is incorrect" to "anything other
than no implies offline mode".
---
 bindings/java/Makefile.am |  4 ++++
 configure.ac              | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am
index ad27526e..f0bb9f68 100644
--- a/bindings/java/Makefile.am
+++ b/bindings/java/Makefile.am
@@ -7,6 +7,10 @@ jar_DATA = $(tsk_jar)
 
 if OFFLINE
  ant_args=-Doffline=true
+if CUSTOM_DEFAULT_JAR_LOCATION
+  ant_args+= -Ddefault-jar-location="@DEFAULT_JAR_LOCATION@"
+else
+endif
 else
 
 endif
diff --git a/configure.ac b/configure.ac
index dc9026ed..d3d41646 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,10 +221,18 @@ AC_ARG_ENABLE([offline],
     [case "${enableval}" in
 	yes) offline=true ;;
 	no) offline=false ;;
-	*) AC_MSG_ERROR([bad value ${enableval} for --enable-online]) ;;
+	*)
+	    offline=true
+	    default_jar_location="${enableval}"
+	    ;;
      esac],[offline=false])
 
 AM_CONDITIONAL([OFFLINE], [test "x$offline" = xtrue])
+AM_CONDITIONAL([CUSTOM_DEFAULT_JAR_LOCATION], [test "x$default_jar_location" != "x"])
+AM_COND_IF([CUSTOM_DEFAULT_JAR_LOCATION],
+    [AC_SUBST([DEFAULT_JAR_LOCATION], [$default_jar_location])]
+)
+
 
 
 dnl Check if we should link libewf.
-- 
2.19.1