-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconfigure.in
93 lines (75 loc) · 2.04 KB
/
configure.in
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
dnl
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([inotify-java],
[2.1],
[https://bitbucket.org/nbargnesi/inotify-java/issues])
AM_INIT_AUTOMAKE([dist-bzip2 dist-xz])
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([src/cpp/inotify-interface.cpp])
AC_CONFIG_SRCDIR([src/java/classes/com/den_4/inotify_java/Inotify.java])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AC_CHECK_HEADERS([sys/inotify.h])
AC_SUBST(JAVA_HOME)
if test "${JAVA_HOME}" = "" ; then
AC_MSG_ERROR([no JAVA_HOME is set])
fi
AC_PATH_PROG(JAVA, java,false, $JAVA_HOME/bin)
if test "${JAVA}" = "false" ; then
AC_MSG_ERROR([no java in \$JAVA_HOME/bin])
fi
echo -en 'checking java version... '
JAVA_VERSION=$($JAVA_HOME/bin/java -version 2>&1 \
| head -n 1 | cut -d ' ' -f3 | tr -d '"')
echo "$JAVA_VERSION"
case $JAVA_VERSION in
1.7.*)
;;
*)
AC_MSG_ERROR([expected Java 7, found ${JAVA_VERSION}])
;;
esac
AC_PATH_PROG(JAVAC,javac,false, $JAVA_HOME/bin)
if test "${JAVAC}" = "false" ; then
AC_MSG_ERROR([no javac in \$JAVA_HOME/bin])
fi
AC_PATH_PROG(JAR,jar,false, $JAVA_HOME/bin)
if test "${JAR}" = "false" ; then
AC_MSG_ERROR([no jar in \$JAVA_HOME/bin])
fi
AC_PATH_PROG(JAVAH,javah,false, $JAVA_HOME/bin)
if test "${JAVAH}" = "false" ; then
AC_MSG_ERROR([no javah in \$JAVA_HOME/bin])
fi
AC_PATH_PROG(ANT,ant,false)
if test "${ANT}" = "false" ; then
AC_MSG_ERROR([no ant in path])
fi
AC_TYPE_SIZE_T
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([pipe])
dnl
dnl other compiler options
dnl
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[use debug compiler flags and macros @<:@default=disabled@:>@])],
[enable_debug="$enableval"],
[enable_debug=no]
)
if test "x$enable_debug" = xyes; then
DEFINES="-DENABLE_DEBUGGING"
DEBUG="-g"
fi
AC_SUBST(DEFINES)
AC_SUBST(DEBUG)
AC_CONFIG_FILES([
Makefile
src/Makefile
src/cpp/Makefile
src/java/Makefile
inotify-java-2.1.pc
])
AC_OUTPUT