components/php/phpize.mk
branchs11-update
changeset 4418 7ae5fd823a4b
equal deleted inserted replaced
4415:a4e14565d114 4418:7ae5fd823a4b
       
     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 
       
    22 #
       
    23 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 
       
    26 # This is a collection of Makefile lines needed for building PHP extensions
       
    27 # outside of the PHP source tree.  It is named for the "phpize" script, which
       
    28 # is the main deviation from the standard configure-make-install cycle.
       
    29 # This file should handle everything necessary for an extension whose upstream
       
    30 # expects the user to run "phpize" in order to create ./configure.
       
    31 
       
    32 # It relies on the Userland makefile for PHP creating modified versions of
       
    33 # phpize and php-config for use during Userland builds, and placing them under
       
    34 # $(PHP_BUNDLE_DIR)/proto-scripts. Therefore, it depends on gmake install of PHP
       
    35 
       
    36 # Usage:
       
    37 # include ../../../make-rules/shared-macros.mk [appropriate path]
       
    38 # include $(WS_COMPONENTS)/php/php-metadata.mk
       
    39 # [COMPONENT_* lines]
       
    40 # include $(WS_MAKE_RULES)/prep.mk
       
    41 # include $(WS_MAKE_RULES)/configure.mk
       
    42 # include $(PHP_TOP_DIR)/phpize.mk
       
    43 
       
    44 # Depends on having a built and intalled (prototype) version of PHP available
       
    45 $(BUILD_DIR_64)/.configured: $(PHP_BUILD_DIR_64)/.installed
       
    46 $(PHP_BUILD_DIR_64)/.installed:
       
    47 	cd $(PHP_BUNDLE_DIR) ; $(GMAKE) install ;
       
    48 
       
    49 include $(PHP_TOP_DIR)/php.mk
       
    50 
       
    51 COMPONENT_PRE_CONFIGURE_ACTION += \
       
    52 	$(GSED) -e "s|^builddir=.*|builddir=$(@D)|" \
       
    53 		< $(PHP_BUNDLE_DIR)/proto-scripts/phpize-proto \
       
    54 		> $(@D)/phpize-proto; \
       
    55 	chmod +x $(@D)/phpize-proto;
       
    56 
       
    57 # .tgz files from pecl contain this file
       
    58 CLEAN_PATHS += package.xml
       
    59 
       
    60 # The phpize script tries to copy some files into here, failing if the directory
       
    61 # doesn't exist.
       
    62 COMPONENT_PRE_CONFIGURE_ACTION += mkdir $(@D)/build;
       
    63 
       
    64 # phpize generates configure where it is run.
       
    65 COMPONENT_PRE_CONFIGURE_ACTION += $(CLONEY) $(SOURCE_DIR) $(@D) ;
       
    66 CONFIGURE_SCRIPT = $(@D)/configure
       
    67 COMPONENT_PRE_CONFIGURE_ACTION += cd $(@D) ; $(@D)/phpize-proto;
       
    68 
       
    69 # Change PHP_EXECUTABLE so that tests can run.
       
    70 PROTOUSRPHPVERDIR = $(PHP_PROTO_DIR)/$(CONFIGURE_PREFIX)
       
    71 COMPONENT_PRE_CONFIGURE_ACTION += \
       
    72 	$(GSED) -i -e "s@^PHP_EXECUTABLE=.*@PHP_EXECUTABLE=$(PROTOUSRPHPVERDIR)/bin/php@" \
       
    73 		$(CONFIGURE_SCRIPT) ;
       
    74 
       
    75 COMPONENT_PRE_CONFIGURE_ACTION += \
       
    76 		cp $(PHP_BUNDLE_DIR)/proto-scripts/php-config-proto $(@D) ;
       
    77 CONFIGURE_OPTIONS += --with-php-config=$(@D)/php-config-proto
       
    78