configure.ac 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. qdnl Process this with autoconf to create configure
  2. AC_INIT([kawa],[3.0]) dnl Also update bin/configure.ac and build.xml.
  3. AC_CONFIG_SRCDIR([doc/kawa.texi])
  4. AC_CONFIG_AUX_DIR([build-aux])
  5. AM_MAINTAINER_MODE([enable])
  6. AC_CANONICAL_HOST
  7. AM_INIT_AUTOMAKE([info-in-builddir foreign])
  8. AC_ARG_WITH(docbook-stylesheets,
  9. AS_HELP_STRING(--with-docbook-stylesheets=path,Building icely-formatted documentation))
  10. dnl AC_ARG_WITH(classpath,[ --with-classpath Path to Java classes], classpath=$withval, classpath=$$CLASSPATH)
  11. AC_ARG_ENABLE(kawa-frontend,
  12. [ --enable-kawa-frontend Build "kawa" front-end program using readline],
  13. enable_kawa_frontend=$enableval, enable_kawa_frontend=no)
  14. AC_ARG_ENABLE(xml,
  15. AS_HELP_STRING(--disable-xml,Don't build support for XML processing),
  16. enable_xml=$enableval, enable_xml=yes)
  17. AC_ARG_WITH(servlet,
  18. AS_HELP_STRING(--with-servlet@<:@=servlet-api.jar@:>@,Build support for generating servlets))
  19. WITH_SERVLET_ARG="${with_servlet}"
  20. AC_ARG_WITH(android,
  21. AS_HELP_STRING(--with-android@<:@=android.jar@:>@,Build for the Android platform))
  22. AC_ARG_WITH(javafx,
  23. AS_HELP_STRING(--with-javafx@<:@=jfxrt.jar@:>@,Enable support for JavaFX))
  24. WITH_JAVAFX_ARG="${with_javafx}"
  25. AC_ARG_WITH(lsp4j,
  26. AS_HELP_STRING(--with-lsp4j=<:@=lsp4j.jar@>))
  27. AC_ARG_WITH(lsp4j.jsonrpc,
  28. AS_HELP_STRING(--with-lsp4j.jsonrpc=<:@=lsp4j.jsonrpc.jar@>))
  29. AC_ARG_WITH(gson,
  30. AS_HELP_STRING(--with-gson=<:@=gson.jar@>))
  31. AC_ARG_WITH(domterm,
  32. AS_HELP_STRING(--with-domterm=<:@=domterm_home:>@,Build support for DomTerm))
  33. WITH_DOMTERM_ARG="${with_domterm}"
  34. AC_ARG_WITH(jline3,
  35. AS_HELP_STRING(--with-jline3=<:@=jline3.jar@:>@,Build support JLine3 input editing))
  36. AC_ARG_WITH(XQTS,
  37. AS_HELP_STRING(--with-XQTS@<:@=XQTS-path@:>@,Support XQuery Test Suite))
  38. AC_ARG_ENABLE(echo2,
  39. AS_HELP_STRING(--enable-echo2,Enable support for the Echo2 web toolkit))
  40. AC_ARG_ENABLE(jemacs,
  41. AS_HELP_STRING(--enable-jemacs,Build JEmacs))
  42. AC_ARG_ENABLE(xquery,
  43. AS_HELP_STRING(--enable-xquery,Build XQuery language support (Qexo) (default on)))
  44. AC_ARG_ENABLE(brl,
  45. AS_HELP_STRING(--enable-brl,Build BRL emulation and KRL))
  46. AC_ARG_WITH(httpserver,
  47. AS_HELP_STRING(--with-httpserver,Make use of JDK6's builtin http server))
  48. AC_ARG_WITH(swing,
  49. AS_HELP_STRING(--with-swing,Assume Swing is available (default on)))
  50. AC_ARG_WITH(swt,
  51. AS_HELP_STRING(--with-swt,Assume SWT is available))
  52. AC_ARG_WITH(awt,
  53. AS_HELP_STRING(--with-awt,Assume AWT is available (default on)))
  54. AC_ARG_WITH(sax2,
  55. AS_HELP_STRING(--with-sax2, Assume SAX2 is available (default on)))
  56. AC_ARG_WITH(javax.script,
  57. AS_HELP_STRING(--with-javax.script, Use javax.script interfaces))
  58. AC_ARG_WITH(java-source,
  59. AS_HELP_STRING(--with-java-source=NUM,Assume functionality of given Java/JDK version))
  60. test -z "${with_java_source}" -a -n "${with_android}" \
  61. && with_java_source=android
  62. test -z "${with_swing}" -a "$with_awt" == "no" \
  63. && with_swing=no
  64. with_java_source=`echo ${with_java_source} | tr A-Z a-z`
  65. # Java 8 is the (current) default
  66. test "${with_java_source}" = "" && with_java_source=8
  67. case "/${with_java_source}/" in
  68. /1/|/1.1*/) # JDK 1.1 - not supported
  69. JAVA_SOURCE=1; JAVA_SOURCE_SELECTOR='%java1';;
  70. /2/|/1.2*/|/1.3*/) # JDK 1.2+, GCJ-3.x - not supported
  71. JAVA_SOURCE=2; JAVA_SOURCE_SELECTOR='%java2' ;;
  72. /4/|/1.4*/) # JDK 1.4, GCJ-4.x, without JAXP - not supported
  73. JAVA_SOURCE=4; JAVA_SOURCE_SELECTOR='%java4' ;;
  74. /4x/|/1.4*+jaxp1.3/) # JDK 1.4, GCJ-4.x with JAXP 1.3 - not supported
  75. JAVA_SOURCE=4x; JAVA_SOURCE_SELECTOR='%java4x' ;;
  76. /5/|/1.5*/) # JDK 1.5
  77. JAVA_SOURCE=5; JAVA_SOURCE_SELECTOR='%java5' ;;
  78. /6/|/1.6*/) # JDK 1.6
  79. JAVA_SOURCE=6; JAVA_SOURCE_SELECTOR='%java6' ;;
  80. /6compat5/) # JDK 1.5 with some Java6 features.
  81. # Requires building with Java6, but runs on Java5 (without those features)
  82. # or on Java6 (with those features).
  83. JAVA_SOURCE=6compat5; JAVA_SOURCE_SELECTOR='%java6compat5' ;;
  84. /7/|/1.7*/) # JDK 1.7
  85. JAVA_SOURCE=7; JAVA_SOURCE_SELECTOR='%java7' ;;
  86. /8/|/1.8*/) # Java 8
  87. JAVA_SOURCE=8; JAVA_SOURCE_SELECTOR='%java8' ;;
  88. /9/|/1.9*/) # Java 9
  89. JAVA_SOURCE=9; JAVA_SOURCE_SELECTOR='%java9' ;;
  90. [/[1-9][0-9]/]) # Java 10-
  91. JAVA_SOURCE=${with_java_source};
  92. JAVA_SOURCE_SELECTOR="%java${with_java_source}"
  93. ;;
  94. /android*/)
  95. JAVA_SOURCE=android; JAVA_SOURCE_SELECTOR='%android'
  96. test -z "$with_swing" && with_swing="no"
  97. test -z "$with_awt" && with_awt="no"
  98. ;;
  99. /*/) AC_MSG_ERROR([Invalid version for --with-java-version.
  100. (Must be 5, 6, ..., or a JDK version such as 1.5.)]) ;;
  101. esac
  102. AC_SUBST(JAVA_SOURCE)
  103. AC_SUBST(JAVA_SOURCE_SELECTOR)
  104. if test -z "$with_sax2" ; then
  105. case "$JAVA_SOURCE" in
  106. 1|2|3) with_sax2="no";;
  107. esac
  108. fi
  109. if test -z "$with_javax_script"; then
  110. case "$JAVA_SOURCE" in
  111. 6compat5|6|7|8|9) with_javax_script="yes";;
  112. esac
  113. fi
  114. if test -z "$with_httpserver"; then
  115. case "$JAVA_SOURCE" in
  116. 6compat5|6|7|8|9)
  117. test "$with_android" != "" -a "$with_android" != "no" \
  118. || with_httpserver="yes";;
  119. esac
  120. fi
  121. AC_PROG_INSTALL
  122. AC_PROG_LN_S
  123. TOP_BUILDDIR=`pwd`
  124. JAVA=${JAVA-java}
  125. JAVAC=${JAVAC-javac}
  126. dnl needed to match _AM_DEPENDENCIES
  127. JAVACFLAGS=${JAVACFLAGS--g}
  128. case "$JAVA_SOURCE" in
  129. 6compat5) JAVACFLAGS="${JAVACFLAGS} -target 1.5 -source 1.5" ;;
  130. esac
  131. filesep='/'
  132. # Partly for compatibility (--enable/--disable-servlet was the old option);
  133. # partly to allow --with-servlet=path-to-jar --disable-servlet.
  134. # we essentially default enable-servlet to with-servlet. But we don't
  135. # want to clutter up configure --help with --enable-servlet.
  136. enable_servlet=${enable_servlet-${with_servlet}}
  137. # Windows has a non-suitable find command.
  138. AC_CACHE_CHECK([for Posix find command], [ac_cv_path_FIND],
  139. [AC_PATH_PROGS_FEATURE_CHECK([FIND], [find],
  140. [[findout=`$ac_path_FIND . -maxdepth 0 -type d -exec echo '{}' ';'`
  141. test "x$findout" = x"." \
  142. && ac_cv_path_FIND=$ac_path_FIND ac_path_FIND_found=:]],
  143. [AC_MSG_WARN([could not find Posix find]); ac_cv_path_FIND=find])])
  144. AC_SUBST([FIND], [$ac_cv_path_FIND])
  145. AM_CONDITIONAL(ENABLE_ECHO2, test "$enable_echo2" = "yes")
  146. AM_CONDITIONAL(WITH_ANDROID,
  147. test "$with_android" != "" -a "$with_android" != "no")
  148. AM_CONDITIONAL(ENABLE_BRL, test "$enable_brl" = "yes")
  149. AM_CONDITIONAL(ENABLE_JEMACS, test "$enable_jemacs" = "yes")
  150. AM_CONDITIONAL(ENABLE_XQUERY, test "$enable_xquery" != "no")
  151. AM_CONDITIONAL(ENABLE_XML, test "$enable_xml" = "yes")
  152. AM_CONDITIONAL(ENABLE_SERVLET,
  153. test "$enable_servlet" != "" -a "$enable_servlet" != "no")
  154. AM_CONDITIONAL(WITH_SWING, test "$with_swing" != "no")
  155. AM_CONDITIONAL(WITH_LSP4J,
  156. test "$with_lsp4j" != "" -a "$with_lsp4j" != "no")
  157. AM_CONDITIONAL(WITH_JLINE3,
  158. test "$with_jline3" != "" -a "$with_jline3" != "no")
  159. AM_CONDITIONAL(WITH_DOMTERM,
  160. test "$with_domterm" != "" -a "$with_domterm" != "no")
  161. AM_CONDITIONAL(WITH_JAVAFX,
  162. test "$with_javafx" != "" -a "$with_javafx" != "no")
  163. AM_CONDITIONAL(WITH_SWT, test "$with_swt" = "yes")
  164. AM_CONDITIONAL(WITH_AWT, test "$with_awt" != "no")
  165. AM_CONDITIONAL(WITH_SAX2, test "$with_sax2" != "no")
  166. AM_CONDITIONAL(WITH_JAVAX_SCRIPT, test "$with_javax_script" = "yes")
  167. AM_CONDITIONAL(WITH_HTTPSERVER, test "$with_httpserver" = "yes")
  168. AM_CONDITIONAL(WITH_DOCBOOK_STYLESHEETS, test "$with_docbook_stylesheets" != "" -a "$with_docbook_stylesheets" != "no")
  169. AM_CONDITIONAL(WITH_XQTS, test "$with_XQTS" != "" -a "$with_XQTS" != "no")
  170. AM_CONDITIONAL(ENABLE_KAWA_FRONTEND, test "$enable_kawa_frontend" = "yes")
  171. AM_CONDITIONAL(ON_WINDOWS, test "$CLASSPATH_SEPARATOR" = ";")
  172. if test -z "${ON_WINDOWS_FALSE}${ENABLE_KAWA_FRONTEND_FALSE}"
  173. then
  174. KAWA_SCRIPT=kawa
  175. else
  176. KAWA_SCRIPT=kawa.sh
  177. fi
  178. AC_SUBST(KAWA_SCRIPT)
  179. AS_IF([test "${KAWA_SCRIPT}" == "kawa"],
  180. AC_CONFIG_FILES([bin/kawa:bin/kawa.sh.in],[chmod +x bin/kawa]),
  181. AC_CONFIG_FILES([bin/kawa.sh:bin/kawa.sh.in],[chmod +x bin/kawa.sh]))
  182. if test "$with_docbook_stylesheets" == "" -o "$with_docbook_stylesheets" == "no" -o "$with_docbook_stylesheets" == "yes"
  183. then
  184. DOCBOOK_STYLESHEETS_PATH='$(TOP_BUILDDIR)/docbook-xsl'
  185. else
  186. DOCBOOK_STYLESHEETS_PATH="${with_docbook_stylesheets}"
  187. fi
  188. if test "$with_jline3" != "" -a "$with_jline3" != "no"
  189. then WITH_JLINE_PATH="${with_jline3}"
  190. fi
  191. if test "$with_gson" != "" -a "$with_gson" != "no"
  192. then WITH_GSON_PATH="${with_gson}"
  193. fi
  194. if test "$with_lsp4j" != "" -a "$with_lsp4j" != "no"
  195. then WITH_LSP4J_PATH="${with_lsp4j}"
  196. fi
  197. if test "$with_lsp4j_jsonrpc" != "" -a "$with_lsp4j_jsonrpc" != "no"
  198. then WITH_LSP4J_JSONRPC_PATH="${with_lsp4j_jsonrpc}"
  199. elif test -n "${WITH_LSP4J_PATH}"
  200. then WITH_LSP4J_JSONRPC_PATH=`echo "${WITH_LSP4J_PATH}"|sed -e 's|\(org.eclipse.lsp4j\)\(.\)|\1.jsonrpc\2|g'`
  201. fi
  202. JEMACS_VERSION=`echo $VERSION | sed -e 's/^1/0/'`
  203. BYTECODE_VERSION="$VERSION"
  204. m4_include(config.classpath)
  205. case ${with_sax2} in
  206. yes) SAX2_PREPROCESS="+SAX2";;
  207. no) SAX2_PREPROCESS="-SAX2";;
  208. *) SAX2_PREPROCESS=""
  209. esac
  210. XQTS_PATH=${with_XQTS:-XQTS}
  211. AC_SUBST(XQTS_PATH)
  212. AC_SUBST(DOCBOOK_STYLESHEETS_PATH)
  213. AC_SUBST(SAX2_PREPROCESS)
  214. AC_SUBST(conf_classpath)
  215. AC_SUBST(run_classpath)
  216. AC_SUBST(CLASSPATH_SEPARATOR)
  217. AC_SUBST(pathsep)
  218. AC_SUBST(filesep)
  219. AC_SUBST(WITH_SERVLET_ARG)
  220. AC_SUBST(WITH_JAVAFX_ARG)
  221. AC_SUBST(WITH_JLINE3)
  222. AC_SUBST(WITH_GSON_PATH)
  223. AC_SUBST(WITH_JLINE_PATH)
  224. AC_SUBST(WITH_LSP4J_PATH)
  225. AC_SUBST(WITH_LSP4J_JSONRPC_PATH)
  226. AC_SUBST(WITH_DOMTERM_ARG)
  227. AC_SUBST(JAVA)
  228. AC_SUBST(JAVAC)
  229. AC_SUBST(JAVACFLAGS)
  230. #These don't do anything, because Make-rules can't contain autoconf
  231. #substitutions. Perhaps fix when new automake is out.
  232. AC_SUBST(TOP_BUILDDIR)
  233. AC_SUBST(PACKAGE)
  234. AC_SUBST(VERSION)
  235. AC_SUBST(JEMACS_VERSION)
  236. AC_SUBST(BYTECODE_VERSION)
  237. if test -z "$KAWA_SHELL"; then
  238. if test -f /bin/bash; then KAWA_SHELL=/bin/bash
  239. elif test -f /bin/ksh; then KAWA_SHELL=/bin/ksh
  240. else KAWA_SHELL=${CONFIG_SHELL-/bin/sh}
  241. fi
  242. fi
  243. AC_SUBST(KAWA_SHELL)
  244. Make_rules="$srcdir/Make-rules"
  245. AC_SUBST_FILE(Make_rules)
  246. AC_CONFIG_LINKS(
  247. testsuite/scribble.html:testsuite/scribble.html.in)
  248. AC_CONFIG_SUBDIRS([bin])
  249. AC_CONFIG_FILES([Makefile gnu/bytecode/Makefile
  250. gnu/Makefile gnu/kawa/servlet/Makefile
  251. gnu/brl/Makefile gnu/kawa/brl/Makefile
  252. kawa/lib/Makefile gnu/kawa/slib/Makefile
  253. gnu/commonlisp/lisp/Makefile gnu/commonlisp/testsuite/Makefile
  254. gnu/jemacs/lisp/Makefile gnu/jemacs/testsuite/Makefile
  255. gnu/q2/testsuite/Makefile
  256. gnu/xquery/testsuite/Makefile
  257. gnu/kawa/android/Makefile
  258. gnu/kawa/javafx/Makefile
  259. doc/Makefile testsuite/Makefile
  260. bin/kawa.bat])
  261. AC_CONFIG_FILES([bin/qexo],[chmod +x bin/qexo])
  262. AC_OUTPUT