source: trunk/gsdl3/src/packages/javagdbm/configure.in@ 10737

Last change on this file since 10737 was 10737, checked in by kjdon, 19 years ago

Java Wrapper for GDBM, from Martin Pool. Original website gone, so added it all in here. I have modified the Makefiles to work in greenstone, and on macs, and added windows makefiles

  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2
3dnl autoconf configuration script for the JNI part of the
4dnl au.com.pharos.gdbm Java package
5dnl $Id: configure.in 10737 2005-10-19 03:06:40Z kjdon $
6
7AC_REVISION($Revision: 10737 $)
8
9# Copyright (C) 1997 by Pharos IP Pty Ltd
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
25AC_INIT(jni/gdbmjava.c)
26
27# TODO: allow the user to specify whether they want a debugging
28# library or not?
29
30# check for compilers and other tools
31AC_PROG_CC
32AC_PROG_INSTALL
33AC_PROG_LN_S
34
35AC_CHECK_SIZEOF(void *)
36AC_CHECK_SIZEOF(int)
37AC_CHECK_SIZEOF(long)
38
39######## check for the JDK and tools within the JDK
40######## look in the JAVA_HOME environment variable at configure-time
41AC_MSG_CHECKING([for the JDK])
42if test "z$JAVA_HOME" != z &&
43 test -d $JAVA_HOME &&
44 test -d $JAVA_HOME/include
45then
46 AC_SUBST(JAVA_HOME)
47 AC_MSG_RESULT([found in $JAVA_HOME])
48else
49 AC_MSG_ERROR([not found in \$JAVA_HOME])
50fi
51
52# TODO: Check for specific header files in the JDK, or
53# functions/definitions within those headers?
54
55# TODO: guess which include directory to use under the JDK
56
57AC_PATH_PROG(javagdbm_cv_path_javah, javah, missing_javah)
58if test "$javagdbm_cv_path_javah" = missing_javah; then
59 AC_MSG_ERROR([javah not found.])
60fi
61
62AC_PATH_PROG(javagdbm_cv_path_java, java, missing)
63if test "$javagdbm_cv_path_java" = missing; then
64 AC_MSG_ERROR([java not found.])
65fi
66
67# check for gdbm library
68AC_CHECK_LIB(gdbm, gdbm_open, [javagdbm_cv_lib_gdbm="-lgdbm"],
69 [javagdbm_cv_lib_gdbm=no])
70if test "$javagdbm_cv_lib_gdbm" = "no"; then
71 AC_MSG_ERROR([no native gdbm library found.])
72fi
73LIBS="$javagdbm_cv_lib_gdbm"
74
75########## set compiler options
76# TODO: is there a more appropriate way to guess which switches to use
77# with which systems/compilers?
78CFLAGS="-Wall -O2 -fpic"
79PKG="au.com.pharos.gdbm"
80AC_SUBST(CFLAGS)
81AC_SUBST(PKG)
82AC_SUBST(LIBS)
83
84# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
85# a non-standard Path
86AC_MSG_CHECKING(for Apple MacOS X/Darwin)
87if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
88 AC_MSG_RESULT(yes)
89 JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
90 JNISUFFIX="jnilib"
91 JNIFLAGS="-dynamiclib -fno-common"
92 LDFLAGS="-framework JavaVM"
93else
94 AC_MSG_RESULT(no)
95 JNIINC=""
96 JNISUFFIX="so"
97 JNIFLAGS="-shared"
98fi
99AC_SUBST(JNIINC)
100AC_SUBST(JNISUFFIX)
101AC_SUBST(JNIFLAGS)
102
103# write the output
104AC_OUTPUT([Makefile jni/Makefile java/Makefile])
Note: See TracBrowser for help on using the repository browser.