From f9bb93c54d202974cd9c7e7934cfee81ef67bbae Mon Sep 17 00:00:00 2001 From: Brandon Invergo Date: Sat, 21 Dec 2013 23:31:45 -0500 Subject: [PATCH] Applied autotool-related patch by Brandon Invergo On Sat, Dec 21, 2013 at 12:29:23PM +0000, Brandon Invergo wrote: > - configure.ac: add "foreign" to the AM_INIT statement so you don't have > to do it from the command line > > - configure.ac: add a test for midair -p, which is standard boilerplate > stuff > > - configure.ac: let the user dictate the locations of the java, node and > closure-compiler executables via the JAVA, NODE and CCJAR environment > variables > > - Makefile.am: use the MKDIR_P and CCJAR environment variables insntead > of hard-coded paths > > - doc/Makefile: rename to doc/Makefile.am > > - doc/Makefile.am: remove manual infodoc handling; Automake can automate > this stuff > > - doc/Makefile.am: support installing the documentation (install-plain, > install-pdf, install-html), which gets installed usually to > ${prefix}/share/doc/easejs (i.e. /usr/share/doc/easejs) > > - doc/classes.texi: fix some @ref macros > > - doc/manual.texi: fix the @include location --- Makefile.am | 7 ++++--- configure.ac | 27 ++++++++++++++++++--------- doc/{Makefile => Makefile.am} | 31 ++++++++++++++++++++++--------- doc/classes.texi | 8 ++++---- doc/manual.texi | 3 +-- 5 files changed, 49 insertions(+), 27 deletions(-) rename doc/{Makefile => Makefile.am} (81%) diff --git a/Makefile.am b/Makefile.am index 4b54ceb..1291d01 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ ## ease.js Makefile.am # see README +SUBDIRS = doc EXTRA_DIST = AUTHORS NEWS ChangeLog path_build = $(top_builddir)/build @@ -19,8 +20,8 @@ perf_tests = @PERF_TESTS@ path_externs_internal = $(path_build)/externs-internal.js combine = $(path_tools)/combine -compiler = $(path_tools)/closure-compiler.jar - +compiler = @CCJAR@ +MKDIR_P = @MKDIR_P@ .PHONY: mkbuild combine min doc test perf @@ -31,7 +32,7 @@ mkbuild: $(path_build) # create build dir $(path_build): - mkdir -p "$(path_build)" + $(MKDIR_P) "$(path_build)" combine: $(path_combine_output) $(path_build)/browser-test.html diff --git a/configure.ac b/configure.ac index b5c7ee5..4843759 100644 --- a/configure.ac +++ b/configure.ac @@ -20,11 +20,12 @@ AC_INIT([ease.js], [0.2.0-dev], [bugs@easejs.org]) AC_CONFIG_AUX_DIR([tools]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([foreign]) -AC_CONFIG_FILES([Makefile]) +AC_PROG_MKDIR_P # check for node, which is required for nearly every operation +AC_ARG_VAR([NODE], [The node.js interpreter]) AC_CHECK_PROGS(NODE, [node nodejs]) AM_CONDITIONAL(HAS_NODE, [test "$NODE"]) @@ -74,20 +75,28 @@ else fi # Java is used for Closure Compiler +AC_ARG_VAR([JAVA], [The Java executable]) +AC_ARG_VAR([CCJAR], [The Clojure Compiler jar file]) AC_CHECK_PROGS(JAVA, [java]) AM_CONDITIONAL(HAS_JAVA, [test "$JAVA"]) ccjar= -if test "$JAVA"; then - AC_CHECK_FILE([tools/closure-compiler.jar], [ccjar=1], [AC_MSG_NOTICE([ +AS_IF(test "$JAVA" -a ! "$CCJAR", + [AC_CHECK_FILE([$srcdir/tools/closure-compiler.jar], + [AC_SUBST([CCJAR], [$srcdir/tools/closure-compiler.jar])], + [AC_MSG_NOTICE([ If you wish perform minification of the combined source file, you must - download closure-compiler.jar into the tools directory; it is available - here: + download closure-compiler.jar into the tools sub-directory; it is + available here: https://developers.google.com/closure/compiler/ - ])]) -fi -AM_CONDITIONAL(HAS_CCJAR, [test "$ccjar"]) + If it is installed elsewhere on your system, specify its location with + the CCJAR environment variable. + ])])], []) + +AM_CONDITIONAL(HAS_CCJAR, [test "$CCJAR"]) + +AC_CONFIG_FILES([Makefile doc/Makefile]) AC_OUTPUT diff --git a/doc/Makefile b/doc/Makefile.am similarity index 81% rename from doc/Makefile rename to doc/Makefile.am index b94291e..e804f1d 100644 --- a/doc/Makefile +++ b/doc/Makefile.am @@ -21,11 +21,19 @@ # along with this program. If not, see . ## +info_TEXINFOS = manual.texi +manual_TEXINFOS = license.texi about.texi classes.texi \ +impl-details.texi integration.texi mkeywords.texi source-tree.texi +EXTRA_DIST = README highlight.pack.js interactive.js manual.css \ +img/composition-uml.dia img/composition-uml.txt inheritance-ex.dia \ +inheritance-ex.txt visobj-collection-wide.dia \ +visobj-collection-wide.txt visobj.dia visobj.txt + path_doc=. path_build=../build path_lib=../lib +docdir = @docdir@ path_doc_output=${path_build}/doc -path_doc_output_info=${path_doc_output}/easejs.info path_doc_output_plain=${path_doc_output}/manual.txt path_doc_output_html=${path_doc_output}/manual path_doc_output_html1=${path_doc_output}/manual.html @@ -34,8 +42,6 @@ path_doc_img=${path_doc}/img path_doc_css_ref=manual.css path_manual_texi=${path_doc}/manual.texi -path_info_install := /usr/local/share/info - doc_src := $(wildcard $(path_doc)/*.texi) doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(path_doc_img)/*.dia)) doc_imgs_txt := $(patsubst %.dia, %.png, $(wildcard $(path_doc_img)/*.txt)) @@ -44,7 +50,7 @@ doc_replace := s/<\/body>/