summaryrefslogtreecommitdiff
blob: a09b745931a7cb765cbb85e789705114558709a8 (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
Index: gjdoc-0.7.7/configure.ac
===================================================================
--- gjdoc-0.7.7.orig/configure.ac
+++ gjdoc-0.7.7/configure.ac
@@ -101,6 +101,38 @@ AC_SUBST(jni_linkflag)
 AM_CONDITIONAL([ENABLE_XMLDOCLET], [test x${enable_xmldoclet} = xyes])
 AM_CONDITIONAL([ENABLE_NATIVE], [test x${enable_native} = xyes])
 
+dnl Start testing for cp -u availability
+dnl Fallback to rsync otherwise
+
+AC_MSG_CHECKING([for working cp -u])
+
+: ${TMPDIR=/tmp}
+{
+  tmp=`
+    (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
+  ` && test -n "$tmp" && test -d "$tmp"
+} || {
+  tmp=$TMPDIR/foo$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || AC_MSG_ERROR([Unable to create a temporary directory])
+
+touch "$tmp/origin"
+if cp -u "$tmp/origin" "$tmp/destination" 2>/dev/null; then
+   AC_MSG_RESULT([yes])
+   CP_U="cp -u"
+else
+   AC_MSG_RESULT([no])
+   AC_CHECK_PROG([CP_U], [rsync], [rsync -u])
+fi
+
+rm -rf "$tmp/origin"
+
+if test "x$CP_U" = "x"; then
+   AC_MSG_ERROR([Unable to find a workign cp -u implementation.])
+fi
+
+AC_SUBST([CP_U])
+
 AC_CONFIG_FILES([gjdoc.sh src/resources/version.properties], [chmod +x gjdoc.sh])
 
 AC_OUTPUT([Makefile docs/Makefile])
Index: gjdoc-0.7.7/Makefile.am
===================================================================
--- gjdoc-0.7.7.orig/Makefile.am
+++ gjdoc-0.7.7/Makefile.am
@@ -385,7 +385,7 @@ gjdoc_resources_src = $(patsubst %, $(sr
 
 gnu-classpath-tools-gjdoc-$(VERSION).jar: $(srcdir)/gjdoc.manifest src/resources/version.properties $(gnu_classpath_tools_gjdoc_jar_CLASSES) $(gnu_classpath_tools_gjdoc_jar_GENCLASSES) $(gjdoc_resources_src)
 	for res in $(gjdoc_resources) ; \
-	do  cp -u $(srcdir)/src/resources/$$res $$res ; done
+	do  $(CP_U) $(srcdir)/src/resources/$$res $$res ; done
 	$(JAR) cfm $@ $(srcdir)/gjdoc.manifest \
 	$(gjdoc_resources) \
 	-C src/resources version.properties \