summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-01-11 10:01:06 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2012-01-11 16:10:08 +0100
commit98386d4e335028c863a183bb7dd48c9357dac480 (patch)
tree0228209e234184e3ec830f33ca2b0fe742a39cdf /Makefile.am
parent24dccab4a66c07073178069fe6866673620216d5 (diff)
documentation: more readable --help, support cross-compilation better
The <<insert sync/source-property>> tags were visible in the --help output. Now it says << see "syncevolution --sync/source-property ?" >> These special tags still get expanded in README and man page. That expansion is done by invoking the uninstalled syncevolution binary. If that failed, compilation aborted. That's still the case for native compilation (because we want to catch problems). For cross-compilation such a failure is okay and keeps the tags in the README/man page. That's done because running a binary compiled for an entirely different architecture is not guaranteed to work.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am20
1 files changed, 15 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 2608842c..e8916cc7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -232,20 +232,30 @@ installcheck-local:
done
endif
+# Be strict about running 'syncevolution' only when not doing
+# cross-compilation: in that case, if running 'syncevolution' fails,
+# abort the build process. Otherwise proceed with the fallback below,
+# which is to keep the "see --sync/source-property ?" placeholders in
+# the README.
+if COND_CROSS_COMPILING
+RUN_SYNCEVOLUTION_CHECK=if ($$?) { return ""; } else { return $$buffer; }
+else
+RUN_SYNCEVOLUTION_CHECK=die if $$?; return $$buffer;
+endif
# patch README.rst properties on-the-fly
README.patched.rst: README.rst src/syncevolution
perl -e '$$syncfound=0; $$sourcefound=0; $$res=0;' \
- -e 'sub run { $$cmd = shift; $$buffer = `$$cmd`; die if $$?; return $$buffer; }' \
+ -e 'sub run { $$cmd = shift; $$buffer = `$$cmd`; $(RUN_SYNCEVOLUTION_CHECK) }' \
-e 'while (<>) {' \
-e 's/^:Version: .*/:Version: $(VERSION)/;' \
-e 's/:Date: .*/":Date: " . `date +%Y-%m-%d`/e;' \
- -e 'if (s;<<insert sync-property>>\n;run("src/syncevolution --daemon=no --sync-property ?");e) { $$syncfound=1; }' \
- -e 'if (s;<<insert source-property>>\n;run("src/syncevolution --daemon=no --source-property ?");e) { $$sourcefound=1; }' \
+ -e 'if (s;(<< see "syncevolution --sync-property ." >>\n);run("src/syncevolution --daemon=no --sync-property ?") || $$1;e) { $$syncfound=1; }' \
+ -e 'if (s;(<< see "syncevolution --source-property ." >>\n);run("src/syncevolution --daemon=no --source-property ?") || $$1;e) { $$sourcefound=1; }' \
-e 'print;' \
-e '}' \
- -e 'die "<<insert sync-property>> not in README.rst?!" unless $$syncfound;' \
- -e 'die "<<insert source-property>> not in README.rst?!" unless $$sourcefound;' \
+ -e 'die "<<sync-property>> tag not in README.rst?!" unless $$syncfound;' \
+ -e 'die "<<source-property>> tag not in README.rst?!" unless $$sourcefound;' \
-e 'exit $$res;' \
$< >$@
CLEANFILES += README.patched.rst