This repository has been archived by the owner on Mar 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure.ac
77 lines (61 loc) · 1.84 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
AC_INIT([libgfapi-java-io],[0.1],[[email protected]])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
if make --help 2>&1 | grep -q no-print-directory; then
AM_MAKEFLAGS="$AM_MAKEFLAGS --no-print-directory";
fi
if make --help 2>&1 | grep -q quiet; then
AM_MAKEFLAGS="$AM_MAKEFLAGS --quiet"
fi
if libtool --help 2>&1 | grep -q quiet; then
AM_LIBTOOLFLAGS="--quiet";
fi
AC_CONFIG_FILES([Makefile
src/Makefile
libgfapi-java-io.spec])
AC_PROG_CC
AC_PROG_LIBTOOL
PKG_CHECK_MODULES([GLFS], [glusterfs-api >= 3])
## swig section
AC_CHECK_PROG(HAVE_SWIG, swig, "yes", "no")
## end swig section
## Java support
AC_ARG_WITH(java, AS_HELP_STRING([--without-java], [Disable Java]))
AC_ARG_WITH(javac,
AS_HELP_STRING([--with-javac=PATH],[Set location of javac executable])
[JAVACBIN="$withval"],
[JAVACBIN=])
BUILD_JAVA=no
# First, check for "--without-java" or "--with-java=no".
if test x"${JAVABIN}" = xno -o x"${JAVACBIN}" = xno; then
AC_MSG_NOTICE([Disabling Java])
JAVA=
else
if test -z "$JAVACBIN"; then
AC_PATH_PROGS(JAVAC, javac)
else
if ! test -x "$JAVACBIN"; then
AC_MSG_WARN([Executable not found: $JAVACBIN])
exit 1;
fi
JAVAC="$JAVACBIN"
fi
REAL_JAVAC=$(readlink -f "$JAVAC")
if test -x "$REAL_JAVAC"; then
AC_ARG_WITH(javaincl,AS_HELP_STRING([--with-javaincl=PATH],
[Set location of Java include directory]),
[JAVAINCDIR="$withval"], [JAVAINCDIR=])
if test -z "$JAVAINCDIR"; then
JAVAINCDIR=$(dirname $(find $(dirname $REAL_JAVAC)/../include -name jni.h))
fi
JNIMDDIR=$(dirname $(find $JAVAINCDIR -name jni_md.h))
JAVA_CPPFLAGS="-I$JAVAINCDIR -I$JNIMDDIR";
orig_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$JAVA_CPPFLAGS $CPPFLAGS"
AC_CHECK_HEADERS([jni.h],[BUILD_JAVA=yes])
CPPFLAGS="$orig_CPPFLAGS"
fi
fi
AC_SUBST(HAVE_SWIG)
AC_SUBST(JAVA_CPPFLAGS)
AC_OUTPUT