Changeset 25673


Ignore:
Timestamp:
2011-02-23T23:24:30+01:00 (7 years ago)
Author:
florian
Message:

[package] php5: first steps to simplify the Makefile

  • Introduce /etc/php5 which is scanned for additional configuration files. So it is possible that a installed modules is automatically enabled without the need to modify the php.ini.
  • Remove unsupported config option: --disable-ttf
  • Add support for SimpleXML module, closes #7758.
  • Add support for PCNTL module.
  • Modularize System V stuff.
  • Rename BuildPlugin to BuildModule which IMHO fits better to the commonly used terminology of "PHP module".

Signed-off-by: Michael Heimpold <mhei@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/lang/php5/Makefile

    r25319 r25673  
    3131 
    3232define Package/php5/Default/description 
    33  PHP is a widely-used general-purpose scripting language that is especially  
    34  suited for Web development and can be embedded into HTML. 
     33  PHP is a widely-used general-purpose scripting language that is especially  
     34  suited for Web development and can be embedded into HTML. 
    3535endef 
    3636 
     
    4646        config PHP5_LIBXML 
    4747                bool "PHP5 LIBXML support" 
    48                 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    49  
    50         config PHP5_SYSVIPC 
    51                 bool "PHP5 Semaphore, Shared Memory and IPC support" 
    5248                depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    5349endef 
     
    6258 
    6359define Package/php5/description 
    64 $(call Package/php5/Default/description) 
    65  This package contains only the PHP config file. You must actually choose  
    66  your PHP flavour (cli, cgi or fastcgi). 
     60  $(call Package/php5/Default/description) 
     61  This package contains only the PHP config file. You must actually choose  
     62  your PHP flavour (cli, cgi or fastcgi). 
    6763endef 
    6864 
     
    7470 
    7571define Package/php5-cli/description 
    76 $(call Package/php5/Default/description) 
    77  This package contains the CLI version of the PHP5 interpreter. 
     72  (call Package/php5/Default/description) 
     73  This package contains the CLI version of the PHP5 interpreter. 
    7874endef 
    7975 
     
    8581 
    8682define Package/php5-cgi/description 
    87 $(call Package/php5/Default/description) 
    88  This package contains the CGI version of the PHP5 interpreter. 
     83  $(call Package/php5/Default/description) 
     84  This package contains the CGI version of the PHP5 interpreter. 
    8985endef 
    9086 
     
    9692 
    9793define Package/php5-cgi/description 
    98 As FastCGI support is now a core feature the php5-fastcgi package now depends 
    99 on the php5-cgi package, containing just the startup script. 
    100 endef 
    101  
    102 define Package/php5-mod-ctype 
    103   $(call Package/php5/Default) 
    104   DEPENDS:=php5 
    105   TITLE:=ctype shared module 
    106 endef 
    107 define Package/php5-mod-ctype/config 
    108   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    109 endef 
    110  
    111 define Package/php5-mod-curl 
    112   $(call Package/php5/Default) 
    113   DEPENDS:=php5 +libcurl 
    114   TITLE:=cURL shared module 
    115 endef 
    116 define Package/php5-mod-curl/config 
    117   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    118 endef 
    119  
    120 define Package/php5-mod-fileinfo 
    121   $(call Package/php5/Default) 
    122   DEPENDS:=php5 +libmagic 
    123   TITLE:=Fileinfo shared module 
    124 endef 
    125 define Package/php5-mod-fileinfo/config 
    126   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    127 endef 
    128  
    129 define Package/php5-mod-dom 
    130   $(call Package/php5/Default) 
    131   DEPENDS:=php5 +libxml2 
    132   TITLE:=DOM shared module 
    133 endef 
    134 define Package/php5-mod-dom/config 
    135   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    136   depends on PHP5_LIBXML 
    137 endef 
    138  
    139 define Package/php5-mod-exif 
    140   $(call Package/php5/Default) 
    141   DEPENDS:=php5 
    142   TITLE:=EXIF shared module 
    143 endef 
    144 define Package/php5-mod-exif/config 
    145   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    146 endef 
    147  
    148 define Package/php5-mod-ftp 
    149   $(call Package/php5/Default) 
    150   DEPENDS:=php5 
    151   TITLE:=FTP shared module 
    152 endef 
    153 define Package/php5-mod-ftp/config 
    154   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    155 endef 
    156  
    157 define Package/php5-mod-gd 
    158   $(call Package/php5/Default) 
    159   DEPENDS:=php5 +libgd 
    160   TITLE:=GD graphics shared module 
    161 endef 
    162 define Package/php5-mod-gd/config 
    163   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    164 endef 
    165  
    166 define Package/php5-mod-gmp 
    167   $(call Package/php5/Default) 
    168   DEPENDS:=php5 +libgmp 
    169   TITLE:=GMP shared module 
    170 endef 
    171 define Package/php5-mod-gmp/config 
    172   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    173 endef 
    174  
    175 define Package/php5-mod-hash 
    176   $(call Package/php5/Default) 
    177   DEPENDS:=php5 
    178   TITLE:=Hash shared module 
    179 endef 
    180 define Package/php5-mod-hash/config 
    181   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    182 endef 
    183  
    184 define Package/php5-mod-iconv 
    185   $(call Package/php5/Default) 
    186   DEPENDS:=php5 $(ICONV_DEPENDS) 
    187   TITLE:=iConv shared module 
    188 endef 
    189 define Package/php5-mod-iconv/config 
    190   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    191 endef 
    192  
    193 define Package/php5-mod-json 
    194   $(call Package/php5/Default) 
    195   DEPENDS:=php5 
    196   TITLE:=JSON shared module 
    197 endef 
    198 define Package/php5-mod-json/config 
    199   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    200 endef 
    201  
    202 define Package/php5-mod-ldap 
    203   $(call Package/php5/Default) 
    204   DEPENDS:=php5 +libopenldap +libsasl2 
    205   TITLE:=LDAP shared module 
    206 endef 
    207 define Package/php5-mod-ldap/config 
    208   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    209 endef 
    210  
    211 define Package/php5-mod-mbstring 
    212   $(call Package/php5/Default) 
    213   DEPENDS:=php5 
    214   TITLE:=MBString shared module 
    215 endef 
    216 define Package/php5-mod-mbstring/config 
    217   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    218 endef 
    219  
    220 define Package/php5-mod-mcrypt 
    221   $(call Package/php5/Default) 
    222   DEPENDS:=php5 +libmcrypt +libltdl 
    223   TITLE:=mcrypt shared module 
    224 endef 
    225 define Package/php5-mod-mcrypt/config 
    226   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    227 endef 
    228  
    229 define Package/php5-mod-mysql 
    230   $(call Package/php5/Default) 
    231   DEPENDS:=php5 +libmysqlclient 
    232   TITLE:=MySQL shared module 
    233 endef 
    234 define Package/php5-mod-mysql/config 
    235   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    236 endef 
    237  
    238 define Package/php5-mod-openssl 
    239   $(call Package/php5/Default) 
    240   DEPENDS:=php5 +libopenssl 
    241   TITLE:=OpenSSL shared module 
    242 endef 
    243 define Package/php5-mod-openssl/config 
    244   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    245 endef 
    246  
    247 define Package/php5-mod-pdo 
    248   $(call Package/php5/Default) 
    249   DEPENDS:=php5 
    250   TITLE:=PHP Data Objects shared module 
    251 endef 
    252 define Package/php5-mod-pdo/config 
    253   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    254 endef 
    255  
    256 define Package/php5-mod-pdo-mysql 
    257   $(call Package/php5/Default) 
    258   DEPENDS:=php5-mod-pdo +libmysqlclient 
    259   TITLE:=PDO driver for MySQL 
    260 endef 
    261  
    262 define Package/php5-mod-pdo-pgsql 
    263   $(call Package/php5/Default) 
    264   DEPENDS:=php5-mod-pdo +libpq 
    265   TITLE:=PDO driver for PostgreSQL 
    266 endef 
    267  
    268 define Package/php5-mod-pdo-sqlite 
    269   $(call Package/php5/Default) 
    270   DEPENDS:=php5-mod-pdo +libsqlite3 +libpthread 
    271   TITLE:=PDO driver for SQLite (3.x) 
    272 endef 
    273  
    274 define Package/php5-mod-pgsql 
    275   $(call Package/php5/Default) 
    276   DEPENDS:=php5 +libpq 
    277   TITLE:=PostgreSQL shared module 
    278 endef 
    279 define Package/php5-mod-pgsql/config 
    280   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    281 endef 
    282  
    283 define Package/php5-mod-session 
    284   $(call Package/php5/Default) 
    285   DEPENDS:=php5 
    286   TITLE:=Session shared module 
    287 endef 
    288 define Package/php5-mod-session/config 
    289   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    290 endef 
    291  
    292 define Package/php5-mod-soap 
    293   $(call Package/php5/Default) 
    294   DEPENDS:=php5 +libxml2 
    295   TITLE:=SOAP shared module 
    296 endef 
    297 define Package/php5-mod-soap/config 
    298   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    299   depends on PHP5_LIBXML 
    300 endef 
    301  
    302 define Package/php5-mod-sockets 
    303   $(call Package/php5/Default) 
    304   DEPENDS:=php5 
    305   TITLE:=Sockets shared module 
    306 endef 
    307 define Package/php5-mod-sockets/config 
    308   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    309 endef 
    310  
    311 define Package/php5-mod-sqlite 
    312   $(call Package/php5/Default) 
    313   DEPENDS:=php5 +libsqlite2 
    314   TITLE:=SQLite shared module (2.x) 
    315 endef 
    316 define Package/php5-mod-sqlite/config 
    317   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    318 endef 
    319  
    320 define Package/php5-mod-sqlite3 
    321   $(call Package/php5/Default) 
    322   DEPENDS:=php5 +libsqlite3 +libpthread 
    323   TITLE:=SQLite3 shared module (3.x) 
    324 endef 
    325 define Package/php5-mod-sqlite3/config 
    326   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    327 endef 
    328  
    329 define Package/php5-mod-tokenizer 
    330   $(call Package/php5/Default) 
    331   DEPENDS:=php5 
    332   TITLE:=Tokenizer shared module 
    333 endef 
    334 define Package/php5-mod-tokenizer/config 
    335   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    336 endef 
    337  
    338 define Package/php5-mod-xml 
    339   $(call Package/php5/Default) 
    340   DEPENDS:=php5 
    341   ifneq ($(CONFIG_PHP5_LIBXML),) 
    342     DEPENDS+= +libxml2 
    343   else 
    344     DEPENDS+= +libexpat 
    345   endif 
    346   TITLE:=XML shared module 
    347 endef 
    348 define Package/php5-mod-xml/config 
    349   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    350 endef 
    351  
    352 define Package/php5-mod-xmlreader 
    353   $(call Package/php5/Default) 
    354   DEPENDS:=php5 +libxml2 $(ICONV_DEPENDS) 
    355   TITLE:=XMLReader shared module 
    356 endef 
    357 define Package/php5-mod-xmlreader/config 
    358   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    359   depends on PHP5_LIBXML 
    360 endef 
    361  
    362 define Package/php5-mod-xmlwriter 
    363   $(call Package/php5/Default) 
    364   DEPENDS:=php5 +libxml2 $(ICONV_DEPENDS) 
    365   TITLE:=XMLWriter shared module 
    366 endef 
    367   define Package/php5-mod-xmlwriter/config 
    368   depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
    369   depends on PHP5_LIBXML 
     94   As FastCGI support is now a core feature the php5-fastcgi package now depends 
     95   on the php5-cgi package, containing just the startup script. 
    37096endef 
    37197 
     
    381107        \ 
    382108        --with-config-file-path=/etc \ 
     109        --with-config-file-scan-dir=/etc/php5 \ 
    383110        --enable-magic-quotes \ 
    384111        --disable-short-tags \ 
     
    450177        --with-png-dir="$(STAGING_DIR)/usr" \ 
    451178        --without-xpm-dir \ 
    452         --without-ttf \ 
    453179        --without-t1lib \ 
    454180        --enable-gd-native-ttf \ 
     
    513239else 
    514240  PKG_CONFIGURE_OPTS+= --without-openssl 
     241endif 
     242 
     243ifneq ($(CONFIG_PACKAGE_php5-mod-pcntl),) 
     244  PKG_CONFIGURE_OPTS+= --enable-pcntl=shared 
     245else 
     246  PKG_CONFIGURE_OPTS+= --disable-pcntl 
    515247endif 
    516248 
     
    574306endif 
    575307 
     308ifneq ($(CONFIG_PACKAGE_php5-mod-sysvmsg),) 
     309  PKG_CONFIGURE_OPTS+= --enable-sysvmsg=shared 
     310else 
     311  PKG_CONFIGURE_OPTS+= --disable-sysvmsg 
     312endif 
     313 
     314ifneq ($(CONFIG_PACKAGE_php5-mod-sysvsem),) 
     315  PKG_CONFIGURE_OPTS+= --enable-sysvsem=shared 
     316else 
     317  PKG_CONFIGURE_OPTS+= --disable-sysvsem 
     318endif 
     319 
     320ifneq ($(CONFIG_PACKAGE_php5-mod-sysvshm),) 
     321  PKG_CONFIGURE_OPTS+= --enable-sysvshm=shared 
     322else 
     323  PKG_CONFIGURE_OPTS+= --disable-sysvshm 
     324endif 
     325 
    576326ifneq ($(CONFIG_PACKAGE_php5-mod-tokenizer),) 
    577327  PKG_CONFIGURE_OPTS+= --enable-tokenizer=shared 
     
    623373endif 
    624374 
    625 ifneq ($(CONFIG_PHP5_SYSVIPC),) 
    626   PKG_CONFIGURE_OPTS+= --enable-sysvsem --enable-sysvshm --enable-sysvmsg 
    627 else 
    628   PKG_CONFIGURE_OPTS+= --disable-sysvsem --disable-sysvshm --disable-sysvmsg 
    629 endif 
    630375 
    631376define Build/Configure 
     
    698443endef 
    699444 
    700 define BuildPlugin 
    701   define Package/$(1)/install 
    702         [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/php 
    703         for m in $(2); do \ 
    704                 [ -z "$(CONFIG_PACKAGE_$(1))" ] \ 
    705                          || $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \ 
    706         done 
     445PHP5_MODULES:= 
     446 
     447define BuildModule 
     448  define Package/php5-mod-$(1) 
     449    $(call Package/php5/Default) 
     450    ifneq ($(3),) 
     451      DEPENDS:=$(3) 
     452    else 
     453      DEPENDS:=php5 
     454    endif 
     455    TITLE:=$(2) shared module 
    707456  endef 
    708457 
    709   $$(eval $$(call BuildPackage,$(1))) 
     458  define Package/php5-mod-$(1)/config 
     459    depends on PACKAGE_php5-cli || PACKAGE_php5-cgi 
     460    $(4) 
     461  endef 
     462 
     463  define Package/php5-mod-$(1)/install 
     464        $(INSTALL_DIR) $$(1)/usr/lib/php 
     465        $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/ 
     466        $(INSTALL_DIR) $$(1)/etc/php5 
     467        echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini 
     468  endef 
     469 
     470  PHP5_MODULES+= php5-mod-$(1) 
    710471endef 
    711472 
     
    714475$(eval $(call BuildPackage,php5-cgi)) 
    715476$(eval $(call BuildPackage,php5-fastcgi)) 
    716 $(eval $(call BuildPlugin,php5-mod-ctype,ctype)) 
    717 $(eval $(call BuildPlugin,php5-mod-curl,curl)) 
    718 $(eval $(call BuildPlugin,php5-mod-fileinfo,fileinfo)) 
    719 $(eval $(call BuildPlugin,php5-mod-dom,dom)) 
    720 $(eval $(call BuildPlugin,php5-mod-exif,exif)) 
    721 $(eval $(call BuildPlugin,php5-mod-ftp,ftp)) 
    722 $(eval $(call BuildPlugin,php5-mod-gd,gd)) 
    723 $(eval $(call BuildPlugin,php5-mod-gmp,gmp)) 
    724 $(eval $(call BuildPlugin,php5-mod-hash,hash)) 
    725 $(eval $(call BuildPlugin,php5-mod-iconv,iconv)) 
    726 $(eval $(call BuildPlugin,php5-mod-json,json)) 
    727 $(eval $(call BuildPlugin,php5-mod-ldap,ldap)) 
    728 $(eval $(call BuildPlugin,php5-mod-mbstring,mbstring)) 
    729 $(eval $(call BuildPlugin,php5-mod-mcrypt,mcrypt)) 
    730 $(eval $(call BuildPlugin,php5-mod-mysql,mysql)) 
    731 $(eval $(call BuildPlugin,php5-mod-openssl,openssl)) 
    732 $(eval $(call BuildPlugin,php5-mod-pdo,pdo)) 
    733 $(eval $(call BuildPlugin,php5-mod-pdo-mysql,pdo_mysql)) 
    734 $(eval $(call BuildPlugin,php5-mod-pdo-pgsql,pdo_pgsql)) 
    735 $(eval $(call BuildPlugin,php5-mod-pdo-sqlite,pdo_sqlite)) 
    736 $(eval $(call BuildPlugin,php5-mod-pgsql,pgsql)) 
    737 $(eval $(call BuildPlugin,php5-mod-session,session)) 
    738 $(eval $(call BuildPlugin,php5-mod-soap,soap)) 
    739 $(eval $(call BuildPlugin,php5-mod-sockets,sockets)) 
    740 $(eval $(call BuildPlugin,php5-mod-sqlite,sqlite)) 
    741 $(eval $(call BuildPlugin,php5-mod-sqlite3,sqlite3)) 
    742 $(eval $(call BuildPlugin,php5-mod-tokenizer,tokenizer)) 
    743 $(eval $(call BuildPlugin,php5-mod-xml,xml)) 
    744 $(eval $(call BuildPlugin,php5-mod-xmlreader,xmlreader)) 
    745 $(eval $(call BuildPlugin,php5-mod-xmlwriter,xmlwriter)) 
     477 
     478$(eval $(call BuildModule,ctype,Ctype)) 
     479$(eval $(call BuildModule,curl,cURL,php5 +libcurl)) 
     480$(eval $(call BuildModule,fileinfo,Fileinfo,php5 +libmagic)) 
     481$(eval $(call BuildModule,dom,DOM,php5 +libxml2,depends on PHP5_LIBXML)) 
     482$(eval $(call BuildModule,exif,EXIF)) 
     483$(eval $(call BuildModule,ftp,FTP)) 
     484$(eval $(call BuildModule,gd,GD graphics,php5 +libgd)) 
     485$(eval $(call BuildModule,gmp,GMP,php5 +libgmp)) 
     486$(eval $(call BuildModule,hash,Hash)) 
     487$(eval $(call BuildModule,iconv,iConv,php5 +libiconv)) 
     488$(eval $(call BuildModule,json,JSON)) 
     489$(eval $(call BuildModule,ldap,LDAP,php5 +libopenldap +libsasl2)) 
     490$(eval $(call BuildModule,mbstring,MBString)) 
     491$(eval $(call BuildModule,mcrypt,Mcrypt,php5 +libmcrypt +libltdl)) 
     492$(eval $(call BuildModule,mysql,MySQL,php5 +libmysqlclient)) 
     493$(eval $(call BuildModule,openssl,OpenSSL,php5 +libopenssl)) 
     494$(eval $(call BuildModule,pcntl,PCNTL)) 
     495$(eval $(call BuildModule,pdo,PHP Data Objects)) 
     496$(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,php5-mod-pdo +libmysqlclient)) 
     497$(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,php5-mod-pdo +libpq)) 
     498$(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,php5-mod-pdo +libsqlite3 +libpthread)) 
     499$(eval $(call BuildModule,pgsql,PostgreSQL,php5 +libpq)) 
     500$(eval $(call BuildModule,session,Session)) 
     501$(eval $(call BuildModule,simplexml,SimpleXML,php5 +libxml2,depends on PHP5_LIBXML)) 
     502$(eval $(call BuildModule,soap,SOAP,php5 +libxml2,depends on PHP5_LIBXML)) 
     503$(eval $(call BuildModule,sockets,Sockets)) 
     504$(eval $(call BuildModule,sqlite,SQLite 2.x,php5 +libsqlite2)) 
     505$(eval $(call BuildModule,sqlite3,SQLite3,php5 +libsqlite3 +libpthread)) 
     506$(eval $(call BuildModule,sysvmsg,System V messages)) 
     507$(eval $(call BuildModule,sysvsem,System V shared memory)) 
     508$(eval $(call BuildModule,sysvshm,System V semaphore)) 
     509$(eval $(call BuildModule,tokenizer,Tokenizer)) 
     510$(eval $(call BuildModule,xml,XML,php5 $(if $(CONFIG_PHP5_LIBXML),+libxml2,+libexpat))) 
     511$(eval $(call BuildModule,xmlreader,XMLReader,php5 +libxml2 +libiconv,depends on PHP5_LIBXML)) 
     512$(eval $(call BuildModule,xmlwriter,XMLWriter,php5 +libxml2 +libiconv,depends on PHP5_LIBXML)) 
     513 
     514PKG_CONFIG_DEPENDS:= $(patsubst %,CONFIG_PACKAGE_%,$(PHP5_MODULES)) 
     515$(foreach p,$(PHP5_MODULES),$(eval $(call BuildPackage,$(p)))) 
Note: See TracChangeset for help on using the changeset viewer.