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)
58 AC_ARG_WITH([fastjar],
59 [AS_HELP_STRING([--with-fastjar=PATH], [define to use a fastjar style tool])],
61 AC_MSG_CHECKING([for user supplied fastjar])
63 AC_MSG_RESULT([${FASTJAR}])
65 [AC_PATH_PROGS([FASTJAR], [fastjar gjar jar])])
66 dnl We disable ZIP by default if we find fastjar.
67 if test x"${FASTJAR}" != x; then
72 [AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])],
74 if test "x${withval}" = xyes || test "x${withval}" = xzip; then
75 install_class_files=no
78 elif test "x${withval}" = xboth; then
79 install_class_files=yes
82 elif test "x${withval}" = xflat; then
83 install_class_files=yes
86 elif test "x${withval}" = xno || test "x${withval}" = xnone; then
87 install_class_files=no
90 elif test "x${withval}" = xbuild; then
91 install_class_files=no
95 AC_MSG_ERROR([unknown value given to --with-glibj])
99 install_class_files=no
102 AM_CONDITIONAL(INSTALL_GLIBJ_ZIP, test "x${use_zip}" = xyes)
103 AM_CONDITIONAL(INSTALL_CLASS_FILES, test "x${install_class_files}" = xyes)
104 AM_CONDITIONAL(BUILD_CLASS_FILES, test "x${build_class_files}" = xyes)
106 AC_ARG_ENABLE([examples],
107 [AS_HELP_STRING(--enable-examples,enable build of the examples [default=yes])],
108 [case "${enableval}" in
109 yes) EXAMPLESDIR="examples" ;;
110 no) EXAMPLESDIR="" ;;
111 *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
113 [EXAMPLESDIR="examples"])
114 if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then
117 AC_SUBST(EXAMPLESDIR)
119 AC_ARG_ENABLE([tools],
120 [AS_HELP_STRING(--enable-tools,enable build of the tools [default=yes])],
121 [case "${enableval}" in
122 yes) TOOLSDIR="tools" ;;
124 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
127 if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then
133 dnl -----------------------------------------------------------
134 dnl Enable generation of API documentation, with gjdoc if it
135 dnl has been compiled to an executable (or a suitable script
136 dnl is in your PATH) or using the argument as gjdoc executable.
137 dnl -----------------------------------------------------------
138 AC_DEFUN([CLASSPATH_WITH_GJDOC],
141 AS_HELP_STRING([--with-gjdoc],
142 [generate documentation using gjdoc (default is NO)]),
143 [if test "x${withval}" = xno; then
145 elif test "x${withval}" = xyes -o "x{withval}" = x; then
147 AC_PATH_PROG(GJDOC, gjdoc, "no")
148 if test "x${GJDOC}" = xno; then
149 AC_MSG_ERROR("gjdoc executable not found");
154 AC_CHECK_FILE(${GJDOC}, AC_SUBST(GJDOC),
155 AC_MSG_ERROR("Cannot use ${withval} as gjdoc executable since it doesn't exist"))
159 AM_CONDITIONAL(CREATE_API_DOCS, test "x${WITH_GJDOC}" = xyes)
162 dnl -----------------------------------------------------------
163 dnl Enable regeneration of parsers using jay
164 dnl http://www.informatik.uni-osnabrueck.de/alumni/bernd/jay/
165 dnl -----------------------------------------------------------
166 AC_DEFUN([REGEN_WITH_JAY],
169 [AS_HELP_STRING(--with-jay[=DIR|PATH],Regenerate the parsers with jay)],
171 AC_MSG_CHECKING([whether to regenerate parsers with jay])
174 if test "x${withval}" = xno; then
176 elif test "x${withval}" = xyes; then
178 JAY_DIR_PATH="/usr/share/jay"
179 elif test -d "${withval}"; then
181 JAY_DIR_PATH="${withval}"
182 elif test -f "${withval}"; then
184 JAY_DIR_PATH=`dirname "${withval}"`
187 AC_MSG_ERROR(jay not found at ${withval})
190 if test "x${JAY_DIR_PATH}" != x; then
191 AC_PATH_PROG(JAY, jay, "no", ${JAY_DIR_PATH}:${PATH})
192 if test "x${JAY}" = xno; then
193 AC_MSG_ERROR(jay executable not found);
195 JAY_SKELETON="${JAY_DIR_PATH}/skeleton"
196 AC_CHECK_FILE(${JAY_SKELETON}, AC_SUBST(JAY_SKELETON),
197 AC_MSG_ERROR(Expected skeleton file in ${JAY_DIR_PATH}))
202 AC_MSG_CHECKING([whether to regenerate parsers with jay])
206 AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes)
209 dnl -----------------------------------------------------------
210 dnl GCJ LOCAL: Calculate toolexeclibdir
211 dnl -----------------------------------------------------------
212 AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
214 multi_os_directory=`$CC -print-multi-os-directory`
215 case $multi_os_directory in
216 .) toolexeclibdir=${libdir} ;; # Avoid trailing /.
217 *) toolexeclibdir=${libdir}/${multi_os_directory} ;;
219 AC_SUBST(toolexeclibdir)
222 dnl -----------------------------------------------------------
223 AC_DEFUN([CLASSPATH_JAVAC_MEM_CHECK],
226 CLASS_TEST=Test.class
227 cat << \EOF > $JAVA_TEST
228 /* [#]line __oline__ "configure" */
231 public static void main(String[] args)
233 System.out.println("Hello World");
237 AC_MSG_CHECKING([whether javac supports -J])
238 $JAVAC $JAVACFLAGS -J-Xmx768M -sourcepath '' $JAVA_TEST
240 if test "x$javac_result" = "x0"; then
242 JAVAC_MEM_OPT="-J-Xmx768M"
246 rm -f $JAVA_TEST $CLASS_TEST
247 AC_SUBST(JAVAC_MEM_OPT)
250 dnl ---------------------------------------------------------------
251 dnl CLASSPATH_COND_IF(COND, SHELL-CONDITION, [IF-TRUE], [IF-FALSE])
252 dnl ---------------------------------------------------------------
253 dnl Automake 1.11 can emit conditional rules for AC_CONFIG_FILES,
254 dnl using AM_COND_IF. This wrapper uses it if it is available,
255 dnl otherwise falls back to code compatible with Automake 1.9.6.
256 AC_DEFUN([CLASSPATH_COND_IF],
257 [m4_ifdef([AM_COND_IF],
258 [AM_COND_IF([$1], [$3], [$4])],
260 m4_default([$3], [:])
262 m4_default([$4], [:])