summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--php/config/Make.rules57
1 files changed, 34 insertions, 23 deletions
diff --git a/php/config/Make.rules b/php/config/Make.rules
index a669dad73b8..a3647651d4c 100644
--- a/php/config/Make.rules
+++ b/php/config/Make.rules
@@ -51,14 +51,43 @@ embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
# your system, then you likely need to review the values of
# PHP_INCLUDE_DIR and PHP_LIB_DIR.
#
+
PHP_HOME ?= /opt/php
+UNAME := $(shell uname)
+
+#
+# Locate and load platform specific definitions.
+#
+ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
+ configdir = $(top_srcdir)/config
+else
+ configdir = $(ICE_HOME)/config
+endif
+
+include $(configdir)/Make.rules.$(UNAME)
+
+#
+# Verifies the PHP_HOME is valid and attempts to adjust for platform variances
+# in install directories. SuSE installs into 'php5' while Redhat installs to
+# php.
+#
ifeq ($(shell test -d $(PHP_HOME) && echo 0),0)
- PHP_INCLUDE_DIR = $(PHP_HOME)/include/php
- PHP_LIB_DIR = $(PHP_HOME)/lib/php
+ ifeq ($(shell test -d $(PHP_HOME)/include/php5 && echo 0),0)
+ PHP_INCLUDE_DIR = $(PHP_HOME)/include/php5
+ PHP_LIB_DIR = $(PHP_HOME)/lib$(lp64suffix)/php5
+ else
+ PHP_INCLUDE_DIR = $(PHP_HOME)/include/php
+ PHP_LIB_DIR = $(PHP_HOME)/lib$(lp64suffix)/php
+ endif
else
- PHP_INCLUDE_DIR = /usr/include/php
- PHP_LIB_DIR = /usr/lib/php
+ ifeq ($(shell test -d /usr/include/php5 && echo 0),0)
+ PHP_INCLUDE_DIR = /usr/include/php5
+ PHP_LIB_DIR = /usr/lib$(lp64suffix)/php5
+ else
+ PHP_INCLUDE_DIR = /usr/include/php
+ PHP_LIB_DIR = /usr/lib$(lp64suffix)/php
+ endif
endif
PHP_FLAGS ?= -I$(PHP_INCLUDE_DIR) -I$(PHP_INCLUDE_DIR)/main -I$(PHP_INCLUDE_DIR)/Zend \
@@ -84,18 +113,6 @@ INSTALL_PROGRAM = ${INSTALL}
INSTALL_LIBRARY = ${INSTALL}
INSTALL_DATA = ${INSTALL}
-UNAME := $(shell uname)
-
-#
-# Platform specific definitions
-#
-ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
- configdir = $(top_srcdir)/config
-else
- configdir = $(ICE_HOME)/config
-endif
-include $(configdir)/Make.rules.$(UNAME)
-
ifeq ($(LP64),yes)
ICE_LIBS = -L$(ICE_HOME)/lib64 -L$(ICE_HOME)/lib -lIce -lIceUtil -lSlice
else
@@ -115,17 +132,11 @@ ifeq ($(LP64),yes)
# TODO: Where should the shared library be installed if it is a 64 bit
# build.
#
- install_libdir = $(prefix)/lib
+ install_libdir = $(prefix)/lib$(lp64suffix)
else
install_libdir = $(prefix)/lib
endif
-ifeq ($(LP64),yes)
- libsubdir := lib$(lp64suffix)
-else
- libsubdir := lib
-endif
-
ifneq ($(embedded_runpath_prefix),)
ifeq ($(LP64),yes)
runpath_libdir := $(embedded_runpath_prefix)/lib$(lp64suffix)