-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
81 lines (64 loc) · 2.15 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
78
79
80
81
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# Autoconf requirements
AC_PREREQ(2.59)
# Autoconf/Automake initialization
AC_INIT(libsqljdbc_auth, 0.1, ddaizovi@gmail.com)
AC_CONFIG_SRCDIR([src/sqljdbc_auth.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
AM_DISABLE_STATIC
# information on the package
# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_CPP
AC_PROG_JAVAH
AS_IF([test "x$JAVAH" = x],
AC_MSG_FAILURE(Can't find javah ))
# Checks for libraries.
AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context])
AC_CHECK_LIB([gssapi], [gss_init_sec_context])
#AC_CHECK_LIB([ntlm], [builtSmbNtlmAuthRequest])
function abspath() {
absdir=$(cd `dirname $1` && pwd)
absfile=`basename $1`
echo -n "$absdir/$absfile"
}
# Check for the Microsoft sqljdbc.jar file
AC_ARG_WITH([sqljdbc],
[AS_HELP_STRING([--with-sqljdbc],
[location of Microsoft SQL Server 2005 JDBC driver @<:@default="sqljdbc.jar"@:>@])],
[],
[with_sqljdbc=sqljdbc.jar])
# If sqljdbc.jar isn't found, search the CLASSPATH environment variable
AC_CHECK_FILE($with_sqljdbc,[],
[for cp in `echo $CLASSPATH | sed -e 's/:/ /g'`; do
cpbase=`basename $cp`
AS_IF([test $cpbase = "sqljdbc.jar"],
[with_sqljdbc=$cp; break ])
done])
# If we still haven't found it, abort configure script
AC_CHECK_FILE($with_sqljdbc,
[AC_SUBST([SQLJDBC_JAR], $(abspath $with_sqljdbc))],
[AC_MSG_FAILURE("Can't find Microsoft SQL Server 2005 JDBC driver")])
# Checks for header files.
AC_HEADER_STDC
AC_JNI_INCLUDE_DIR
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
do
CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
done
AC_CHECK_HEADERS([gssapi.h gssapi/gssapi_krb5.h],,[ac_do_krb5="yes"])
#AC_CHECK_HEADERS([ntlm.h],,[ac_do_ntlm="yes"])
# Check that at least one of KRB5 or NTLM is possible
AS_IF([(test "x$ac_do_krb5" != x && test "x$ac_do_ntlm" != x)],
AC_MSG_FAILURE("No supported authentication methods were found"))
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
# Write output
AC_OUTPUT