aboutsummaryrefslogtreecommitdiff
path: root/build/import
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-11-11 13:55:23 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-16 12:48:18 +0200
commit1e92015c3ebdeb3050f389e2fda5484c1d50a98d (patch)
tree6042ccc4713d63a066ea8643f4fafd093346ceec /build/import
parent5b7ab91905867794c671d0eb64321f85d9afd5dd (diff)
Allow Instant Client installation to be specified during configuration
Diffstat (limited to 'build/import')
-rwxr-xr-xbuild/import/liboci/configure43
-rw-r--r--build/import/liboci/rules.make10
2 files changed, 46 insertions, 7 deletions
diff --git a/build/import/liboci/configure b/build/import/liboci/configure
index ca05a06..1fa54f7 100755
--- a/build/import/liboci/configure
+++ b/build/import/liboci/configure
@@ -19,9 +19,46 @@ $echo "Configuring external dependency on 'OCI library' for '$project_name'."
$echo
$echo
-$echo "Please enter the 'Oracle' home directory."
+$echo "Please enter the 'Oracle' home or Instant Client directory."
$echo
-liboci_root=`read_path --directory --exist $ORACLE_HOME`
+liboci_root=$ORACLE_HOME
+liboci_include=
+liboci_lib=
-echo liboci_root := $liboci_root >$1
+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`
+ 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=
+
+ $echo
+ $echo "The libclntsh shared library cannot be found."
+ $echo
+ fi
+
+done
+
+echo liboci_root := $liboci_root > $1
+echo liboci_include := $liboci_include >>$1
+echo liboci_lib := $liboci_lib >>$1
diff --git a/build/import/liboci/rules.make b/build/import/liboci/rules.make
index 6c980b4..2376ba3 100644
--- a/build/import/liboci/rules.make
+++ b/build/import/liboci/rules.make
@@ -4,14 +4,16 @@
# license : ODB NCUEL; see accompanying LICENSE file
$(dcf_root)/import/liboci/%: root := $(liboci_root)
+$(dcf_root)/import/liboci/%: include := $(liboci_include)
+$(dcf_root)/import/liboci/%: lib := $(liboci_lib)
$(dcf_root)/import/liboci/oci.l: | $(dcf_root)/import/liboci/.
-$(dcf_root)/import/liboci/oci.l: $(liboci_root)/lib/libclntsh.so
- @echo $< >$@
- @echo rpath:$(root)/lib >>$@
+$(dcf_root)/import/liboci/oci.l: $(liboci_lib)
+ @echo $(lib) >$@
+ @echo rpath:$(dir $(lib)) >>$@
$(dcf_root)/import/liboci/oci.l.cpp-options: | $(dcf_root)/import/liboci/.
- @echo include: -I$(root)/rdbms/public >$@
+ @echo include: -I$(include) >$@
ifndef %foreign%