code
string
repo_name
string
path
string
language
string
license
string
size
int64
################################################################################ # # php-memcached # ################################################################################ PHP_MEMCACHED_VERSION = 6ee96cad7be5caa1f13a1f3e5a4d5f900b9c04ce PHP_MEMCACHED_SITE = $(call github,php-memcached-dev,php-memcached,$(PHP_MEMCACHED_VERSION)) PHP_MEMCACHED_CONF_OPTS = --with-php-config=$(STAGING_DIR)/usr/bin/php-config \ --disable-memcached-sasl \ --with-libmemcached-dir=$(STAGING_DIR)/usr \ --with-zlib-dir=$(STAGING_DIR)/usr # phpize does the autoconf magic PHP_MEMCACHED_DEPENDENCIES = libmemcached php zlib host-autoconf host-pkgconf PHP_MEMCACHED_LICENSE = MIT PHP_MEMCACHED_LICENSE_FILES = LICENSE define PHP_MEMCACHED_PHPIZE (cd $(@D); \ PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \ PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \ $(STAGING_DIR)/usr/bin/phpize) endef PHP_MEMCACHED_PRE_CONFIGURE_HOOKS += PHP_MEMCACHED_PHPIZE $(eval $(autotools-package))
shibajee/buildroot
package/php-memcached/php-memcached.mk
mk
mit
975
config BR2_PACKAGE_PHP_SSH2 bool "php-ssh2" depends on BR2_PACKAGE_PHP depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS \ && !BR2_PACKAGE_OPENSSL # libssh2, libgcrypt select BR2_PACKAGE_LIBSSH2 help PHP bindings for the libssh2 library. http://pecl.php.net/package/ssh2
shibajee/buildroot
package/php-ssh2/Config.in
in
mit
285
# Locally calculated sha256 3d79a6c9ffed3fd6ec16e834c0cc93cf125d9f5bdbb951b8b76a3507498548d5 php-ssh2-12dd52236c601577a63e33ee71e3ce6dad811e40.tar.gz
shibajee/buildroot
package/php-ssh2/php-ssh2.hash
hash
mit
151
################################################################################ # # php-ssh2 # ################################################################################ PHP_SSH2_VERSION = 12dd52236c601577a63e33ee71e3ce6dad811e40 PHP_SSH2_SITE = $(call github,php,pecl-networking-ssh2,$(PHP_SSH2_VERSION)) PHP_SSH2_CONF_OPTS = --with-php-config=$(STAGING_DIR)/usr/bin/php-config \ --with-ssh2=$(STAGING_DIR)/usr # phpize does the autoconf magic PHP_SSH2_DEPENDENCIES = libssh2 php host-autoconf PHP_SSH2_LICENSE = PHP PHP_SSH2_LICENSE_FILES = LICENSE define PHP_SSH2_PHPIZE (cd $(@D); \ PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \ PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \ $(STAGING_DIR)/usr/bin/phpize) endef PHP_SSH2_PRE_CONFIGURE_HOOKS += PHP_SSH2_PHPIZE $(eval $(autotools-package))
shibajee/buildroot
package/php-ssh2/php-ssh2.mk
mk
mit
812
config BR2_PACKAGE_PHP_YAML bool "php-yaml" depends on BR2_PACKAGE_PHP select BR2_PACKAGE_LIBYAML help PHP YAML-1.1 parser and emitter. http://pecl.php.net/package/yaml
shibajee/buildroot
package/php-yaml/Config.in
in
mit
180
# Locally calculated sha256 d49acf2b7843258957a16df0d7ced56c0e1fc3eaa54f54289e4012edc002814c yaml-2.0.0RC7.tgz
shibajee/buildroot
package/php-yaml/php-yaml.hash
hash
mit
112
################################################################################ # # php-yaml # ################################################################################ PHP_YAML_VERSION = 2.0.0RC7 PHP_YAML_SOURCE = yaml-$(PHP_YAML_VERSION).tgz PHP_YAML_SITE = https://pecl.php.net/get PHP_YAML_CONF_OPTS = --with-php-config=$(STAGING_DIR)/usr/bin/php-config \ --with-yaml=$(STAGING_DIR)/usr # phpize does the autoconf magic PHP_YAML_DEPENDENCIES = libyaml php host-autoconf PHP_YAML_LICENSE = MIT PHP_YAML_LICENSE_FILES = LICENSE define PHP_YAML_PHPIZE (cd $(@D); \ PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \ PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \ $(STAGING_DIR)/usr/bin/phpize) endef PHP_YAML_PRE_CONFIGURE_HOOKS += PHP_YAML_PHPIZE $(eval $(autotools-package))
shibajee/buildroot
package/php-yaml/php-yaml.mk
mk
mit
792
comment "php-zmq needs a toolchain w/ C++, wchar, threads" depends on !(BR2_INSTALL_LIBSTDCPP && BR2_USE_WCHAR \ && BR2_TOOLCHAIN_HAS_THREADS) config BR2_PACKAGE_PHP_ZMQ bool "php-zmq" depends on BR2_PACKAGE_PHP depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_WCHAR # util-linux depends on BR2_TOOLCHAIN_HAS_THREADS select BR2_PACKAGE_ZEROMQ help ZeroMQ messaging bindings for PHP http://pecl.php.net/package/zmq
shibajee/buildroot
package/php-zmq/Config.in
in
mit
435
# Locally calculated sha256 c492375818bd51b355352798fb94f04d6828c6aeda41ba813849624af74144ce zmq-1.1.3.tgz
shibajee/buildroot
package/php-zmq/php-zmq.hash
hash
mit
108
################################################################################ # # php-zmq # ################################################################################ PHP_ZMQ_VERSION = 1.1.3 PHP_ZMQ_SOURCE = zmq-$(PHP_ZMQ_VERSION).tgz PHP_ZMQ_SITE = https://pecl.php.net/get # phpize does the autoconf magic PHP_ZMQ_DEPENDENCIES = php zeromq host-autoconf host-pkgconf PHP_ZMQ_CONF_OPTS = --with-php-config=$(STAGING_DIR)/usr/bin/php-config PHP_ZMQ_LICENSE = BSD-3c PHP_ZMQ_LICENSE_FILES = LICENSE define PHP_ZMQ_PHPIZE (cd $(@D); \ PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \ PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \ $(STAGING_DIR)/usr/bin/phpize) endef PHP_ZMQ_PRE_CONFIGURE_HOOKS += PHP_ZMQ_PHPIZE $(eval $(autotools-package))
shibajee/buildroot
package/php-zmq/php-zmq.mk
mk
mit
757
From 7a4168062fbab2e33ef9a42bca9f87a5921afac2 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias <gustavo@zacarias.com.ar> Date: Tue, 9 Aug 2016 11:49:56 +0200 Subject: [PATCH] acinclude.m4: don't unset variables Unsetting ac_cv_{func,lib}_* is bad, you can't feed the configure cache. Terminate them with extreme prejudice. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> --- acinclude.m4 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 28506b6..af4aa06 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1898,8 +1898,6 @@ define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])) dnl AC_DEFUN([PHP_CHECK_FUNC_LIB],[ ifelse($2,,:,[ - unset ac_cv_lib_$2[]_$1 - unset ac_cv_lib_$2[]___$1 unset found AC_CHECK_LIB($2, $1, [found=yes], [ AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) @@ -1931,8 +1929,6 @@ dnl in the default libraries and as a fall back in the specified library. dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. dnl AC_DEFUN([PHP_CHECK_FUNC],[ - unset ac_cv_func_$1 - unset ac_cv_func___$1 unset found AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) -- 2.7.4
shibajee/buildroot
package/php/0001-acinclude.m4-don-t-unset-variables.patch
patch
mit
1,241
From 1357df0196806d5697b1f84497ef72aab5faa8a3 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias <gustavo@zacarias.com.ar> Date: Tue, 9 Aug 2016 11:50:49 +0200 Subject: [PATCH] iconv: tweak iconv detection Tweak PHP_SETUP_ICONV from aclocal/acinclude.m4 to not PHP_ADD_INCLUDE $ICONV_DIR/include since the tests use test instead of AC_TRY_LINK to find headers which is bad, specially when adding /usr and /usr/local to the mix. Do basically the same with ext/iconv/config.m4 by tweaking PHP_ICONV_H_PATH which, again, uses test and absolute paths. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> [Gustavo: convert to nice m4 instead of patching configure] [Gustavo: update for 5.6.10] --- acinclude.m4 | 2 +- ext/iconv/config.m4 | 22 ---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index af4aa06..1bd2652 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2471,7 +2471,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [ dnl if test "$found_iconv" = "no"; then - for i in $PHP_ICONV /usr/local /usr; do + for i in $PHP_ICONV; do if test -r $i/include/giconv.h; then AC_DEFINE(HAVE_GICONV_H, 1, [ ]) ICONV_DIR=$i diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index 6a05697..694fcb8 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -14,28 +14,6 @@ if test "$PHP_ICONV" != "no"; then ]) if test "$iconv_avail" != "no"; then - if test -z "$ICONV_DIR"; then - for i in /usr/local /usr; do - if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then - PHP_ICONV_PREFIX="$i" - break - fi - done - if test -z "$PHP_ICONV_PREFIX"; then - PHP_ICONV_PREFIX="/usr" - fi - else - PHP_ICONV_PREFIX="$ICONV_DIR" - fi - - CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS" - LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS" - - if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h" - else - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h" - fi AC_MSG_CHECKING([if iconv is glibc's]) AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();], -- 2.7.4
shibajee/buildroot
package/php/0002-iconv-tweak-iconv-detection.patch
patch
mit
2,262
From 5ba6355e489f647c88ca48afbc75965468193181 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias <gustavo@zacarias.com.ar> Date: Tue, 9 Aug 2016 11:51:53 +0200 Subject: [PATCH] configure: disable the 'phar' tool Disable the 'phar' command-line tool build/installation since it requires php to run and pack up phar itself in phar format. This would require a host-php instance and really probably nobody needs the phar tool on the target. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> [Gustavo: update for autoreconf/configure.in] --- configure.in | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 25c8abf..4dc8a09 100644 --- a/configure.in +++ b/configure.in @@ -1445,13 +1445,8 @@ CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag" INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag" CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)" -if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then - pharcmd=pharcmd - pharcmd_install=install-pharcmd -else - pharcmd= - pharcmd_install= -fi; +pharcmd= +pharcmd_install= all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd" install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install" -- 2.7.4
shibajee/buildroot
package/php/0003-configure-disable-the-phar-tool.patch
patch
mit
1,372
From bedbd41ef0a5ce80b83a6f6eaebd7c90f0bc5615 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias <gustavo@zacarias.com.ar> Date: Tue, 9 Aug 2016 11:52:19 +0200 Subject: [PATCH] OPcache: flock mechanism is obviously linux so force it. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> --- ext/opcache/config.m4 | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 index fbb9b21..ffddc8e 100644 --- a/ext/opcache/config.m4 +++ b/ext/opcache/config.m4 @@ -343,38 +343,8 @@ int main() { msg=yes,msg=no,msg=no) AC_MSG_RESULT([$msg]) -flock_type=unknown -AC_MSG_CHECKING("whether flock struct is linux ordered") -AC_TRY_RUN([ - #include <fcntl.h> - struct flock lock = { 1, 2, 3, 4, 5 }; - int main() { - if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) { - return 0; - } - return 1; - } -], [ - flock_type=linux - AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) - AC_MSG_RESULT("yes") -], AC_MSG_RESULT("no") ) - -AC_MSG_CHECKING("whether flock struct is BSD ordered") -AC_TRY_RUN([ - #include <fcntl.h> - struct flock lock = { 1, 2, 3, 4, 5 }; - int main() { - if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) { - return 0; - } - return 1; - } -], [ - flock_type=bsd - AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) - AC_MSG_RESULT("yes") -], AC_MSG_RESULT("no") ) +flock_type=linux +AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) if test "$flock_type" = "unknown"; then AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no]) -- 2.7.4
shibajee/buildroot
package/php/0004-OPcache-flock-mechanism-is-obviously-linux-so-force-.patch
patch
mit
1,752
From a874ba472151c6811018de322a5787d0ca6148c9 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias <gustavo@zacarias.com.ar> Date: Tue, 9 Aug 2016 11:52:51 +0200 Subject: [PATCH] ext/fileinfo/config.m4: allow cache answer for strcasestr discovery Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> --- ext/fileinfo/config.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4 index 7e98d62..8561962 100644 --- a/ext/fileinfo/config.m4 +++ b/ext/fileinfo/config.m4 @@ -14,6 +14,7 @@ if test "$PHP_FILEINFO" != "no"; then libmagic/readcdf.c libmagic/softmagic.c" AC_MSG_CHECKING([for strcasestr]) + AC_CACHE_VAL(ac_cv_func_strcasestr, AC_TRY_RUN([ #include <string.h> #include <strings.h> @@ -46,7 +47,7 @@ int main(void) AC_MSG_RESULT(no) AC_MSG_NOTICE(using libmagic strcasestr implementation) libmagic_sources="$libmagic_sources libmagic/strcasestr.c" - ]) + ])) PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic) PHP_ADD_BUILD_DIR($ext_builddir/libmagic) -- 2.7.4
shibajee/buildroot
package/php/0005-ext-fileinfo-config.m4-allow-cache-answer-for-strcas.patch
patch
mit
1,126
From 1a8714d0b56e06301b3c261eaef93d897ec5d834 Mon Sep 17 00:00:00 2001 From: Floris Bos <bos@je-eigen-domein.nl> Date: Fri, 1 May 2015 15:28:55 +0200 Subject: [PATCH] Fix php-fpm.service.in - Expand file paths. - Remove obsolete After=syslog.target. Syslog is socket activated nowadays. Signed-off-by: Floris Bos <bos@je-eigen-domein.nl> --- sapi/fpm/php-fpm.service.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in index a2df30e..c135f04 100644 --- a/sapi/fpm/php-fpm.service.in +++ b/sapi/fpm/php-fpm.service.in @@ -1,11 +1,11 @@ [Unit] Description=The PHP FastCGI Process Manager -After=syslog.target network.target +After=network.target [Service] Type=@php_fpm_systemd@ -PIDFile=@localstatedir@/run/php-fpm.pid -ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf +PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid +ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf ExecReload=/bin/kill -USR2 $MAINPID [Install] -- 2.7.4
shibajee/buildroot
package/php/0006-Fix-php-fpm.service.in.patch
patch
mit
1,103
From 9ca3de0446fcd31b1561b333020ae0674a83bec7 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: Tue, 9 Aug 2016 11:39:10 +0200 Subject: [PATCH] phpdbg_prompt: enclose phpdbg_load_module_or_extension() in HAVE_LIBDL The phpdbg_load_module_or_extension() function relies on libdl functionality, so it should be enclosed in HAVE_LIBDL to avoid the following build failure when libdl support is not available: php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c20): undefined reference to `_DL_LOAD' php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c36): undefined reference to `_GET_DL_ERROR' php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c6a): undefined reference to `_DL_FETCH_SYMBOL' php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c7e): undefined reference to `_DL_FETCH_SYMBOL' php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1dc6): undefined reference to `_DL_UNLOAD' This function is only called in the "dl" debug command, inside an HAVE_LIBDL condition. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- sapi/phpdbg/phpdbg_prompt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 6f73d30..6768dc5 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1019,6 +1019,7 @@ static int add_zendext_info(zend_extension *ext) /* {{{ */ { } /* }}} */ +#ifdef HAVE_LIBDL PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) /* {{{ */ { DL_HANDLE handle; char *extension_dir; @@ -1158,6 +1159,7 @@ quit: DL_UNLOAD(handle); return NULL; } +#endif /* }}} */ PHPDBG_COMMAND(dl) /* {{{ */ -- 2.7.4
shibajee/buildroot
package/php/0007-phpdbg_prompt-enclose-phpdbg_load_module_or_extensio.patch
patch
mit
1,701
menu "Extensions" config BR2_PACKAGE_PHP_EXT_CALENDAR bool "Calendar" help Calendar and event support config BR2_PACKAGE_PHP_EXT_FILEINFO bool "Fileinfo" help File Information support config BR2_PACKAGE_PHP_EXT_OPCACHE bool "OPcache" help Enable the Zend OPcache accelerator. comment "Readline needs a toolchain w/ dynamic library" depends on BR2_STATIC_LIBS config BR2_PACKAGE_PHP_EXT_READLINE bool "Readline" depends on !BR2_STATIC_LIBS select BR2_PACKAGE_NCURSES select BR2_PACKAGE_READLINE help Readline support config BR2_PACKAGE_PHP_EXT_SESSION bool "Session" default y help Session support comment "Compression extensions" config BR2_PACKAGE_PHP_EXT_BZIP2 bool "bzip2" select BR2_PACKAGE_BZIP2 help bzip2 read/write support config BR2_PACKAGE_PHP_EXT_PHAR bool "phar" help PHP Archive support config BR2_PACKAGE_PHP_EXT_ZIP bool "zip" select BR2_PACKAGE_ZLIB help Zip read/write support config BR2_PACKAGE_PHP_EXT_ZLIB bool "zlib" select BR2_PACKAGE_ZLIB default y help zlib support comment "Cryptography extensions" config BR2_PACKAGE_PHP_EXT_HASH bool "hash" help HASH message digest framework config BR2_PACKAGE_PHP_EXT_MCRYPT bool "mcrypt" select BR2_PACKAGE_LIBMCRYPT help mcrypt support config BR2_PACKAGE_PHP_EXT_OPENSSL bool "openssl" select BR2_PACKAGE_OPENSSL help openssl support comment "Database extensions" config BR2_PACKAGE_PHP_EXT_DBA bool "DBA" help Database Abstraction Layer if BR2_PACKAGE_PHP_EXT_DBA config BR2_PACKAGE_PHP_EXT_DBA_CDB bool "cdb" help CDB handler config BR2_PACKAGE_PHP_EXT_DBA_DB4 bool "db4/5" select BR2_PACKAGE_BERKELEYDB help BerkeleyDB version 4/5 handler config BR2_PACKAGE_PHP_EXT_DBA_FLAT bool "flat" default y help Flat file handler config BR2_PACKAGE_PHP_EXT_DBA_INI bool "ini" default y help INI file handler endif config BR2_PACKAGE_PHP_EXT_MYSQLI bool "Mysqli" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # mysql depends on BR2_TOOLCHAIN_HAS_THREADS # mysql select BR2_PACKAGE_MYSQL help MySQL Improved extension support config BR2_PACKAGE_PHP_EXT_SQLITE bool "SQLite3" select BR2_PACKAGE_SQLITE help SQLite3 support config BR2_PACKAGE_PHP_EXT_PDO bool "PDO" help PHP Data Objects support if BR2_PACKAGE_PHP_EXT_PDO config BR2_PACKAGE_PHP_EXT_PDO_MYSQL bool "MySQL" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # mysql depends on BR2_TOOLCHAIN_HAS_THREADS # mysql select BR2_PACKAGE_MYSQL help PDO driver for MySQL comment "MySQL drivers need a toolchain w/ C++, threads" depends on BR2_USE_MMU depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_PHP_EXT_PDO_POSTGRESQL bool "PostgreSQL" select BR2_PACKAGE_POSTGRESQL depends on BR2_USE_MMU # postgresql depends on !BR2_STATIC_LIBS help PDO driver for PostgreSQL comment "PostgreSQL drivers need a toolchain w/ dynamic library" depends on BR2_USE_MMU depends on BR2_STATIC_LIBS config BR2_PACKAGE_PHP_EXT_PDO_SQLITE bool "SQLite3" select BR2_PACKAGE_SQLITE help SQLite3 driver for PDO config BR2_PACKAGE_PHP_EXT_PDO_UNIXODBC bool "unixODBC" select BR2_PACKAGE_UNIXODBC help unixODBC driver for PDO endif comment "Human language and character encoding support" config BR2_PACKAGE_PHP_EXT_GETTEXT bool "Gettext" select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT depends on BR2_USE_WCHAR help Gettext support comment "Gettext support needs a toolchain w/ wchar" depends on !BR2_USE_WCHAR config BR2_PACKAGE_PHP_EXT_ICONV bool "iconv" select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE help iconv character set conversion support config BR2_PACKAGE_PHP_EXT_INTL bool "intl" select BR2_PACKAGE_ICU depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_WCHAR depends on !BR2_BINFMT_FLAT # icu depends on BR2_TOOLCHAIN_HAS_THREADS # icu help Internationalization support comment "intl support needs a toolchain w/ C++, wchar, threads" depends on !BR2_BINFMT_FLAT depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_PHP_EXT_MBSTRING bool "mbstring" help multibyte string support comment "Image processing" config BR2_PACKAGE_PHP_EXT_EXIF bool "EXIF" help EXIF support config BR2_PACKAGE_PHP_EXT_GD bool "GD" select BR2_PACKAGE_FREETYPE select BR2_PACKAGE_JPEG select BR2_PACKAGE_LIBPNG help GD support comment "Mathematical extensions" config BR2_PACKAGE_PHP_EXT_BCMATH bool "BC math" help BCMath arbitrary precision mathematics support config BR2_PACKAGE_PHP_EXT_GMP bool "GMP" select BR2_PACKAGE_GMP help GNU Multiple Precision support comment "Other basic extensions" config BR2_PACKAGE_PHP_EXT_JSON bool "JSON" help JavaScript Object Serialization support config BR2_PACKAGE_PHP_EXT_TOKENIZER bool "Tokenizer" help Tokenizer functions support comment "Other services" config BR2_PACKAGE_PHP_EXT_CURL bool "cURL" select BR2_PACKAGE_LIBCURL help cURL for URL streams config BR2_PACKAGE_PHP_EXT_FTP bool "FTP" help FTP support config BR2_PACKAGE_PHP_EXT_SNMP bool "SNMP" depends on BR2_USE_MMU # netsnmp fork() select BR2_PACKAGE_NETSNMP select BR2_PACKAGE_NETSNMP_ENABLE_MIBS help SNMP support config BR2_PACKAGE_PHP_EXT_SOCKETS bool "sockets" help Sockets support comment "Process Control" config BR2_PACKAGE_PHP_EXT_PCNTL bool "PCNTL" depends on BR2_USE_MMU # fork() help Process control support config BR2_PACKAGE_PHP_EXT_POSIX bool "Posix" default y help POSIX.1 (IEEE 1003.1) function support config BR2_PACKAGE_PHP_EXT_SHMOP bool "shmop" help Shared memory support config BR2_PACKAGE_PHP_EXT_SYSVMSG bool "sysvmsg" help System V message queue support config BR2_PACKAGE_PHP_EXT_SYSVSEM bool "sysvsem" help System V semaphore support config BR2_PACKAGE_PHP_EXT_SYSVSHM bool "sysvshm" help System V shared memory support comment "Variable and Type related" config BR2_PACKAGE_PHP_EXT_CTYPE bool "Ctype" help Character type checking support config BR2_PACKAGE_PHP_EXT_FILTER bool "Filter" help Input filter support comment "Web services" config BR2_PACKAGE_PHP_EXT_SOAP bool "SOAP" select BR2_PACKAGE_PHP_EXT_LIBXML2 help SOAP support config BR2_PACKAGE_PHP_EXT_XMLRPC bool "XML-RPC" select BR2_PACKAGE_PHP_EXT_LIBXML2 select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE help XML-RPC support comment "XML manipulation" config BR2_PACKAGE_PHP_EXT_DOM bool "DOM" select BR2_PACKAGE_PHP_EXT_LIBXML2 help Document Object Model support config BR2_PACKAGE_PHP_EXT_LIBXML2 bool "libxml" select BR2_PACKAGE_LIBXML2 help libxml2 support config BR2_PACKAGE_PHP_EXT_SIMPLEXML bool "SimpleXML" select BR2_PACKAGE_PHP_EXT_LIBXML2 help SimpleXML support config BR2_PACKAGE_PHP_EXT_WDDX bool "WDDX" select BR2_PACKAGE_EXPAT select BR2_PACKAGE_PHP_EXT_LIBXML2 help WDDX support config BR2_PACKAGE_PHP_EXT_XML bool "XML Parser" select BR2_PACKAGE_PHP_EXT_LIBXML2 help XML Parser support config BR2_PACKAGE_PHP_EXT_XMLREADER bool "XMLReader" select BR2_PACKAGE_PHP_EXT_LIBXML2 help XMLReader support config BR2_PACKAGE_PHP_EXT_XMLWRITER bool "XMLWriter" select BR2_PACKAGE_PHP_EXT_LIBXML2 help XMLWriter support config BR2_PACKAGE_PHP_EXT_XSL bool "XSL" select BR2_PACKAGE_PHP_EXT_DOM select BR2_PACKAGE_PHP_EXT_LIBXML2 select BR2_PACKAGE_LIBXSLT help XSL transformation support endmenu
shibajee/buildroot
package/php/Config.ext
ext
mit
7,495
config BR2_PACKAGE_PHP bool "php" help PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. http://www.php.net if BR2_PACKAGE_PHP config BR2_PACKAGE_PHP_CLI bool config BR2_PACKAGE_PHP_CGI bool config BR2_PACKAGE_PHP_FPM bool choice prompt "Interface" default BR2_PACKAGE_PHP_SAPI_CGI help Select the PHP interface(s). config BR2_PACKAGE_PHP_SAPI_CGI bool "CGI" # CGI uses fork() depends on BR2_USE_MMU select BR2_PACKAGE_PHP_CGI help Common Gateway Interface config BR2_PACKAGE_PHP_SAPI_CLI bool "CLI" select BR2_PACKAGE_PHP_CLI help Command Line Interface config BR2_PACKAGE_PHP_SAPI_FPM bool "FPM" depends on BR2_USE_MMU select BR2_PACKAGE_PHP_FPM help PHP-FPM (FastCGI Process Manager) config BR2_PACKAGE_PHP_SAPI_CLI_CGI bool "CGI and CLI" # CGI uses fork() depends on BR2_USE_MMU select BR2_PACKAGE_PHP_CLI select BR2_PACKAGE_PHP_CGI help Command line and Common gateway interfaces config BR2_PACKAGE_PHP_SAPI_CLI_FPM bool "FPM and CLI" depends on BR2_USE_MMU select BR2_PACKAGE_PHP_CLI select BR2_PACKAGE_PHP_FPM help Command line and PHP-FPM (FastCGI Process Manager) endchoice source "package/php/Config.ext" endif
shibajee/buildroot
package/php/Config.in
in
mit
1,280
[www] # Only start children when there are requests to be processed pm = ondemand # Terminate them again after there haven't been any for 2 minutes pm.process_idle_timeout = 120s # Maximum number of children processing PHP requests concurrently pm.max_children = 5 listen = /var/run/php-fpm.sock listen.owner = www-data listen.group = www-data user = www-data group = www-data
shibajee/buildroot
package/php/php-fpm.conf
INI
mit
379
# From http://php.net/downloads.php sha256 970c322ba3e472cb0264b8ba9d4d92e87918da5d0cca53c4aba2a70545b8626d php-7.0.9.tar.xz
shibajee/buildroot
package/php/php.hash
hash
mit
126
################################################################################ # # php # ################################################################################ PHP_VERSION = 7.0.9 PHP_SITE = http://www.php.net/distributions PHP_SOURCE = php-$(PHP_VERSION).tar.xz PHP_INSTALL_STAGING = YES PHP_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install PHP_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install PHP_DEPENDENCIES = host-pkgconf PHP_LICENSE = PHP PHP_LICENSE_FILES = LICENSE PHP_CONF_OPTS = \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-all \ --without-pear \ --with-config-file-path=/etc \ --disable-rpath PHP_CONF_ENV = \ ac_cv_func_strcasestr=yes \ EXTRA_LIBS="$(PHP_EXTRA_LIBS)" ifeq ($(BR2_STATIC_LIBS),y) PHP_CONF_ENV += LIBS="$(PHP_STATIC_LIBS)" endif ifeq ($(BR2_STATIC_LIBS)$(BR2_TOOLCHAIN_HAS_THREADS),yy) PHP_STATIC_LIBS += -lpthread endif ifeq ($(call qstrip,$(BR2_TARGET_LOCALTIME)),) PHP_LOCALTIME = UTC else # Not q-stripping this value, as we need quotes in the php.ini file PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME) endif # PHP can't be AUTORECONFed the standard way unfortunately PHP_DEPENDENCIES += host-autoconf host-automake host-libtool define PHP_BUILDCONF cd $(@D) ; $(TARGET_MAKE_ENV) ./buildconf --force endef PHP_PRE_CONFIGURE_HOOKS += PHP_BUILDCONF ifeq ($(BR2_ENDIAN),"BIG") PHP_CONF_ENV += ac_cv_c_bigendian_php=yes else PHP_CONF_ENV += ac_cv_c_bigendian_php=no endif PHP_CONFIG_SCRIPTS = php-config PHP_CFLAGS = $(TARGET_CFLAGS) # The OPcache extension isn't cross-compile friendly # Throw some defines here to avoid patching heavily ifeq ($(BR2_PACKAGE_PHP_EXT_OPCACHE),y) PHP_CONF_OPTS += --enable-opcache PHP_CONF_ENV += ac_cv_func_mprotect=yes PHP_CFLAGS += \ -DHAVE_SHM_IPC \ -DHAVE_SHM_MMAP_ANON \ -DHAVE_SHM_MMAP_ZERO \ -DHAVE_SHM_MMAP_POSIX \ -DHAVE_SHM_MMAP_FILE endif # We need to force dl "detection" ifeq ($(BR2_STATIC_LIBS),) PHP_CONF_ENV += ac_cv_func_dlopen=yes ac_cv_lib_dl_dlopen=yes PHP_EXTRA_LIBS += -ldl else PHP_CONF_ENV += ac_cv_func_dlopen=no ac_cv_lib_dl_dlopen=no endif PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_CLI),,--disable-cli) PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_CGI),,--disable-cgi) PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm,--disable-fpm) ### Extensions PHP_CONF_OPTS += \ $(if $(BR2_PACKAGE_PHP_EXT_SOCKETS),--enable-sockets) \ $(if $(BR2_PACKAGE_PHP_EXT_POSIX),--enable-posix) \ $(if $(BR2_PACKAGE_PHP_EXT_SESSION),--enable-session) \ $(if $(BR2_PACKAGE_PHP_EXT_HASH),--enable-hash) \ $(if $(BR2_PACKAGE_PHP_EXT_DOM),--enable-dom) \ $(if $(BR2_PACKAGE_PHP_EXT_SIMPLEXML),--enable-simplexml) \ $(if $(BR2_PACKAGE_PHP_EXT_SOAP),--enable-soap) \ $(if $(BR2_PACKAGE_PHP_EXT_XML),--enable-xml) \ $(if $(BR2_PACKAGE_PHP_EXT_XMLREADER),--enable-xmlreader) \ $(if $(BR2_PACKAGE_PHP_EXT_XMLWRITER),--enable-xmlwriter) \ $(if $(BR2_PACKAGE_PHP_EXT_EXIF),--enable-exif) \ $(if $(BR2_PACKAGE_PHP_EXT_FTP),--enable-ftp) \ $(if $(BR2_PACKAGE_PHP_EXT_JSON),--enable-json) \ $(if $(BR2_PACKAGE_PHP_EXT_TOKENIZER),--enable-tokenizer) \ $(if $(BR2_PACKAGE_PHP_EXT_PCNTL),--enable-pcntl) \ $(if $(BR2_PACKAGE_PHP_EXT_SHMOP),--enable-shmop) \ $(if $(BR2_PACKAGE_PHP_EXT_SYSVMSG),--enable-sysvmsg) \ $(if $(BR2_PACKAGE_PHP_EXT_SYSVSEM),--enable-sysvsem) \ $(if $(BR2_PACKAGE_PHP_EXT_SYSVSHM),--enable-sysvshm) \ $(if $(BR2_PACKAGE_PHP_EXT_ZIP),--enable-zip) \ $(if $(BR2_PACKAGE_PHP_EXT_CTYPE),--enable-ctype) \ $(if $(BR2_PACKAGE_PHP_EXT_FILTER),--enable-filter) \ $(if $(BR2_PACKAGE_PHP_EXT_CALENDAR),--enable-calendar) \ $(if $(BR2_PACKAGE_PHP_EXT_FILEINFO),--enable-fileinfo) \ $(if $(BR2_PACKAGE_PHP_EXT_BCMATH),--enable-bcmath) \ $(if $(BR2_PACKAGE_PHP_EXT_MBSTRING),--enable-mbstring) \ $(if $(BR2_PACKAGE_PHP_EXT_PHAR),--enable-phar) ifeq ($(BR2_PACKAGE_PHP_EXT_MCRYPT),y) PHP_CONF_OPTS += --with-mcrypt=$(STAGING_DIR)/usr PHP_DEPENDENCIES += libmcrypt endif ifeq ($(BR2_PACKAGE_PHP_EXT_OPENSSL),y) PHP_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr PHP_DEPENDENCIES += openssl # openssl needs zlib, but the configure script forgets to link against # it causing detection failures with static linking PHP_STATIC_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs openssl` endif ifeq ($(BR2_PACKAGE_PHP_EXT_LIBXML2),y) PHP_CONF_ENV += php_cv_libxml_build_works=yes PHP_CONF_OPTS += --enable-libxml --with-libxml-dir=${STAGING_DIR}/usr PHP_DEPENDENCIES += libxml2 endif ifeq ($(BR2_PACKAGE_PHP_EXT_WDDX),y) PHP_CONF_OPTS += --enable-wddx --with-libexpat-dir=$(STAGING_DIR)/usr PHP_DEPENDENCIES += expat endif ifeq ($(BR2_PACKAGE_PHP_EXT_XMLRPC),y) PHP_CONF_OPTS += \ --with-xmlrpc \ $(if $(BR2_PACKAGE_LIBICONV),--with-iconv-dir=$(STAGING_DIR)/usr) PHP_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) endif ifneq ($(BR2_PACKAGE_PHP_EXT_ZLIB)$(BR2_PACKAGE_PHP_EXT_ZIP),) PHP_CONF_OPTS += --with-zlib=$(STAGING_DIR)/usr PHP_DEPENDENCIES += zlib endif ifeq ($(BR2_PACKAGE_PHP_EXT_GETTEXT),y) PHP_CONF_OPTS += --with-gettext=$(STAGING_DIR)/usr PHP_DEPENDENCIES += $(if $(BR2_NEEDS_GETTEXT),gettext) endif ifeq ($(BR2_PACKAGE_PHP_EXT_ICONV),y) ifeq ($(BR2_PACKAGE_LIBICONV),y) PHP_CONF_OPTS += --with-iconv=$(STAGING_DIR)/usr PHP_DEPENDENCIES += libiconv else PHP_CONF_OPTS += --with-iconv endif endif ifeq ($(BR2_PACKAGE_PHP_EXT_INTL),y) PHP_CONF_OPTS += --enable-intl --with-icu-dir=$(STAGING_DIR)/usr PHP_DEPENDENCIES += icu # The intl module is implemented in C++, but PHP fails to use # g++ as the compiler for the final link. As a workaround, # tell it to link libstdc++. PHP_EXTRA_LIBS += -lstdc++ endif ifeq ($(BR2_PACKAGE_PHP_EXT_GMP),y) PHP_CONF_OPTS += --with-gmp=$(STAGING_DIR)/usr PHP_DEPENDENCIES += gmp endif ifeq ($(BR2_PACKAGE_PHP_EXT_READLINE),y) PHP_CONF_OPTS += --with-readline=$(STAGING_DIR)/usr PHP_DEPENDENCIES += readline endif ### Native SQL extensions ifeq ($(BR2_PACKAGE_PHP_EXT_MYSQLI),y) PHP_CONF_OPTS += --with-mysqli=$(STAGING_DIR)/usr/bin/mysql_config PHP_DEPENDENCIES += mysql endif ifeq ($(BR2_PACKAGE_PHP_EXT_SQLITE),y) PHP_CONF_OPTS += --with-sqlite3=$(STAGING_DIR)/usr PHP_DEPENDENCIES += sqlite PHP_STATIC_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs sqlite3` endif ### PDO ifeq ($(BR2_PACKAGE_PHP_EXT_PDO),y) PHP_CONF_OPTS += --enable-pdo ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_SQLITE),y) PHP_CONF_OPTS += --with-pdo-sqlite=$(STAGING_DIR)/usr PHP_DEPENDENCIES += sqlite PHP_CFLAGS += -DSQLITE_OMIT_LOAD_EXTENSION endif ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),y) PHP_CONF_OPTS += --with-pdo-mysql=$(STAGING_DIR)/usr PHP_DEPENDENCIES += mysql endif ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_POSTGRESQL),y) PHP_CONF_OPTS += --with-pdo-pgsql=$(STAGING_DIR)/usr PHP_DEPENDENCIES += postgresql endif ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_UNIXODBC),y) PHP_CONF_OPTS += --with-pdo-odbc=unixODBC,$(STAGING_DIR)/usr PHP_DEPENDENCIES += unixodbc endif endif define PHP_DISABLE_PCRE_JIT $(SED) '/^#define SUPPORT_JIT/d' $(@D)/ext/pcre/pcrelib/config.h endef ### Use external PCRE if it's available ifeq ($(BR2_PACKAGE_PCRE),y) PHP_CONF_OPTS += --with-pcre-regex=$(STAGING_DIR)/usr PHP_DEPENDENCIES += pcre else # The bundled pcre library is not configurable through ./configure options, # and by default is configured to be thread-safe, so it wants pthreads. So # we must explicitly tell it when we don't have threads. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),) PHP_CFLAGS += -DSLJIT_SINGLE_THREADED=1 endif # check ext/pcre/pcrelib/sljit/sljitConfigInternal.h for supported archs ifeq ($(BR2_i386)$(BR2_x86_64)$(BR2_arm)$(BR2_armeb)$(BR2_aarch64)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_powerpc)$(BR2_sparc),) PHP_POST_CONFIGURE_HOOKS += PHP_DISABLE_PCRE_JIT endif endif ifeq ($(BR2_PACKAGE_PHP_EXT_CURL),y) PHP_CONF_OPTS += --with-curl=$(STAGING_DIR)/usr PHP_DEPENDENCIES += libcurl endif ifeq ($(BR2_PACKAGE_PHP_EXT_XSL),y) PHP_CONF_OPTS += --with-xsl=$(STAGING_DIR)/usr PHP_DEPENDENCIES += libxslt endif ifeq ($(BR2_PACKAGE_PHP_EXT_BZIP2),y) PHP_CONF_OPTS += --with-bz2=$(STAGING_DIR)/usr PHP_DEPENDENCIES += bzip2 endif ### DBA ifeq ($(BR2_PACKAGE_PHP_EXT_DBA),y) PHP_CONF_OPTS += --enable-dba ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_CDB),y) PHP_CONF_OPTS += --without-cdb endif ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_FLAT),y) PHP_CONF_OPTS += --without-flatfile endif ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_INI),y) PHP_CONF_OPTS += --without-inifile endif ifeq ($(BR2_PACKAGE_PHP_EXT_DBA_DB4),y) PHP_CONF_OPTS += --with-db4=$(STAGING_DIR)/usr PHP_DEPENDENCIES += berkeleydb endif endif ifeq ($(BR2_PACKAGE_PHP_EXT_SNMP),y) PHP_CONF_OPTS += --with-snmp=$(STAGING_DIR)/usr PHP_DEPENDENCIES += netsnmp endif ifeq ($(BR2_PACKAGE_PHP_EXT_GD),y) PHP_CONF_OPTS += \ --with-gd \ --with-jpeg-dir=$(STAGING_DIR)/usr \ --with-png-dir=$(STAGING_DIR)/usr \ --with-zlib-dir=$(STAGING_DIR)/usr \ --with-freetype-dir=$(STAGING_DIR)/usr PHP_DEPENDENCIES += jpeg libpng freetype endif ifeq ($(BR2_PACKAGE_PHP_FPM),y) define PHP_INSTALL_INIT_SYSV $(INSTALL) -D -m 0755 $(@D)/sapi/fpm/init.d.php-fpm \ $(TARGET_DIR)/etc/init.d/S49php-fpm endef define PHP_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 0644 $(@D)/sapi/fpm/php-fpm.service \ $(TARGET_DIR)/usr/lib/systemd/system/php-fpm.service mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service endef define PHP_INSTALL_FPM_CONF $(INSTALL) -D -m 0644 package/php/php-fpm.conf \ $(TARGET_DIR)/etc/php-fpm.conf rm -f $(TARGET_DIR)/etc/php-fpm.conf.default # remove unused sample status page /usr/php/php/fpm/status.html rm -rf $(TARGET_DIR)/usr/php endef PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FPM_CONF endif define PHP_EXTENSIONS_FIXUP $(SED) "/prefix/ s:/usr:$(STAGING_DIR)/usr:" \ $(STAGING_DIR)/usr/bin/phpize $(SED) "/extension_dir/ s:/usr:$(TARGET_DIR)/usr:" \ $(STAGING_DIR)/usr/bin/php-config endef PHP_POST_INSTALL_TARGET_HOOKS += PHP_EXTENSIONS_FIXUP define PHP_INSTALL_FIXUP rm -rf $(TARGET_DIR)/usr/lib/php/build rm -f $(TARGET_DIR)/usr/bin/phpize $(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \ $(TARGET_DIR)/etc/php.ini $(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \ $(TARGET_DIR)/etc/php.ini $(if $(BR2_PACKAGE_PHP_EXT_OPCACHE), $(SED) '/;extension=php_xsl.dll/azend_extension=opcache.so' \ $(TARGET_DIR)/etc/php.ini) endef PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)" $(eval $(autotools-package))
shibajee/buildroot
package/php/php.mk
mk
mit
10,487
config BR2_PACKAGE_PICOCOM bool "picocom" depends on BR2_USE_MMU # fork() help picocom is a minimal dumb-terminal emulation program. It is, in principle, very much like minicom, only it's pico instead of mini! https://github.com/npat-efault/picocom/
shibajee/buildroot
package/picocom/Config.in
in
mit
263
# Locally calculated sha256 6b152fc5f816eaef6b86336a4cec7cf1496b7c712061e5aea5a36f143a0b09ed picocom-2.1.tar.gz
shibajee/buildroot
package/picocom/picocom.hash
hash
mit
113
################################################################################ # # picocom # ################################################################################ PICOCOM_VERSION = 2.1 PICOCOM_SITE = $(call github,npat-efault,picocom,$(PICOCOM_VERSION)) PICOCOM_LICENSE = GPLv2+ PICOCOM_LICENSE_FILES = LICENSE.txt define PICOCOM_BUILD_CMDS $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) endef define PICOCOM_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/picocom $(TARGET_DIR)/usr/bin/picocom endef $(eval $(generic-package))
shibajee/buildroot
package/picocom/picocom.mk
mk
mit
561
Makefile: make it cross-compile (and Buildroot) friendly. The current Makefile makes heavy assumptions that it is doing native compilation on the RPi, as it checks that `uname -m` is an ARM machine. This is wrong in the cross-compilation case. Remove the conditional altogether, and do not override the CFLAGS as passed in the environment (Buildroot passes proper CFLAGS). [intial patch by: Eric Limpens <limpens@gmail.com>] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> diff -durN pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile --- pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile 2014-05-04 18:21:40.000000000 +0200 +++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-06-21 16:38:31.971804343 +0200 @@ -1,20 +1,8 @@ CC = gcc -STD_CFLAGS = -Wall -std=gnu99 -c -g -O3 -# Enable ARM-specific options only on ARM, and compilation of the app only on ARM -UNAME := $(shell uname -m) - -ifeq ($(UNAME), armv6l) - CFLAGS = $(STD_CFLAGS) -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math - app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o $(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile -else - CFLAGS = $(STD_CFLAGS) -endif - - rds_wav: rds.o waveforms.o rds_wav.o fm_mpx.o $(CC) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lm -lsndfile
shibajee/buildroot
package/pifmrds/0001-Makefile-cross-compile-friendly.patch
patch
mit
1,455
Makefile: use LDFLAGS when linking Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> diff -durN pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile --- pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile 2014-06-21 16:46:49.101118754 +0200 +++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-06-21 16:47:47.801745683 +0200 @@ -1,10 +1,10 @@ CC = gcc app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o - $(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile + $(CC) $(LDFLAGS) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile rds_wav: rds.o waveforms.o rds_wav.o fm_mpx.o - $(CC) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lm -lsndfile + $(CC) $(LDFLAGS) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lm -lsndfile rds.o: rds.c waveforms.h $(CC) $(CFLAGS) rds.c
shibajee/buildroot
package/pifmrds/0002-Makefile-use-LDFLAGS.patch
patch
mit
974
Makefile: Fix static linking Since libsndfile uses funtions from libm, the -lm should be specified after libsndfile for static linking. Signed-off-by: "Eric Limpens" <Limpens@gmail.com> diff -purN pifmrds-0bf57f9ce0d954365a38d8af8e7be6f28521c3f2.orig/src/Makefile pifmrds-0bf57f9ce0d954365a38d8af8e7be6f28521c3f2/src/Makefile --- pifmrds-0bf57f9ce0d954365a38d8af8e7be6f28521c3f2.orig/src/Makefile 2016-02-26 08:06:43.102962592 +0100 +++ pifmrds-0bf57f9ce0d954365a38d8af8e7be6f28521c3f2/src/Makefile 2016-02-26 08:27:11.069148203 +0100 @@ -1,10 +1,10 @@ CC = gcc app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o - $(CC) $(LDFLAGS) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile + $(CC) $(LDFLAGS) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lsndfile -lm rds_wav: rds.o waveforms.o rds_wav.o fm_mpx.o - $(CC) $(LDFLAGS) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lm -lsndfile + $(CC) $(LDFLAGS) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lsndfile -lm rds.o: rds.c waveforms.h $(CC) $(CFLAGS) rds.c
shibajee/buildroot
package/pifmrds/0003-Makefile-fix-static-link.patch
patch
mit
1,091
config BR2_PACKAGE_PIFMRDS bool "pifmrds" depends on BR2_arm select BR2_PACKAGE_LIBSNDFILE help pifmrds, FM-RDS transmitter using the Raspberry Pi's PWM https://github.com/ChristopheJacquet/PiFmRds
shibajee/buildroot
package/pifmrds/Config.in
in
mit
209
# Locally calculated sha256 2afc9f3c9fc206ba32865d7dd77f3a97d7d86dcfc9b44eeb5665e8fddaafcf44 pifmrds-0bf57f9ce0d954365a38d8af8e7be6f28521c3f2.tar.gz
shibajee/buildroot
package/pifmrds/pifmrds.hash
hash
mit
150
################################################################################ # # pifmrds # ################################################################################ PIFMRDS_VERSION = 0bf57f9ce0d954365a38d8af8e7be6f28521c3f2 PIFMRDS_SITE = $(call github,ChristopheJacquet,PiFmRds,$(PIFMRDS_VERSION)) PIFMRDS_DEPENDENCIES = libsndfile PIFMRDS_LICENSE = GPLv3+ PIFMRDS_LICENSE_FILES = LICENSE define PIFMRDS_BUILD_CMDS $(MAKE) -C $(@D)/src CC="$(TARGET_CC)" LDFLAGS="$(TARGET_LDFLAGS)" \ CFLAGS="$(TARGET_CFLAGS) -std=gnu99 -ffast-math -c" \ app rds_wav endef define PIFMRDS_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/src/pi_fm_rds $(TARGET_DIR)/usr/bin/pi_fm_rds $(INSTALL) -D -m 0755 $(@D)/src/rds_wav $(TARGET_DIR)/usr/bin/rds_wav endef $(eval $(generic-package))
shibajee/buildroot
package/pifmrds/pifmrds.mk
mk
mit
791
From cf84bf3ef505059d42184b22cf38f89336bec43d Mon Sep 17 00:00:00 2001 From: Gergely Imreh <imrehg@gmail.com> Date: Mon, 22 Jun 2015 07:51:17 +0000 Subject: [PATCH 1/1] remove hard-wired ncursesw include path Don't assume that the ncursesw headers are in ../usr/include/ncursesw/.., and pkg-config finds the correct include path anyways. Signed-off-by: Gergely Imreh <imrehg@gmail.com> --- pinentry/pinentry-curses.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c index 235435a..bdcd0f4 100644 --- a/pinentry/pinentry-curses.c +++ b/pinentry/pinentry-curses.c @@ -22,11 +22,7 @@ #include <config.h> #endif #include <assert.h> -#ifdef HAVE_NCURSESW -#include <ncursesw/curses.h> -#else #include <curses.h> -#endif #include <signal.h> #include <fcntl.h> #include <unistd.h> -- 1.9.1
shibajee/buildroot
package/pinentry/0001-remove-hard-wired-ncursesw-include-path.patch
patch
mit
857
menuconfig BR2_PACKAGE_PINENTRY bool "pinentry" # At least one backend is needed to avoid build breakage select BR2_PACKAGE_PINENTRY_NCURSES if !BR2_PACKAGE_PINENTRY_GTK2 && !BR2_PACKAGE_PINENTRY_QT4 help A collection of simple PIN or pass-phrase entry dialogs https://www.gnupg.org/related_software/pinentry/ if BR2_PACKAGE_PINENTRY config BR2_PACKAGE_PINENTRY_NCURSES bool "pinentry-ncurses" select BR2_PACKAGE_NCURSES select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE help The pinentry-ncurses tool config BR2_PACKAGE_PINENTRY_GTK2 bool "pinentry-gtk2" depends on BR2_PACKAGE_XORG7 depends on BR2_USE_WCHAR depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU depends on BR2_INSTALL_LIBSTDCPP depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libgtk2 -> pango -> harfbuzz select BR2_PACKAGE_LIBGTK2 select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE help The pinentry-gtk2 tool comment "pinentry-gtk2 needs X and a toolchain w/ wchar, threads, C++" depends on BR2_USE_MMU depends on BR2_TOOLCHAIN_HAS_SYNC_4 depends on !BR2_PACKAGE_XORG7 || !BR2_USE_WCHAR || \ !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_PINENTRY_QT4 bool "pinentry-qt4" depends on BR2_USE_MMU # fork depends on BR2_INSTALL_LIBSTDCPP depends on BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 # Qt GUI module select BR2_PACKAGE_QT select BR2_PACKAGE_QT_GUI_MODULE help The pinentry-qt4 tool comment "pinentry-qt4 support needs a toolchain not affected by Binutils bug 19405" depends on BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 comment "pinentry-qt4 needs a toolchain w/ C++, threads" depends on BR2_USE_MMU depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS endif
shibajee/buildroot
package/pinentry/Config.in
in
mit
1,750
# From https://www.gnupg.org/download/integrity_check.html sha1 0c47f0ddea4631bcba01ebbeca8bffe0bf43e440 pinentry-0.9.4.tar.bz2
shibajee/buildroot
package/pinentry/pinentry.hash
hash
mit
130
################################################################################ # # pinentry # ################################################################################ PINENTRY_VERSION = 0.9.4 PINENTRY_SOURCE = pinentry-$(PINENTRY_VERSION).tar.bz2 PINENTRY_SITE = ftp://ftp.gnupg.org/gcrypt/pinentry PINENTRY_LICENSE = GPLv2+ PINENTRY_LICENSE_FILES = COPYING PINENTRY_DEPENDENCIES = \ $(if $(BR2_PACKAGE_LIBICONV),libiconv) \ host-pkgconf PINENTRY_CONF_OPTS += --without-libcap # requires PAM # pinentry uses some std::string functionality that needs C++11 # support when gcc >= 5.x. This should be removed when bumping # pinentry, since newer versions no longer use std::string. ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),y) PINENTRY_CONF_ENV = CXXFLAGS="$(TARGET_CXXFLAGS) -std=gnu++11" endif # build with X if available ifeq ($(BR2_PACKAGE_XORG7),y) PINENTRY_CONF_OPTS += --with-x else PINENTRY_CONF_OPTS += --without-x endif ifeq ($(BR2_PACKAGE_LIBSECRET),y) PINENTRY_CONF_OPTS += --enable-libsecret PINENTRY_DEPENDENCIES += libsecret else PINENTRY_CONF_OPTS += --disable-libsecret endif # pinentry-ncurses backend ifeq ($(BR2_PACKAGE_PINENTRY_NCURSES),y) PINENTRY_CONF_OPTS += --enable-ncurses --with-ncurses-include-dir=none PINENTRY_DEPENDENCIES += ncurses else PINENTRY_CONF_OPTS += --disable-ncurses endif # pinentry-gtk2 backend ifeq ($(BR2_PACKAGE_PINENTRY_GTK2),y) PINENTRY_CONF_OPTS += --enable-pinentry-gtk2 PINENTRY_DEPENDENCIES += libgtk2 else PINENTRY_CONF_OPTS += --disable-pinentry-gtk2 endif # pinentry-qt4 backend ifeq ($(BR2_PACKAGE_PINENTRY_QT4),y) # -pthread needs to be passed for certain toolchains # http://autobuild.buildroot.net/results/6be/6be109ccedec603a67cebdb31b55865dcce0e128/ PINENTRY_CONF_OPTS += LIBS=-pthread MOC=$(HOST_DIR)/usr/bin/moc PINENTRY_CONF_OPTS += --enable-pinentry-qt4 PINENTRY_DEPENDENCIES += qt else PINENTRY_CONF_OPTS += --disable-pinentry-qt4 endif $(eval $(autotools-package))
shibajee/buildroot
package/pinentry/pinentry.mk
mk
mit
1,953
From 9b8132738c364fc3c886e81e7d383aaff80dc867 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" <yann.morin.1998@free.fr> Date: Sat, 5 Dec 2015 12:00:53 +0100 Subject: [PATCH] Disable tests Tests are causing build failures on some architectures that are missing a proper fenv.h, so just disable them. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> --- Status: Buildroot specific, not suitable for upstream in this state. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 5137c9e..eae79fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = pixman demos test +SUBDIRS = pixman demos pkgconfigdir=$(libdir)/pkgconfig pkgconfig_DATA=pixman-1.pc -- 1.9.1
shibajee/buildroot
package/pixman/0001-Disable-tests.patch
patch
mit
752
From 2a5b33fe5cb921993573392afac19185e224b49a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: Sun, 17 Jan 2016 14:14:28 +0100 Subject: [PATCH] pixman-private: include <float.h> only in C code <float.h> is included unconditionally by pixman-private.h, which in turn gets included by assembler files. Unfortunately, with certain C libraries (like the musl C library), <float.h> cannot be included in assembler files: CCLD libpixman-arm-simd.la /home/test/buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/float.h: Assembler messages: /home/test/buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/float.h:8: Error: bad instruction `int __flt_rounds(void)' /home/test/buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/float.h: Assembler messages: /home/test/buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/float.h:8: Error: bad instruction `int __flt_rounds(void)' It turns out however that <float.h> is not needed by assembly files, so we move its inclusion within the #ifndef __ASSEMBLER__ condition, which solves the problem. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- pixman/pixman-private.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 73108a0..73a5414 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -1,5 +1,3 @@ -#include <float.h> - #ifndef PIXMAN_PRIVATE_H #define PIXMAN_PRIVATE_H @@ -30,6 +28,7 @@ #include <stdio.h> #include <string.h> #include <stddef.h> +#include <float.h> #include "pixman-compiler.h" -- 2.6.4
shibajee/buildroot
package/pixman/0002-pixman-private-include-float.h-only-in-C-code.patch
patch
mit
1,734
config BR2_PACKAGE_PIXMAN bool "pixman" help Cairo pixel manager http://cairographics.org/releases/
shibajee/buildroot
package/pixman/Config.in
in
mit
109
# From http://lists.x.org/archives/xorg-announce/2016-January/002672.html sha1 367698744e74d6d4f363041482965b9ea7fbe4a5 pixman-0.34.0.tar.bz2
shibajee/buildroot
package/pixman/pixman.hash
hash
mit
142
################################################################################ # # pixman # ################################################################################ PIXMAN_VERSION = 0.34.0 PIXMAN_SOURCE = pixman-$(PIXMAN_VERSION).tar.bz2 PIXMAN_SITE = http://xorg.freedesktop.org/releases/individual/lib PIXMAN_LICENSE = MIT PIXMAN_LICENSE_FILES = COPYING PIXMAN_INSTALL_STAGING = YES PIXMAN_DEPENDENCIES = host-pkgconf HOST_PIXMAN_DEPENDENCIES = host-pkgconf # For 0001-Disable-tests.patch PIXMAN_AUTORECONF = YES # don't build gtk based demos PIXMAN_CONF_OPTS = --disable-gtk # The ARM SIMD code from pixman requires a recent enough ARM core, but # there is a runtime CPU check that makes sure it doesn't get used if # the HW doesn't support it. The only case where the ARM SIMD code # cannot be *built* at all is when the platform doesn't support ARM # instructions at all, so we have to disable that explicitly. ifeq ($(BR2_ARM_CPU_HAS_ARM),y) PIXMAN_CONF_OPTS += --enable-arm-simd else PIXMAN_CONF_OPTS += --disable-arm-simd endif ifeq ($(BR2_ARM_CPU_HAS_ARM)$(BR2_ARM_CPU_HAS_NEON),yy) PIXMAN_CONF_OPTS += --enable-arm-neon else PIXMAN_CONF_OPTS += --disable-arm-neon endif # disable iwmmxt support for CPU's that don't have # this feature ifneq ($(BR2_iwmmxt),y) PIXMAN_CONF_OPTS += --disable-arm-iwmmxt endif # toolchain gets confused about TLS access through GOT (PIC), so disable TLS # movhi r4, %got_hiadj(%tls_ldo(fast_path_cache)) # {standard input}:172: Error: bad expression ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII),y) PIXMAN_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -DPIXMAN_NO_TLS" endif $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/pixman/pixman.mk
mk
mit
1,694
################################################################################ # Autotools package infrastructure # # This file implements an infrastructure that eases development of # package .mk files for autotools packages. It should be used for all # packages that use the autotools as their build system. # # See the Buildroot documentation for details on the usage of this # infrastructure # # In terms of implementation, this autotools infrastructure requires # the .mk file to only specify metadata information about the # package: name, version, download URL, etc. # # We still allow the package .mk file to override what the different # steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is # already defined, it is used as the list of commands to perform to # build the package, instead of the default autotools behaviour. The # package can also define some post operation hooks. # ################################################################################ # # Utility function to upgrade config.sub and config.guess files # # argument 1 : directory into which config.guess and config.sub need # to be updated. Note that config.sub and config.guess are searched # recursively in this directory. # define CONFIG_UPDATE for file in config.guess config.sub; do \ for i in $$(find $(1) -name $$file); do \ cp support/gnuconfig/$$file $$i; \ done; \ done endef # This function generates the ac_cv_file_<foo> value for a given # filename. This is needed to convince configure script doing # AC_CHECK_FILE() tests that the file actually exists, since such # tests cannot be done in a cross-compilation context. This function # takes as argument the path of the file. An example usage is: # # FOOBAR_CONF_ENV = \ # $(call AUTOCONF_AC_CHECK_FILE_VAL,/dev/random)=yes AUTOCONF_AC_CHECK_FILE_VAL = ac_cv_file_$(subst -,_,$(subst /,_,$(subst .,_,$(1)))) # # Hook to update config.sub and config.guess if needed # define UPDATE_CONFIG_HOOK @$(call MESSAGE,"Updating config.sub and config.guess") $(call CONFIG_UPDATE,$(@D)) endef # # Hook to patch libtool to make it work properly for cross-compilation # define LIBTOOL_PATCH_HOOK @$(call MESSAGE,"Patching libtool") $(Q)for i in `find $($(PKG)_SRCDIR) -name ltmain.sh`; do \ ltmain_version=`sed -n '/^[ \t]*VERSION=/{s/^[ \t]*VERSION=//;p;q;}' $$i | \ sed -e 's/\([0-9]*\.[0-9]*\).*/\1/' -e 's/\"//'`; \ ltmain_patchlevel=`sed -n '/^[ \t]*VERSION=/{s/^[ \t]*VERSION=//;p;q;}' $$i | \ sed -e 's/\([0-9]*\.[0-9]*\.*\)\([0-9]*\).*/\2/' -e 's/\"//'`; \ if test $${ltmain_version} = '1.5'; then \ patch -i support/libtool/buildroot-libtool-v1.5.patch $${i}; \ elif test $${ltmain_version} = "2.2"; then\ patch -i support/libtool/buildroot-libtool-v2.2.patch $${i}; \ elif test $${ltmain_version} = "2.4"; then\ if test $${ltmain_patchlevel:-0} -gt 2; then\ patch -i support/libtool/buildroot-libtool-v2.4.4.patch $${i}; \ else \ patch -i support/libtool/buildroot-libtool-v2.4.patch $${i}; \ fi \ fi \ done endef # # Hook to gettextize the package if needed # define GETTEXTIZE_HOOK @$(call MESSAGE,"Gettextizing") $(Q)cd $($(PKG)_SRCDIR) && $(GETTEXTIZE) $($(PKG)_GETTEXTIZE_OPTS) endef # # Hook to autoreconf the package if needed # define AUTORECONF_HOOK @$(call MESSAGE,"Autoreconfiguring") $(Q)cd $($(PKG)_SRCDIR) && $($(PKG)_AUTORECONF_ENV) $(AUTORECONF) $($(PKG)_AUTORECONF_OPTS) endef ################################################################################ # inner-autotools-package -- defines how the configuration, compilation and # installation of an autotools package should be done, implements a # few hooks to tune the build process for autotools specifities and # calls the generic package infrastructure to generate the necessary # make targets # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) ################################################################################ define inner-autotools-package ifndef $(2)_LIBTOOL_PATCH ifdef $(3)_LIBTOOL_PATCH $(2)_LIBTOOL_PATCH = $$($(3)_LIBTOOL_PATCH) else $(2)_LIBTOOL_PATCH ?= YES endif endif ifndef $(2)_MAKE ifdef $(3)_MAKE $(2)_MAKE = $$($(3)_MAKE) else $(2)_MAKE ?= $$(MAKE) endif endif ifndef $(2)_AUTORECONF ifdef $(3)_AUTORECONF $(2)_AUTORECONF = $$($(3)_AUTORECONF) else $(2)_AUTORECONF ?= NO endif endif ifndef $(2)_GETTEXTIZE ifdef $(3)_GETTEXTIZE $(2)_GETTEXTIZE = $$($(3)_GETTEXTIZE) else $(2)_GETTEXTIZE ?= NO endif endif ifeq ($(4),host) $(2)_GETTEXTIZE_OPTS ?= $$($(3)_GETTEXTIZE_OPTS) endif ifeq ($(4),host) $(2)_AUTORECONF_OPTS ?= $$($(3)_AUTORECONF_OPTS) endif $(2)_CONF_ENV ?= $(2)_CONF_OPTS ?= $(2)_MAKE_ENV ?= $(2)_MAKE_OPTS ?= $(2)_INSTALL_OPTS ?= install $(2)_INSTALL_STAGING_OPTS ?= DESTDIR=$$(STAGING_DIR) install $(2)_INSTALL_TARGET_OPTS ?= DESTDIR=$$(TARGET_DIR) install # # Configure step. Only define it if not already defined by the package # .mk file. And take care of the differences between host and target # packages. # ifndef $(2)_CONFIGURE_CMDS ifeq ($(4),target) # Configure package for target define $(2)_CONFIGURE_CMDS (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache && \ $$(TARGET_CONFIGURE_OPTS) \ $$(TARGET_CONFIGURE_ARGS) \ $$($$(PKG)_CONF_ENV) \ CONFIG_SITE=/dev/null \ ./configure \ --target=$$(GNU_TARGET_NAME) \ --host=$$(GNU_TARGET_NAME) \ --build=$$(GNU_HOST_NAME) \ --prefix=/usr \ --exec-prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --program-prefix="" \ --disable-gtk-doc \ --disable-gtk-doc-html \ --disable-doc \ --disable-docs \ --disable-documentation \ --with-xmlto=no \ --with-fop=no \ --disable-dependency-tracking \ --enable-ipv6 \ $$(DISABLE_NLS) \ $$(SHARED_STATIC_LIBS_OPTS) \ $$(QUIET) $$($$(PKG)_CONF_OPTS) \ ) endef else # Configure package for host # disable all kind of documentation generation in the process, # because it often relies on host tools which may or may not be # installed. define $(2)_CONFIGURE_CMDS (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache; \ $$(HOST_CONFIGURE_OPTS) \ CFLAGS="$$(HOST_CFLAGS)" \ LDFLAGS="$$(HOST_LDFLAGS)" \ $$($$(PKG)_CONF_ENV) \ CONFIG_SITE=/dev/null \ ./configure \ --prefix="$$(HOST_DIR)/usr" \ --sysconfdir="$$(HOST_DIR)/etc" \ --localstatedir="$$(HOST_DIR)/var" \ --enable-shared --disable-static \ --disable-gtk-doc \ --disable-gtk-doc-html \ --disable-doc \ --disable-docs \ --disable-documentation \ --disable-debug \ --with-xmlto=no \ --with-fop=no \ --disable-dependency-tracking \ $$(QUIET) $$($$(PKG)_CONF_OPTS) \ ) endef endif endif $(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK ifeq ($$($(2)_AUTORECONF),YES) # This has to come before autoreconf ifeq ($$($(2)_GETTEXTIZE),YES) $(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK $(2)_DEPENDENCIES += host-gettext endif $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK # default values are not evaluated yet, so don't rely on this defaulting to YES ifneq ($$($(2)_LIBTOOL_PATCH),NO) $(2)_PRE_CONFIGURE_HOOKS += LIBTOOL_PATCH_HOOK endif $(2)_DEPENDENCIES += host-automake host-autoconf host-libtool else # ! AUTORECONF = YES # default values are not evaluated yet, so don't rely on this defaulting to YES ifneq ($$($(2)_LIBTOOL_PATCH),NO) $(2)_POST_PATCH_HOOKS += LIBTOOL_PATCH_HOOK endif endif # # Build step. Only define it if not already defined by the package .mk # file. # ifndef $(2)_BUILD_CMDS ifeq ($(4),target) define $(2)_BUILD_CMDS $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) endef else define $(2)_BUILD_CMDS $$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) endef endif endif # # Host installation step. Only define it if not already defined by the # package .mk file. # ifndef $(2)_INSTALL_CMDS define $(2)_INSTALL_CMDS $$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_OPTS) -C $$($$(PKG)_SRCDIR) endef endif # # Staging installation step. Only define it if not already defined by # the package .mk file. # ifndef $(2)_INSTALL_STAGING_CMDS define $(2)_INSTALL_STAGING_CMDS $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPTS) -C $$($$(PKG)_SRCDIR) endef endif # # Target installation step. Only define it if not already defined by # the package .mk file. # ifndef $(2)_INSTALL_TARGET_CMDS define $(2)_INSTALL_TARGET_CMDS $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_TARGET_OPTS) -C $$($$(PKG)_SRCDIR) endef endif # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) endef ################################################################################ # autotools-package -- the target generator macro for autotools packages ################################################################################ autotools-package = $(call inner-autotools-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) host-autotools-package = $(call inner-autotools-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
shibajee/buildroot
package/pkg-autotools.mk
mk
mit
9,453
################################################################################ # CMake package infrastructure # # This file implements an infrastructure that eases development of # package .mk files for CMake packages. It should be used for all # packages that use CMake as their build system. # # See the Buildroot documentation for details on the usage of this # infrastructure # # In terms of implementation, this CMake infrastructure requires # the .mk file to only specify metadata information about the # package: name, version, download URL, etc. # # We still allow the package .mk file to override what the different # steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is # already defined, it is used as the list of commands to perform to # build the package, instead of the default CMake behaviour. The # package can also define some post operation hooks. # ################################################################################ # Set compiler variables. ifeq ($(BR2_CCACHE),y) CMAKE_HOST_C_COMPILER = $(HOST_DIR)/usr/bin/ccache CMAKE_HOST_CXX_COMPILER = $(HOST_DIR)/usr/bin/ccache CMAKE_HOST_C_COMPILER_ARG1 = $(HOSTCC_NOCCACHE) CMAKE_HOST_CXX_COMPILER_ARG1 = $(HOSTCXX_NOCCACHE) else CMAKE_HOST_C_COMPILER = $(HOSTCC) CMAKE_HOST_CXX_COMPILER = $(HOSTCXX) endif ifneq ($(QUIET),) CMAKE_QUIET = -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_INSTALL_MESSAGE=NEVER endif ################################################################################ # inner-cmake-package -- defines how the configuration, compilation and # installation of a CMake package should be done, implements a few hooks to # tune the build process and calls the generic package infrastructure to # generate the necessary make targets # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) ################################################################################ define inner-cmake-package $(2)_CONF_ENV ?= $(2)_CONF_OPTS ?= $(2)_MAKE ?= $$(MAKE) $(2)_MAKE_ENV ?= $(2)_MAKE_OPTS ?= $(2)_INSTALL_OPTS ?= install $(2)_INSTALL_STAGING_OPTS ?= DESTDIR=$$(STAGING_DIR) install/fast $(2)_INSTALL_TARGET_OPTS ?= DESTDIR=$$(TARGET_DIR) install/fast $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) $(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES) $(2)_BUILDDIR = $$($(2)_SRCDIR) else $(2)_BUILDDIR = $$($(2)_SRCDIR)/buildroot-build endif # # Configure step. Only define it if not already defined by the package # .mk file. And take care of the differences between host and target # packages. # ifndef $(2)_CONFIGURE_CMDS ifeq ($(4),target) # Configure package for target define $(2)_CONFIGURE_CMDS (mkdir -p $$($$(PKG)_BUILDDIR) && \ cd $$($$(PKG)_BUILDDIR) && \ rm -f CMakeCache.txt && \ PATH=$$(BR_PATH) \ $$($$(PKG)_CONF_ENV) $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \ -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \ -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),RelWithDebInfo,Release) \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_COLOR_MAKEFILE=OFF \ -DBUILD_DOC=OFF \ -DBUILD_DOCS=OFF \ -DBUILD_EXAMPLE=OFF \ -DBUILD_EXAMPLES=OFF \ -DBUILD_TEST=OFF \ -DBUILD_TESTS=OFF \ -DBUILD_TESTING=OFF \ -DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \ $$(CMAKE_QUIET) \ $$($$(PKG)_CONF_OPTS) \ ) endef else # Configure package for host define $(2)_CONFIGURE_CMDS (mkdir -p $$($$(PKG)_BUILDDIR) && \ cd $$($$(PKG)_BUILDDIR) && \ rm -f CMakeCache.txt && \ PATH=$$(BR_PATH) \ $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \ -DCMAKE_INSTALL_SO_NO_EXE=0 \ -DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \ -DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \ -DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \ -DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \ -DCMAKE_ASM_COMPILER="$$(HOSTAS)" \ -DCMAKE_C_COMPILER="$$(CMAKE_HOST_C_COMPILER)" \ -DCMAKE_CXX_COMPILER="$$(CMAKE_HOST_CXX_COMPILER)" \ $(if $$(CMAKE_HOST_C_COMPILER_ARG1),\ -DCMAKE_C_COMPILER_ARG1="$$(CMAKE_HOST_C_COMPILER_ARG1)" \ -DCMAKE_CXX_COMPILER_ARG1="$$(CMAKE_HOST_CXX_COMPILER_ARG1)" \ ) \ -DCMAKE_COLOR_MAKEFILE=OFF \ -DBUILD_DOC=OFF \ -DBUILD_DOCS=OFF \ -DBUILD_EXAMPLE=OFF \ -DBUILD_EXAMPLES=OFF \ -DBUILD_TEST=OFF \ -DBUILD_TESTS=OFF \ -DBUILD_TESTING=OFF \ $$(CMAKE_QUIET) \ $$($$(PKG)_CONF_OPTS) \ ) endef endif endif # Since some CMake modules (even upstream ones) use pgk_check_modules # primitives to find {C,LD}FLAGS, add it to the dependency list. $(2)_DEPENDENCIES += host-pkgconf $(2)_DEPENDENCIES += host-cmake # # Build step. Only define it if not already defined by the package .mk # file. # ifndef $(2)_BUILD_CMDS ifeq ($(4),target) define $(2)_BUILD_CMDS $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR) endef else define $(2)_BUILD_CMDS $$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR) endef endif endif # # Host installation step. Only define it if not already defined by the # package .mk file. # ifndef $(2)_INSTALL_CMDS define $(2)_INSTALL_CMDS $$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) $$($$(PKG)_INSTALL_OPTS) -C $$($$(PKG)_BUILDDIR) endef endif # # Staging installation step. Only define it if not already defined by # the package .mk file. # ifndef $(2)_INSTALL_STAGING_CMDS define $(2)_INSTALL_STAGING_CMDS $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) $$($$(PKG)_INSTALL_STAGING_OPTS) -C $$($$(PKG)_BUILDDIR) endef endif # # Target installation step. Only define it if not already defined by # the package .mk file. # ifndef $(2)_INSTALL_TARGET_CMDS define $(2)_INSTALL_TARGET_CMDS $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) $$($$(PKG)_INSTALL_TARGET_OPTS) -C $$($$(PKG)_BUILDDIR) endef endif # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) endef ################################################################################ # cmake-package -- the target generator macro for CMake packages ################################################################################ cmake-package = $(call inner-cmake-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host) ################################################################################ # Generation of the CMake toolchain file ################################################################################ # CMAKE_SYSTEM_PROCESSOR should match uname -m ifeq ($(BR2_ARM_CPU_ARMV4),y) CMAKE_SYSTEM_PROCESSOR_ARM_VARIANT = armv4 else ifeq ($(BR2_ARM_CPU_ARMV5),y) CMAKE_SYSTEM_PROCESSOR_ARM_VARIANT = armv5 else ifeq ($(BR2_ARM_CPU_ARMV6),y) CMAKE_SYSTEM_PROCESSOR_ARM_VARIANT = armv6 else ifeq ($(BR2_ARM_CPU_ARMV7A),y) CMAKE_SYSTEM_PROCESSOR_ARM_VARIANT = armv7 endif ifeq ($(BR2_arm),y) CMAKE_SYSTEM_PROCESSOR = $(CMAKE_SYSTEM_PROCESSOR_ARM_VARIANT)l else ifeq ($(BR2_armeb),y) CMAKE_SYSTEM_PROCESSOR = $(CMAKE_SYSTEM_PROCESSOR_ARM_VARIANT)b else CMAKE_SYSTEM_PROCESSOR = $(BR2_ARCH) endif # In order to allow the toolchain to be relocated, we calculate the HOST_DIR # based on the toolchainfile.cmake file's location: $(HOST_DIR)/usr/share/buildroot # In all the other variables, HOST_DIR will be replaced by RELOCATED_HOST_DIR, # so we have to strip "$(HOST_DIR)/" from the paths that contain it. $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake: @mkdir -p $(@D) sed \ -e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \ -e 's#@@TARGET_CFLAGS@@#$(call qstrip,$(TARGET_CFLAGS))#' \ -e 's#@@TARGET_CXXFLAGS@@#$(call qstrip,$(TARGET_CXXFLAGS))#' \ -e 's#@@TARGET_FCFLAGS@@#$(call qstrip,$(TARGET_FCFLAGS))#' \ -e 's#@@TARGET_LDFLAGS@@#$(call qstrip,$(TARGET_LDFLAGS))#' \ -e 's#@@TARGET_CC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC)))#' \ -e 's#@@TARGET_CXX@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX)))#' \ -e 's#@@TARGET_FC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_FC)))#' \ -e 's#@@CMAKE_SYSTEM_PROCESSOR@@#$(call qstrip,$(CMAKE_SYSTEM_PROCESSOR))#' \ -e 's#@@TOOLCHAIN_HAS_FORTRAN@@#$(if $(BR2_TOOLCHAIN_HAS_FORTRAN),1,0)#' \ $(TOPDIR)/support/misc/toolchainfile.cmake.in \ > $@
shibajee/buildroot
package/pkg-cmake.mk
mk
mit
8,840
################################################################################ # # This file contains the download helpers for the various package # infrastructures. It is used to handle downloads from HTTP servers, # FTP servers, Git repositories, Subversion repositories, Mercurial # repositories, Bazaar repositories, and SCP servers. # ################################################################################ # Download method commands export WGET := $(call qstrip,$(BR2_WGET)) export SVN := $(call qstrip,$(BR2_SVN)) export CVS := $(call qstrip,$(BR2_CVS)) export BZR := $(call qstrip,$(BR2_BZR)) export GIT := $(call qstrip,$(BR2_GIT)) export HG := $(call qstrip,$(BR2_HG)) export SCP := $(call qstrip,$(BR2_SCP)) SSH := $(call qstrip,$(BR2_SSH)) export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES)) DL_WRAPPER = support/download/dl-wrapper # DL_DIR may have been set already from the environment ifeq ($(origin DL_DIR),undefined) DL_DIR ?= $(call qstrip,$(BR2_DL_DIR)) ifeq ($(DL_DIR),) DL_DIR := $(TOPDIR)/dl endif else # Restore the BR2_DL_DIR that was overridden by the .config file BR2_DL_DIR = $(DL_DIR) endif # ensure it exists and a absolute path DL_DIR := $(shell mkdir -p $(DL_DIR) && cd $(DL_DIR) >/dev/null && pwd) # # URI scheme helper functions # Example URIs: # * http://www.example.com/dir/file # * scp://www.example.com:dir/file (with domainseparator :) # # geturischeme: http geturischeme = $(firstword $(subst ://, ,$(call qstrip,$(1)))) # stripurischeme: www.example.com/dir/file stripurischeme = $(lastword $(subst ://, ,$(call qstrip,$(1)))) # domain: www.example.com domain = $(firstword $(subst $(call domainseparator,$(2)), ,$(call stripurischeme,$(1)))) # notdomain: dir/file notdomain = $(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$(call stripurischeme,$(1))) # # default domainseparator is /, specify alternative value as first argument domainseparator = $(if $(1),$(1),/) # github(user,package,version): returns site of GitHub repository github = https://github.com/$(1)/$(2)/archive/$(3) # Expressly do not check hashes for those files # Exported variables default to immediately expanded in some versions of # make, but we need it to be recursively-epxanded, so explicitly assign it. export BR_NO_CHECK_HASH_FOR = ################################################################################ # The DOWNLOAD_* helpers are in charge of getting a working copy # of the source repository for their corresponding SCM, # checking out the requested version / commit / tag, and create an # archive out of it. DOWNLOAD_SCP uses scp to obtain a remote file with # ssh authentication. DOWNLOAD_WGET is the normal wget-based download # mechanism. # # The SOURCE_CHECK_* helpers are in charge of simply checking that the source # is available for download. This can be used to make sure one will be able # to get all the sources needed for one's build configuration. ################################################################################ define DOWNLOAD_GIT $(EXTRA_ENV) $(DL_WRAPPER) -b git \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ $(if $($(PKG)_GIT_SUBMODULES),-r) \ $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \ $($(PKG)_BASE_NAME) endef # TODO: improve to check that the given PKG_DL_VERSION exists on the remote # repository define SOURCE_CHECK_GIT $(GIT) ls-remote --heads $($(PKG)_SITE) > /dev/null endef define DOWNLOAD_BZR $(EXTRA_ENV) $(DL_WRAPPER) -b bzr \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \ $($(PKG)_BASE_NAME) endef define SOURCE_CHECK_BZR $(BZR) ls --quiet $($(PKG)_SITE) > /dev/null endef define DOWNLOAD_CVS $(EXTRA_ENV) $(DL_WRAPPER) -b cvs \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ $(QUIET) \ -- \ $(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \ $($(PKG)_DL_VERSION) \ $($(PKG)_RAWNAME) \ $($(PKG)_BASE_NAME) endef # Not all CVS servers support ls/rls, use login to see if we can connect define SOURCE_CHECK_CVS $(CVS) -d:pserver:anonymous:@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) login endef define DOWNLOAD_SVN $(EXTRA_ENV) $(DL_WRAPPER) -b svn \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \ $($(PKG)_BASE_NAME) endef define SOURCE_CHECK_SVN $(SVN) ls $($(PKG)_SITE)@$($(PKG)_DL_VERSION) > /dev/null endef # SCP URIs should be of the form scp://[user@]host:filepath # Note that filepath is relative to the user's home directory, so you may want # to prepend the path with a slash: scp://[user@]host:/absolutepath define DOWNLOAD_SCP $(EXTRA_ENV) $(DL_WRAPPER) -b scp \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ $(QUIET) \ -- \ '$(call stripurischeme,$(call qstrip,$(1)))' endef define SOURCE_CHECK_SCP $(SSH) $(call domain,$(1),:) ls '$(call notdomain,$(1),:)' > /dev/null endef define DOWNLOAD_HG $(EXTRA_ENV) $(DL_WRAPPER) -b hg \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \ $($(PKG)_BASE_NAME) endef # TODO: improve to check that the given PKG_DL_VERSION exists on the remote # repository define SOURCE_CHECK_HG $(HG) incoming --force -l1 $($(PKG)_SITE) > /dev/null endef define DOWNLOAD_WGET $(EXTRA_ENV) $(DL_WRAPPER) -b wget \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ $(QUIET) \ -- \ '$(call qstrip,$(1))' endef define SOURCE_CHECK_WGET $(WGET) --spider '$(call qstrip,$(1))' endef define DOWNLOAD_LOCALFILES $(EXTRA_ENV) $(DL_WRAPPER) -b cp \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ $(QUIET) \ -- \ $(call stripurischeme,$(call qstrip,$(1))) endef define SOURCE_CHECK_LOCALFILES test -e $(call stripurischeme,$(call qstrip,$(1))) endef ################################################################################ # DOWNLOAD -- Download helper. Will try to download source from: # 1) BR2_PRIMARY_SITE if enabled # 2) Download site, unless BR2_PRIMARY_SITE_ONLY is set # 3) BR2_BACKUP_SITE if enabled, unless BR2_PRIMARY_SITE_ONLY is set # # Argument 1 is the source location # # E.G. use like this: # $(call DOWNLOAD,$(FOO_SITE)) ################################################################################ define DOWNLOAD $(call DOWNLOAD_INNER,$(1),$(notdir $(1)),DOWNLOAD) endef define SOURCE_CHECK $(call DOWNLOAD_INNER,$(1),$(notdir $(1)),SOURCE_CHECK) endef define DOWNLOAD_INNER $(Q)$(if $(filter bzr cvs git hg svn,$($(PKG)_SITE_METHOD)),export BR_NO_CHECK_HASH_FOR=$(2);) \ if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \ case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \ file) $(call $(3)_LOCALFILES,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \ scp) $(call $(3)_SCP,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \ *) $(call $(3)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \ esac ; \ fi ; \ if test "$(BR2_PRIMARY_SITE_ONLY)" = "y" ; then \ exit 1 ; \ fi ; \ if test -n "$(1)" ; then \ case "$($(PKG)_SITE_METHOD)" in \ git) $($(3)_GIT) && exit ;; \ svn) $($(3)_SVN) && exit ;; \ cvs) $($(3)_CVS) && exit ;; \ bzr) $($(3)_BZR) && exit ;; \ file) $($(3)_LOCALFILES) && exit ;; \ scp) $($(3)_SCP) && exit ;; \ hg) $($(3)_HG) && exit ;; \ *) $(call $(3)_WGET,$(1),$(2)) && exit ;; \ esac ; \ fi ; \ if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \ $(call $(3)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \ fi ; \ exit 1 endef
shibajee/buildroot
package/pkg-download.mk
mk
mit
7,456
################################################################################ # Generic package infrastructure # # This file implements an infrastructure that eases development of # package .mk files. It should be used for packages that do not rely # on a well-known build system for which Buildroot has a dedicated # infrastructure (so far, Buildroot has special support for # autotools-based and CMake-based packages). # # See the Buildroot documentation for details on the usage of this # infrastructure # # In terms of implementation, this generic infrastructure requires the # .mk file to specify: # # 1. Metadata information about the package: name, version, # download URL, etc. # # 2. Description of the commands to be executed to configure, build # and install the package ################################################################################ ################################################################################ # Helper functions to catch start/end of each step ################################################################################ # Those two functions are called by each step below. # They are responsible for calling all hooks defined in # $(GLOBAL_INSTRUMENTATION_HOOKS) and pass each of them # three arguments: # $1: either 'start' or 'end' # $2: the name of the step # $3: the name of the package # Start step # $1: step name define step_start $(foreach hook,$(GLOBAL_INSTRUMENTATION_HOOKS),$(call $(hook),start,$(1),$($(PKG)_NAME))$(sep)) endef # End step # $1: step name define step_end $(foreach hook,$(GLOBAL_INSTRUMENTATION_HOOKS),$(call $(hook),end,$(1),$($(PKG)_NAME))$(sep)) endef ####################################### # Actual steps hooks # Time steps define step_time printf "%s:%-5.5s:%-20.20s: %s\n" \ "$$(date +%s)" "$(1)" "$(2)" "$(3)" \ >>"$(BUILD_DIR)/build-time.log" endef GLOBAL_INSTRUMENTATION_HOOKS += step_time # Hooks to collect statistics about installed files # This hook will be called before the target installation of a # package. We store in a file named .br_filelist_before the list of # files currently installed in the target. Note that the MD5 is also # stored, in order to identify if the files are overwritten. define step_pkg_size_start (cd $(TARGET_DIR) ; find . -type f -print0 | xargs -0 md5sum) | sort > \ $($(PKG)_DIR)/.br_filelist_before endef # This hook will be called after the target installation of a # package. We store in a file named .br_filelist_after the list of # files (and their MD5) currently installed in the target. We then do # a diff with the .br_filelist_before to compute the list of files # installed by this package. define step_pkg_size_end (cd $(TARGET_DIR); find . -type f -print0 | xargs -0 md5sum) | sort > \ $($(PKG)_DIR)/.br_filelist_after comm -13 $($(PKG)_DIR)/.br_filelist_before $($(PKG)_DIR)/.br_filelist_after | \ while read hash file ; do \ echo "$(1),$${file}" >> $(BUILD_DIR)/packages-file-list.txt ; \ done endef define step_pkg_size $(if $(filter install-target,$(2)),\ $(if $(filter start,$(1)),$(call step_pkg_size_start,$(3))) \ $(if $(filter end,$(1)),$(call step_pkg_size_end,$(3)))) endef GLOBAL_INSTRUMENTATION_HOOKS += step_pkg_size # This hook checks that host packages that need libraries that we build # have a proper DT_RPATH or DT_RUNPATH tag define check_host_rpath $(if $(filter install-host,$(2)),\ $(if $(filter end,$(1)),support/scripts/check-host-rpath $(3) $(HOST_DIR))) endef GLOBAL_INSTRUMENTATION_HOOKS += check_host_rpath # User-supplied script ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),) define step_user @$(foreach user_hook, $(BR2_INSTRUMENTATION_SCRIPTS), \ $(EXTRA_ENV) $(user_hook) "$(1)" "$(2)" "$(3)"$(sep)) endef GLOBAL_INSTRUMENTATION_HOOKS += step_user endif ################################################################################ # Implicit targets -- produce a stamp file for each step of a package build ################################################################################ # Retrieve the archive $(BUILD_DIR)/%/.stamp_downloaded: $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) # Only show the download message if it isn't already downloaded $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \ if test ! -e $(DL_DIR)/`basename $$p` ; then \ $(call MESSAGE,"Downloading") ; \ break ; \ fi ; \ done $(foreach p,$($(PKG)_ALL_DOWNLOADS),$(call DOWNLOAD,$(p))$(sep)) $(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) $(Q)mkdir -p $(@D) $(Q)touch $@ # Retrieve actual source archive, e.g. for prebuilt external toolchains $(BUILD_DIR)/%/.stamp_actual_downloaded: $(call DOWNLOAD,$($(PKG)_ACTUAL_SOURCE_SITE)/$($(PKG)_ACTUAL_SOURCE_TARBALL)); \ $(Q)mkdir -p $(@D) $(Q)touch $@ # Unpack the archive $(BUILD_DIR)/%/.stamp_extracted: @$(call step_start,extract) @$(call MESSAGE,"Extracting") $(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep)) $(Q)mkdir -p $(@D) $($(PKG)_EXTRACT_CMDS) # some packages have messed up permissions inside $(Q)chmod -R +rw $(@D) $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep)) @$(call step_end,extract) $(Q)touch $@ # Rsync the source directory if the <pkg>_OVERRIDE_SRCDIR feature is # used. $(BUILD_DIR)/%/.stamp_rsynced: @$(call MESSAGE,"Syncing from source dir $(SRCDIR)") @test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1) $(foreach hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep)) rsync -au --chmod=u=rwX,go=rX $(RSYNC_VCS_EXCLUSIONS) $(call qstrip,$(SRCDIR))/ $(@D) $(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep)) $(Q)touch $@ # Patch # # The RAWNAME variable is the lowercased package name, which allows to # find the package directory (typically package/<pkgname>) and the # prefix of the patches # # For BR2_GLOBAL_PATCH_DIR, only generate if it is defined $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $(PKGDIR) $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) $(BUILD_DIR)/%/.stamp_patched: @$(call step_start,patch) @$(call MESSAGE,"Patching") $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep)) $(foreach p,$($(PKG)_PATCH),$(APPLY_PATCHES) $(@D) $(DL_DIR) $(notdir $(p))$(sep)) $(Q)( \ for D in $(PATCH_BASE_DIRS); do \ if test -d $${D}; then \ if test -d $${D}/$($(PKG)_VERSION); then \ $(APPLY_PATCHES) $(@D) $${D}/$($(PKG)_VERSION) \*.patch \*.patch.$(ARCH) || exit 1; \ else \ $(APPLY_PATCHES) $(@D) $${D} \*.patch \*.patch.$(ARCH) || exit 1; \ fi; \ fi; \ done; \ ) $(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep)) @$(call step_end,patch) $(Q)touch $@ # Check that all directories specified in BR2_GLOBAL_PATCH_DIR exist. $(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\ $(if $(wildcard $(dir)),,\ $(error BR2_GLOBAL_PATCH_DIR contains nonexistent directory $(dir)))) # Configure $(BUILD_DIR)/%/.stamp_configured: @$(call step_start,configure) @$(call MESSAGE,"Configuring") $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) $($(PKG)_CONFIGURE_CMDS) $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) @$(call step_end,configure) $(Q)touch $@ # Build $(BUILD_DIR)/%/.stamp_built:: @$(call step_start,build) @$(call MESSAGE,"Building") $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep)) +$($(PKG)_BUILD_CMDS) $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep)) @$(call step_end,build) $(Q)touch $@ # Install to host dir $(BUILD_DIR)/%/.stamp_host_installed: @$(call step_start,install-host) @$(call MESSAGE,"Installing to host directory") $(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep)) +$($(PKG)_INSTALL_CMDS) $(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep)) @$(call step_end,install-host) $(Q)touch $@ # Install to staging dir # # Some packages install libtool .la files alongside any installed # libraries. These .la files sometimes refer to paths relative to the # sysroot, which libtool will interpret as absolute paths to host # libraries instead of the target libraries. Since this is not what we # want, these paths are fixed by prefixing them with $(STAGING_DIR). # As we configure with --prefix=/usr, this fix needs to be applied to # any path that starts with /usr. # # To protect against the case that the output or staging directories or # the pre-installed external toolchain themselves are under /usr, we first # substitute away any occurrences of these directories with @BASE_DIR@, # @STAGING_DIR@ and @TOOLCHAIN_EXTERNAL_INSTALL_DIR@ respectively. # # Note that STAGING_DIR can be outside BASE_DIR when the user sets # BR2_HOST_DIR to a custom value. Note that TOOLCHAIN_EXTERNAL_INSTALL_DIR # can be under @BASE_DIR@ when it's a downloaded toolchain, and can be # empty when we use an internal toolchain. # $(BUILD_DIR)/%/.stamp_staging_installed: @$(call step_start,install-staging) @$(call MESSAGE,"Installing to staging directory") $(foreach hook,$($(PKG)_PRE_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep)) +$($(PKG)_INSTALL_STAGING_CMDS) $(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep)) $(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \ $(call MESSAGE,"Fixing package configuration files") ;\ $(SED) "s,$(BASE_DIR),@BASE_DIR@,g" \ -e "s,$(STAGING_DIR),@STAGING_DIR@,g" \ -e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" \ -e "s,-I/usr/,-I@STAGING_DIR@/usr/,g" \ -e "s,-L/usr/,-L@STAGING_DIR@/usr/,g" \ -e "s,@STAGING_DIR@,$(STAGING_DIR),g" \ -e "s,@BASE_DIR@,$(BASE_DIR),g" \ $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\ fi @$(call MESSAGE,"Fixing libtool files") $(Q)find $(STAGING_DIR)/usr/lib* -name "*.la" | xargs --no-run-if-empty \ $(SED) "s:$(BASE_DIR):@BASE_DIR@:g" \ -e "s:$(STAGING_DIR):@STAGING_DIR@:g" \ $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\ -e "s:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:g") \ -e "s:\(['= ]\)/usr:\\1@STAGING_DIR@/usr:g" \ $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\ -e "s:@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):g") \ -e "s:@STAGING_DIR@:$(STAGING_DIR):g" \ -e "s:@BASE_DIR@:$(BASE_DIR):g" @$(call step_end,install-staging) $(Q)touch $@ # Install to images dir $(BUILD_DIR)/%/.stamp_images_installed: @$(call step_start,install-image) $(foreach hook,$($(PKG)_PRE_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep)) @$(call MESSAGE,"Installing to images directory") +$($(PKG)_INSTALL_IMAGES_CMDS) $(foreach hook,$($(PKG)_POST_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep)) @$(call step_end,install-image) $(Q)touch $@ # Install to target dir $(BUILD_DIR)/%/.stamp_target_installed: @$(call step_start,install-target) @$(call MESSAGE,"Installing to target") $(foreach hook,$($(PKG)_PRE_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep)) +$($(PKG)_INSTALL_TARGET_CMDS) $(if $(BR2_INIT_SYSTEMD),\ $($(PKG)_INSTALL_INIT_SYSTEMD)) $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\ $($(PKG)_INSTALL_INIT_SYSV)) $(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep)) $(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \ $(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \ fi @$(call step_end,install-target) $(Q)touch $@ # Remove package sources $(BUILD_DIR)/%/.stamp_dircleaned: rm -Rf $(@D) ################################################################################ # virt-provides-single -- check that provider-pkg is the declared provider for # the virtual package virt-pkg # # argument 1 is the lower-case name of the virtual package # argument 2 is the upper-case name of the virtual package # argument 3 is the lower-case name of the provider # # example: # $(call virt-provides-single,libegl,LIBEGL,rpi-userland) ################################################################################ define virt-provides-single ifneq ($$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(2))),$(3)) $$(error Configuration error: both "$(3)" and $$(BR2_PACKAGE_PROVIDES_$(2))\ are selected as providers for virtual package "$(1)". Only one provider can\ be selected at a time. Please fix your configuration) endif endef ################################################################################ # inner-generic-package -- generates the make targets needed to build a # generic package # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) # # Note about variable and function references: inside all blocks that are # evaluated with $(eval), which includes all 'inner-xxx-package' blocks, # specific rules apply with respect to variable and function references. # - Numbered variables (parameters to the block) can be referenced with a single # dollar sign: $(1), $(2), $(3), etc. # - pkgdir and pkgname should be referenced with a single dollar sign too. These # functions rely on 'the most recently parsed makefile' which is supposed to # be the package .mk file. If we defer the evaluation of these functions using # double dollar signs, then they may be evaluated too late, when other # makefiles have already been parsed. One specific case is when $$(pkgdir) is # assigned to a variable using deferred evaluation with '=' and this variable # is used in a target rule outside the eval'ed inner block. In this case, the # pkgdir will be that of the last makefile parsed by buildroot, which is not # the expected value. This mechanism is for example used for the TARGET_PATCH # rule. # - All other variables should be referenced with a double dollar sign: # $$(TARGET_DIR), $$($(2)_VERSION), etc. Also all make functions should be # referenced with a double dollar sign: $$(subst), $$(call), $$(filter-out), # etc. This rule ensures that these variables and functions are only expanded # during the $(eval) step, and not earlier. Otherwise, unintuitive and # undesired behavior occurs with respect to these variables and functions. # ################################################################################ define inner-generic-package # Ensure the package is only declared once, i.e. do not accept that a # package be re-defined by a br2-external tree ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),) $$(error Package '$(1)' defined a second time in '$(pkgdir)'; \ previous definition was in '$$($(2)_PKGDIR)') endif PACKAGES_ALL += $(1) # Define default values for various package-related variables, if not # already defined. For some variables (version, source, site and # subdir), if they are undefined, we try to see if a variable without # the HOST_ prefix is defined. If so, we use such a variable, so that # this information has only to be specified once, for both the # target and host packages of a given .mk file. $(2)_TYPE = $(4) $(2)_NAME = $(1) $(2)_RAWNAME = $$(patsubst host-%,%,$(1)) $(2)_PKGDIR = $(pkgdir) # Keep the package version that may contain forward slashes in the _DL_VERSION # variable, then replace all forward slashes ('/') by underscores ('_') to # sanitize the package version that is used in paths, directory and file names. # Forward slashes may appear in the package's version when pointing to a # version control system branch or tag, for example remotes/origin/1_10_stable. # Similar for spaces and colons (:) that may appear in date-based revisions for # CVS. ifndef $(2)_VERSION ifdef $(3)_DL_VERSION $(2)_DL_VERSION := $$($(3)_DL_VERSION) else ifdef $(3)_VERSION $(2)_DL_VERSION := $$($(3)_VERSION) endif else $(2)_DL_VERSION := $$(strip $$($(2)_VERSION)) endif $(2)_VERSION := $$(call sanitize,$$($(2)_DL_VERSION)) ifdef $(3)_OVERRIDE_SRCDIR $(2)_OVERRIDE_SRCDIR ?= $$($(3)_OVERRIDE_SRCDIR) endif $(2)_BASE_NAME = $$(if $$($(2)_VERSION),$(1)-$$($(2)_VERSION),$(1)) $(2)_RAW_BASE_NAME = $$(if $$($(2)_VERSION),$$($(2)_RAWNAME)-$$($(2)_VERSION),$$($(2)_RAWNAME)) $(2)_DL_DIR = $$(DL_DIR)/$$($(2)_BASE_NAME) $(2)_DIR = $$(BUILD_DIR)/$$($(2)_BASE_NAME) ifndef $(2)_SUBDIR ifdef $(3)_SUBDIR $(2)_SUBDIR = $$($(3)_SUBDIR) else $(2)_SUBDIR ?= endif endif ifndef $(2)_STRIP_COMPONENTS ifdef $(3)_STRIP_COMPONENTS $(2)_STRIP_COMPONENTS = $$($(3)_STRIP_COMPONENTS) else $(2)_STRIP_COMPONENTS ?= 1 endif endif $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) $(2)_BUILDDIR ?= $$($(2)_SRCDIR) ifneq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_VERSION = custom endif ifndef $(2)_SOURCE ifdef $(3)_SOURCE $(2)_SOURCE = $$($(3)_SOURCE) else ifdef $(2)_VERSION $(2)_SOURCE ?= $$($(2)_RAW_BASE_NAME).tar.gz endif endif # If FOO_ACTUAL_SOURCE_TARBALL is explicitly defined, it means FOO_SOURCE is # indeed a binary (e.g. external toolchain) and FOO_ACTUAL_SOURCE_TARBALL/_SITE # point to the actual sources tarball. Use the actual sources for legal-info. # For most packages the FOO_SITE/FOO_SOURCE pair points to real source code, # so these are the defaults for FOO_ACTUAL_*. $(2)_ACTUAL_SOURCE_TARBALL ?= $$($(2)_SOURCE) $(2)_ACTUAL_SOURCE_SITE ?= $$(call qstrip,$$($(2)_SITE)) ifndef $(2)_PATCH ifdef $(3)_PATCH $(2)_PATCH = $$($(3)_PATCH) endif endif $(2)_ALL_DOWNLOADS = \ $$(foreach p,$$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS),\ $$(if $$(findstring ://,$$(p)),$$(p),\ $$($(2)_SITE)/$$(p))) ifndef $(2)_SITE ifdef $(3)_SITE $(2)_SITE = $$($(3)_SITE) endif endif ifndef $(2)_SITE_METHOD ifdef $(3)_SITE_METHOD $(2)_SITE_METHOD = $$($(3)_SITE_METHOD) else # Try automatic detection using the scheme part of the URI $(2)_SITE_METHOD = $$(call geturischeme,$$($(2)_SITE)) endif endif # Do not accept to download git submodule if not using the git method ifneq ($$($(2)_GIT_SUBMODULES),) ifneq ($$($(2)_SITE_METHOD),git) $$(error $(2) declares having git sub-modules, but does not use the \ 'git' method (uses '$$($(2)_SITE_METHOD)' instead)) endif endif ifeq ($$($(2)_SITE_METHOD),local) ifeq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_OVERRIDE_SRCDIR = $$($(2)_SITE) endif endif ifndef $(2)_LICENSE ifdef $(3)_LICENSE $(2)_LICENSE = $$($(3)_LICENSE) endif endif $(2)_LICENSE ?= unknown ifndef $(2)_LICENSE_FILES ifdef $(3)_LICENSE_FILES $(2)_LICENSE_FILES = $$($(3)_LICENSE_FILES) endif endif ifndef $(2)_REDISTRIBUTE ifdef $(3)_REDISTRIBUTE $(2)_REDISTRIBUTE = $$($(3)_REDISTRIBUTE) endif endif $(2)_REDISTRIBUTE ?= YES $(2)_REDIST_SOURCES_DIR = $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))/$$($(2)_RAW_BASE_NAME) # When a target package is a toolchain dependency set this variable to # 'NO' so the 'toolchain' dependency is not added to prevent a circular # dependency $(2)_ADD_TOOLCHAIN_DEPENDENCY ?= YES ifeq ($(4),target) ifneq ($(1),skeleton) $(2)_DEPENDENCIES += skeleton endif ifeq ($$($(2)_ADD_TOOLCHAIN_DEPENDENCY),YES) $(2)_DEPENDENCIES += toolchain endif endif # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) $(2)_FINAL_PATCH_DEPENDENCIES = $$(sort $$($(2)_PATCH_DEPENDENCIES)) $(2)_FINAL_ALL_DEPENDENCIES = $$(sort $$($(2)_FINAL_DEPENDENCIES) $$($(2)_FINAL_PATCH_DEPENDENCIES)) $(2)_INSTALL_STAGING ?= NO $(2)_INSTALL_IMAGES ?= NO $(2)_INSTALL_TARGET ?= YES # define sub-target stamps $(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed $(2)_TARGET_INSTALL_STAGING = $$($(2)_DIR)/.stamp_staging_installed $(2)_TARGET_INSTALL_IMAGES = $$($(2)_DIR)/.stamp_images_installed $(2)_TARGET_INSTALL_HOST = $$($(2)_DIR)/.stamp_host_installed $(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built $(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured $(2)_TARGET_RSYNC = $$($(2)_DIR)/.stamp_rsynced $(2)_TARGET_PATCH = $$($(2)_DIR)/.stamp_patched $(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_extracted $(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded $(2)_TARGET_ACTUAL_SOURCE = $$($(2)_DIR)/.stamp_actual_downloaded $(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned # default extract command $(2)_EXTRACT_CMDS ?= \ $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \ $$(TAR) --strip-components=$$($(2)_STRIP_COMPONENTS) \ -C $$($(2)_DIR) \ $$(foreach x,$$($(2)_EXCLUDES),--exclude='$$(x)' ) \ $$(TAR_OPTIONS) -) # pre/post-steps hooks $(2)_PRE_DOWNLOAD_HOOKS ?= $(2)_POST_DOWNLOAD_HOOKS ?= $(2)_PRE_EXTRACT_HOOKS ?= $(2)_POST_EXTRACT_HOOKS ?= $(2)_PRE_RSYNC_HOOKS ?= $(2)_POST_RSYNC_HOOKS ?= $(2)_PRE_PATCH_HOOKS ?= $(2)_POST_PATCH_HOOKS ?= $(2)_PRE_CONFIGURE_HOOKS ?= $(2)_POST_CONFIGURE_HOOKS ?= $(2)_PRE_BUILD_HOOKS ?= $(2)_POST_BUILD_HOOKS ?= $(2)_PRE_INSTALL_HOOKS ?= $(2)_POST_INSTALL_HOOKS ?= $(2)_PRE_INSTALL_STAGING_HOOKS ?= $(2)_POST_INSTALL_STAGING_HOOKS ?= $(2)_PRE_INSTALL_TARGET_HOOKS ?= $(2)_POST_INSTALL_TARGET_HOOKS ?= $(2)_PRE_INSTALL_IMAGES_HOOKS ?= $(2)_POST_INSTALL_IMAGES_HOOKS ?= $(2)_PRE_LEGAL_INFO_HOOKS ?= $(2)_POST_LEGAL_INFO_HOOKS ?= $(2)_TARGET_FINALIZE_HOOKS ?= # human-friendly targets and target sequencing $(1): $(1)-install ifeq ($$($(2)_TYPE),host) $(1)-install: $(1)-install-host else $(1)-install: $(1)-install-staging $(1)-install-target $(1)-install-images endif ifeq ($$($(2)_INSTALL_TARGET),YES) $(1)-install-target: $$($(2)_TARGET_INSTALL_TARGET) $$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_BUILD) else $(1)-install-target: endif ifeq ($$($(2)_INSTALL_STAGING),YES) $(1)-install-staging: $$($(2)_TARGET_INSTALL_STAGING) $$($(2)_TARGET_INSTALL_STAGING): $$($(2)_TARGET_BUILD) # Some packages use install-staging stuff for install-target $$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_INSTALL_STAGING) else $(1)-install-staging: endif ifeq ($$($(2)_INSTALL_IMAGES),YES) $(1)-install-images: $$($(2)_TARGET_INSTALL_IMAGES) $$($(2)_TARGET_INSTALL_IMAGES): $$($(2)_TARGET_BUILD) else $(1)-install-images: endif $(1)-install-host: $$($(2)_TARGET_INSTALL_HOST) $$($(2)_TARGET_INSTALL_HOST): $$($(2)_TARGET_BUILD) $(1)-build: $$($(2)_TARGET_BUILD) $$($(2)_TARGET_BUILD): $$($(2)_TARGET_CONFIGURE) # Since $(2)_FINAL_DEPENDENCIES are phony targets, they are always "newer" # than $(2)_TARGET_CONFIGURE. This would force the configure step (and # therefore the other steps as well) to be re-executed with every # invocation of make. Therefore, make $(2)_FINAL_DEPENDENCIES an order-only # dependency by using |. $(1)-configure: $$($(2)_TARGET_CONFIGURE) $$($(2)_TARGET_CONFIGURE): | $$($(2)_FINAL_DEPENDENCIES) $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dirs prepare ifeq ($$(filter $(1),$$(DEPENDENCIES_HOST_PREREQ)),) $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dependencies endif ifeq ($$($(2)_OVERRIDE_SRCDIR),) # In the normal case (no package override), the sequence of steps is # source, by downloading # depends # extract # patch # configure $$($(2)_TARGET_CONFIGURE): $$($(2)_TARGET_PATCH) $(1)-patch: $$($(2)_TARGET_PATCH) $$($(2)_TARGET_PATCH): $$($(2)_TARGET_EXTRACT) # Order-only dependency $$($(2)_TARGET_PATCH): | $$(patsubst %,%-patch,$$($(2)_FINAL_PATCH_DEPENDENCIES)) $(1)-extract: $$($(2)_TARGET_EXTRACT) $$($(2)_TARGET_EXTRACT): $$($(2)_TARGET_SOURCE) $(1)-depends: $$($(2)_FINAL_DEPENDENCIES) $(1)-source: $$($(2)_TARGET_SOURCE) $(1)-all-source: $(1)-legal-source $(1)-legal-info: $(1)-legal-source $(1)-legal-source: $(1)-source # Only download the actual source if it differs from the 'main' archive ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),) ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE)) $(1)-legal-source: $$($(2)_TARGET_ACTUAL_SOURCE) endif # actual sources != sources endif # actual sources != "" $(1)-source-check: $$(foreach p,$$($(2)_ALL_DOWNLOADS),$$(call SOURCE_CHECK,$$(p))$$(sep)) $(1)-external-deps: @for p in $$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS) ; do \ echo `basename $$$$p` ; \ done else # In the package override case, the sequence of steps # source, by rsyncing # depends # configure # Use an order-only dependency so the "<pkg>-clean-for-rebuild" rule # can remove the stamp file without triggering the configure step. $$($(2)_TARGET_CONFIGURE): | $$($(2)_TARGET_RSYNC) $(1)-depends: $$($(2)_FINAL_DEPENDENCIES) $(1)-patch: $(1)-rsync $(1)-extract: $(1)-rsync $(1)-rsync: $$($(2)_TARGET_RSYNC) $(1)-source: $(1)-legal-source: $(1)-source-check: test -d $$($(2)_OVERRIDE_SRCDIR) $(1)-external-deps: @echo "file://$$($(2)_OVERRIDE_SRCDIR)" endif $(1)-show-version: @echo $$($(2)_VERSION) $(1)-show-depends: @echo $$($(2)_FINAL_ALL_DEPENDENCIES) $(1)-graph-depends: graph-depends-requirements @$$(INSTALL) -d $$(GRAPHS_DIR) @cd "$$(CONFIG_DIR)"; \ $$(TOPDIR)/support/scripts/graph-depends $$(BR2_GRAPH_DEPS_OPTS) \ -p $(1) -o $$(GRAPHS_DIR)/$$(@).dot dot $$(BR2_GRAPH_DOT_OPTS) -T$$(BR_GRAPH_OUT) \ -o $$(GRAPHS_DIR)/$$(@).$$(BR_GRAPH_OUT) \ $$(GRAPHS_DIR)/$$(@).dot $(1)-all-source: $(1)-source $(1)-all-source: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source) $(1)-all-source-check: $(1)-source-check $(1)-all-source-check: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source-check) $(1)-all-external-deps: $(1)-external-deps $(1)-all-external-deps: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-external-deps) $(1)-all-legal-info: $(1)-legal-info $(1)-all-legal-info: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-legal-info) $(1)-dirclean: $$($(2)_TARGET_DIRCLEAN) $(1)-clean-for-reinstall: ifneq ($$($(2)_OVERRIDE_SRCDIR),) rm -f $$($(2)_TARGET_RSYNC) endif rm -f $$($(2)_TARGET_INSTALL_STAGING) rm -f $$($(2)_TARGET_INSTALL_TARGET) rm -f $$($(2)_TARGET_INSTALL_IMAGES) rm -f $$($(2)_TARGET_INSTALL_HOST) $(1)-reinstall: $(1)-clean-for-reinstall $(1) $(1)-clean-for-rebuild: $(1)-clean-for-reinstall rm -f $$($(2)_TARGET_BUILD) $(1)-rebuild: $(1)-clean-for-rebuild $(1) $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild rm -f $$($(2)_TARGET_CONFIGURE) $(1)-reconfigure: $(1)-clean-for-reconfigure $(1) # define the PKG variable for all targets, containing the # uppercase package variable prefix $$($(2)_TARGET_INSTALL_TARGET): PKG=$(2) $$($(2)_TARGET_INSTALL_STAGING): PKG=$(2) $$($(2)_TARGET_INSTALL_IMAGES): PKG=$(2) $$($(2)_TARGET_INSTALL_HOST): PKG=$(2) $$($(2)_TARGET_BUILD): PKG=$(2) $$($(2)_TARGET_CONFIGURE): PKG=$(2) $$($(2)_TARGET_RSYNC): SRCDIR=$$($(2)_OVERRIDE_SRCDIR) $$($(2)_TARGET_RSYNC): PKG=$(2) $$($(2)_TARGET_PATCH): PKG=$(2) $$($(2)_TARGET_PATCH): RAWNAME=$$(patsubst host-%,%,$(1)) $$($(2)_TARGET_PATCH): PKGDIR=$(pkgdir) $$($(2)_TARGET_EXTRACT): PKG=$(2) $$($(2)_TARGET_SOURCE): PKG=$(2) $$($(2)_TARGET_SOURCE): PKGDIR=$(pkgdir) $$($(2)_TARGET_ACTUAL_SOURCE): PKG=$(2) $$($(2)_TARGET_ACTUAL_SOURCE): PKGDIR=$(pkgdir) $$($(2)_TARGET_DIRCLEAN): PKG=$(2) # Compute the name of the Kconfig option that correspond to the # package being enabled. We handle three cases: the special Linux # kernel case, the bootloaders case, and the normal packages case. ifeq ($(1),linux) $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL else ifneq ($$(filter boot/% $(BR2_EXTERNAL)/boot/%,$(pkgdir)),) $(2)_KCONFIG_VAR = BR2_TARGET_$(2) else ifneq ($$(filter toolchain/% $(BR2_EXTERNAL)/toolchain/%,$(pkgdir)),) $(2)_KCONFIG_VAR = BR2_$(2) else $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2) endif # legal-info: declare dependencies and set values used later for the manifest ifneq ($$($(2)_LICENSE_FILES),) $(2)_MANIFEST_LICENSE_FILES = $$($(2)_LICENSE_FILES) endif $(2)_MANIFEST_LICENSE_FILES ?= not saved # We need to extract and patch a package to be able to retrieve its # license files (if any) and the list of patches applied to it (if # any). $(1)-legal-info: $(1)-patch # We only save the sources of packages we want to redistribute, that are # non-overriden (local or true override). ifeq ($$($(2)_REDISTRIBUTE),YES) ifeq ($$($(2)_OVERRIDE_SRCDIR),) # Packages that have a tarball need it downloaded beforehand $(1)-legal-info: $(1)-source $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4))) endif endif # legal-info: produce legally relevant info. $(1)-legal-info: # Packages without a source are assumed to be part of Buildroot, skip them. $$(foreach hook,$$($(2)_PRE_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep)) ifneq ($$(call qstrip,$$($(2)_SOURCE)),) # Save license files if defined # We save the license files for any kind of package: normal, local, # overridden, or non-redistributable alike. # The reason to save license files even for no-redistribute packages # is that the license still applies to the files distributed as part # of the rootfs, even if the sources are not themselves redistributed. ifeq ($$(call qstrip,$$($(2)_LICENSE_FILES)),) @$$(call legal-license-nofiles,$$($(2)_RAW_BASE_NAME),$$(call UPPERCASE,$(4))) @$$(call legal-warning-pkg,$$($(2)_RAW_BASE_NAME),cannot save license ($(2)_LICENSE_FILES not defined)) else @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAW_BASE_NAME),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep)) endif # license files ifeq ($$($(2)_SITE_METHOD),local) # Packages without a tarball: don't save and warn @$$(call legal-warning-nosource,$$($(2)_RAWNAME),local) else ifneq ($$($(2)_OVERRIDE_SRCDIR),) @$$(call legal-warning-nosource,$$($(2)_RAWNAME),override) else # Other packages ifeq ($$($(2)_REDISTRIBUTE),YES) # Save the source tarball and any extra downloads, but not # patches, as they are handled specially afterwards. $$(foreach e,$$($(2)_ACTUAL_SOURCE_TARBALL) $$(notdir $$($(2)_EXTRA_DOWNLOADS)),\ $$(Q)support/scripts/hardlink-or-copy \ $$(DL_DIR)/$$(e) \ $$($(2)_REDIST_SOURCES_DIR)$$(sep)) # Save patches and generate the series file $$(Q)while read f; do \ support/scripts/hardlink-or-copy \ $$$${f} \ $$($(2)_REDIST_SOURCES_DIR) || exit 1; \ printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \ done <$$($(2)_DIR)/.applied_patches_list endif # redistribute endif # other packages @$$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call UPPERCASE,$(4))) endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),) $$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep)) # add package to the general list of targets if requested by the buildroot # configuration ifeq ($$($$($(2)_KCONFIG_VAR)),y) # Ensure the calling package is the declared provider for all the virtual # packages it claims to be an implementation of. ifneq ($$($(2)_PROVIDES),) $$(foreach pkg,$$($(2)_PROVIDES),\ $$(eval $$(call virt-provides-single,$$(pkg),$$(call UPPERCASE,$$(pkg)),$(1))$$(sep))) endif # Ensure unified variable name conventions between all packages Some # of the variables are used by more than one infrastructure; so, # rather than duplicating the checks in each infrastructure, we check # all variables here in pkg-generic, even though pkg-generic should # have no knowledge of infra-specific variables. $(eval $(call check-deprecated-variable,$(2)_MAKE_OPT,$(2)_MAKE_OPTS)) $(eval $(call check-deprecated-variable,$(2)_INSTALL_OPT,$(2)_INSTALL_OPTS)) $(eval $(call check-deprecated-variable,$(2)_INSTALL_TARGET_OPT,$(2)_INSTALL_TARGET_OPTS)) $(eval $(call check-deprecated-variable,$(2)_INSTALL_STAGING_OPT,$(2)_INSTALL_STAGING_OPTS)) $(eval $(call check-deprecated-variable,$(2)_INSTALL_HOST_OPT,$(2)_INSTALL_HOST_OPTS)) $(eval $(call check-deprecated-variable,$(2)_AUTORECONF_OPT,$(2)_AUTORECONF_OPTS)) $(eval $(call check-deprecated-variable,$(2)_CONF_OPT,$(2)_CONF_OPTS)) $(eval $(call check-deprecated-variable,$(2)_BUILD_OPT,$(2)_BUILD_OPTS)) $(eval $(call check-deprecated-variable,$(2)_GETTEXTIZE_OPT,$(2)_GETTEXTIZE_OPTS)) $(eval $(call check-deprecated-variable,$(2)_KCONFIG_OPT,$(2)_KCONFIG_OPTS)) PACKAGES += $(1) ifneq ($$($(2)_PERMISSIONS),) PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep) endif ifneq ($$($(2)_DEVICES),) PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep) endif ifneq ($$($(2)_USERS),) PACKAGES_USERS += $$($(2)_USERS)$$(sep) endif TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS) ifeq ($$($(2)_SITE_METHOD),svn) DL_TOOLS_DEPENDENCIES += svn else ifeq ($$($(2)_SITE_METHOD),git) DL_TOOLS_DEPENDENCIES += git else ifeq ($$($(2)_SITE_METHOD),bzr) DL_TOOLS_DEPENDENCIES += bzr else ifeq ($$($(2)_SITE_METHOD),scp) DL_TOOLS_DEPENDENCIES += scp ssh else ifeq ($$($(2)_SITE_METHOD),hg) DL_TOOLS_DEPENDENCIES += hg else ifeq ($$($(2)_SITE_METHOD),cvs) DL_TOOLS_DEPENDENCIES += cvs endif # SITE_METHOD # $(firstword) is used here because the extractor can have arguments, like # ZCAT="gzip -d -c", and to check for the dependency we only want 'gzip'. # Do not add xzcat to the list of required dependencies, as it gets built # automatically if it isn't found. ifneq ($$(call suitable-extractor,$$($(2)_SOURCE)),$$(XZCAT)) DL_TOOLS_DEPENDENCIES += $$(firstword $$(call suitable-extractor,$$($(2)_SOURCE))) endif # Ensure all virtual targets are PHONY. Listed alphabetically. .PHONY: $(1) \ $(1)-all-external-deps \ $(1)-all-legal-info \ $(1)-all-source \ $(1)-all-source-check \ $(1)-build \ $(1)-clean-for-rebuild \ $(1)-clean-for-reconfigure \ $(1)-clean-for-reinstall \ $(1)-configure \ $(1)-depends \ $(1)-dirclean \ $(1)-external-deps \ $(1)-extract \ $(1)-graph-depends \ $(1)-install \ $(1)-install-host \ $(1)-install-images \ $(1)-install-staging \ $(1)-install-target \ $(1)-legal-info \ $(1)-legal-source \ $(1)-patch \ $(1)-rebuild \ $(1)-reconfigure \ $(1)-reinstall \ $(1)-rsync \ $(1)-show-depends \ $(1)-show-version \ $(1)-source \ $(1)-source-check ifneq ($$($(2)_SOURCE),) ifeq ($$($(2)_SITE),) $$(error $(2)_SITE cannot be empty when $(2)_SOURCE is not) endif endif ifeq ($$(patsubst %/,ERROR,$$($(2)_SITE)),ERROR) $$(error $(2)_SITE ($$($(2)_SITE)) cannot have a trailing slash) endif ifneq ($$($(2)_HELP_CMDS),) HELP_PACKAGES += $(2) endif endif # $(2)_KCONFIG_VAR endef # inner-generic-package ################################################################################ # generic-package -- the target generator macro for generic packages ################################################################################ # In the case of target packages, keep the package name "pkg" generic-package = $(call inner-generic-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) # In the case of host packages, turn the package name "pkg" into "host-pkg" host-generic-package = $(call inner-generic-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host) # :mode=makefile:
shibajee/buildroot
package/pkg-generic.mk
mk
mit
34,993
################################################################################ # Kconfig package infrastructure # # This file implements an infrastructure that eases development of # package .mk files for packages that use kconfig for configuration files. # It is based on the generic-package infrastructure, and inherits all of its # features. # # See the Buildroot documentation for details on the usage of this # infrastructure. # ################################################################################ ################################################################################ # inner-kconfig-package -- generates the make targets needed to support a # kconfig package # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) ################################################################################ define inner-kconfig-package # Call the generic package infrastructure to generate the necessary # make targets. # Note: this must be done _before_ attempting to use $$($(2)_DIR) in a # dependency expression $(call inner-generic-package,$(1),$(2),$(3),$(4)) # Default values $(2)_KCONFIG_EDITORS ?= menuconfig $(2)_KCONFIG_OPTS ?= $(2)_KCONFIG_FIXUP_CMDS ?= $(2)_KCONFIG_FRAGMENT_FILES ?= # The config file as well as the fragments could be in-tree, so before # depending on them the package should be extracted (and patched) first. # # Since those files only have a order-only dependency, make would treat # any missing one as a "force" target: # https://www.gnu.org/software/make/manual/make.html#Force-Targets # and would forcibly any rule that depend on those files, causing a # rebuild of the kernel each time make is called. # # So, we provide a recipe that checks all of those files exist, to # overcome that standard make behaviour. # $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch for f in $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES); do \ if [ ! -f "$$$${f}" ]; then \ printf "Kconfig fragment '%s' for '%s' does not exist\n" "$$$${f}" "$(1)"; \ exit 1; \ fi; \ done $(2)_KCONFIG_MAKE = \ $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) $$($(2)_KCONFIG_OPTS) # $(2)_KCONFIG_MAKE may already rely on shell expansion. As the $() syntax # of the shell conflicts with Make's own syntax, this means that backticks # are used with those shell constructs. Unfortunately, the backtick syntax # does not nest, and we need to use Make instead of the shell to handle # conditions. # A recursively expanded variable is necessary, to be sure that the shell # command is called when the rule is processed during the build and not # when the rule is created when parsing all packages. $(2)_KCONFIG_RULES = \ $$(shell $$($(2)_KCONFIG_MAKE) -pn config 2>/dev/null | \ sed 's/^\([_0-9a-zA-Z]*config\):.*/\1/ p; d') # The correct way to regenerate a .config file is to use 'make olddefconfig'. # For historical reasons, the target name is 'oldnoconfig' between Linux kernel # versions 2.6.36 and 3.6, and remains as an alias in later versions. # In older versions, and in some other projects that use kconfig, the target is # not supported at all, and we use 'yes "" | make oldconfig' as a fallback # only, as this can fail in complex cases. define $(2)_REGEN_DOT_CONFIG $$(if $$(filter olddefconfig,$$($(2)_KCONFIG_RULES)), $$(Q)$$($(2)_KCONFIG_MAKE) olddefconfig, $$(if $$(filter oldnoconfig,$$($(2)_KCONFIG_RULES)), $$(Q)$$($(2)_KCONFIG_MAKE) oldnoconfig, $$(Q)(yes "" | $$($(2)_KCONFIG_MAKE) oldconfig))) endef # The specified source configuration file and any additional configuration file # fragments are merged together to .config, after the package has been patched. # Since the file could be a defconfig file it needs to be expanded to a # full .config first. $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES) $$(Q)$$(if $$($(2)_KCONFIG_DEFCONFIG), \ $$($(2)_KCONFIG_MAKE) $$($(2)_KCONFIG_DEFCONFIG), \ cp $$($(2)_KCONFIG_FILE) $$(@)) $$(Q)support/kconfig/merge_config.sh -m -O $$(@D) \ $$(@) $$($(2)_KCONFIG_FRAGMENT_FILES) $$($(2)_REGEN_DOT_CONFIG) # If _KCONFIG_FILE or _KCONFIG_FRAGMENT_FILES exists, this dependency is # already implied, but if we only have a _KCONFIG_DEFCONFIG we have to add # it explicitly. It doesn't hurt to always have it though. $$($(2)_DIR)/.config: | $(1)-patch # In order to get a usable, consistent configuration, some fixup may be needed. # The exact rules are specified by the package .mk file. define $(2)_FIXUP_DOT_CONFIG $$($(2)_KCONFIG_FIXUP_CMDS) $$($(2)_REGEN_DOT_CONFIG) $$(Q)touch $$($(2)_DIR)/.stamp_kconfig_fixup_done endef $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config $$($(2)_FIXUP_DOT_CONFIG) # Before running configure, the configuration file should be present and fixed $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done # Only enable the foo-*config targets when the package is actually enabled. # Note: the variable $(2)_KCONFIG_VAR is not related to the kconfig # infrastructure, but defined by pkg-generic.mk. The generic infrastructure is # already called above, so we can effectively use this variable. ifeq ($$($$($(2)_KCONFIG_VAR)),y) ifeq ($$(BR_BUILDING),y) # Either FOO_KCONFIG_FILE or FOO_KCONFIG_DEFCONFIG is required... ifeq ($$(or $$($(2)_KCONFIG_FILE),$$($(2)_KCONFIG_DEFCONFIG)),) $$(error Internal error: no value specified for $(2)_KCONFIG_FILE or $(2)_KCONFIG_DEFCONFIG) endif # ... but not both: ifneq ($$(and $$($(2)_KCONFIG_FILE),$$($(2)_KCONFIG_DEFCONFIG)),) $$(error Internal error: $(2)_KCONFIG_FILE and $(2)_KCONFIG_DEFCONFIG are mutually exclusive but both are defined) endif endif # For the configurators, we do want to use the system-provided host # tools, not the ones we build. This is particularly true for # pkg-config; if we use our pkg-config (from host-pkgconf), then it # would not look for the .pc from the host, but we do need them, # especially to find ncurses, GTK+, Qt (resp. for menuconfig and # nconfig, gconfig, xconfig). # So we simply remove our PATH and PKG_CONFIG_* variables. $(2)_CONFIGURATOR_MAKE_ENV = \ $$(filter-out PATH=% PKG_CONFIG=% PKG_CONFIG_SYSROOT_DIR=% PKG_CONFIG_LIBDIR=%,$$($(2)_MAKE_ENV)) \ PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" # Configuration editors (menuconfig, ...) # # We need to apply the configuration fixups right after a configuration # editor exits, so that it is possible to save the configuration right # after exiting an editor, and so the user always sees a .config file # that is clean wrt. our requirements. # # Because commands in $(1)_FIXUP_KCONFIG are probably using $(@D), we # need to have a valid @D set. But, because the configurators rules are # not real files and do not contain the path to the package build dir, # @D would be just '.' in this case. So, we use an intermediate rule # with a stamp-like file which path is in the package build dir, so we # end up having a valid @D. # $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $(1)-%: $$($(2)_DIR)/.kconfig_editor_% $$($(2)_DIR)/.kconfig_editor_%: $$($(2)_DIR)/.stamp_kconfig_fixup_done $$($(2)_CONFIGURATOR_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ $$($(2)_KCONFIG_OPTS) $$(*) rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built} rm -f $$($(2)_DIR)/.stamp_{target,staging,images}_installed $$($(2)_FIXUP_DOT_CONFIG) # Saving back the configuration # # Ideally, that should directly depend on $$($(2)_DIR)/.stamp_kconfig_fixup_done, # but that breaks the use-case in PR-8156 (from a clean tree): # make menuconfig <- enable kernel, use an in-tree defconfig, save and exit # make linux-menuconfig <- enable/disable whatever option, save and exit # make menuconfig <- change to use a custom defconfig file, set a path, save and exit # make linux-update-config <- should save to the new custom defconfig file # # Because of that use-case, saving the configuration can *not* directly # depend on the stamp file, because it itself depends on the .config, # which in turn depends on the (newly-set an non-existent) custom # defconfig file. # # Instead, we use an PHONY rule that will catch that situation. # $(1)-check-configuration-done: @if [ ! -f $$($(2)_DIR)/.stamp_kconfig_fixup_done ]; then \ echo "$(1) is not yet configured"; \ exit 1; \ fi $(1)-savedefconfig: $(1)-check-configuration-done $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ $$($(2)_KCONFIG_OPTS) savedefconfig # Target to copy back the configuration to the source configuration file # Even though we could use 'cp --preserve-timestamps' here, the separate # cp and 'touch --reference' is used for symmetry with $(1)-update-defconfig. $(1)-update-config: $(1)-check-configuration-done @$$(if $$($(2)_KCONFIG_FRAGMENT_FILES), \ echo "Unable to perform $(1)-update-config when fragment files are set"; exit 1) @$$(if $$($(2)_KCONFIG_DEFCONFIG), \ echo "Unable to perform $(1)-update-config when using a defconfig rule"; exit 1) cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) # Note: make sure the timestamp of the stored configuration is not newer than # the .config to avoid a useless rebuild. Note that, contrary to # $(1)-update-config, the reference for 'touch' is _not_ the file from which # we copy. $(1)-update-defconfig: $(1)-savedefconfig @$$(if $$($(2)_KCONFIG_FRAGMENT_FILES), \ echo "Unable to perform $(1)-update-defconfig when fragment files are set"; exit 1) @$$(if $$($(2)_KCONFIG_DEFCONFIG), \ echo "Unable to perform $(1)-update-defconfig when using a defconfig rule"; exit 1) cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE) touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) endif # package enabled .PHONY: \ $(1)-update-config \ $(1)-update-defconfig \ $(1)-savedefconfig \ $(1)-check-configuration-done \ $$($(2)_DIR)/.kconfig_editor_% \ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)) endef # inner-kconfig-package ################################################################################ # kconfig-package -- the target generator macro for kconfig packages ################################################################################ kconfig-package = $(call inner-kconfig-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
shibajee/buildroot
package/pkg-kconfig.mk
mk
mit
10,519
################################################################################ # kernel module infrastructure for building Linux kernel modules # # This file implements an infrastructure that eases development of package # .mk files for out-of-tree Linux kernel modules. It should be used for all # packages that build a Linux kernel module using the kernel's out-of-tree # buildsystem, unless they use a complex custom buildsystem. # # The kernel-module infrastructure requires the packages that use it to also # use another package infrastructure. kernel-module only defines post-build # and post-install hooks. This allows the package to build both kernel # modules and/or user-space components (with any of the other *-package # infra). # # As such, it is to be used in conjunction with another *-package infra, # like so: # # $(eval $(kernel-module)) # $(eval $(generic-package)) # # Note: if the caller needs access to the kernel modules (either after they # are built or after they are installed), it will have to define its own # post-build/install hooks *after* calling kernel-module, but *before* # calling the other *-package infra, like so: # # $(eval $(kernel-module)) # define FOO_MOD_TWEAK # # do something # endef # FOO_POST_BUILD_HOOKS += FOO_MOD_TWEAK # $(eval $(generic-package)) # # Note: this infra does not check that the kernel is enabled; it is expected # to be enforced at the Kconfig level with proper 'depends on'. ################################################################################ ################################################################################ # inner-kernel-module -- generates the make targets needed to support building # a kernel module # # argument 1 is the lowercase package name # argument 2 is the uppercase package name ################################################################################ define inner-kernel-module # If the package is enabled, ensure the kernel will support modules ifeq ($$(BR2_PACKAGE_$(2)),y) LINUX_NEEDS_MODULES = y endif # The kernel must be built first. $(2)_DEPENDENCIES += linux # This is only defined in some infrastructures (e.g. autotools, cmake), # but not in others (e.g. generic). So define it here as well. $(2)_MAKE ?= $$(MAKE) # If not specified, consider the source of the kernel module to be at # the root of the package. $(2)_MODULE_SUBDIRS ?= . # Build the kernel module(s) # Force PWD for those packages that want to use it to find their # includes and other support files (Booo!) define $(2)_KERNEL_MODULES_BUILD @$$(call MESSAGE,"Building kernel module(s)") $$(foreach d,$$($(2)_MODULE_SUBDIRS), \ $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \ -C $$(LINUX_DIR) \ $$(LINUX_MAKE_FLAGS) \ $$($(2)_MODULE_MAKE_OPTS) \ PWD=$$(@D)/$$(d) \ M=$$(@D)/$$(d) \ modules$$(sep)) endef $(2)_POST_BUILD_HOOKS += $(2)_KERNEL_MODULES_BUILD # Install the kernel module(s) # Force PWD for those packages that want to use it to find their # includes and other support files (Booo!) define $(2)_KERNEL_MODULES_INSTALL @$$(call MESSAGE,"Installing kernel module(s)") $$(foreach d,$$($(2)_MODULE_SUBDIRS), \ $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \ -C $$(LINUX_DIR) \ $$(LINUX_MAKE_FLAGS) \ $$($(2)_MODULE_MAKE_OPTS) \ PWD=$$(@D)/$$(d) \ M=$$(@D)/$$(d) \ modules_install$$(sep)) endef $(2)_POST_INSTALL_TARGET_HOOKS += $(2)_KERNEL_MODULES_INSTALL endef ################################################################################ # kernel-module -- the target generator macro for kernel module packages ################################################################################ kernel-module = $(call inner-kernel-module,$(pkgname),$(call UPPERCASE,$(pkgname)))
shibajee/buildroot
package/pkg-kernel-module.mk
mk
mit
3,737
################################################################################ # LuaRocks package infrastructure # see http://luarocks.org/ # # This file implements an infrastructure that eases development of # package .mk files for LuaRocks packages. # LuaRocks supports various build.type : builtin, make, cmake. # This luarocks infrastructure supports only the builtin mode, # the make & cmake modes could be directly handled by generic & cmake infrastructure. # # See the Buildroot documentation for details on the usage of this # infrastructure # # In terms of implementation, this LuaRocks infrastructure requires # the .mk file to only specify metadata information about the # package: name, version, etc. # ################################################################################ ################################################################################ # inner-luarocks-package -- defines how the configuration, compilation and # installation of a LuaRocks package should be done, implements a few hooks to # tune the build process and calls the generic package infrastructure to # generate the necessary make targets # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) ################################################################################ define inner-luarocks-package $(2)_BUILD_OPTS ?= $(2)_SUBDIR ?= $(1)-$$(shell echo "$$($(3)_VERSION)" | sed -e "s/-[0-9]$$$$//") $(2)_ROCKSPEC ?= $(1)-$$($(3)_VERSION).rockspec $(2)_SOURCE ?= $(1)-$$($(3)_VERSION).src.rock $(2)_SITE ?= $$(call qstrip,$$(BR2_LUAROCKS_MIRROR)) # Since we do not support host-luarocks-package, we know this is # a target package, and can just add the required dependencies $(2)_DEPENDENCIES += host-luarocks luainterpreter # # Extract step # ifndef $(2)_EXTRACT_CMDS define $(2)_EXTRACT_CMDS cd $$($(2)_DIR)/.. && \ $$(LUAROCKS_RUN_ENV) $$(LUAROCKS_RUN_CMD) unpack --force $$(DL_DIR)/$$($(2)_SOURCE) endef endif # # Build/install step. # ifndef $(2)_INSTALL_TARGET_CMDS define $(2)_INSTALL_TARGET_CMDS cd $$($(2)_SRCDIR) && $$(LUAROCKS_RUN_ENV) flock $$(TARGET_DIR) \ $$(LUAROCKS_RUN_CMD) make --keep $$($(2)_ROCKSPEC) $$($(2)_BUILD_OPTS) endef endif # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) # $(2)_DEPENDENCIES are handled for configure step (too late) # but host-luarocks is required to do the extract $$($(2)_TARGET_EXTRACT): | host-luarocks endef ################################################################################ # luarocks-package -- the target generator macro for LuaRocks packages ################################################################################ luarocks-package = $(call inner-luarocks-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) # host-luarocks-package not supported
shibajee/buildroot
package/pkg-luarocks.mk
mk
mit
3,111
################################################################################ # Perl package infrastructure # # This file implements an infrastructure that eases development of # package .mk files for Perl packages. # # See the Buildroot documentation for details on the usage of this # infrastructure # # In terms of implementation, this perl infrastructure requires # the .mk file to only specify metadata information about the # package: name, version, download URL, etc. # # We still allow the package .mk file to override what the different # steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is # already defined, it is used as the list of commands to perform to # build the package, instead of the default perl behaviour. The # package can also define some post operation hooks. # ################################################################################ PERL_ARCHNAME = $(ARCH)-linux PERL_RUN = PERL5LIB= $(HOST_DIR)/usr/bin/perl ################################################################################ # inner-perl-package -- defines how the configuration, compilation and # installation of a perl package should be done, implements a # few hooks to tune the build process for perl specifities and # calls the generic package infrastructure to generate the necessary # make targets # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) ################################################################################ define inner-perl-package # Target packages need both the perl interpreter on the target (for # runtime) and the perl interpreter on the host (for # compilation). However, host packages only need the perl # interpreter on the host. ifeq ($(4),target) $(2)_DEPENDENCIES += host-perl perl else $(2)_DEPENDENCIES += host-perl endif # # Configure step. Only define it if not already defined by the package # .mk file. And take care of the differences between host and target # packages. # ifndef $(2)_CONFIGURE_CMDS ifeq ($(4),target) # Configure package for target define $(2)_CONFIGURE_CMDS cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ $$($(2)_CONF_ENV) \ PERL_MM_USE_DEFAULT=1 \ $$(PERL_RUN) Build.PL \ --config ar="$$(TARGET_AR)" \ --config full_ar="$$(TARGET_AR)" \ --config cc="$$(TARGET_CC)" \ --config ccflags="$$(TARGET_CFLAGS)" \ --config optimize=" " \ --config ld="$$(TARGET_CC)" \ --config lddlflags="-shared $$(TARGET_LDFLAGS)" \ --config ldflags="$$(TARGET_LDFLAGS)" \ --include_dirs $$(STAGING_DIR)/usr/lib/perl5/$$(PERL_VERSION)/$$(PERL_ARCHNAME)/CORE \ --destdir $$(TARGET_DIR) \ --installdirs vendor \ --install_path lib=/usr/lib/perl5/site_perl/$$(PERL_VERSION) \ --install_path arch=/usr/lib/perl5/site_perl/$$(PERL_VERSION)/$$(PERL_ARCHNAME) \ --install_path bin=/usr/bin \ --install_path script=/usr/bin \ --install_path bindoc=/usr/share/man/man1 \ --install_path libdoc=/usr/share/man/man3 \ $$($(2)_CONF_OPTS); \ else \ $$($(2)_CONF_ENV) \ PERL_MM_USE_DEFAULT=1 \ PERL_AUTOINSTALL=--skipdeps \ $$(PERL_RUN) Makefile.PL \ AR="$$(TARGET_AR)" \ FULL_AR="$$(TARGET_AR)" \ CC="$$(TARGET_CC)" \ CCFLAGS="$$(TARGET_CFLAGS)" \ OPTIMIZE=" " \ LD="$$(TARGET_CC)" \ LDDLFLAGS="-shared $$(TARGET_LDFLAGS)" \ LDFLAGS="$$(TARGET_LDFLAGS)" \ DESTDIR=$$(TARGET_DIR) \ INSTALLDIRS=vendor \ INSTALLVENDORLIB=/usr/lib/perl5/site_perl/$$(PERL_VERSION) \ INSTALLVENDORARCH=/usr/lib/perl5/site_perl/$$(PERL_VERSION)/$$(PERL_ARCHNAME) \ INSTALLVENDORBIN=/usr/bin \ INSTALLVENDORSCRIPT=/usr/bin \ INSTALLVENDORMAN1DIR=/usr/share/man/man1 \ INSTALLVENDORMAN3DIR=/usr/share/man/man3 \ $$($(2)_CONF_OPTS); \ fi endef else # Configure package for host define $(2)_CONFIGURE_CMDS cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ $$($(2)_CONF_ENV) \ PERL_MM_USE_DEFAULT=1 \ $$(PERL_RUN) Build.PL \ $$($(2)_CONF_OPTS); \ else \ $$($(2)_CONF_ENV) \ PERL_MM_USE_DEFAULT=1 \ PERL_AUTOINSTALL=--skipdeps \ $$(PERL_RUN) Makefile.PL \ $$($(2)_CONF_OPTS); \ fi endef endif endif # # Build step. Only define it if not already defined by the package .mk # file. And take care of the differences between host and target # packages. # ifndef $(2)_BUILD_CMDS ifeq ($(4),target) # Build package for target define $(2)_BUILD_CMDS cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ $$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \ else \ $$(MAKE1) \ PERL_INC=$$(STAGING_DIR)/usr/lib/perl5/$$(PERL_VERSION)/$$(PERL_ARCHNAME)/CORE \ FIXIN=: \ $$($(2)_BUILD_OPTS) pure_all; \ fi endef else # Build package for host define $(2)_BUILD_CMDS cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ $$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \ else \ $$(MAKE1) $$($(2)_BUILD_OPTS) pure_all; \ fi endef endif endif # # Host installation step. Only define it if not already defined by the # package .mk file. # ifndef $(2)_INSTALL_CMDS define $(2)_INSTALL_CMDS cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ $$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \ else \ $$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \ fi endef endif # # Target installation step. Only define it if not already defined by # the package .mk file. # ifndef $(2)_INSTALL_TARGET_CMDS define $(2)_INSTALL_TARGET_CMDS cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \ $$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \ else \ $$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \ fi endef endif # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) endef ################################################################################ # perl-package -- the target generator macro for Perl packages ################################################################################ perl-package = $(call inner-perl-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) host-perl-package = $(call inner-perl-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
shibajee/buildroot
package/pkg-perl.mk
mk
mit
6,384
################################################################################ # Python package infrastructure # # This file implements an infrastructure that eases development of # package .mk files for Python packages. It should be used for all # packages that use Python setup.py/setuptools as their build system. # # See the Buildroot documentation for details on the usage of this # infrastructure # # In terms of implementation, this Python infrastructure requires the # .mk file to only specify metadata information about the package: # name, version, download URL, etc. # # We still allow the package .mk file to override what the different # steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is # already defined, it is used as the list of commands to perform to # build the package, instead of the default Python behaviour. The # package can also define some post operation hooks. # ################################################################################ # Target distutils-based packages PKG_PYTHON_DISTUTILS_ENV = \ PATH=$(BR_PATH) \ CC="$(TARGET_CC)" \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ LDSHARED="$(TARGET_CROSS)gcc -shared" \ PYTHONPATH="$(if $(BR2_PACKAGE_PYTHON3),$(PYTHON3_PATH),$(PYTHON_PATH))" \ _python_sysroot=$(STAGING_DIR) \ _python_prefix=/usr \ _python_exec_prefix=/usr PKG_PYTHON_DISTUTILS_BUILD_OPTS = \ --executable=/usr/bin/python PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS = \ --prefix=$(TARGET_DIR)/usr PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \ --prefix=$(STAGING_DIR)/usr # Host distutils-based packages HOST_PKG_PYTHON_DISTUTILS_ENV = \ PATH=$(BR_PATH) HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \ --prefix=$(HOST_DIR)/usr # Target setuptools-based packages PKG_PYTHON_SETUPTOOLS_ENV = \ PATH=$(BR_PATH) \ PYTHONPATH="$(if $(BR2_PACKAGE_PYTHON3),$(PYTHON3_PATH),$(PYTHON_PATH))" \ _python_sysroot=$(STAGING_DIR) \ _python_prefix=/usr \ _python_exec_prefix=/usr PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS = \ --prefix=$(TARGET_DIR)/usr \ --executable=/usr/bin/python \ --single-version-externally-managed \ --root=/ PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \ --prefix=$(STAGING_DIR)/usr \ --executable=/usr/bin/python \ --single-version-externally-managed \ --root=/ # Host setuptools-based packages HOST_PKG_PYTHON_SETUPTOOLS_ENV = \ PATH=$(BR_PATH) HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ --prefix=$(HOST_DIR)/usr ################################################################################ # inner-python-package -- defines how the configuration, compilation # and installation of a Python package should be done, implements a # few hooks to tune the build process and calls the generic package # infrastructure to generate the necessary make targets # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) ################################################################################ define inner-python-package $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) $(2)_BUILDDIR = $$($(2)_SRCDIR) $(2)_ENV ?= $(2)_BUILD_OPTS ?= $(2)_INSTALL_OPTS ?= ifndef $(2)_SETUP_TYPE ifdef $(3)_SETUP_TYPE $(2)_SETUP_TYPE = $$($(3)_SETUP_TYPE) else $$(error "$(2)_SETUP_TYPE must be set") endif endif # Distutils ifeq ($$($(2)_SETUP_TYPE),distutils) ifeq ($(4),target) $(2)_BASE_ENV = $$(PKG_PYTHON_DISTUTILS_ENV) $(2)_BASE_BUILD_TGT = build $(2)_BASE_BUILD_OPTS = $$(PKG_PYTHON_DISTUTILS_BUILD_OPTS) $(2)_BASE_INSTALL_TARGET_OPTS = $$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_OPTS = $$(PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS) else $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_DISTUTILS_ENV) $(2)_BASE_BUILD_TGT = build $(2)_BASE_BUILD_OPTS = $(2)_BASE_INSTALL_OPTS = $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS) endif # Setuptools else ifeq ($$($(2)_SETUP_TYPE),setuptools) ifeq ($(4),target) $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV) $(2)_BASE_BUILD_TGT = build $(2)_BASE_BUILD_OPTS = $(2)_BASE_INSTALL_TARGET_OPTS = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_OPTS = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS) else $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) $(2)_BASE_BUILD_TGT = build $(2)_BASE_BUILD_OPTS = $(2)_BASE_INSTALL_OPTS = $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) endif else $$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils' or 'setuptools'") endif # Target packages need both the python interpreter on the target (for # runtime) and the python interpreter on the host (for # compilation). However, host packages only need the python # interpreter on the host, whose version may be enforced by setting # the *_NEEDS_HOST_PYTHON variable. # # So: # - for target packages, we always depend on the default python interpreter # (the one selected by the config); # - for host packages: # - if *_NEEDS_HOST_PYTHON is not set, then we depend on use the default # interperter; # - otherwise, we depend on the one requested by *_NEEDS_HOST_PYTHON. # ifeq ($(4),target) $(2)_DEPENDENCIES += $$(if $$(BR2_PACKAGE_PYTHON3),host-python3 python3,host-python python) else ifeq ($$($(2)_NEEDS_HOST_PYTHON),) $(2)_DEPENDENCIES += $$(if $$(BR2_PACKAGE_PYTHON3),host-python3,host-python) else ifeq ($$($(2)_NEEDS_HOST_PYTHON),python2) $(2)_DEPENDENCIES += host-python else ifeq ($$($(2)_NEEDS_HOST_PYTHON),python3) $(2)_DEPENDENCIES += host-python3 else $$(error Incorrect value '$$($(2)_NEEDS_HOST_PYTHON)' for $(2)_NEEDS_HOST_PYTHON) endif endif # ($$($(2)_NEEDS_HOST_PYTHON),) endif # ($(4),target) # Setuptools based packages will need host-python-setuptools (both # host and target). We need to have a special exclusion for the # host-setuptools package itself: it is setuptools-based, but # shouldn't depend on host-setuptools (because it would otherwise # depend on itself!). ifeq ($$($(2)_SETUP_TYPE),setuptools) ifneq ($(2),HOST_PYTHON_SETUPTOOLS) $(2)_DEPENDENCIES += host-python-setuptools endif endif # Python interpreter to use for building the package. # # We may want to specify the python interpreter to be used for building a # package, especially for host-packages (target packages must be built using # the same version of the interpreter as the one installed on the target). # # So: # - for target packages, we always use the default python interpreter (which # is the same version as the one built and installed on the target); # - for host packages: # - if *_NEEDS_HOST_PYTHON is not set, then we use use the default # interperter; # - otherwise, we use the one requested by *_NEEDS_HOST_PYTHON. # ifeq ($(4),target) $(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/usr/bin/python else ifeq ($$($(2)_NEEDS_HOST_PYTHON),) $(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/usr/bin/python else $(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/usr/bin/$$($(2)_NEEDS_HOST_PYTHON) endif endif # # Build step. Only define it if not already defined by the package .mk # file. # ifndef $(2)_BUILD_CMDS define $(2)_BUILD_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ $$($(2)_PYTHON_INTERPRETER) setup.py \ $$($$(PKG)_BASE_BUILD_TGT) \ $$($$(PKG)_BASE_BUILD_OPTS) $$($$(PKG)_BUILD_OPTS)) endef endif # # Host installation step. Only define it if not already defined by the # package .mk file. # ifndef $(2)_INSTALL_CMDS define $(2)_INSTALL_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ $$($(2)_PYTHON_INTERPRETER) setup.py install \ $$($$(PKG)_BASE_INSTALL_OPTS) $$($$(PKG)_INSTALL_OPTS)) endef endif # # Target installation step. Only define it if not already defined by # the package .mk file. # ifndef $(2)_INSTALL_TARGET_CMDS define $(2)_INSTALL_TARGET_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ $$($(2)_PYTHON_INTERPRETER) setup.py install --no-compile \ $$($$(PKG)_BASE_INSTALL_TARGET_OPTS) \ $$($$(PKG)_INSTALL_TARGET_OPTS)) endef endif # # Staging installation step. Only define it if not already defined by # the package .mk file. # ifndef $(2)_INSTALL_STAGING_CMDS define $(2)_INSTALL_STAGING_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ $$($(2)_PYTHON_INTERPRETER) setup.py install \ $$($$(PKG)_BASE_INSTALL_STAGING_OPTS) \ $$($$(PKG)_INSTALL_STAGING_OPTS)) endef endif # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) endef ################################################################################ # python-package -- the target generator macro for Python packages ################################################################################ python-package = $(call inner-python-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) host-python-package = $(call inner-python-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
shibajee/buildroot
package/pkg-python.mk
mk
mit
9,162
################################################################################ # rebar package infrastructure for Erlang packages # # This file implements an infrastructure that eases development of # package .mk files for rebar packages. It should be used for all # packages that use rebar as their build system. # # In terms of implementation, this rebar infrastructure requires the # .mk file to only specify metadata information about the package: # name, version, download URL, etc. # # We still allow the package .mk file to override what the different # steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is # already defined, it is used as the list of commands to perform to # build the package, instead of the default rebar behaviour. The # package can also define some post operation hooks. # ################################################################################ # Directories to store rebar dependencies in. # # These directories actually only contain symbolic links to Erlang # applications in either $(HOST_DIR) or $(STAGING_DIR). One needs # them to avoid rebar complaining about missing dependencies, as this # infrastructure tells rebar to NOT download dependencies during # the build stage. # REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps # Tell rebar where to find the dependencies # REBAR_HOST_DEPS_ENV = \ ERL_COMPILER_OPTIONS='{i, "$(REBAR_HOST_DEPS_DIR)"}' \ ERL_EI_LIBDIR=$(HOST_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib REBAR_TARGET_DEPS_ENV = \ ERL_COMPILER_OPTIONS='{i, "$(REBAR_TARGET_DEPS_DIR)"}' \ ERL_EI_LIBDIR=$(STAGING_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib ################################################################################ # Helper functions ################################################################################ # Install an Erlang application from $(@D). # # i.e., define a recipe that installs the "bin ebin priv $(2)" directories # from $(@D) to $(1)$($(PKG)_ERLANG_LIBDIR). # # argument 1 should typically be $(HOST_DIR), $(TARGET_DIR), # or $(STAGING_DIR). # argument 2 is typically empty when installing in $(TARGET_DIR) and # "include" when installing in $(HOST_DIR) or # $(STAGING_DIR). # # Note: calling this function must be done with $$(call ...) because it # expands package-related variables. # define install-erlang-directories $(INSTALL) -d $(1)/$($(PKG)_ERLANG_LIBDIR) for dir in bin ebin priv $(2); do \ if test -d $(@D)/$$dir; then \ cp -r $(@D)/$$dir $(1)$($(PKG)_ERLANG_LIBDIR); \ fi; \ done endef # Setup a symbolic link in rebar's deps_dir to the actual location # where an Erlang application is installed. # # i.e., define a recipe that creates a symbolic link # from $($(PKG)_REBAR_DEPS_DIR)/$($(PKG)_ERLANG_APP) # to $(1)$($(PKG)_ERLANG_LIBDIR). # # For target packages for example, one uses this to setup symbolic # links from $(STAGING_DIR)/usr/share/rebar/deps/<erlang-app> to # $(STAGING_DIR)/usr/lib/erlang/lib/<erlang-app>-<version>. This # infrastructure points rebar at the former in order to tell rebar to # NOT download dependencies during the build stage, and instead use # the already available dependencies. # # Therefore, # argument 1 is $(HOST_DIR) (for host packages) or # $(STAGING_DIR) (for target packages). # # argument 2 is HOST (for host packages) or # TARGET (for target packages). # # Note: calling this function must be done with $$(call ...) because it # expands package-related variables. # define install-rebar-deps $(INSTALL) -d $(REBAR_$(2)_DEPS_DIR) ln -f -s $(1)/$($(PKG)_ERLANG_LIBDIR) \ $(REBAR_$(2)_DEPS_DIR)/$($(PKG)_ERLANG_APP) endef ################################################################################ # inner-rebar-package -- defines how the configuration, compilation # and installation of a rebar package should be done, implements a few # hooks to tune the build process according to rebar specifities, and # calls the generic package infrastructure to generate the necessary # make targets. # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) # ################################################################################ define inner-rebar-package # Extract just the raw package name, lowercase without the leading # erlang- or host- prefix, as this is used by rebar to find the # dependencies a package specifies. # $(2)_ERLANG_APP = $(subst -,_,$(patsubst erlang-%,%,$(patsubst host-%,%,$(1)))) # Path where to store the package's libs, relative to either $(HOST_DIR) # for host packages, or $(STAGING_DIR) for target packages. # $(2)_ERLANG_LIBDIR = \ /usr/lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION) # If a host package, inherit <pkg>_USE_BUNDLED_REBAR from the target # package, if not explicitly defined. Otherwise, default to NO. ifndef $(2)_USE_BUNDLED_REBAR ifdef $(3)_USE_BUNDLED_REBAR $(2)_USE_BUNDLED_REBAR = $$($(3)_USE_BUNDLED_REBAR) else $(2)_USE_BUNDLED_REBAR ?= NO endif endif # If a host package, inherit <pkg>_USE_AUTOCONF from the target # package, if not explicitly defined. Otherwise, default to NO. ifndef $(2)_USE_AUTOCONF ifdef $(3)_USE_AUTOCONF $(2)_USE_AUTOCONF = $$($(3)_USE_AUTOCONF) else $(2)_USE_AUTOCONF ?= NO endif endif # Define the build and install commands # ifeq ($(4),target) # Target packages need the erlang interpreter on the target $(2)_DEPENDENCIES += erlang # Used only if the package uses autotools underneath; otherwise, ignored $(2)_CONF_ENV += $$(REBAR_TARGET_DEPS_ENV) ifndef $(2)_BUILD_CMDS define $(2)_BUILD_CMDS (cd $$(@D); \ CC="$$(TARGET_CC)" \ CXX="$$(TARGET_CXX)" \ CFLAGS="$$(TARGET_CFLAGS)" \ CXXFLAGS="$$(TARGET_CXXFLAGS)" \ LDFLAGS="$$(TARGET_LDFLAGS)" \ $$(REBAR_TARGET_DEPS_ENV) \ $$(TARGET_MAKE_ENV) \ $$($$(PKG)_REBAR_ENV) $$($$(PKG)_REBAR) deps_dir=$$(REBAR_TARGET_DEPS_DIR) compile \ ) endef endif # We need to double-$ the 'call' because it wants to expand # package-related variables ifndef $(2)_INSTALL_STAGING_CMDS define $(2)_INSTALL_STAGING_CMDS $$(call install-erlang-directories,$$(STAGING_DIR),include) $$(call install-rebar-deps,$$(STAGING_DIR),TARGET) endef endif # We need to double-$ the 'call' because it wants to expand # package-related variables ifndef $(2)_INSTALL_TARGET_CMDS define $(2)_INSTALL_TARGET_CMDS $$(call install-erlang-directories,$$(TARGET_DIR)) endef endif else # !target # Host packages need the erlang interpreter on the host $(2)_DEPENDENCIES += host-erlang # Used only if the package uses autotools underneath; otherwise, ignored $(2)_CONF_ENV += $$(REBAR_HOST_DEPS_ENV) ifndef $(2)_BUILD_CMDS define $(2)_BUILD_CMDS (cd $$(@D); \ CC="$$(HOSTCC)" \ CFLAGS="$$(HOST_CFLAGS)" \ LDFLAGS="$$(HOST_LDFLAGS)" \ $$(REBAR_HOST_DEPS_ENV) \ $$(HOST_MAKE_ENV) \ $$($$(PKG)_REBAR_ENV) $$($$(PKG)_REBAR) deps_dir=$$(REBAR_HOST_DEPS_DIR) compile \ ) endef endif # We need to double-$ the 'call' because it wants to expand # package-related variables ifndef $(2)_INSTALL_CMDS define $(2)_INSTALL_CMDS $$(call install-erlang-directories,$$(HOST_DIR),include) $$(call install-rebar-deps,$$(HOST_DIR),HOST) endef endif endif # !target # Whether to use the generic rebar or the package's bundled rebar # ifeq ($$($(2)_USE_BUNDLED_REBAR),YES) $(2)_REBAR = ./rebar else $(2)_REBAR = rebar $(2)_DEPENDENCIES += host-erlang-rebar endif # The package sub-infra to use # ifeq ($$($(2)_USE_AUTOCONF),YES) $(call inner-autotools-package,$(1),$(2),$(3),$(4)) else $(call inner-generic-package,$(1),$(2),$(3),$(4)) endif endef # inner-rebar-package rebar-package = $(call inner-rebar-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) host-rebar-package = $(call inner-rebar-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
shibajee/buildroot
package/pkg-rebar.mk
mk
mit
8,260
################################################################################ # # This file contains various utility functions used by the package # infrastructure, or by the packages themselves. # ################################################################################ # Case conversion macros. This is inspired by the 'up' macro from gmsl # (http://gmsl.sf.net). It is optimised very heavily because these macros # are used a lot. It is about 5 times faster than forking a shell and tr. # # The caseconvert-helper creates a definition of the case conversion macro. # After expansion by the outer $(eval ), the UPPERCASE macro is defined as: # $(strip $(eval __tmp := $(1)) $(eval __tmp := $(subst a,A,$(__tmp))) ... ) # In other words, every letter is substituted one by one. # # The caseconvert-helper allows us to create this definition out of the # [FROM] and [TO] lists, so we don't need to write down every substition # manually. The uses of $ and $$ quoting are chosen in order to do as # much expansion as possible up-front. # # Note that it would be possible to conceive a slightly more optimal # implementation that avoids the use of __tmp, but that would be even # more unreadable and is not worth the effort. [FROM] := a b c d e f g h i j k l m n o p q r s t u v w x y z - . [TO] := A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ _ define caseconvert-helper $(1) = $$(strip \ $$(eval __tmp := $$(1))\ $(foreach c, $(2),\ $$(eval __tmp := $$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)),$$(__tmp))))\ $$(__tmp)) endef $(eval $(call caseconvert-helper,UPPERCASE,$(join $(addsuffix :,$([FROM])),$([TO])))) $(eval $(call caseconvert-helper,LOWERCASE,$(join $(addsuffix :,$([TO])),$([FROM])))) # Sanitize macro cleans up generic strings so it can be used as a filename # and in rules. Particularly useful for VCS version strings, that can contain # slashes, colons (OK in filenames but not in rules), and spaces. sanitize = $(subst $(space),_,$(subst :,_,$(subst /,_,$(strip $(1))))) # # Manipulation of .config files based on the Kconfig # infrastructure. Used by the BusyBox package, the Linux kernel # package, and more. # define KCONFIG_ENABLE_OPT # (option, file) $(SED) "/\\<$(1)\\>/d" $(2) echo '$(1)=y' >> $(2) endef define KCONFIG_SET_OPT # (option, value, file) $(SED) "/\\<$(1)\\>/d" $(3) echo '$(1)=$(2)' >> $(3) endef define KCONFIG_DISABLE_OPT # (option, file) $(SED) "/\\<$(1)\\>/d" $(2) echo '# $(1) is not set' >> $(2) endef # Helper functions to determine the name of a package and its # directory from its makefile directory, using the $(MAKEFILE_LIST) # variable provided by make. This is used by the *-package macros to # automagically find where the package is located. pkgdir = $(dir $(lastword $(MAKEFILE_LIST))) pkgname = $(lastword $(subst /, ,$(pkgdir))) # Define extractors for different archive suffixes INFLATE.bz2 = $(BZCAT) INFLATE.gz = $(ZCAT) INFLATE.lzma = $(XZCAT) INFLATE.tbz = $(BZCAT) INFLATE.tbz2 = $(BZCAT) INFLATE.tgz = $(ZCAT) INFLATE.xz = $(XZCAT) INFLATE.tar = cat # suitable-extractor(filename): returns extractor based on suffix suitable-extractor = $(INFLATE$(suffix $(1))) # MESSAGE Macro -- display a message in bold type MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(call qstrip,$(1))$(TERM_RESET)" TERM_BOLD := $(shell tput smso 2>/dev/null) TERM_RESET := $(shell tput rmso 2>/dev/null) # Utility functions for 'find' # findfileclauses(filelist) => -name 'X' -o -name 'Y' findfileclauses = $(call notfirstword,$(patsubst %,-o -name '%',$(1))) # finddirclauses(base, dirlist) => -path 'base/dirX' -o -path 'base/dirY' finddirclauses = $(call notfirstword,$(patsubst %,-o -path '$(1)/%',$(2))) # Miscellaneous utility functions # notfirstword(wordlist): returns all but the first word in wordlist notfirstword = $(wordlist 2,$(words $(1)),$(1)) # Needed for the foreach loops to loop over the list of hooks, so that # each hook call is properly separated by a newline. define sep endef PERCENT = % QUOTE = ' # ' # Meh... syntax-highlighting # This macro properly escapes a command string, then prints it with printf: # # - first, backslash '\' are self-escaped, so that they do not escape # the following char and so that printf properly outputs a backslash; # # - next, single quotes are escaped by closing an existing one, adding # an escaped one, and re-openning a new one (see below for the reason); # # - then '%' signs are self-escaped so that the printf does not interpret # them as a format specifier, in case the variable contains an actual # printf with a format; # # - finally, $(sep) is replaced with the literal '\n' so that make does # not break on the so-expanded variable, but so that the printf does # correctly output an LF. # # Note: this must be escaped in this order to avoid over-escaping the # previously escaped elements. # # Once everything has been escaped, it is passed between single quotes # (that's why the single-quotes are escaped they way they are, above, # and why the dollar sign is not escaped) to printf(1). A trailing # newline is apended, too. # # Note: leading or trailing spaces are *not* stripped. # define PRINTF printf '$(subst $(sep),\n,\ $(subst $(PERCENT),$(PERCENT)$(PERCENT),\ $(subst $(QUOTE),$(QUOTE)\$(QUOTE)$(QUOTE),\ $(subst \,\\,$(1)))))\n' endef # check-deprecated-variable -- throw an error on deprecated variables # example: # $(eval $(call check-deprecated-variable,FOO_MAKE_OPT,FOO_MAKE_OPTS)) define check-deprecated-variable # (deprecated var, new var) ifneq ($$(origin $(1)),undefined) $$(error Package error: use $(2) instead of $(1). Please fix your .mk file) endif endef # # legal-info helper functions # LEGAL_INFO_SEPARATOR = "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" define legal-warning # text echo "WARNING: $(1)" >>$(LEGAL_WARNINGS) endef define legal-warning-pkg # pkg, text echo "WARNING: $(1): $(2)" >>$(LEGAL_WARNINGS) endef define legal-warning-nosource # pkg, {local|override} $(call legal-warning-pkg,$(1),sources not saved ($(2) packages not handled)) endef define legal-manifest # pkg, version, license, license-files, source, url, {HOST|TARGET} echo '"$(1)","$(2)","$(3)","$(4)","$(5)","$(6)"' >>$(LEGAL_MANIFEST_CSV_$(7)) endef define legal-license-header # pkg, license-file, {HOST|TARGET} printf "$(LEGAL_INFO_SEPARATOR)\n\t$(1):\ $(2)\n$(LEGAL_INFO_SEPARATOR)\n\n\n" >>$(LEGAL_LICENSES_TXT_$(3)) endef define legal-license-nofiles # pkg, {HOST|TARGET} $(call legal-license-header,$(1),unknown license file(s),$(2)) endef define legal-license-file # pkg, filename, file-fullpath, {HOST|TARGET} $(call legal-license-header,$(1),$(2) file,$(4)) && \ cat $(3) >>$(LEGAL_LICENSES_TXT_$(4)) && \ echo >>$(LEGAL_LICENSES_TXT_$(4)) && \ mkdir -p $(LICENSE_FILES_DIR_$(4))/$(1)/$(dir $(2)) && \ cp $(3) $(LICENSE_FILES_DIR_$(4))/$(1)/$(2) endef
shibajee/buildroot
package/pkg-utils.mk
mk
mit
6,964
################################################################################ # Virtual package infrastructure # # This file implements an infrastructure that eases development of # package .mk files for virtual packages. It should be used for all # virtual packages. # # See the Buildroot documentation for details on the usage of this # infrastructure # # In terms of implementation, this virtual infrastructure requires # the .mk file to only call the 'virtual-package' macro. # ################################################################################ ################################################################################ # inner-virtual-package -- defines the dependency rules of the virtual # package against its provider. # # argument 1 is the lowercase package name # argument 2 is the uppercase package name, including a HOST_ prefix # for host packages # argument 3 is the uppercase package name, without the HOST_ prefix # for host packages # argument 4 is the type (target or host) ################################################################################ # Note: putting this comment here rather than in the define block, otherwise # make would try to expand the $(error ...) in the comment, which is not # really what we want. # We need to use second-expansion for the $(error ...) call, below, # so it is not evaluated now, but as part of the generated make code. define inner-virtual-package # Ensure the virtual package has an implementation defined. ifeq ($$(BR2_PACKAGE_HAS_$(2)),y) ifeq ($$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(2))),) $$(error No implementation selected for virtual package $(1). Configuration error) endif endif $(2)_IS_VIRTUAL = YES # Add dependency against the provider # For a host package, there is no corresponding BR2_PACKAGE_PROVIDES_HOST_FOO, # so we need to compute it from the target variant. ifeq ($(4),target) $(2)_DEPENDENCIES += $$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(2))) else $(2)_DEPENDENCIES += host-$$(call qstrip,$$(BR2_PACKAGE_PROVIDES_$(3))) endif # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) endef ################################################################################ # virtual-package -- the target generator macro for virtual packages ################################################################################ virtual-package = $(call inner-virtual-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) host-virtual-package = $(call inner-virtual-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
shibajee/buildroot
package/pkg-virtual.mk
mk
mit
2,709
From abc7a780f2a52a1aa3ee288e17140b817b545cc3 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias <gustavo@zacarias.com.ar> Date: Mon, 2 Nov 2015 18:38:00 -0300 Subject: [PATCH] Fix all-variables sysroot prefix problem According to the pkg-config specifications (or rather documentation) only the -L/-I directory entries should be sysroot-prefixed. We also need to prefix the mapdir/sdkdir variables since they're used by xorg and expected that way. Also allow prefixing for includedir and libdir since in some silly cases the directories may be requested barebones via pkg-config --variable=includedir libfool for example. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> --- main.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 6947126..52d16c2 100644 --- a/main.c +++ b/main.c @@ -313,9 +313,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags) memset(req->buf, 0, sizeof(req->buf)); if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) && - (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir)))) - strlcat(req->buf, sysroot_dir, sizeof(req->buf)); - + (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) && + (!strcmp(req->variable, "includedir") || \ + !strcmp(req->variable, "libdir") || \ + !strcmp(req->variable, "mapdir") || \ + !strcmp(req->variable, "sdkdir"))) + strlcat(req->buf, sysroot_dir, sizeof(req->buf)); strlcat(req->buf, var, sizeof(req->buf)); return; } @@ -323,8 +326,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags) strlcat(req->buf, " ", sizeof(req->buf)); if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) && - (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir)))) - strlcat(req->buf, sysroot_dir, sizeof(req->buf)); + (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) && + (!strcmp(req->variable, "includedir") || \ + !strcmp(req->variable, "libdir") || \ + !strcmp(req->variable, "mapdir") || \ + !strcmp(req->variable, "sdkdir"))) + strlcat(req->buf, sysroot_dir, sizeof(req->buf)); strlcat(req->buf, var, sizeof(req->buf)); } -- 2.4.10
shibajee/buildroot
package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
patch
mit
2,278
config BR2_PACKAGE_PKGCONF bool "pkgconf" help pkgconf is a program which helps to configure compiler and linker flags for development frameworks. It is similar to pkg-config, but was written from scratch in the summer of 2011 to replace pkg-config, which now needs itself to build itself https://github.com/nenolod/pkgconf
shibajee/buildroot
package/pkgconf/Config.in
in
mit
342
#!/bin/sh PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-@PKG_CONFIG_LIBDIR@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} $(dirname $0)/pkgconf @STATIC@ $@
shibajee/buildroot
package/pkgconf/pkg-config.in
in
mit
168
# Locally calculated sha256 7ec8b516e655e247f4ba976837cee808134785819ab8f538f652fe919cc6c09f pkgconf-0.9.12.tar.bz2
shibajee/buildroot
package/pkgconf/pkgconf.hash
hash
mit
116
################################################################################ # # pkgconf # ################################################################################ PKGCONF_VERSION = 0.9.12 PKGCONF_SITE = https://github.com/pkgconf/pkgconf/releases/download/pkgconf-$(PKGCONF_VERSION) PKGCONF_SOURCE = pkgconf-$(PKGCONF_VERSION).tar.bz2 PKGCONF_LICENSE = pkgconf license PKGCONF_LICENSE_FILES = COPYING PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/usr/bin/pkg-config define PKGCONF_LINK_PKGCONFIG ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config endef define HOST_PKGCONF_INSTALL_WRAPPER $(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \ $(HOST_DIR)/usr/bin/pkg-config $(SED) 's,@PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \ -e 's,@STAGING_DIR@,$(STAGING_DIR),' \ $(HOST_DIR)/usr/bin/pkg-config endef define HOST_PKGCONF_STATIC $(SED) 's,@STATIC@,--static,' $(HOST_DIR)/usr/bin/pkg-config endef define HOST_PKGCONF_SHARED $(SED) 's,@STATIC@,,' $(HOST_DIR)/usr/bin/pkg-config endef PKGCONF_POST_INSTALL_TARGET_HOOKS += PKGCONF_LINK_PKGCONFIG HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_INSTALL_WRAPPER ifeq ($(BR2_STATIC_LIBS),y) HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_STATIC else HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_SHARED endif $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/pkgconf/pkgconf.mk
mk
mit
1,389
From b8417607ec8840e6a1e27cf03b6958c794a33e49 Mon Sep 17 00:00:00 2001 From: Baruch Siach <baruch@tkos.co.il> Date: Tue, 4 Aug 2015 10:14:00 +0200 Subject: [PATCH 1/2] poco: add the staging path to search path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the mysql headers and client libraries to the search path of the preprocessor and the linker. The $MYSQL_LIBDIR / $MYSQL_INCIDR variables must be set from the make command line. [Peter: Remove host dirs, add MYSQL_INCDIR] Signed-off-by: Baruch Siach <baruch@tkos.co.il> [Jörg: Update to version 1.6.1 from github] Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks> --- Data/MySQL/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/MySQL/Makefile b/Data/MySQL/Makefile index 0b18ca5..094e807 100644 --- a/Data/MySQL/Makefile +++ b/Data/MySQL/Makefile @@ -8,8 +8,8 @@ include $(POCO_BASE)/build/rules/global -SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient -INCLUDE += -I/usr/local/include/mysql/ -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include +SYSLIBS += -L$(MYSQL_LIBDIR) -lmysqlclient +INCLUDE += -I$(MYSQL_INCDIR) SYSFLAGS += -DTHREADSAFE -DNO_TCL objects = Binder Extractor SessionImpl Connector \ -- 2.5.0
shibajee/buildroot
package/poco/0001-poco-add-the-staging-path-to-search-path.patch
patch
mit
1,450
Fixes compile for m68k. From upstream double-conversion commit da111796231: https://github.com/google/double-conversion/blob/master/double-conversion/utils.h Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur poco-poco-1.7.2-release.orig/Foundation/src/utils.h poco-poco-1.7.2-release/Foundation/src/utils.h --- poco-poco-1.7.2-release.orig/Foundation/src/utils.h 2016-03-19 08:19:35.000000000 +0100 +++ poco-poco-1.7.2-release/Foundation/src/utils.h 2016-08-11 02:55:02.827238119 +0200 @@ -63,6 +63,8 @@ defined(__AARCH64EL__) || \ defined(nios2) || defined(__nios2) || defined(__nios2__) #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#elif defined(__mc68000__) +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) #if defined(_WIN32) // Windows uses a 64bit wide floating point stack.
shibajee/buildroot
package/poco/0002-fix-m68k-double-conv-detect.patch
patch
mit
885
config BR2_PACKAGE_POCO bool "poco" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_WCHAR depends on BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_STATIC_LIBS # dlopen() depends on !(BR2_arc || BR2_bfin || BR2_microblaze || BR2_mipsel \ || BR2_xtensa) select BR2_PACKAGE_ZLIB select BR2_PACKAGE_PCRE help The C++ Portable Components Libraries http://pocoproject.org if BR2_PACKAGE_POCO comment "poco components" config BR2_PACKAGE_POCO_XML bool "xml" select BR2_PACKAGE_EXPAT config BR2_PACKAGE_POCO_UTIL bool "util" select BR2_PACKAGE_POCO_XML config BR2_PACKAGE_POCO_NET bool "net" config BR2_PACKAGE_POCO_CRYPTO bool "crypto" select BR2_PACKAGE_OPENSSL config BR2_PACKAGE_POCO_NETSSL_OPENSSL bool "netssl_openssl" select BR2_PACKAGE_POCO_NET select BR2_PACKAGE_POCO_CRYPTO select BR2_PACKAGE_POCO_UTIL select BR2_PACKAGE_OPENSSL config BR2_PACKAGE_POCO_ZIP bool "zip" select BR2_PACKAGE_POCO_XML select BR2_PACKAGE_POCO_NET select BR2_PACKAGE_POCO_UTIL config BR2_PACKAGE_POCO_DATA bool config BR2_PACKAGE_POCO_DATA_SQLITE bool "sqlite" select BR2_PACKAGE_POCO_DATA select BR2_PACKAGE_SQLITE config BR2_PACKAGE_POCO_DATA_MYSQL bool "mysql" depends on BR2_USE_MMU # mysql select BR2_PACKAGE_POCO_DATA select BR2_PACKAGE_MYSQL endif # BR2_PACKAGE_POCO comment "poco needs a toolchain w/ wchar, threads, C++, dynamic library" depends on !BR2_USE_WCHAR || !BR2_INSTALL_LIBSTDCPP \ || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS depends on !(BR2_arc || BR2_bfin || BR2_microblaze || BR2_mipsel \ || BR2_xtensa)
shibajee/buildroot
package/poco/Config.in
in
mit
1,572
# Locally computed sha256 cfd311ecbc9e58accf1c4ea70170af88f92f88e73dd14944e528e7f6229e6cab poco-poco-1.7.2-release.tar.gz sha256 32182791e7eac00ba367d2f22dd1dd5bfce0b6d6f76fd52f853364f98402dda3 30159aea4b3f6421da9d74a8bf22aad6d3bf26b4.patch
shibajee/buildroot
package/poco/poco.hash
hash
mit
245
################################################################################ # # poco # ################################################################################ POCO_VERSION = poco-1.7.2-release POCO_SITE = $(call github,pocoproject,poco,$(POCO_VERSION)) POCO_LICENSE = Boost-v1.0 POCO_LICENSE_FILES = LICENSE POCO_INSTALL_STAGING = YES POCO_PATCH = https://github.com/pocoproject/poco/commit/30159aea4b3f6421da9d74a8bf22aad6d3bf26b4.patch POCO_DEPENDENCIES = zlib pcre \ $(if $(BR2_PACKAGE_POCO_XML),expat) \ $(if $(BR2_PACKAGE_POCO_CRYPTO),openssl) \ $(if $(BR2_PACKAGE_POCO_NETSSL_OPENSSL),openssl) \ $(if $(BR2_PACKAGE_POCO_DATA_SQLITE),sqlite) \ $(if $(BR2_PACKAGE_POCO_DATA_MYSQL),mysql) POCO_OMIT = Data/ODBC PageCompiler \ $(if $(BR2_PACKAGE_POCO_XML),,XML) \ $(if $(BR2_PACKAGE_POCO_UTIL),,Util) \ $(if $(BR2_PACKAGE_POCO_NET),,Net) \ $(if $(BR2_PACKAGE_POCO_NETSSL_OPENSSL),,NetSSL_OpenSSL) \ $(if $(BR2_PACKAGE_POCO_CRYPTO),,Crypto) \ $(if $(BR2_PACKAGE_POCO_ZIP),,Zip) \ $(if $(BR2_PACKAGE_POCO_DATA),,Data) \ $(if $(BR2_PACKAGE_POCO_DATA_MYSQL),,Data/MySQL) \ $(if $(BR2_PACKAGE_POCO_DATA_SQLITE),,Data/SQLite) ifeq ($(LIBC),uclibc) POCO_CONF_OPTS += --no-fpenvironment --no-wstring endif # architectures missing some FE_* in their fenv.h ifeq ($(BR2_sh4a)$(BR2_nios2),y) POCO_CONF_OPTS += --no-fpenvironment endif ifeq ($(BR2_STATIC_LIBS),y) POCO_MAKE_TARGET = static_release else ifeq ($(BR2_SHARED_LIBS),y) POCO_MAKE_TARGET = shared_release else ifeq ($(BR2_SHARED_STATIC_LIBS),y) POCO_MAKE_TARGET = all_release endif define POCO_CONFIGURE_CMDS (cd $(@D); ./configure \ --config=Linux \ --prefix=/usr \ --omit="$(POCO_OMIT)" \ $(POCO_CONF_OPTS) \ --unbundled \ --no-tests \ --no-samples) endef define POCO_BUILD_CMDS $(MAKE) POCO_TARGET_OSARCH=$(ARCH) CROSS_COMPILE=$(TARGET_CROSS) \ MYSQL_LIBDIR=$(STAGING_DIR)/usr/lib/mysql \ MYSQL_INCDIR=$(STAGING_DIR)/usr/include/mysql \ DEFAULT_TARGET=$(POCO_MAKE_TARGET) -C $(@D) endef define POCO_INSTALL_STAGING_CMDS $(MAKE) DESTDIR=$(STAGING_DIR) POCO_TARGET_OSARCH=$(ARCH) \ DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D) endef define POCO_INSTALL_TARGET_CMDS $(MAKE) DESTDIR=$(TARGET_DIR) POCO_TARGET_OSARCH=$(ARCH) \ DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D) endef $(eval $(generic-package))
shibajee/buildroot
package/poco/poco.mk
mk
mit
2,368
Add BUILD_TESTS option to disable test suite By default, PolarSSL builds a fairly extensive test suite to validate the library. In the context of Buildroot, building this test suite is not really useful, so we add a BUILD_TESTS to disable its build. [Gustavo: update for 1.2.11] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> diff -Nura polarssl-1.2.11.orig/CMakeLists.txt polarssl-1.2.11/CMakeLists.txt --- polarssl-1.2.11.orig/CMakeLists.txt 2014-07-11 17:14:43.414651327 -0300 +++ polarssl-1.2.11/CMakeLists.txt 2014-07-11 17:23:00.573498626 -0300 @@ -49,9 +49,11 @@ add_subdirectory(library) add_subdirectory(include) -if(CMAKE_COMPILER_IS_GNUCC) +option(BUILD_TESTS "Build tests." ON) + +if(CMAKE_COMPILER_IS_GNUCC AND BUILD_TESTS) add_subdirectory(tests) -endif(CMAKE_COMPILER_IS_GNUCC) +endif(CMAKE_COMPILER_IS_GNUCC AND BUILD_TESTS) if(CMAKE_COMPILER_IS_CLANG) add_subdirectory(tests) endif(CMAKE_COMPILER_IS_CLANG)
shibajee/buildroot
package/polarssl/0001-no-test-suite.patch
patch
mit
1,020
From a14028b0878c1ba27f7c7a6d0962874d0f7f3801 Mon Sep 17 00:00:00 2001 From: Samuel Martin <s.martin49@gmail.com> Date: Sun, 31 Aug 2014 11:54:37 +0200 Subject: [PATCH 3/3] cmake: use the standard CMake flag to drive the shared object build If BUILD_SHARED_LIBS is set and not USE_SHARED_POLARSSL_LIBRARY, then drive USE_SHARED_POLARSSL_LIBRARY with the BUILD_SHARED_LIBS value. Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- library/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 27bd2e0..2ae0aba 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,5 +1,15 @@ -option(USE_STATIC_POLARSSL_LIBRARY "Build PolarSSL static library." ON) -option(USE_SHARED_POLARSSL_LIBRARY "Build PolarSSL shared library." OFF) +# Use the standard CMake flag to drive the shared object build. +if(DEFINED BUILD_SHARED_LIBS AND NOT DEFINED USE_STATIC_POLARSSL_LIBRARY AND NOT DEFINED USE_SHARED_POLARSSL_LIBRARY) + set(USE_STATIC_POLARSSL_LIBRARY ON) + if(BUILD_SHARED_LIBS) + set(USE_SHARED_POLARSSL_LIBRARY ON) + else() + set(USE_SHARED_POLARSSL_LIBRARY OFF) + endif() +else() + option(USE_STATIC_POLARSSL_LIBRARY "Build PolarSSL static library." ON) + option(USE_SHARED_POLARSSL_LIBRARY "Build PolarSSL shared library." OFF) +endif() set(src aes.c -- 2.1.0
shibajee/buildroot
package/polarssl/0002-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch
patch
mit
1,400
config BR2_PACKAGE_POLARSSL bool "polarssl" help PolarSSL is an SSL library written in ANSI C. PolarSSL makes it easy for developers to include cryptographic and SSL/TLS capabilities in their (embedded) products with as little hassle as possible. It is designed to be readable, documented, tested, loosely coupled and portable. Warning: PolarSSL is licensed under the GPL. If you want to use it in your own proprietary applications, you have to purchase a commercial license. https://tls.mbed.org/ if BR2_PACKAGE_POLARSSL config BR2_PACKAGE_POLARSSL_PROGRAMS bool "polarssl programs" depends on BR2_USE_MMU # fork() help This option enables the installation and the build of PolarSSL companion programs: aescrypt2, benchmark, cert_app, crl_app, crypt_and_hash, dh_client, dh_genprime, dh_server, gen_entropy, generic_sum, gen_random_ctr_drbg, gen_random_havege, hello, key_app, md5sum, mpi_demo, rsa_decrypt, rsa_encrypt, rsa_genkey, rsa_sign, rsa_verify, selftest, sha1sum, sha2sum, ssi-cgi, ssl_cert_test, ssl_client1, ssl_client2, ssl_fork_server, ssl_mail_client, ssl_server, ssl_test endif
shibajee/buildroot
package/polarssl/Config.in
in
mit
1,159
# From https://tls.mbed.org/tech-updates/releases/mbedtls-2.2.1-2.1.4-1.3.16-and-polarssl.1.2.19-released sha256 24cb1608a160101ead3c7240f35fc447fe7880cd60f7ed6c9db7a1d773ccd4b8 polarssl-1.2.19-gpl.tgz
shibajee/buildroot
package/polarssl/polarssl.hash
hash
mit
202
################################################################################ # # polarssl # ################################################################################ POLARSSL_SITE = https://tls.mbed.org/code/releases POLARSSL_VERSION = 1.2.19 POLARSSL_SOURCE = polarssl-$(POLARSSL_VERSION)-gpl.tgz POLARSSL_CONF_OPTS = \ -DENABLE_PROGRAMS=$(if $(BR2_PACKAGE_POLARSSL_PROGRAMS),ON,OFF) POLARSSL_INSTALL_STAGING = YES POLARSSL_LICENSE = GPLv2 POLARSSL_LICENSE_FILES = LICENSE define POLARSSL_DISABLE_ASM $(SED) '/^#define POLARSSL_HAVE_ASM/d' $(@D)/include/polarssl/config.h endef # ARM in thumb mode breaks debugging with asm optimizations # Microblaze asm optimizations are broken in general # MIPS R6 asm is not yet supported ifeq ($(BR2_ENABLE_DEBUG)$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_ARM_INSTRUCTIONS_THUMB2),yy) POLARSSL_POST_CONFIGURE_HOOKS += POLARSSL_DISABLE_ASM else ifeq ($(BR2_microblaze),y) POLARSSL_POST_CONFIGURE_HOOKS += POLARSSL_DISABLE_ASM else ifeq ($(BR2_mips_32r6)$(BR2_mips_64r6),y) POLARSSL_POST_CONFIGURE_HOOKS += POLARSSL_DISABLE_ASM endif $(eval $(cmake-package))
shibajee/buildroot
package/polarssl/polarssl.mk
mk
mit
1,106
config BR2_PACKAGE_POLKIT bool "polkit" depends on BR2_USE_WCHAR # libglib2 depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2 depends on BR2_USE_MMU # libglib2 select BR2_PACKAGE_LIBGLIB2 select BR2_PACKAGE_EXPAT help PolicyKit is a toolkit for defining and handling authorizations. It is used for allowing unprivileged processes to speak to privileged processes. http://www.freedesktop.org/wiki/Software/polkit comment "polkit needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
shibajee/buildroot
package/polkit/Config.in
in
mit
565
# Locally calculated after checking pgp signature sha256 36607c8ce576980ee55bd12bab1944f13217eb8e9d04ab56022545861ece3bc5 polkit-0.103.tar.gz
shibajee/buildroot
package/polkit/polkit.hash
hash
mit
142
################################################################################ # # polkit # ################################################################################ POLKIT_VERSION = 0.103 POLKIT_SITE = http://www.freedesktop.org/software/polkit/releases POLKIT_LICENSE = GPLv2 POLKIT_LICENSE_FILES = COPYING POLKIT_INSTALL_STAGING = YES POLKIT_DEPENDENCIES = libglib2 host-intltool expat # We could also support --with-authfw=pam POLKIT_CONF_OPTS = \ --with-authfw=shadow \ --with-os-type=unknown \ --disable-man-pages \ --disable-examples $(eval $(autotools-package))
shibajee/buildroot
package/polkit/polkit.mk
mk
mit
588
Fix syntax issue in configure script The change is not done in configure.ac, because the package doesn't autoreconf properly. Patch on configure.ac submitted upstream at https://bugs.freedesktop.org/show_bug.cgi?id=90292. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Index: b/configure =================================================================== --- a/configure +++ b/configure @@ -19738,7 +19738,7 @@ CXXFLAGS="$CXXFLAGS $LIBTIFF_CFLAGS" LIBS="$LIBS $LIBTIFF_LIBS" if test x$enable_libtiff = xyes; then - if test x"$LIBTIFF_LIBS" != ; then + if test x"$LIBTIFF_LIBS" != x; then ac_fn_cxx_check_func "$LINENO" "TIFFOpen" "ac_cv_func_TIFFOpen" if test "x$ac_cv_func_TIFFOpen" = xyes; then :
shibajee/buildroot
package/poppler/0001-Fix-invalid-shell-comparaison-in-libtiff-test.patch
patch
mit
740
config BR2_PACKAGE_POPPLER bool "poppler" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_TOOLCHAIN_HAS_THREADS select BR2_PACKAGE_FONTCONFIG select BR2_PACKAGE_XLIB_LIBX11 if BR2_PACKAGE_XORG7 select BR2_PACKAGE_XLIB_LIBXEXT if BR2_PACKAGE_XORG7 help Poppler is a PDF rendering library based on the xpdf-3.0 code base. http://poppler.freedesktop.org/ if BR2_PACKAGE_POPPLER config BR2_PACKAGE_POPPLER_QT bool "Qt support" depends on BR2_PACKAGE_QT depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 # Qt GUI module select BR2_PACKAGE_QT_GUI_MODULE select BR2_PACKAGE_QT_XML help Build Qt support into the Poppler library comment "poppler Qt support needs a toolchain not affected by Binutils bug 19405" depends on BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 endif comment "poppler needs a toolchain w/ C++, threads" depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
shibajee/buildroot
package/poppler/Config.in
in
mit
902
# Locally calculated sha256 4963e31ba5e17530a87b16588e22928bc044e8d28d02303dded981bff6725b98 poppler-0.32.0.tar.xz
shibajee/buildroot
package/poppler/poppler.hash
hash
mit
115
################################################################################ # # poppler # ################################################################################ POPPLER_VERSION = 0.32.0 POPPLER_SOURCE = poppler-$(POPPLER_VERSION).tar.xz POPPLER_SITE = http://poppler.freedesktop.org POPPLER_DEPENDENCIES = fontconfig host-pkgconf POPPLER_LICENSE = GPLv2+ POPPLER_LICENSE_FILES = COPYING POPPLER_INSTALL_STAGING = YES POPPLER_CONF_OPTS = --with-font-configuration=fontconfig \ --enable-xpdf-headers ifeq ($(BR2_PACKAGE_LCMS2),y) POPPLER_CONF_OPTS += --enable-cms=lcms2 POPPLER_DEPENDENCIES += lcms2 else POPPLER_CONF_OPTS += --enable-cms=none endif ifeq ($(BR2_PACKAGE_TIFF),y) POPPLER_CONF_OPTS += --enable-libtiff # Help poppler to find libtiff in static linking scenarios POPPLER_CONF_ENV += \ LIBTIFF_LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libtiff-4`" POPPLER_DEPENDENCIES += tiff else POPPLER_CONF_OPTS += --disable-libtiff endif ifeq ($(BR2_PACKAGE_JPEG),y) POPPLER_CONF_OPTS += --enable-libjpeg POPPLER_DEPENDENCIES += jpeg else POPPLER_CONF_OPTS += --disable-libjpeg endif ifeq ($(BR2_PACKAGE_LIBPNG),y) POPPLER_CONF_OPTS += --enable-libpng POPPLER_DEPENDENCIES += libpng else POPPLER_CONF_OPTS += --disable-libpng endif ifeq ($(BR2_PACKAGE_ZLIB),y) POPPLER_CONF_OPTS += --enable-zlib POPPLER_DEPENDENCIES += zlib else POPPLER_CONF_OPTS += --disable-zlib endif ifeq ($(BR2_PACKAGE_POPPLER_LIBCURL),y) POPPLER_CONF_OPTS += --enable-libcurl POPPLER_DEPENDENCIES += libcurl else POPPLER_CONF_OPTS += --disable-libcurl endif ifeq ($(BR2_PACKAGE_XORG7),y) POPPLER_CONF_OPTS += --with-x POPPLER_DEPENDENCIES += xlib_libX11 xlib_libXext else POPPLER_CONF_OPTS += --without-x endif ifeq ($(BR2_PACKAGE_POPPLER_QT),y) POPPLER_DEPENDENCIES += qt POPPLER_CONF_OPTS += --enable-poppler-qt4 else POPPLER_CONF_OPTS += --disable-poppler-qt4 endif ifeq ($(BR2_PACKAGE_OPENJPEG),y) POPPLER_DEPENDENCIES += openjpeg POPPLER_CONF_OPTS += --enable-libopenjpeg else POPPLER_CONF_OPTS += --enable-libopenjpeg=none endif $(eval $(autotools-package))
shibajee/buildroot
package/poppler/poppler.mk
mk
mit
2,063
diff -ru popt-1.14_vanilla/popthelp.c popt-1.14_no-wchar/popthelp.c --- popt-1.14_vanilla/popthelp.c 2008-03-27 17:33:08.000000000 +0000 +++ popt-1.14_no-wchar/popthelp.c 2008-04-10 05:44:43.000000000 +0000 @@ -15,7 +15,7 @@ #include <sys/ioctl.h> #endif -#define POPT_WCHAR_HACK +/* #define POPT_WCHAR_HACK */ #ifdef POPT_WCHAR_HACK #include <wchar.h> /* for mbsrtowcs */ /*@access mbstate_t @*/
shibajee/buildroot
package/popt/0001-no-wchar.patch
patch
mit
407
Make sure we can autoreconfigure popt This commit makes a few changes in the popt build system to allow it to be autoreconfigured with modern autotools: - the TESTS variable shouldn't be using $(top_srcdir), and since we don't care about tests in Buildroot, we just disable it. - the AM_C_PROTOTYPES macro is deprecated and should no longer be used, causes an error with autoconf/automake. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Index: b/Makefile.am =================================================================== --- a/Makefile.am +++ b/Makefile.am @@ -37,8 +37,6 @@ TESTS_ENVIRONMENT = \ test1="$(top_builddir)/test1" -TESTS = $(top_srcdir)/testit.sh - include_HEADERS = popt.h usrlibdir = $(libdir) Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,6 @@ AC_SYS_LARGEFILE AC_ISC_POSIX -AM_C_PROTOTYPES AC_CHECK_HEADERS(float.h fnmatch.h glob.h langinfo.h libintl.h mcheck.h unistd.h)
shibajee/buildroot
package/popt/0002-fix-autoreconf.patch
patch
mit
1,042
Detect glob_pattern_p() The current popt build system tests the existence of <glob.h>, and then assumes that if __GLIBC__ is defined, then glob_pattern_p() must be available. Unfortunately, that's not true with uClibc: <glob.h> may be installed, but not necessarily the GNU glob extensions... and uClibc defines __GLIBC__. This is causing build issues with certain uClibc toolchains that do not have GNU glob extensions enabled. To fix this, this patch adds an AC_CHECK_FUNCS() test for glob_pattern_p, and uses that to find out whether glob_pattern_p() is available or not. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac @@ -81,7 +81,7 @@ AC_CHECK_FUNC(setreuid, [], [ AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi]) ]) -AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf srandom) +AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf srandom glob_pattern_p) AM_GNU_GETTEXT([external]) AM_ICONV_LINK Index: b/poptconfig.c =================================================================== --- a/poptconfig.c +++ b/poptconfig.c @@ -42,7 +42,7 @@ /*@=declundef =exportheader =incondefs =protoparammatch =redecl =type @*/ #endif /* __LCLINT__ */ -#if !defined(__GLIBC__) +#if !defined(HAVE_GLOB_PATTERN_P) /* Return nonzero if PATTERN contains any metacharacters. Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ static int
shibajee/buildroot
package/popt/0003-glob-detection.patch
patch
mit
1,678
From 470755ccc353b59107c957972d908cbde4942c8d Mon Sep 17 00:00:00 2001 From: Fabio Porcedda <fabio.porcedda@gmail.com> Date: Sun, 1 Mar 2015 21:13:48 +0100 Subject: [PATCH] popt.pc: add the libintl library to the Libs.private field If static linking and libintl is used, the program that uses the popt library needs to link to the libintl library too so add the libintl library to the libs.private field because is useful for programs that call pkg-config --static --libs popt they get the libintl library too: -L<...> -lpopt -lintl This patch was already sent upstream: http://rpm5.org/community/popt-devel/0294.html Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> --- configure.ac | 1 + popt.pc.in | 1 + 2 files changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index e8eb238..816d272 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,7 @@ popt_sysconfdir="${sysconfdir}" eval "popt_sysconfdir=\"${popt_sysconfdir}\"" # expand contained ${prefix} AC_DEFINE_UNQUOTED([POPT_SYSCONFDIR], ["$popt_sysconfdir"], [Full path to default POPT configuration directory]) +AC_SUBST([POPT_PKGCONFIG_LIBS_PRIVATE],"$LIBINTL") # Define a (hope) portable Libs pkgconfig directive that # - Don't harm if the default library search path include ${libdir} diff --git a/popt.pc.in b/popt.pc.in index a86437c..0acfdb9 100644 --- a/popt.pc.in +++ b/popt.pc.in @@ -6,5 +6,6 @@ includedir=@includedir@ Name: popt Version: @VERSION@ Description: popt library. +Libs.private: @POPT_PKGCONFIG_LIBS_PRIVATE@ Libs: @POPT_PKGCONFIG_LIBS@ Cflags: -I${includedir} -- 2.3.1
shibajee/buildroot
package/popt/0004-popt.pc-add-the-libintl-library-to-the-Libs.private-.patch
patch
mit
1,605
config BR2_PACKAGE_POPT bool "popt" help Popt is a C library for parsing command line parameters. http://rpm5.org
shibajee/buildroot
package/popt/Config.in
in
mit
123
# Locally calculated: sha256 e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8 popt-1.16.tar.gz
shibajee/buildroot
package/popt/popt.hash
hash
mit
111
################################################################################ # # popt # ################################################################################ POPT_VERSION = 1.16 POPT_SITE = http://rpm5.org/files/popt POPT_INSTALL_STAGING = YES POPT_LICENSE = MIT POPT_LICENSE_FILES = COPYING POPT_AUTORECONF = YES POPT_GETTEXTIZE = YES ifeq ($(BR2_PACKAGE_GETTEXT),y) POPT_DEPENDENCIES += gettext endif POPT_CONF_ENV = ac_cv_va_copy=yes ifeq ($(BR2_PACKAGE_LIBICONV),y) POPT_CONF_ENV += am_cv_lib_iconv=yes POPT_CONF_OPTS += --with-libiconv-prefix=$(STAGING_DIR)/usr endif $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/popt/popt.mk
mk
mit
656
comment "portaudio needs a toolchain w/ threads" depends on !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_PORTAUDIO bool "portaudio" depends on BR2_TOOLCHAIN_HAS_THREADS help PortAudio is a free, cross-platform, open-source, audio I/O library. http://www.portaudio.com/ if BR2_PACKAGE_PORTAUDIO config BR2_PACKAGE_PORTAUDIO_ALSA bool "alsa support" select BR2_PACKAGE_ALSA_LIB default y help Compile with ALSA support. config BR2_PACKAGE_PORTAUDIO_OSS bool "oss support" help Compile with OSS support. config BR2_PACKAGE_PORTAUDIO_CXX bool "C++ bindings" depends on BR2_INSTALL_LIBSTDCPP help Enables C++ bindings. endif # BR2_PACKAGE_PORTAUDIO
shibajee/buildroot
package/portaudio/Config.in
in
mit
683
# Locally calculated sha256 8fe024a5f0681e112c6979808f684c3516061cc51d3acc0b726af98fc96c8d57 pa_stable_v19_20140130.tgz
shibajee/buildroot
package/portaudio/portaudio.hash
hash
mit
120
################################################################################ # # portaudio # ################################################################################ PORTAUDIO_VERSION = v19_20140130 PORTAUDIO_SITE = http://www.portaudio.com/archives PORTAUDIO_SOURCE = pa_stable_$(PORTAUDIO_VERSION).tgz PORTAUDIO_INSTALL_STAGING = YES PORTAUDIO_MAKE = $(MAKE1) PORTAUDIO_LICENSE = portaudio license (MIT-like plus special clause) PORTAUDIO_LICENSE_FILES = LICENSE.txt PORTAUDIO_DEPENDENCIES = \ $(if $(BR2_PACKAGE_PORTAUDIO_ALSA),alsa-lib) PORTAUDIO_CONF_OPTS = \ $(if $(BR2_PACKAGE_PORTAUDIO_ALSA),--with-alsa,--without-alsa) \ $(if $(BR2_PACKAGE_PORTAUDIO_OSS),--with-oss,--without-oss) \ $(if $(BR2_PACKAGE_PORTAUDIO_CXX),--enable-cxx,--disable-cxx) $(eval $(autotools-package))
shibajee/buildroot
package/portaudio/portaudio.mk
mk
mit
803
From af4a27a17bbdbe941f2462e116c2e4c8ade110e3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger <vapier@gentoo.org> Date: Fri, 19 Nov 2010 23:35:20 -0500 Subject: [PATCH 1/4] README: fix typo in tcp wrapper doc Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- README | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/README b/README index 0da54cc..916de7e 100644 --- a/README +++ b/README @@ -18,7 +18,7 @@ There is no "./configure", just use "make". Some make variable can be used to control compilation. - NO_TCP_WRAPPER= if non-empty, doen't use tcp_wrappers + NO_TCP_WRAPPER= if non-empty, don't use tcp_wrappers USE_DNS= if set, tcp_wrappers can check peers based on hostname as well as IP address. This should only be used if you are certain that gethostbyname will never trigger a -- 1.7.3.1
shibajee/buildroot
package/portmap/0001-README-fix-typo-in-tcp-wrapper-doc.patch
patch
mit
850
From 087874b15367a04fd482541d1832696d7163d1ac Mon Sep 17 00:00:00 2001 From: Mike Frysinger <vapier@gentoo.org> Date: Fri, 19 Nov 2010 23:35:47 -0500 Subject: [PATCH 2/4] NO_PIE: make PIE support controllable Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- Makefile | 8 ++++++-- README | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5343428..cfcfdbb 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,10 @@ CPPFLAGS += -DIGNORE_SIGCHLD # AIX 4.x, HP-UX 9.x # # LDLIBS += -m # CFLAGS += -arch m68k -arch i386 -arch hppa +ifeq ($(NO_PIE),) +CFLAGS_PIE = -fpie +LDFLAGS_PIE = -pie +endif # Auxiliary libraries that you may have to specify # @@ -125,9 +129,9 @@ CFLAGS += -Wall -Wstrict-prototypes all: portmap pmap_dump pmap_set portmap.man CPPFLAGS += $(HOSTS_ACCESS) -portmap: CFLAGS += -fpie +portmap: CFLAGS += $(CFLAGS_PIE) portmap: LDLIBS += $(WRAP_LIB) -portmap: LDFLAGS += -pie +portmap: LDFLAGS += $(LDFLAGS_PIE) portmap: portmap.o pmap_check.o from_local.o from_local: CPPFLAGS += -DTEST diff --git a/README b/README index 916de7e..e0b561a 100644 --- a/README +++ b/README @@ -18,6 +18,7 @@ There is no "./configure", just use "make". Some make variable can be used to control compilation. + NO_PIE= if non-empty, don't build portmap as a PIE NO_TCP_WRAPPER= if non-empty, don't use tcp_wrappers USE_DNS= if set, tcp_wrappers can check peers based on hostname as well as IP address. This should only be used if you -- 1.7.3.1
shibajee/buildroot
package/portmap/0002-NO_PIE-make-PIE-support-controllable.patch
patch
mit
1,549
From b3afea5757af1a7356ba30d2e0a7d5909ca18121 Mon Sep 17 00:00:00 2001 From: Mike Frysinger <vapier@gentoo.org> Date: Fri, 19 Nov 2010 23:48:20 -0500 Subject: [PATCH 3/4] NO_FORK: control usage of fork() for nommu systems nommu systems lack a fork() function, so add a NO_FORK flag to control its usage. We don't lose a ton of functionality in doing so, and on an embedded system, this is OK. Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- Makefile | 5 +++++ README | 1 + pmap_check.c | 6 ++++-- portmap.c | 6 ++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cfcfdbb..9df5574 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,11 @@ MAN_SED += -e 's/USE_DNS/yes/' endif endif +# For no-mmu systems, we have to disable the fork() functions. +ifneq ($(NO_FORK),) +CPPFLAGS += -DNO_FORK +endif + # Comment out if your RPC library does not allocate privileged ports for # requests from processes with root privilege, or the new portmap will # always reject requests to register/unregister services on privileged diff --git a/README b/README index e0b561a..bda1707 100644 --- a/README +++ b/README @@ -18,6 +18,7 @@ There is no "./configure", just use "make". Some make variable can be used to control compilation. + NO_FORK= if non-empty, don't use fork (good for nommu systems) NO_PIE= if non-empty, don't build portmap as a PIE NO_TCP_WRAPPER= if non-empty, don't use tcp_wrappers USE_DNS= if set, tcp_wrappers can check peers based on hostname diff --git a/pmap_check.c b/pmap_check.c index 6b3e490..983414e 100644 --- a/pmap_check.c +++ b/pmap_check.c @@ -302,8 +302,10 @@ static void logit(int severity, struct sockaddr_in *addr, * getrpcbynumber() or syslog() does its thing. */ - if (fork() == 0) { - +#ifndef NO_FORK + if (fork() == 0) +#endif + { /* Try to map program number to name. */ if (prognum == 0) { diff --git a/portmap.c b/portmap.c index 2a98881..94abc64 100644 --- a/portmap.c +++ b/portmap.c @@ -753,6 +755,7 @@ static void callit(struct svc_req *rqstp, SVCXPRT *xprt) if ((pml = find_service(a.rmt_prog, a.rmt_vers, (u_long)IPPROTO_UDP)) == NULL) return; +#ifndef NO_FORK /* * fork a child to do the work. Parent immediately returns. * Child exits upon completion. @@ -763,6 +766,7 @@ static void callit(struct svc_req *rqstp, SVCXPRT *xprt) a.rmt_prog); return; } +#endif port = pml->pml_map.pm_port; get_myaddress(&me); me.sin_port = htons(port); @@ -783,7 +787,9 @@ static void callit(struct svc_req *rqstp, SVCXPRT *xprt) clnt_destroy(client); } (void)close(so); +#ifndef NO_FORK exit(0); +#endif } #ifndef IGNORE_SIGCHLD /* Lionel Cons <cons@dxcern.cern.ch> */ -- 1.7.3.1
shibajee/buildroot
package/portmap/0003-NO_FORK-control-usage-of-fork-for-nommu-systems.patch
patch
mit
2,793
From 8cea0778f0fb838a7bd764be08f15e1494e5a0b2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger <vapier@gentoo.org> Date: Fri, 19 Nov 2010 23:50:27 -0500 Subject: [PATCH 4/4] NO_PERROR: control overriding of perror() symbol Doing static builds of portmap might fail when the C library's perror() function is pulled in and collides with portmap's definition. So add a flag to control the local override. Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- Makefile | 5 +++++ README | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index 9df5574..1635107 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,11 @@ ifneq ($(NO_FORK),) CPPFLAGS += -DNO_FORK endif +# For static builds, we might hit perror() symbol clashes +ifneq ($(NO_PERROR),) +CPPFLAGS += -DNO_PERROR +endif + # Comment out if your RPC library does not allocate privileged ports for # requests from processes with root privilege, or the new portmap will # always reject requests to register/unregister services on privileged diff --git a/README b/README index bda1707..05861a8 100644 --- a/README +++ b/README @@ -19,6 +19,7 @@ There is no "./configure", just use "make". Some make variable can be used to control compilation. NO_FORK= if non-empty, don't use fork (good for nommu systems) + NO_PERROR= if non-empty, don't override the perror() func NO_PIE= if non-empty, don't build portmap as a PIE NO_TCP_WRAPPER= if non-empty, don't use tcp_wrappers USE_DNS= if set, tcp_wrappers can check peers based on hostname diff --git a/portmap.c b/portmap.c index 2a98881..94abc64 100644 --- a/portmap.c +++ b/portmap.c @@ -391,12 +391,14 @@ main(int argc, char **argv) abort(); } +#ifndef NO_PERROR /* need to override perror calls in rpc library */ void perror(const char *what) { syslog(LOG_ERR, "%s: %m", what); } +#endif static struct pmaplist * find_service(u_long prog, u_long vers, u_long prot) -- 1.7.3.1
shibajee/buildroot
package/portmap/0004-NO_PERROR-control-overriding-of-perror-symbol.patch
patch
mit
1,970
Enable compile without tcp-wrappers Patch by Timothy Redaelli <drizzt@gentoo.org> http://bugs.gentoo.org/178242 --- portmap_6.0/pmap_check.c +++ portmap_6.0/pmap_check.c @@ -44,7 +44,9 @@ #include <netinet/in.h> #include <rpc/rpcent.h> #endif +#ifdef HOSTS_ACCESS #include <tcpd.h> +#endif #include <arpa/inet.h> #include <grp.h>
shibajee/buildroot
package/portmap/0005-tcpd.patch
patch
mit
341
config BR2_PACKAGE_PORTMAP bool "portmap" depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC # portmap and rpcbind provide the same feature, so they are # mutually exclusive. rpcbind is the newer, preferred # implementation. depends on !BR2_PACKAGE_RPCBIND help The standard portmapper for RPC services. Note that portmap is being deprecated in favour of rpcbind. http://neil.brown.name/portmap/ comment "portmap needs a toolchain w/ RPC" depends on !BR2_TOOLCHAIN_HAS_NATIVE_RPC
shibajee/buildroot
package/portmap/Config.in
in
mit
489
#! /bin/sh [ -f /sbin/portmap ] || exit 0 start() { printf "Starting portmap: " portmap mkdir -p /var/lock/subsys touch /var/lock/subsys/portmap echo "done" } stop() { printf "Stopping portmap: " echo killall portmap rm -rf /var/lock/subsys echo "done" } restart() { stop start rm -f /var/run/portmap.state } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; *) echo "Usage: $0 {start|stop|reload|restart}" exit 1 esac exit $?
shibajee/buildroot
package/portmap/S13portmap
none
mit
530
# Locally calculated sha256 02c820d39f3e6e729d1bea3287a2d8a6c684f1006fb9612f97dcad4a281d41de portmap-6.0.tgz
shibajee/buildroot
package/portmap/portmap.hash
hash
mit
110
################################################################################ # # portmap # ################################################################################ PORTMAP_VERSION = 6.0 PORTMAP_SOURCE = portmap-$(PORTMAP_VERSION).tgz PORTMAP_SITE = http://neil.brown.name/portmap PORTMAP_LICENSE = BSD-4c (portmap.c) SunRPC License (portmap.c from_local.c) PORTMAP_LICENSE_FILES = portmap.c from_local.c PORTMAP_SBINS = portmap pmap_dump pmap_set PORTMAP_FLAGS = NO_TCP_WRAPPER=1 NO_PIE=1 NO_PERROR=1 ifeq ($(BR2_USE_MMU),) PORTMAP_FLAGS += NO_FORK=1 endif define PORTMAP_BUILD_CMDS $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(PORTMAP_FLAGS) endef define PORTMAP_INSTALL_TARGET_CMDS for sbin in $(PORTMAP_SBINS); do \ $(INSTALL) -D -m 0755 $(@D)/$$sbin $(TARGET_DIR)/sbin/$$sbin || exit 1; \ done endef define PORTMAP_INSTALL_INIT_SYSV $(INSTALL) -D -m 0755 package/portmap/S13portmap $(TARGET_DIR)/etc/init.d/S13portmap endef $(eval $(generic-package))
shibajee/buildroot
package/portmap/portmap.mk
mk
mit
978
config BR2_PACKAGE_POSTGRESQL bool "postgresql" depends on BR2_USE_MMU # fork() # fails to build in a pure static linking scenario, and # postgresql is unlikely to be used in a pure statically # linked environment. depends on !BR2_STATIC_LIBS help PostgreSQL is a powerful, open source object-relational database system. Enable the readline package to gain readline support in pgsql (the command line interpreter), which offers command history and edit functions. Enable the zlib package to gain builtin compression for archives with pg_dump and pg_restore. http://www.postgresql.org comment "postgresql needs a toolchain w/ dynamic library" depends on BR2_STATIC_LIBS
shibajee/buildroot
package/postgresql/Config.in
in
mit
705
#!/bin/sh # # start postgresql # umask 077 if [ ! -f /var/lib/pgsql/PG_VERSION ]; then echo "Initializing postgresql data base..." su - postgres -c '/usr/bin/pg_ctl initdb -D /var/lib/pgsql' echo "done" fi start() { printf "Starting postgresql: " su - postgres -c '/usr/bin/pg_ctl start -w -D /var/lib/pgsql -l logfile' echo "OK" } stop() { printf "Stopping postgresql: " su - postgres -c '/usr/bin/pg_ctl stop -D /var/lib/pgsql -m fast' echo "OK" } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $?
shibajee/buildroot
package/postgresql/S50postgresql
none
mit
642
#!/bin/sh # # Minimal pg_config implementation as replacement for the native pg_config application # Only implements --includedir and --libdir # prefix=/usr case "$1" in --includedir) echo "$prefix/include" ;; --libdir) echo "$prefix/lib" ;; *) echo "Usage: $0 {--includedir|--libdir}" esac
shibajee/buildroot
package/postgresql/pg_config
none
mit
305
# From https://ftp.postgresql.org/pub/source/v9.5.3/postgresql-9.5.3.tar.bz2.sha256 sha256 7385c01dc58acba8d7ac4e6ad42782bd7c0b59272862a3a3d5fe378d4503a0b4 postgresql-9.5.3.tar.bz2
shibajee/buildroot
package/postgresql/postgresql.hash
hash
mit
182
################################################################################ # # postgresql # ################################################################################ POSTGRESQL_VERSION = 9.5.3 POSTGRESQL_SOURCE = postgresql-$(POSTGRESQL_VERSION).tar.bz2 POSTGRESQL_SITE = http://ftp.postgresql.org/pub/source/v$(POSTGRESQL_VERSION) POSTGRESQL_LICENSE = PostgreSQL POSTGRESQL_LICENSE_FILES = COPYRIGHT POSTGRESQL_INSTALL_STAGING = YES POSTGRESQL_CONFIG_SCRIPTS = pg_config POSTGRESQL_CONF_ENV = ac_cv_type_struct_sockaddr_in6=yes \ pgac_cv_snprintf_long_long_int_modifier="%lld" \ pgac_cv_snprintf_size_t_support=yes POSTGRESQL_CONF_OPTS = --disable-rpath ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) # PostgreSQL does not build against uClibc with locales # enabled, due to an uClibc bug, see # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html # so overwrite automatic detection and disable locale support POSTGRESQL_CONF_ENV += pgac_cv_type_locale_t=no endif ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y) POSTGRESQL_CONF_OPTS += --disable-thread-safety endif ifeq ($(BR2_arcle)$(BR2_arceb)$(BR2_microblazeel)$(BR2_microblazebe)$(BR2_nios2)$(BR2_xtensa),y) POSTGRESQL_CONF_OPTS += --disable-spinlocks endif ifeq ($(BR2_PACKAGE_READLINE),y) POSTGRESQL_DEPENDENCIES += readline else POSTGRESQL_CONF_OPTS += --without-readline endif ifeq ($(BR2_PACKAGE_ZLIB),y) POSTGRESQL_DEPENDENCIES += zlib else POSTGRESQL_CONF_OPTS += --without-zlib endif ifeq ($(BR2_PACKAGE_TZDATA),y) POSTGRESQL_DEPENDENCIES += tzdata POSTGRESQL_CONF_OPTS += --with-system-tzdata=/usr/share/zoneinfo else POSTGRESQL_DEPENDENCIES += host-zic POSTGRESQL_CONF_ENV += ZIC="$(ZIC)" endif ifeq ($(BR2_PACKAGE_OPENSSL),y) POSTGRESQL_DEPENDENCIES += openssl POSTGRESQL_CONF_OPTS += --with-openssl endif define POSTGRESQL_USERS postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server endef define POSTGRESQL_INSTALL_TARGET_FIXUP $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql $(RM) -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs endef POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG $(INSTALL) -m 0755 -D package/postgresql/pg_config \ $(STAGING_DIR)/usr/bin/pg_config endef POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG define POSTGRESQL_INSTALL_INIT_SYSV $(INSTALL) -m 0755 -D package/postgresql/S50postgresql \ $(TARGET_DIR)/etc/init.d/S50postgresql endef define POSTGRESQL_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 package/postgresql/postgresql.service \ $(TARGET_DIR)/usr/lib/systemd/system/postgresql.service mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants ln -fs ../../../../usr/lib/systemd/system/postgresql.service \ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service endef $(eval $(autotools-package))
shibajee/buildroot
package/postgresql/postgresql.mk
mk
mit
2,886
[Unit] Description=PostgreSQL database server After=network.target [Service] Type=forking # start timeout disabled because initdb may run a little # longer (eg. 5 minutes on RaspberryPi) TimeoutStartSec=0 User=postgres Group=postgres SyslogIdentifier=postgres PIDFile=/var/lib/pgsql/postmaster.pid ExecStartPre=/bin/sh -c "if [ ! -f /var/lib/pgsql/PG_VERSION ]; then /usr/bin/pg_ctl initdb -D /var/lib/pgsql; fi" ExecStart=/usr/bin/pg_ctl start -D /var/lib/pgsql -w -l /var/lib/pgsql/logfile ExecReload=/usr/bin/pg_ctl reload -D /var/lib/pgsql ExecStop=/usr/bin/pg_ctl stop -D /var/lib/pgsql -m fast [Install] WantedBy=multi-user.target
shibajee/buildroot
package/postgresql/postgresql.service
service
mit
643
config BR2_PACKAGE_POUND bool "pound" depends on !BR2_STATIC_LIBS depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # fork() select BR2_PACKAGE_OPENSSL help The Pound program is a reverse proxy, load balancer and HTTPS front-end for Web server(s). Pound was developed to enable distributing the load among several Web-servers and to allow for a convenient SSL wrapper for those Web servers that do not offer it natively. http://www.apsis.ch/pound comment "pound needs a toolchain w/ dynamic library, threads" depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU
shibajee/buildroot
package/pound/Config.in
in
mit
627