aboutsummaryrefslogtreecommitdiff
path: root/build/import/liboci/configure
blob: 5fcefa5666077f6f120b57a358018a13ab89d640 (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
#! /usr/bin/env bash

# file      : build/import/liboci/configure
# license   : GNU GPL v2; see accompanying LICENSE file


# $1           - out config file
#
# bld_root     - build root
# project_name - project name
#

source $bld_root/dialog.bash

$echo
$echo "Configuring external dependency on 'OCI library' for '$project_name'."
$echo

$echo
$echo "Please enter the 'Oracle' home or 'Instant Client' directory."
$echo

liboci_root=$ORACLE_HOME
liboci_include=
liboci_lib=

while [ -z "$liboci_include" ]; do
  liboci_root=`read_path --directory --exist $liboci_root`

  if [ -d "$liboci_root/sdk/include" ]; then
    liboci_include="$liboci_root/sdk/include"

    liboci_lib=`ls $liboci_root/libclntsh.so 2>/dev/null`
    if [ -z "$liboci_lib" ]; then
      liboci_lib=`ls $liboci_root/libclntsh.so.* 2>/dev/null`
    fi

  elif [ -d "$liboci_root/rdbms/public" ]; then
    liboci_include="$liboci_root/rdbms/public"
    liboci_lib=`ls $liboci_root/lib/libclntsh.so 2>/dev/null`
  elif [ -d "$liboci_root/include" ]; then
    liboci_include="$liboci_root/include"

    liboci_lib=`ls $liboci_root/lib/libclntsh.so 2>/dev/null`
    if [ -z "$liboci_lib" ]; then
      liboci_lib=`ls $liboci_root/lib/libclntsh.so.* 2>/dev/null`
    fi
  fi

  if [ -z "$liboci_include" ]; then
    liboci_root=

    $echo
    $echo "The specified directory looks like neither an Instant Client nor"
    $echo "an Oracle home directory."
    $echo
  elif [ -z "$liboci_lib" ]; then
    liboci_root=
    liboci_include=

    $echo
    $echo "The libclntsh.so shared library not found."
    $echo
  fi

done

echo liboci_root := $liboci_root        > $1
echo liboci_include := $liboci_include  >>$1
echo liboci_lib := $liboci_lib          >>$1