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 \