summaryrefslogtreecommitdiffstats
path: root/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
blob: 0d94ee9bf6c46e9c3376dda668e2b90e5f1fdff9 (plain)
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
AC_PREREQ([2.69])
AC_INIT
AC_CONFIG_SRCDIR([rlm_sql_db2.c])
AC_REVISION($Revision$)
FR_INIT_MODULE([rlm_sql_db2])

SMART_LIBS=
SMART_CLFAGS=

FR_MODULE_START_TESTS

dnl extra argument: --with-ibmdb2-include-dir
ibmdb2_include_dir=
AC_ARG_WITH(ibmdb2-include-dir,
	[AS_HELP_STRING([--with-ibmdb2-include-dir=DIR],
		[Directory where the IBM-DB2 includes may be found])],
	[case "$withval" in
	no)
		AC_MSG_ERROR(Need ibmdb2-include-dir)
		;;
	yes)
		;;
	*)
		ibmdb2_include_dir="$withval"
		;;
	esac])

dnl extra argument: --with-ibmdb2-lib-dir
ibmdb2_lib_dir=
AC_ARG_WITH(ibmdb2-lib-dir,
	[AS_HELP_STRING([--with-ibmdb2-lib-dir=DIR],
		[Directory where the IBM-DB2 libraries may be found])],
	[case "$withval" in
	no)
		AC_MSG_ERROR(Need ibmdb2-lib-dir)
		;;
	yes)
		;;
	*)
		ibmdb2_lib_dir="$withval"
		;;
	esac])

dnl extra argument: --with-ibmdb2-dir
AC_ARG_WITH(ibmdb2-dir,
	[AS_HELP_STRING([--with-ibmdb2-dir=DIR],
		[Base directory where IBM-DB2 is installed])],
	[case "$withval" in
	no)
		AC_MSG_ERROR(Need ibmdb2-dir)
		;;
	yes)
		;;
	*)
		ibmdb2_lib_dir="$withval/lib"
		ibmdb2_include_dir="$withval/include"
		;;
	esac])

dnl Check for SQLConnect in -ldb2
smart_try_dir="$ibmdb2_lib_dir /usr/local/db2/lib /usr/IBMdb2/V7.1/lib"
FR_SMART_CHECK_LIB(db2, SQLConnect)
if test "x$ac_cv_lib_db2_SQLConnect" != xyes; then
	FR_MODULE_FAIL([libdb2])
fi

dnl Check for sqlcli.h
smart_try_dir="$ibmdb2_include_dir /usr/local/db2/include /usr/IBMdb2/V7.1/include"
FR_SMART_CHECK_INCLUDE(sqlcli.h)
if test "x$ac_cv_header_sqlcli_h" != xyes; then
	FR_MODULE_FAIL([sqlcli.h])
fi

FR_MODULE_END_TESTS

sql_ibmdb2_ldflags="$SMART_LIBS"
sql_ibmdb2_cflags="$SMART_CPPFLAGS"

AC_SUBST(sql_ibmdb2_ldflags)
AC_SUBST(sql_ibmdb2_cflags)

AC_CONFIG_FILES([all.mk])
AC_OUTPUT