e73f7b
From: Peter Lemenkov <lemenkov@gmail.com>
dd6e1a
Date: Thu, 14 Jun 2012 11:38:48 +0400
fa3f24
Subject: [PATCH] Cleanup Oracle's makefiles
e73f7b
e73f7b
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
e73f7b
e73f7b
diff --git a/modules/db_oracle/Makefile b/modules/db_oracle/Makefile
a63b79
index bd0d82a6e..d2e0f133f 100644
e73f7b
--- a/modules/db_oracle/Makefile
e73f7b
+++ b/modules/db_oracle/Makefile
aca7c2
@@ -6,77 +6,8 @@ include ../../Makefile.defs
e73f7b
 auto_gen=
e73f7b
 NAME=db_oracle.so
e73f7b
 
aca7c2
-SCRIPTS_DIR?=../../scripts/
aca7c2
-UTILS_DIR?=../../utils/
aca7c2
-
e73f7b
-# can be defined for non standard placement of oracle so's
e73f7b
-ORAPATH=
e73f7b
-LIBS=
e73f7b
-
e73f7b
-# use for multiple client sdk version install
e73f7b
-ifneq ($(ORAVERSION),)
e73f7b
-    ORAVERDIR=/$(ORAVERSION)
e73f7b
-endif
e73f7b
-
e73f7b
-# use include/library path's for full client installation
e73f7b
-ifneq ($(ORAHOME),)
e73f7b
-    DEFS +=-I$(ORAHOME)/include
e73f7b
-    LIBS +=-L$(ORAHOME)/lib
e73f7b
-ifeq ($(ORAPATH),)
e73f7b
-    ORAPATH=$(ORAHOME)/lib
e73f7b
-endif
e73f7b
-else
e73f7b
-# use standard know paths oci.h locations (linux)
e73f7b
-DEFS +=-I$(LOCALBASE)/include/oracle$(ORAVERDIR) \
e73f7b
-    -I$(SYSBASE)/include/oracle$(ORAVERDIR)
e73f7b
-endif
e73f7b
-
e73f7b
-# search 'so' path if it non standard (possible liboclntsh locations on linux)
e73f7b
-ifeq ($(ORAPATH),)
e73f7b
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/libocci.so ] && \
e73f7b
-	    echo $(LOCALBASE)/lib64/oracle$(ORAVERDIR) )
e73f7b
-endif
e73f7b
-ifeq ($(ORAPATH),)
e73f7b
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib64/oracle$(ORAVERDIR)/libocci.so ] && \
e73f7b
-	    echo $(SYSBASE)/lib64/oracle$(ORAVERDIR) )
e73f7b
-endif
e73f7b
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/lib )
b9a480
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib64/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(SYSBASE)/lib64/oracle$(ORAVERDIR)/lib )
b9a480
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib/oracle$(ORAVERDIR)/libocci.so ] && \
b9a480
-	    echo $(LOCALBASE)/lib/oracle$(ORAVERDIR) )
e73f7b
-endif
e73f7b
-ifeq ($(ORAPATH),)
e73f7b
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib/oracle$(ORAVERDIR)/libocci.so ] && \
e73f7b
-	    echo $(SYSBASE)/lib/oracle$(ORAVERDIR) )
e73f7b
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(LOCALBASE)/lib/oracle$(ORAVERDIR)/lib )
b9a480
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(SYSBASE)/lib/oracle$(ORAVERDIR)/lib )
b9a480
-endif
e73f7b
-
e73f7b
-ifneq ($(ORAPATH),)
e73f7b
-    LIBS +=-L$(ORAPATH)
e73f7b
-endif
e73f7b
-
dd6e1a
-LIBS +=-locci -lclntsh
dd6e1a
-
e73f7b
-#DEFS+=-DLINUX -D_GNU_SOURCE -D_REENTRANT
e73f7b
-#LIBS+=-lpthread
e73f7b
-
dd6e1a
-ifneq ($(ORAPATH),)
dd6e1a
-    LIBS +=-Wl,-rpath $(ORAPATH)
dd6e1a
-endif
dd6e1a
+DEFS +=-I$(ORAHOME)/include
dd6e1a
+LIBS +=-L$(ORAHOME)/lib -locci -lclntsh
dd6e1a
 
e73f7b
 include ../../Makefile.modules
aca7c2
 
dd6e1a
diff --git a/utils/db_oracle/Makefile b/utils/db_oracle/Makefile
a63b79
index 1f1af8ed6..956513423 100644
dd6e1a
--- a/utils/db_oracle/Makefile
dd6e1a
+++ b/utils/db_oracle/Makefile
b9a480
@@ -10,72 +10,8 @@ NAME=opensips_orasel
dd6e1a
 
dd6e1a
 include ../../Makefile.sources
dd6e1a
 
dd6e1a
-ORAPATH=
dd6e1a
-
dd6e1a
-# use for multiple client sdk version install
dd6e1a
-ifneq ($(ORAVERSION),)
dd6e1a
-    ORAVERDIR=/$(ORAVERSION)
dd6e1a
-endif
dd6e1a
-
dd6e1a
-# use include/library path's for full client installation
dd6e1a
-ifneq ($(ORAHOME),)
dd6e1a
-    DEFS +=-I$(ORAHOME)/include
dd6e1a
-    LIBS +=-L$(ORAHOME)/lib
dd6e1a
-ifeq ($(ORAPATH),)
dd6e1a
-    ORAPATH=$(ORAHOME)/lib
dd6e1a
-endif
dd6e1a
-else
dd6e1a
-# use standard know paths oci.h locations (linux)
dd6e1a
-    DEFS +=-I$(LOCALBASE)/include/oracle$(ORAVERDIR) \
dd6e1a
-	-I$(SYSBASE)/include/oracle$(ORAVERDIR)
dd6e1a
-endif
dd6e1a
-
dd6e1a
-# search 'so' path if it non standard (possible liboclntsh locations on linux)
dd6e1a
-ifeq ($(ORAPATH),)
dd6e1a
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/libocci.so ] && \
dd6e1a
-	    echo $(LOCALBASE)/lib64/oracle$(ORAVERDIR) )
dd6e1a
-endif
dd6e1a
-ifeq ($(ORAPATH),)
dd6e1a
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib64/oracle$(ORAVERDIR)/libocci.so ] && \
dd6e1a
-	    echo $(SYSBASE)/lib64/oracle$(ORAVERDIR) )
dd6e1a
-endif
dd6e1a
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/lib )
b9a480
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib64/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(SYSBASE)/lib64/oracle$(ORAVERDIR)/lib )
b9a480
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib/oracle$(ORAVERDIR)/libocci.so ] && \
b9a480
-	    echo $(LOCALBASE)/lib/oracle$(ORAVERDIR) )
dd6e1a
-endif
dd6e1a
-ifeq ($(ORAPATH),)
dd6e1a
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib/oracle$(ORAVERDIR)/libocci.so ] && \
dd6e1a
-	    echo $(SYSBASE)/lib/oracle$(ORAVERDIR) )
dd6e1a
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(LOCALBASE)/lib/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(LOCALBASE)/lib/oracle$(ORAVERDIR)/lib )
b9a480
-endif
b9a480
-ifeq ($(ORAPATH),)
b9a480
-    ORAPATH=$(shell [ -f $(SYSBASE)/lib/oracle$(ORAVERDIR)/lib/libocci.so ] && \
b9a480
-	    echo $(SYSBASE)/lib/oracle$(ORAVERDIR)/lib )
b9a480
-endif
dd6e1a
-
dd6e1a
-ifneq ($(ORAPATH),)
dd6e1a
-    LIBS +=-L$(ORAPATH)
dd6e1a
-endif
dd6e1a
-
dd6e1a
-LIBS +=-locci -lclntsh
dd6e1a
-
dd6e1a
-#DEFS +=-DLINUX -D_GNU_SOURCE -D_REENTRANT
dd6e1a
-#LIBS +=-lpthread
dd6e1a
-
dd6e1a
-ifneq ($(ORAPATH),)
dd6e1a
-    LIBS +=-Wl,-rpath $(ORAPATH)
dd6e1a
-endif
dd6e1a
+DEFS +=-I$(ORAHOME)/include
dd6e1a
+LIBS +=-L$(ORAHOME)/lib -locci -lclntsh
dd6e1a
 
dd6e1a
 include ../../Makefile.rules
dd6e1a