]> git.ipfire.org Git - thirdparty/pdns.git/blob - m4/pdns_with_oracle.m4
Add debug informations to the MPlexer unit tests, tracking a failure
[thirdparty/pdns.git] / m4 / pdns_with_oracle.m4
1 AC_DEFUN([PDNS_WITH_ORACLE],[
2 AC_ARG_WITH(oracle_includes, AS_HELP_STRING([--with-oracle-includes=<path>],[instantclient sdk include dir]))
3 AC_ARG_WITH(oracle_libs, AS_HELP_STRING([--with-oracle-libs=<path>],[instantclient oracle library dir]))
4
5 if test x"$with_oracle_includes" = "x"; then
6 # check possible locations
7 for p1 in /usr/include/oracle /usr/local/include/oracle; do
8 for p2 in $p1/*/client*; do
9 if test -d "$p2"; then
10 with_oracle_includes=$p2
11 fi
12 done
13 done
14 fi
15
16 if test x"$with_oracle_includes" = x && test "$ORACLE_HOME/rdbms/public" != "/rdbms/public"; then
17 if test -d $ORACLE_HOME/rdbms/public; then
18 with_oracle_includes=$ORACLE_HOME/rdbms/public
19 fi
20 fi
21
22 # test header
23 old_CXXFLAGS="$CXXFLAGS"
24 old_CFLAGS="$CFLAGS"
25 CXXFLAGS="$CXXFLAGS -I$with_oracle_includes"
26 CPPFLAGS="$CPPFLAGS -I$with_oracle_includes"
27 AC_CHECK_HEADER([oci.h], ORACLE_CFLAGS="-I$with_oracle_includes", AC_MSG_ERROR([Could not find oci.h]))
28 CXXFLAGS="$old_CXXFLAGS"
29 CPPFLAGS="$old_CPPFLAGS"
30 AC_SUBST([ORACLE_CFLAGS])
31 AC_SUBST([ORACLE_LIBS])
32
33 if test x"$with_oracle_libs" = "x"; then
34 # check possible locations
35 for p1 in /usr/lib/oracle /usr/local/lib/oracle; do
36 for p2 in $p1/*/client*/lib; do
37 if test -d "$p2"; then
38 with_oracle_libs=$p2
39 fi
40 done
41 done
42 fi
43
44 if test x"$with_oracle_libs" = x && test "$ORACLE_HOME/lib" != "/lib"; then
45 if test -d $ORACLE_HOME/lib; then
46 with_oracle_libs=$ORACLE_HOME/lib
47 fi
48 fi
49
50 # we have to check for client9 as well...
51 # test -lclntsh
52 old_LDFLAGS="$LDFLAGS"
53 LDFLAGS="-L$with_oracle_libs -locci"
54 AC_CHECK_LIB([clntsh],[OCIEnvInit],
55 [ORACLE_LIBS="-L$with_oracle_libs -lclntsh -locci"],
56 AC_CHECK_LIB([client9], [OCIEnvInit],
57 [ORACLE_LIBS="-L$with_oracle_libs -lclient9 -lclntsh9"],
58 [AC_MSG_ERROR([Could not find client libraries])]
59 )
60 )
61 LDFLAGS="$old_LDFLAGS"
62 ])