3 dnl Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
4 dnl C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 dnl E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 dnl J. Wenninger, Institut f. Computersprachen - TU Wien
8 dnl This file is part of CACAO.
10 dnl This program is free software; you can redistribute it and/or
11 dnl modify it under the terms of the GNU General Public License as
12 dnl published by the Free Software Foundation; either version 2, or (at
13 dnl your option) any later version.
15 dnl This program is distributed in the hope that it will be useful, but
16 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 dnl General Public License for more details.
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with this program; if not, write to the Free Software
22 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 dnl $Id: configure.ac 7228 2007-01-19 01:13:48Z edwin $
28 dnl which Java core library should we use
30 AC_DEFUN([AC_CHECK_WITH_CLASSPATH],[
31 AC_MSG_CHECKING(which Java core library to use)
32 AC_ARG_WITH([classpath],
33 [AS_HELP_STRING(--with-classpath=<type>,specifies which type of classpath to use as Java core library (cldc1.1,gnu) [[default=gnu]])],
36 WITH_CLASSPATH=cldc1.1
37 AC_DEFINE([WITH_CLASSPATH_CLDC1_1], 1, [use Sun's CLDC1.1 classes])
38 AC_SUBST(WITH_CLASSPATH_CLDC1_1)
42 AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
43 AC_SUBST(WITH_CLASSPATH_GNU)
46 AC_MSG_ERROR(unknown classpath ${withval})
50 AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
51 AC_SUBST(WITH_CLASSPATH_GNU)])
52 AC_MSG_RESULT(${WITH_CLASSPATH})
53 AM_CONDITIONAL([WITH_CLASSPATH_CLDC1_1], test x"${WITH_CLASSPATH}" = "xcldc1.1")
54 AM_CONDITIONAL([WITH_CLASSPATH_GNU], test x"${WITH_CLASSPATH}" = "xgnu")
58 dnl where is Java core library installed
60 AC_DEFUN([AC_CHECK_WITH_CLASSPATH_PREFIX],[
61 AC_MSG_CHECKING(where Java core library is installed)
62 AC_ARG_WITH([classpath-prefix],
63 [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of Java core library [[default=/usr/local/classpath]])],
64 [CLASSPATH_PREFIX=${withval}],
65 [CLASSPATH_PREFIX=/usr/local/classpath])
66 AC_MSG_RESULT(${CLASSPATH_PREFIX})
67 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [Java core library installation directory])
68 AC_SUBST(CLASSPATH_PREFIX)
72 dnl where are Java core library classes installed
74 AC_DEFUN([AC_CHECK_WITH_CLASSPATH_CLASSES],[
75 AC_MSG_CHECKING(where Java core library classes are installed)
76 AC_ARG_WITH([classpath-classes],
77 [AS_HELP_STRING(--with-classpath-classes=<path>,path to Java core library classes (includes the name of the file and may be flat) [[default=/usr/local/classpath/share/classpath/glibj.zip]])],
78 [CLASSPATH_CLASSES=${withval}],
79 [CLASSPATH_CLASSES=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
80 AC_MSG_RESULT(${CLASSPATH_CLASSES})
81 AC_DEFINE_UNQUOTED([CLASSPATH_CLASSES], "${CLASSPATH_CLASSES}", [Java core library classes])
82 AC_SUBST(CLASSPATH_CLASSES)
86 dnl where are Java core library native libraries installed
88 AC_DEFUN([AC_CHECK_WITH_CLASSPATH_LIBDIR],[
89 AC_MSG_CHECKING(where Java core library native libraries are installed)
90 AC_ARG_WITH([classpath-libdir],
91 [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of Java core library native libraries [[default=/usr/local/classpath/lib]])],
92 [CLASSPATH_LIBDIR=${withval}],
93 [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
94 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
96 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
97 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
98 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [Java core library native libraries installation directory])
99 AC_SUBST(CLASSPATH_LIBDIR)
103 dnl where are Java core library headers installed
105 AC_DEFUN([AC_CHECK_WITH_CLASSPATH_INCLUDEDIR],[
106 AC_MSG_CHECKING(where Java core library headers are installed)
107 AC_ARG_WITH([classpath-includedir],
108 [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of Java core library headers [[default=/usr/local/classpath/include]])],
109 [CLASSPATH_INCLUDEDIR=${withval}],
110 [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
111 AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
113 AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
114 [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [Java core library jni.h header])],
115 [AC_MSG_ERROR(cannot find jni.h)])