components/php-5_3/common.mk
changeset 4987 6a82655eda42
parent 4986 90a869b3f47a
child 4988 4b69c7c7e09b
equal deleted inserted replaced
4986:90a869b3f47a 4987:6a82655eda42
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     4 # The contents of this file are subject to the terms of the
       
     5 # Common Development and Distribution License (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 # Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
       
    22 #
       
    23 
       
    24 PHP_REL=		5.3
       
    25 APACHE_VERSION_DIR=	2.2
       
    26 
       
    27 TOP_DIR=/usr/php/$(PHP_REL)
       
    28 CONF_DIR=/etc/php/$(PHP_REL)
       
    29 ZTS_MODULES_DIR=$(TOP_DIR)/zts-modules
       
    30 
       
    31 APACHE_DIR_PREFIX=apache2/$(APACHE_VERSION_DIR)
       
    32 APACHE_USR_PREFIX=/usr/$(APACHE_DIR_PREFIX)
       
    33 APACHE_VAR_PREFIX=/var/$(APACHE_DIR_PREFIX)
       
    34 APACHE_ETC_PREFIX=/etc/$(APACHE_DIR_PREFIX)
       
    35 APACHE2_SAMPLES_CONFDIR=$(APACHE_ETC_PREFIX)/samples-conf.d
       
    36 APACHE2_CONFDIR=$(APACHE_ETC_PREFIX)/conf.d
       
    37 APACHE2_PHP=$(APACHE2_CONFDIR)/php
       
    38 APACHE2_EXTDIR=$(APACHE_USR_PREFIX)/libexec
       
    39 PHP_ROOT=/usr/php/$(PHP_REL)
       
    40 PHP_BIN=$(PHP_ROOT)/bin
       
    41 PHP_LIB=$(PHP_ROOT)/lib
       
    42 PHP_ROOT_EXT=$(PHP_ROOT)/modules
       
    43 PHP_ROOT_ZTS_EXT=$(PHP_ROOT)/zts-modules
       
    44 EXTDIR=$(TOP_DIR)/modules
       
    45 CONFDIR=/etc/php/$(PHP_REL)
       
    46 MODULES_CONFDIR=$(CONFDIR)/conf.d
       
    47 NSAPI_CONFDIR=/etc/php/$(PHP_REL)/nsapi
       
    48 ZTS_MODULES_CONFDIR=$(CONFDIR)/zts-conf.d
       
    49 COPYRIGHT_TMPL=$(COMPONENT_DIR)/../Solaris/copyright.tmpl
       
    50 DOCDIR=$(PHP_ROOT)/doc
       
    51 SCRIPTS_DIR=$(PHP_ROOT)/samples/scripts
       
    52 
       
    53 IMAP_DIR = $(COMPONENT_DIR)/../imap/build/$(MACH32)
       
    54 IMAP_CLIENT_DIR = $(IMAP_DIR)/c-client
       
    55 MODULES_DIR = $(TOP_DIR)/modules
       
    56 MODULES_CONF_DIR=$(CONF_DIR)/conf.d
       
    57 MYSQL_DIR = /usr/mysql
       
    58 MYSQL_LIBDIR=/usr/mysql/lib/mysql
       
    59 PHP_SAPI_BUILD = $(COMPONENT_DIR)/../php-sapi/build/$(MACH32)
       
    60 PEAR_DIR=/var/php/$(PHP_REL)/pear
       
    61 
       
    62 
       
    63 COMMON_CONFIG_OPTIONS= \
       
    64 	--bindir=$(TOP_DIR)/bin \
       
    65 	--datadir=$(TOP_DIR)/share \
       
    66 	--disable-dbase \
       
    67 	--disable-debug \
       
    68 	--disable-dmalloc  \
       
    69 	--disable-inline-optimization \
       
    70 	--disable-libgcc \
       
    71 	--disable-libtool-lock \
       
    72 	--disable-rpath \
       
    73 	--disable-static \
       
    74 	--enable-bcmath \
       
    75 	--enable-calendar \
       
    76 	--enable-ctype \
       
    77 	--enable-cli \
       
    78 	--enable-dom \
       
    79 	--enable-dtrace \
       
    80 	--enable-exif \
       
    81 	--enable-flatfile \
       
    82 	--enable-filter \
       
    83 	--enable-gd-jis-conv \
       
    84 	--enable-gd-native-ttf \
       
    85 	--enable-hash \
       
    86 	--enable-inifile \
       
    87 	--enable-ipv6 \
       
    88 	--enable-json \
       
    89 	--enable-magic-quotes \
       
    90 	--enable-mbregex \
       
    91 	--enable-mbstring \
       
    92 	--enable-mod-charset \
       
    93 	--enable-pcntl \
       
    94 	--enable-posix \
       
    95 	--enable-reflection \
       
    96 	--with-libxml-dir=/usr \
       
    97 	--enable-libxml \
       
    98 	--enable-sqlite-utf8 \
       
    99 	--enable-session \
       
   100 	--enable-shared \
       
   101 	--enable-shmop \
       
   102 	--enable-short-tags \
       
   103 	--enable-simplexml \
       
   104 	--enable-soap \
       
   105 	--enable-sockets \
       
   106 	--enable-spl \
       
   107 	--enable-sysvmsg \
       
   108 	--enable-sysvsem \
       
   109 	--enable-sysvshm \
       
   110 	--enable-tokenizer \
       
   111 	--enable-xml \
       
   112 	--enable-xmlreader \
       
   113 	--enable-xmlwriter \
       
   114 	--enable-zend-multibyte \
       
   115 	--enable-zip \
       
   116 	--exec-prefix=$(TOP_DIR) \
       
   117 	--includedir=$(TOP_DIR)/include \
       
   118 	--libdir=$(TOP_DIR)/lib \
       
   119 	--libexecdir=$(TOP_DIR)/modules \
       
   120 	--mandir=$(TOP_DIR)/man \
       
   121 	--oldincludedir=$(TOP_DIR)/share \
       
   122 	--prefix=$(TOP_DIR) \
       
   123 	--sbindir=$(TOP_DIR)/sbin \
       
   124 	--sysconfdir=$(CONF_DIR) \
       
   125 	--with-cdb \
       
   126 	--with-exec-dir=$(TOP_DIR)/bin \
       
   127 	--with-freetype-dir=/usr/sfw \
       
   128 	--with-jpeg-dir=/usr \
       
   129 	--with-kerberos \
       
   130 	--with-layout=PHP \
       
   131 	--with-mcrypt=shared,/usr \
       
   132 	--with-pcre-dir=/usr \
       
   133 	--with-pcre-regex \
       
   134 	--with-png-dir=/usr \
       
   135 	--with-xmlrpc \
       
   136 	--with-xpm-dir=/usr/X11 \
       
   137 	--with-xsl \
       
   138 	--with-zlib \
       
   139 	--with-zend-vm=CALL \
       
   140 	--without-dbm \
       
   141 	--without-t1lib
       
   142 
       
   143 
       
   144 studio_C99MODE = $(studio_99_ENABLE)
       
   145 studio_cplusplus_C99MODE = $(studio_cplusplus_C99_ENABLE)
       
   146 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS
       
   147 CPPFLAGS += $(CPP_LARGEFILES)
       
   148 CPPFLAGS += -I../CPPFLAGSTEST
       
   149 LIBS = -lsocket -lnsl -ldl -lposix4
       
   150 LD = $(CXX) $(studio_NORUNPATH)
       
   151 LDFLAGS += -L$(MYSQL_LIBDIR) -lrt -L$(IMAP_CLIENT_DIR)
       
   152 
       
   153 ASLR_MODE = $(ASLR_ENABLE)
       
   154 
       
   155 CONFIGURE_OPTIONS  +=	CFLAGS="$(CFLAGS)"
       
   156 CONFIGURE_OPTIONS  +=	CPPFLAGS="$(CPPFLAGS)"
       
   157 CONFIGURE_OPTIONS  +=	LD="$(LD)"
       
   158 CONFIGURE_OPTIONS  +=	LDFLAGS="$(LDFLAGS)"
       
   159 CONFIGURE_OPTIONS  +=	PATH="$(PATH):/usr/sbin"
       
   160 
       
   161 CONF_ENVLINE += \
       
   162 	LIBS="$(LIBS)" \
       
   163 	EXTENSION_DIR=$(MODULES_DIR) \
       
   164 	PHP_PEAR_CACHE_DIR=/var/cache/php-pear \
       
   165 	PHP_PEAR_DOWNLOAD_DIR=/tmp/pear/download \
       
   166 	PHP_PEAR_EXTENSION_DIR=/var/php/$(PHP_REL)/modules \
       
   167 	PHP_PEAR_INSTALL_DIR=/var/php/$(PHP_REL)/pear \
       
   168 	PHP_PEAR_SIG_BIN=/usr/gnu/bin/gpg \
       
   169 	DESTDIR=$(PROTO_DIR) \
       
   170 	INSTALL_ROOT=$(PROTO_DIR) \
       
   171 	INSTALL=$(INSTALL)
       
   172 
       
   173 PHP_ZTS_CFLAGS=-mt -D_REENTRANT
       
   174 ZTS_MODULES_CONF_DIR=$(CONF_DIR)/zts-conf.d
       
   175 
       
   176 
       
   177 ZTS_CONF_ENVLINE= \
       
   178 	CC=$(CC) \
       
   179 	CXX=$(CXX) \
       
   180 	CPPFLAGS="-I../CPPFLAGSTEST -D_POSIX_PTHREAD_SEMANTICS" \
       
   181 	CFLAGS="$(CFLAGS) $(PHP_ZTS_CFLAGS)" \
       
   182 	LDFLAGS="-L$(MYSQL_LIBDIR) -lrt" \
       
   183 	LIBS="$(LIBS)" \
       
   184 	EXTENSION_DIR=$(ZTS_MODULES_DIR) \
       
   185 	DESTDIR=$(PROTO_DIR) \
       
   186 	INSTALL_ROOT=$(PROTO_DIR) \
       
   187 	INSTALL=$(INSTALL)
       
   188 
       
   189 ENVLINE= \
       
   190         $(CONF_ENVLINE)
       
   191 
       
   192 ZTS_ENVLINE= \
       
   193 	$(ZTS_CONF_ENVLINE)
       
   194 
       
   195 COMPONENT_BUILD_ENV += PATH="$(PATH):/usr/sbin"
       
   196 COMPONENT_INSTALL_ENV += $(CONFIGURE_ENV)
       
   197 
       
   198 COMPONENT_TEST_ENV += $(CONFIGURE_ENV)
       
   199 COMPONENT_TEST_TARGETS = test
       
   200 # Turns off question at the end of the test run.
       
   201 COMPONENT_TEST_ENV += NO_INTERACTION=1
       
   202 
       
   203 # We provide an .ini file for some extensions.
       
   204 # Extensions without .ini's get handled below.
       
   205 FIX_CONFIG_FILES = ( \
       
   206 	set -e; \
       
   207 	$(MKDIR) $(COMPONENT_DIR)/tmp; \
       
   208 	cd $(COMPONENT_DIR)/tmp; \
       
   209 	$(MKDIR) $(PROTO_DIR)/$(MODULES_CONFDIR); \
       
   210 	$(MKDIR) $(PROTO_DIR)/$(ZTS_MODULES_CONFDIR); \
       
   211 	for conffile in ../config/*.ini; do \
       
   212 		ext=$${conffile\#\#*/}; \
       
   213 		$(GSED) -e  "s@PHP_VERSION@$(PHP_REL)@" < $${conffile} > tmp; \
       
   214 		$(INSTALL) -m 644 tmp \
       
   215 			$(PROTO_DIR)/$(MODULES_CONFDIR)/$${ext}; \
       
   216 		$(GSED) -e "s@zend_extension=$(PHP_ROOT_EXT)@zend_extension=$(PHP_ROOT_ZTS_EXT)@" < tmp > tmp2; \
       
   217 		$(INSTALL) -m 644 tmp2 \
       
   218 			$(PROTO_DIR)/$(ZTS_MODULES_CONFDIR)/$${ext}; \
       
   219 	done; \
       
   220 	)
       
   221 
       
   222 
       
   223 # Create configuration files for those without.
       
   224 FIX_CONFIG_FILES_2 = ( \
       
   225 	set -e; \
       
   226 	$(MKDIR) $(COMPONENT_DIR)/tmp; \
       
   227 	cd $(COMPONENT_DIR)/tmp; \
       
   228 	$(MKDIR) $(PROTO_DIR)/$(MODULES_CONFDIR); \
       
   229 	$(MKDIR) $(PROTO_DIR)/$(ZTS_MODULES_CONFDIR); \
       
   230 	for module in $(PROTO_DIR)/$(EXTDIR)/*.so; do \
       
   231 		module=$${module%.so}; \
       
   232 		ext=$${module\#\#*/}; \
       
   233 		echo "extension=$${ext}.so" > $${ext}.ini; \
       
   234 		$(INSTALL) -m 644 $${ext}.ini \
       
   235 			$(PROTO_DIR)/$(MODULES_CONFDIR)/$${ext}.ini; \
       
   236 		$(INSTALL) -m 644 $${ext}.ini \
       
   237 			$(PROTO_DIR)/$(ZTS_MODULES_CONFDIR)/$${ext}.ini; \
       
   238 	done; \
       
   239 	)
       
   240 
       
   241 # See php-cgi/Makefile, php-nsapi/Makefile, php-sapi/Makefile for further
       
   242 # notes about testing php.
       
   243 
       
   244 # Test transforms to delete references to:
       
   245 #	remove everything before the first '============'
       
   246 # ============================================================
       
   247 # 	machine names and version
       
   248 # PHP_OS      : SunOS - SunOS slitheen 5.12 s12_70 sun4v
       
   249 #	time
       
   250 # TIME START 2015-04-14 01:21:42
       
   251 # Time taken      : 2410 seconds
       
   252 #	path to php
       
   253 # PHP         : /builds/cmohrman/userland_defau...
       
   254 #	the last output line
       
   255 # make[2]: Leaving directory `$(@D)'
       
   256 
       
   257 COMPONENT_TEST_TRANSFORMS += \
       
   258 	'-e "1,/^==========/d"' \
       
   259 	'-e "s/^PHP_OS.*$$//"' \
       
   260 	'-e "s/^TIME.*$$//"' \
       
   261 	'-e "s/^Time.*$$//"' \
       
   262 	'-e "s/^PHP   .*$$//"' \
       
   263 	'-e "\$$d"'
       
   264 
       
   265 # Use openldap
       
   266 # This is good enough to fool configure
       
   267 SOLARIS_OPENLDAP= CPPFLAGS="$(CPPFLAGS) -I/usr/include/openldap" \
       
   268 	LDFLAGS="$(LDFLAGS) -lldap_r"
       
   269 # but ensure "make" gets the point
       
   270 COMPONENT_BUILD_ARGS += LDAP_SHARED_LIBADD="-lldap_r"