1 dnl Used by aclocal to generate configure
3 dnl -----------------------------------------------------------
4 AC_DEFUN([CLASSPATH_WITH_JAVAH],
7 [AS_HELP_STRING(--with-javah,specify path or name of a javah-like program)],
9 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
10 CLASSPATH_CHECK_JAVAH(${withval})
21 dnl -----------------------------------------------------------
22 dnl Checking for a javah like program
23 dnl -----------------------------------------------------------
24 AC_DEFUN([CLASSPATH_CHECK_JAVAH],
26 if test "x$1" != x; then
30 AC_PATH_PROG(USER_JAVAH, "$1")
33 AC_PATH_PROGS([USER_JAVAH],[gjavah gjavah-4.3 gjavah-4.2 gjavah-4.1 gcjh-wrapper-4.1 gcjh-4.1 javah])
36 if test "x${USER_JAVAH}" = x; then
37 AC_MSG_ERROR([can not find javah])
41 dnl -----------------------------------------------------------
42 dnl CLASSPATH_WITH_CLASSLIB - checks for user specified classpath additions
43 dnl -----------------------------------------------------------
44 AC_DEFUN([CLASSPATH_WITH_CLASSLIB],
46 AC_ARG_WITH([vm-classes],
47 [AS_HELP_STRING(--with-vm-classes,specify path to VM override source files)], [vm_classes="$with_vm_classes"],
48 [vm_classes='${top_srcdir}/vm/reference'])
52 dnl -----------------------------------------------------------
53 dnl CLASSPATH_WITH_GLIBJ - specify what to install
54 dnl -----------------------------------------------------------
55 AC_DEFUN([CLASSPATH_WITH_GLIBJ],
57 AC_PATH_PROG(ZIP, zip)
59 AC_MSG_CHECKING(for a jar-like tool)
61 [AS_HELP_STRING([--with-jar=PATH], [define to use a jar style tool])],
72 if test -f "${withval}"; then
76 AC_MSG_RESULT([not found])
77 AC_MSG_ERROR([The jar tool ${withval} was not found.])
85 if test x"${JAR}" = "xyes"; then
86 AC_MSG_RESULT([trying fastjar, gjar and jar])
87 AC_PATH_PROGS([JAR], [fastjar gjar jar])
88 if test x"${RHINO_JAR}" = "xyes"; then
89 AC_MSG_RESULT([not found])
92 if test x"${JAR}" = "xno" && test x"${ZIP}" = ""; then
93 AC_MSG_ERROR([No zip or jar tool found.])
95 AM_CONDITIONAL(WITH_JAR, test x"${JAR}" != "xno" && test x"${JAR}" != "xyes")
99 [AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])],
101 if test "x${withval}" = xyes || test "x${withval}" = xzip; then
102 install_class_files=no
103 build_class_files=yes
105 elif test "x${withval}" = xboth; then
106 install_class_files=yes
107 build_class_files=yes
109 elif test "x${withval}" = xflat; then
110 install_class_files=yes
111 build_class_files=yes
113 elif test "x${withval}" = xno || test "x${withval}" = xnone; then
114 install_class_files=no
117 elif test "x${withval}" = xbuild; then
118 install_class_files=no
119 build_class_files=yes
122 AC_MSG_ERROR([unknown value given to --with-glibj])
126 install_class_files=no
129 AM_CONDITIONAL(INSTALL_GLIBJ_ZIP, test "x${use_zip}" = xyes)
130 AM_CONDITIONAL(INSTALL_CLASS_FILES, test "x${install_class_files}" = xyes)
131 AM_CONDITIONAL(BUILD_CLASS_FILES, test "x${build_class_files}" = xyes)
133 AC_ARG_ENABLE([examples],
134 [AS_HELP_STRING(--enable-examples,enable build of the examples [default=yes])],
135 [case "${enableval}" in
136 yes) EXAMPLESDIR="examples" ;;
137 no) EXAMPLESDIR="" ;;
138 *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
140 [EXAMPLESDIR="examples"])
141 if test "x${build_class_files}" = xno; then
144 AC_SUBST(EXAMPLESDIR)
146 AC_ARG_ENABLE([tools],
147 [AS_HELP_STRING(--enable-tools,enable build of the tools [default=yes])],
148 [case "${enableval}" in
149 yes) TOOLSDIR="tools" ;;
151 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
154 if test "x${build_class_files}" = xno; then
160 dnl -----------------------------------------------------------
161 dnl Enable generation of API documentation, with gjdoc if it
162 dnl has been compiled to an executable (or a suitable script
163 dnl is in your PATH) or using the argument as gjdoc executable.
164 dnl -----------------------------------------------------------
165 AC_DEFUN([CLASSPATH_WITH_GJDOC],
168 AS_HELP_STRING([--with-gjdoc],
169 [generate documentation using gjdoc (default is NO)]),
170 [if test "x${withval}" = xno; then
172 elif test "x${withval}" = xyes -o "x{withval}" = x; then
174 AC_PATH_PROG(GJDOC, gjdoc, "no")
175 if test "x${GJDOC}" = xno; then
176 AC_MSG_ERROR("gjdoc executable not found");
181 AC_CHECK_FILE(${GJDOC}, AC_SUBST(GJDOC),
182 AC_MSG_ERROR("Cannot use ${withval} as gjdoc executable since it doesn't exist"))
185 AM_CONDITIONAL(CREATE_API_DOCS, test "x${WITH_GJDOC}" = xyes)
186 if test "x${WITH_GJDOC}" = xyes; then
187 AC_MSG_CHECKING([version of GJDoc])
188 gjdoc_version=$(${GJDOC} --version|cut -d ' ' -f2)
189 AC_MSG_RESULT(${gjdoc_version})
190 case ${gjdoc_version} in
195 *) AC_MSG_ERROR([Building documentation requires GJDoc >= 0.7.9, ${gjdoc_version} found.]) ;;
200 dnl -----------------------------------------------------------
201 dnl Enable regeneration of parsers using jay
202 dnl http://www.informatik.uni-osnabrueck.de/alumni/bernd/jay/
203 dnl -----------------------------------------------------------
204 AC_DEFUN([REGEN_WITH_JAY],
207 [AS_HELP_STRING(--with-jay[=DIR|PATH],Regenerate the parsers with jay)],
209 AC_MSG_CHECKING([whether to regenerate parsers with jay])
212 if test "x${withval}" = xno; then
214 elif test "x${withval}" = xyes; then
216 JAY_DIR_PATH="/usr/share/jay"
217 elif test -d "${withval}"; then
219 JAY_DIR_PATH="${withval}"
220 elif test -f "${withval}"; then
222 JAY_DIR_PATH=`dirname "${withval}"`
225 AC_MSG_ERROR(jay not found at ${withval})
228 if test "x${JAY_DIR_PATH}" != x; then
229 AC_PATH_PROG(JAY, jay, "no", ${JAY_DIR_PATH}:${PATH})
230 if test "x${JAY}" = xno; then
231 AC_MSG_ERROR(jay executable not found);
233 JAY_SKELETON="${JAY_DIR_PATH}/skeleton"
234 AC_CHECK_FILE(${JAY_SKELETON}, AC_SUBST(JAY_SKELETON),
235 AC_MSG_ERROR(Expected skeleton file in ${JAY_DIR_PATH}))
240 AC_MSG_CHECKING([whether to regenerate parsers with jay])
244 AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes)
247 dnl -----------------------------------------------------------
248 dnl GCJ LOCAL: Calculate toolexeclibdir
249 dnl -----------------------------------------------------------
250 AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
252 case ${version_specific_libs} in
254 # Need the gcc compiler version to know where to install libraries
255 # and header files if --enable-version-specific-runtime-libs option
257 includedir='$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include/'
258 toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
259 toolexecmainlibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
260 toolexeclibdir=$toolexecmainlibdir
263 if test -n "$with_cross_host" &&
264 test x"$with_cross_host" != x"no"; then
265 # Install a library built with a cross compiler in tooldir, not libdir.
266 toolexecdir='$(exec_prefix)/$(target_noncanonical)'
267 toolexecmainlibdir='$(toolexecdir)/lib'
269 toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
270 toolexecmainlibdir='$(libdir)'
272 multi_os_directory=`$CC -print-multi-os-directory`
273 case $multi_os_directory in
274 .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /.
275 *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;;
279 AC_SUBST(toolexecdir)
280 AC_SUBST(toolexecmainlibdir)
281 AC_SUBST(toolexeclibdir)
284 dnl -----------------------------------------------------------
285 AC_DEFUN([CLASSPATH_JAVAC_MEM_CHECK],
288 CLASS_TEST=Test.class
289 cat << \EOF > $JAVA_TEST
290 /* [#]line __oline__ "configure" */
293 public static void main(String[] args)
295 System.out.println("Hello World");
299 if test x$JAVAC_IS_GCJ != xyes; then
300 AC_MSG_CHECKING([whether javac supports -J])
301 $JAVAC $JAVACFLAGS -J-Xmx768M -sourcepath '' $JAVA_TEST
303 if test "x$javac_result" = "x0"; then
305 JAVAC_MEM_OPT="-J-Xmx768M"
310 rm -f $JAVA_TEST $CLASS_TEST
311 AC_SUBST(JAVAC_MEM_OPT)
314 dnl ---------------------------------------------------------------
315 dnl CLASSPATH_COND_IF(COND, SHELL-CONDITION, [IF-TRUE], [IF-FALSE])
316 dnl ---------------------------------------------------------------
317 dnl Automake 1.11 can emit conditional rules for AC_CONFIG_FILES,
318 dnl using AM_COND_IF. This wrapper uses it if it is available,
319 dnl otherwise falls back to code compatible with Automake 1.9.6.
320 AC_DEFUN([CLASSPATH_COND_IF],
321 [m4_ifdef([AM_COND_IF],
322 [AM_COND_IF([$1], [$3], [$4])],
324 m4_default([$3], [:])
326 m4_default([$4], [:])