[icinga-checkins] icinga.org: icinga-core/mfriedrich/ocilib: modify configure to set LD_LIBRARY_PATH to link against ocilib at runtime (init script)

git at icinga.org git at icinga.org
Mon Oct 19 02:08:54 CEST 2009


Module: icinga-core
Branch: mfriedrich/ocilib
Commit: 4e7871d542c684da62e46546d77f31d1104a62a1
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=4e7871d542c684da62e46546d77f31d1104a62a1

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Mon Sep 28 18:39:31 2009 +0200

modify configure to set LD_LIBRARY_PATH to link against ocilib at runtime (init script)

---

 configure    |   10 +++++++++-
 configure.in |   13 ++++++++++++-
 rc.ido2db.in |    5 ++++-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index e7c4bee..47f5975 100755
--- a/configure
+++ b/configure
@@ -715,6 +715,7 @@ DBLIBS
 icinga_name
 icingastats_name
 ido2db_name
+ido2db_runtime
 PATH_TO_TRACEROUTE
 PACKDIR
 VERSION
@@ -7686,6 +7687,9 @@ _ACEOF
 
 fi
 
+
+OCILIB_LIB=""
+
 USE_IDOUTILS=no
 # Check whether --enable-idoutils was given.
 if test "${enable_idoutils+set}" = set; then
@@ -7803,7 +7807,8 @@ fi
 				OCILIB_INC="/usr/local/include"
 		OCILIB_LIB="/usr/local/lib"
 
-		CFLAGS="$CFLAGS -I$OCILIB_INC -DOCI_IMPORT_UNICODE -DOCI_CHARSET_UNICODE"
+
+		CFLAGS="$CFLAGS -I$OCILIB_INC -DOCI_IMPORT_RUNTIME -DOCI_CHARSET_UNICODE"
 		LDFLAGS="$LDFLAGS -L$OCILIB_LIB"
 
 				#AC_CHECK_HEADER(ocilib.h, [], [], [${OCILIB_INC}])
@@ -7985,6 +7990,8 @@ fi
 
 
 
+ido2db_runtime="$OCILIB_LIB"
+
 
 
 # Extract the first word of "traceroute", so it can be a program name with args.
@@ -9052,6 +9059,7 @@ DBLIBS!$DBLIBS$ac_delim
 icinga_name!$icinga_name$ac_delim
 icingastats_name!$icingastats_name$ac_delim
 ido2db_name!$ido2db_name$ac_delim
+ido2db_runtime!$ido2db_runtime$ac_delim
 PATH_TO_TRACEROUTE!$PATH_TO_TRACEROUTE$ac_delim
 PACKDIR!$PACKDIR$ac_delim
 VERSION!$VERSION$ac_delim
diff --git a/configure.in b/configure.in
index ea2e189..38984b5 100644
--- a/configure.in
+++ b/configure.in
@@ -649,6 +649,10 @@ if test x$USE_EVENTBROKER = xyes; then
 fi
 
 dnl Configure IDOUtils
+
+dnl set dummy for ocilib
+OCILIB_LIB=""
+
 USE_IDOUTILS=no
 AC_ARG_ENABLE(idoutils,AC_HELP_STRING([--enable-idoutils],[enables database connectivity using idoutils]),USE_IDOUTILS=$enableval,USE_IDOUTILS=no)
 if test x$USE_IDOUTILS = xyes; then
@@ -686,7 +690,11 @@ if test x$USE_IDOUTILS = xyes; then
 		OCILIB_INC="/usr/local/include"
 		OCILIB_LIB="/usr/local/lib"
 
-		CFLAGS="$CFLAGS -I$OCILIB_INC -DOCI_IMPORT_UNICODE -DOCI_CHARSET_UNICODE"
+		dnl create ido2db_runtime for rc.ido2db.in
+		dnl ido2db_runtime="$OCILIB_LIB"
+		dnl AC_SUBST(ido2db_runtime)
+
+		CFLAGS="$CFLAGS -I$OCILIB_INC -DOCI_IMPORT_RUNTIME -DOCI_CHARSET_UNICODE"
 		LDFLAGS="$LDFLAGS -L$OCILIB_LIB"
 
 		dnl check and include ocilib.h
@@ -775,6 +783,9 @@ AC_SUBST(icinga_name)
 AC_SUBST(icingastats_name)
 AC_SUBST(ido2db_name)
 
+dnl create ido2db_runtime for rc.ido2db.in
+ido2db_runtime="$OCILIB_LIB"
+AC_SUBST(ido2db_runtime)
 
 dnl Should predictive failure routines be compiled in?
 dnl AC_ARG_ENABLE(failure-prediction,AC_HELP_STRING([--enable-failure-prediction],[will enable integration with failure prediction module (NOT HERE YET!)]),[
diff --git a/rc.ido2db.in b/rc.ido2db.in
index b568c75..6fd6759 100644
--- a/rc.ido2db.in
+++ b/rc.ido2db.in
@@ -107,7 +107,10 @@ Ido2dbLockDir=/var/lock/subsys
 Ido2dbLockFile=@ido2db_name@
 Ido2dbUser=@icinga_user@
 Ido2dbGroup=@icinga_grp@
-          
+
+#add ocilib lib path to link at runtime if enabled
+LD_LIBRARY_PATH=@ido2db_runtime@
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
 
 # Check that ido2db exists.
 if [ ! -f $Ido2dbBin ]; then





More information about the icinga-checkins mailing list