Merge branch 'next'

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Peter Korsgaard 2013-12-01 20:31:43 +01:00
commit 50ce7ffb76
82 changed files with 1481 additions and 889 deletions

View File

@ -24,7 +24,7 @@
#-------------------------------------------------------------- #--------------------------------------------------------------
# Set and export the version string # Set and export the version string
export BR2_VERSION:=2013.11 export BR2_VERSION:=2014.02-git
# Check for minimal make version (note: this check will break at make 10.x) # Check for minimal make version (note: this check will break at make 10.x)
MIN_MAKE_VERSION=3.81 MIN_MAKE_VERSION=3.81
@ -108,10 +108,14 @@ TARGET_DIR:=$(BASE_DIR)/target
HOST_DIR:=$(BASE_DIR)/host HOST_DIR:=$(BASE_DIR)/host
LEGAL_INFO_DIR=$(BASE_DIR)/legal-info LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources REDIST_SOURCES_DIR_TARGET=$(LEGAL_INFO_DIR)/sources
LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses REDIST_SOURCES_DIR_HOST=$(LEGAL_INFO_DIR)/host-sources
LEGAL_MANIFEST_CSV=$(LEGAL_INFO_DIR)/manifest.csv LICENSE_FILES_DIR_TARGET=$(LEGAL_INFO_DIR)/licenses
LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt LICENSE_FILES_DIR_HOST=$(LEGAL_INFO_DIR)/host-licenses
LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv
LEGAL_MANIFEST_CSV_HOST=$(LEGAL_INFO_DIR)/host-manifest.csv
LEGAL_LICENSES_TXT_TARGET=$(LEGAL_INFO_DIR)/licenses.txt
LEGAL_LICENSES_TXT_HOST=$(LEGAL_INFO_DIR)/host-licenses.txt
LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
LEGAL_REPORT=$(LEGAL_INFO_DIR)/README LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
@ -401,7 +405,7 @@ world: $(BASE_TARGETS) $(TARGETS_ALL)
# dependencies anywhere else # dependencies anywhere else
# #
################################################################################ ################################################################################
$(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR): $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
@mkdir -p $@ @mkdir -p $@
# We make a symlink lib32->lib or lib64->lib as appropriate # We make a symlink lib32->lib or lib64->lib as appropriate
@ -513,7 +517,7 @@ endif
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \ @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
$(call MESSAGE,"Executing post-build script $(s)"); \ $(call MESSAGE,"Executing post-build script $(s)"); \
$(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) $(USER_HOOKS_EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
@ -559,7 +563,7 @@ endif
target-post-image: target-post-image:
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
$(call MESSAGE,"Executing post-image script $(s)"); \ $(call MESSAGE,"Executing post-image script $(s)"); \
$(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) $(USER_HOOKS_EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
toolchain-eclipse-register: toolchain-eclipse-register:
./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH) ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH)
@ -574,15 +578,16 @@ legal-info-clean:
legal-info-prepare: $(LEGAL_INFO_DIR) legal-info-prepare: $(LEGAL_INFO_DIR)
@$(call MESSAGE,"Collecting legal info") @$(call MESSAGE,"Collecting legal info")
@$(call legal-license-file,buildroot,COPYING,COPYING) @$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE) @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,TARGET)
@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved) @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,HOST)
@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,HOST)
@$(call legal-warning,the Buildroot source code has not been saved) @$(call legal-warning,the Buildroot source code has not been saved)
@$(call legal-warning,the toolchain has not been saved) @$(call legal-warning,the toolchain has not been saved)
@cp $(BUILDROOT_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config @cp $(BUILDROOT_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
legal-info: dirs legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \ legal-info: dirs legal-info-clean legal-info-prepare $(TARGETS_LEGAL_INFO) \
$(TARGETS_LEGAL_INFO) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST)
@cat support/legal-info/README.header >>$(LEGAL_REPORT) @cat support/legal-info/README.header >>$(LEGAL_REPORT)
@if [ -r $(LEGAL_WARNINGS) ]; then \ @if [ -r $(LEGAL_WARNINGS) ]; then \
cat support/legal-info/README.warnings-header \ cat support/legal-info/README.warnings-header \

View File

@ -25,12 +25,6 @@ config BR2_ENDIAN
config BR2_GCC_TARGET_TUNE config BR2_GCC_TARGET_TUNE
default "v8" if BR2_sparc_v8 default "v8" if BR2_sparc_v8
default "v9" if BR2_sparc_v9
default "v9" if BR2_sparc_v9a
default "v9" if BR2_sparc_v9b
default "ultrasparc" if BR2_sparc_ultrasparc
default "ultrasparc3" if BR2_sparc_ultrasparc3
default "niagara" if BR2_sparc_niagara
config BR2_GCC_TARGET_CPU config BR2_GCC_TARGET_CPU
default "sparchfleon" if BR2_sparc_sparchfleon default "sparchfleon" if BR2_sparc_sparchfleon

View File

@ -1,23 +1,16 @@
CONFIG_MIPS_MALTA=y CONFIG_MIPS_MALTA=y
CONFIG_CPU_MIPS64_R1=y CONFIG_CPU_MIPS64_R1=y
CONFIG_64BIT=y CONFIG_64BIT=y
CONFIG_64BIT_PHYS_ADDR=y
CONFIG_MIPS_MT_SMP=y CONFIG_MIPS_MT_SMP=y
CONFIG_NR_CPUS=2
CONFIG_HZ_100=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y CONFIG_HIGH_RES_TIMERS=y
CONFIG_HZ_100=y
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y
CONFIG_LOG_BUF_SHIFT=15 CONFIG_LOG_BUF_SHIFT=15
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_RELAY=y
CONFIG_NAMESPACES=y CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y CONFIG_RELAY=y
CONFIG_IPC_NS=y
CONFIG_PID_NS=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y CONFIG_SLAB=y
CONFIG_MODULES=y CONFIG_MODULES=y
@ -26,7 +19,9 @@ CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set # CONFIG_BLK_DEV_BSG is not set
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PM=y CONFIG_MIPS32_COMPAT=y
CONFIG_MIPS32_O32=y
CONFIG_MIPS32_N32=y
CONFIG_NET=y CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
@ -40,39 +35,25 @@ CONFIG_IP_PNP=y
# CONFIG_IPV6 is not set # CONFIG_IPV6 is not set
# CONFIG_WIRELESS is not set # CONFIG_WIRELESS is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
# CONFIG_MISC_DEVICES is not set
CONFIG_IDE=y CONFIG_IDE=y
CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDECD=y
CONFIG_IDE_GENERIC=y CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_GENERIC=y CONFIG_BLK_DEV_GENERIC=y
CONFIG_BLK_DEV_PIIX=y CONFIG_BLK_DEV_PIIX=y
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_NET_ETHERNET=y
CONFIG_NET_PCI=y
CONFIG_PCNET32=y CONFIG_PCNET32=y
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
# CONFIG_WLAN is not set # CONFIG_WLAN is not set
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO_I8042 is not set
CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
# CONFIG_HW_RANDOM is not set # CONFIG_HW_RANDOM is not set
# CONFIG_HWMON is not set # CONFIG_HWMON is not set
# CONFIG_MFD_SUPPORT is not set
CONFIG_FB=y CONFIG_FB=y
CONFIG_FB_CIRRUS=y CONFIG_FB_CIRRUS=y
# CONFIG_VGA_CONSOLE is not set # CONFIG_VGA_CONSOLE is not set
# CONFIG_HID_SUPPORT is not set
# CONFIG_USB_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
CONFIG_EXT2_FS=y CONFIG_EXT4_FS=y
CONFIG_EXT3_FS=y
CONFIG_QUOTA=y
CONFIG_PROC_KCORE=y CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y CONFIG_ROOT_NFS=y
# CONFIG_RCU_CPU_STALL_DETECTOR is not set

View File

@ -3,9 +3,6 @@ Run the emulation with:
qemu-system-mips64 -M malta -kernel output/images/vmlinux -serial stdio -hda output/images/rootfs.ext2 -append "root=/dev/hda" qemu-system-mips64 -M malta -kernel output/images/vmlinux -serial stdio -hda output/images/rootfs.ext2 -append "root=/dev/hda"
The login prompt will appear in the terminal that started Qemu. The The login prompt will appear in the terminal that started Qemu. The
graphical window is the framebuffer. No keyboard support has been graphical window is the framebuffer.
enabled.
This configuration is known to be flaky.
Tested with QEMU 1.6.1 Tested with QEMU 1.6.1

View File

@ -0,0 +1,60 @@
CONFIG_MIPS_MALTA=y
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_CPU_MIPS64_R1=y
CONFIG_64BIT=y
CONFIG_MIPS_MT_SMP=y
CONFIG_NR_CPUS=2
CONFIG_HZ_100=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_LOG_BUF_SHIFT=15
CONFIG_NAMESPACES=y
CONFIG_RELAY=y
CONFIG_EMBEDDED=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
CONFIG_PCI=y
CONFIG_MIPS32_COMPAT=y
CONFIG_MIPS32_O32=y
CONFIG_MIPS32_N32=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_PNP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
# CONFIG_WIRELESS is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_IDE=y
CONFIG_BLK_DEV_IDECD=y
CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_GENERIC=y
CONFIG_BLK_DEV_PIIX=y
CONFIG_NETDEVICES=y
CONFIG_PCNET32=y
# CONFIG_WLAN is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
# CONFIG_HW_RANDOM is not set
# CONFIG_HWMON is not set
CONFIG_FB=y
CONFIG_FB_CIRRUS=y
# CONFIG_VGA_CONSOLE is not set
# CONFIG_USB_SUPPORT is not set
CONFIG_EXT4_FS=y
CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y

View File

@ -0,0 +1,8 @@
Run the emulation with:
qemu-system-mips64el -M malta -kernel output/images/vmlinux -serial stdio -hda output/images/rootfs.ext2 -append "root=/dev/hda"
The login prompt will appear in the terminal that started Qemu. The
graphical window is the framebuffer.
Tested with QEMU 1.6.1

View File

@ -12,7 +12,7 @@ choice
Select the specific Barebox version you want to use Select the specific Barebox version you want to use
config BR2_TARGET_BAREBOX_LATEST_VERSION config BR2_TARGET_BAREBOX_LATEST_VERSION
bool "2013.10.1" bool "2013.11.0"
config BR2_TARGET_BAREBOX_CUSTOM_VERSION config BR2_TARGET_BAREBOX_CUSTOM_VERSION
bool "Custom version" bool "Custom version"
@ -40,7 +40,7 @@ endif
config BR2_TARGET_BAREBOX_VERSION config BR2_TARGET_BAREBOX_VERSION
string string
default "2013.10.1" if BR2_TARGET_BAREBOX_LATEST_VERSION default "2013.11.0" if BR2_TARGET_BAREBOX_LATEST_VERSION
default BR2_TARGET_BAREBOX_CUSTOM_VERSION_VALUE if BR2_TARGET_BAREBOX_CUSTOM_VERSION default BR2_TARGET_BAREBOX_CUSTOM_VERSION_VALUE if BR2_TARGET_BAREBOX_CUSTOM_VERSION
default "custom" if BR2_TARGET_BAREBOX_CUSTOM_TARBALL default "custom" if BR2_TARGET_BAREBOX_CUSTOM_TARBALL
default BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION if BR2_TARGET_BAREBOX_CUSTOM_GIT default BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION if BR2_TARGET_BAREBOX_CUSTOM_GIT

View File

@ -2,10 +2,6 @@
BR2_mips64=y BR2_mips64=y
BR2_MIPS_NABI64=y BR2_MIPS_NABI64=y
# Toolchain
# uClibc dynamic loader seems broken for mips64
BR2_PREFER_STATIC_LIB=y
# Filesystem # Filesystem
BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2=y
# BR2_TARGET_ROOTFS_TAR is not set # BR2_TARGET_ROOTFS_TAR is not set

View File

@ -0,0 +1,26 @@
# Architecture
BR2_mips64el=y
BR2_MIPS_NABI64=y
# Toolchain
BR2_TOOLCHAIN_BUILDROOT_EGLIBC=y
# Filesystem
BR2_TARGET_ROOTFS_EXT2=y
# BR2_TARGET_ROOTFS_TAR is not set
# Lock to 3.12 headers to avoid breaking with newer kernels
BR2_KERNEL_HEADERS_VERSION=y
BR2_DEFAULT_KERNEL_VERSION="3.12.1"
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.12.1"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/mips64el-malta/linux-3.12.config"
BR2_LINUX_KERNEL_VMLINUX=y
# Serial port config
BR2_TARGET_GENERIC_GETTY=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"

View File

@ -41,6 +41,7 @@ there are a few ways to customize the resulting target filesystem.
- +BUILDROOT_CONFIG+: the path to the Buildroot .config file - +BUILDROOT_CONFIG+: the path to the Buildroot .config file
- +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see - +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see
xref:generic-package-reference[] xref:generic-package-reference[]
- +BUILD_DIR+: the directory where packages are extracted and built
- +BINARIES_DIR+: the place where all binary files (aka images) are - +BINARIES_DIR+: the place where all binary files (aka images) are
stored stored
- +BASE_DIR+: the base output directory - +BASE_DIR+: the base output directory
@ -78,8 +79,8 @@ in one of these _post-image scripts_ will require special handling
Just like for the _post-build scripts_ mentioned above, you also have Just like for the _post-build scripts_ mentioned above, you also have
access to the following environment variables from your _post-image access to the following environment variables from your _post-image
scripts_: +BUILDROOT_CONFIG+, +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+, scripts_: +BUILDROOT_CONFIG+, +BUILD_DIR+, +HOST_DIR+, +STAGING_DIR+,
+BINARIES_DIR+ and +BASE_DIR+. +TARGET_DIR+, +BINARIES_DIR+ and +BASE_DIR+.
Additionally, each of the +BR2_ROOTFS_POST_BUILD_SCRIPT+ and Additionally, each of the +BR2_ROOTFS_POST_BUILD_SCRIPT+ and
+BR2_ROOTFS_POST_IMAGE_SCRIPT+ scripts will be passed the arguments +BR2_ROOTFS_POST_IMAGE_SCRIPT+ scripts will be passed the arguments

View File

@ -0,0 +1,33 @@
// -*- mode:doc; -*-
// vim: set syntax=asciidoc:
[[debugging-buildroot]]
Debugging Buildroot
-------------------
It is possible to instrument the steps +Buildroot+ does when building
packages. Define the variable +BR2_INSTRUMENTATION_SCRIPTS+ to contain
the path of one or more scripts (or other executables), in a
space-separated list, you want called before and after each step. The
scripts are called in sequence, with three parameters:
- +start+ or +end+ to denote the start (resp. the end) of a step;
- the name of the step about to be started, or which just ended.
- the name of the package
For example :
----
make BR2_INSTRUMENTATION_SCRIPTS="/path/to/my/script1 /path/to/my/script2"
----
That script has access to the following variables:
- +BUILDROOT_CONFIG+: the path to the Buildroot .config file
- +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see
xref:generic-package-reference[]
- +BUILD_DIR+: the directory where packages are extracted and built
- +BINARIES_DIR+: the place where all binary files (aka images) are
stored
- +BASE_DIR+: the base output directory

View File

@ -11,3 +11,5 @@ include::adding-packages.txt[]
include::patch-policy.txt[] include::patch-policy.txt[]
include::download-infra.txt[] include::download-infra.txt[]
include::debugging-buildroot.txt[]

View File

@ -39,16 +39,19 @@ There you will find:
* +buildroot.config+: this is the Buildroot configuration file that is usually * +buildroot.config+: this is the Buildroot configuration file that is usually
produced with +make menuconfig+, and which is necessary to reproduce the produced with +make menuconfig+, and which is necessary to reproduce the
build. build.
* The source code for all packages; this is saved in the +sources/+ * The source code for all packages; this is saved in the +sources/+ and
subdirectory (except for proprietary packages, whose source code is not +host-sources/+ subdirectories for target and host packages respectively.
saved); The source code for packages that set +<PKG>_REDISTRIBUTE = NO+ will not be
patches applied to some packages by Buildroot are distributed with the saved.
Buildroot sources and are not duplicated in the +sources/+ subdirectory. Patches applied to some packages by Buildroot are distributed with the
* A manifest file listing the configured packages, their version, license and Buildroot sources and are not duplicated in the +sources/+ and +host-sources/+
related information. subdirectories.
* A manifest file (one for host and one for target packages) listing the
configured packages, their version, license and related information.
Some of this information might not be defined in Buildroot; such items are Some of this information might not be defined in Buildroot; such items are
marked as "unknown". marked as "unknown".
* A +licenses/+ subdirectory, which contains the license text of packages. * The license texts of all packages, in the +licenses/+ and +host-licenses/+
subdirectories for target and host packages respectively.
If the license file(s) are not defined in Buildroot, the file is not produced If the license file(s) are not defined in Buildroot, the file is not produced
and a warning in the +README+ indicates this. and a warning in the +README+ indicates this.
@ -72,7 +75,7 @@ License abbreviations
--------------------- ---------------------
Here is a list of the licenses that are most widely used by packages in Here is a list of the licenses that are most widely used by packages in
Buildroot, with the name used in the manifest file: Buildroot, with the name used in the manifest files:
* `GPLv2`: * `GPLv2`:
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html[ http://www.gnu.org/licenses/old-licenses/gpl-2.0.html[

View File

@ -750,6 +750,7 @@ source "package/bc/Config.in"
source "package/collectd/Config.in" source "package/collectd/Config.in"
source "package/empty/Config.in" source "package/empty/Config.in"
source "package/googlefontdirectory/Config.in" source "package/googlefontdirectory/Config.in"
source "package/haveged/Config.in"
source "package/mcrypt/Config.in" source "package/mcrypt/Config.in"
source "package/mobile-broadband-provider-info/Config.in" source "package/mobile-broadband-provider-info/Config.in"
source "package/shared-mime-info/Config.in" source "package/shared-mime-info/Config.in"
@ -791,6 +792,7 @@ source "package/dropbear/Config.in"
source "package/ebtables/Config.in" source "package/ebtables/Config.in"
source "package/ethtool/Config.in" source "package/ethtool/Config.in"
source "package/foomatic-filters/Config.in" source "package/foomatic-filters/Config.in"
source "package/fping/Config.in"
source "package/gesftpserver/Config.in" source "package/gesftpserver/Config.in"
source "package/gutenprint/Config.in" source "package/gutenprint/Config.in"
source "package/heirloom-mailx/Config.in" source "package/heirloom-mailx/Config.in"

View File

@ -275,6 +275,12 @@ HOST_MAKE_ENV=PATH=$(HOST_PATH) \
PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig" \ PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig" \
PERLLIB="$(HOST_DIR)/usr/lib/perl" PERLLIB="$(HOST_DIR)/usr/lib/perl"
# This extra environment we can not export ourselves (eg. because some
# packages use that variable internally, eg. uboot), so we have to
# explicitly pass it to user-supplied external hooks (eg. post-build,
# post-images)
USER_HOOKS_EXTRA_ENV=\
BUILD_DIR=$(BUILD_DIR)
################################################################################ ################################################################################
# settings we need to pass to configure # settings we need to pass to configure

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
AUTOMAKE_VERSION = 1.12.6 AUTOMAKE_VERSION = 1.14
AUTOMAKE_SOURCE = automake-$(AUTOMAKE_VERSION).tar.xz AUTOMAKE_SOURCE = automake-$(AUTOMAKE_VERSION).tar.xz
AUTOMAKE_SITE = $(BR2_GNU_MIRROR)/automake AUTOMAKE_SITE = $(BR2_GNU_MIRROR)/automake
AUTOMAKE_LICENSE = GPLv2+ AUTOMAKE_LICENSE = GPLv2+

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
BISON_VERSION = 3.0 BISON_VERSION = 3.0.1
BISON_SOURCE = bison-$(BISON_VERSION).tar.xz BISON_SOURCE = bison-$(BISON_VERSION).tar.xz
BISON_SITE = $(BR2_GNU_MIRROR)/bison BISON_SITE = $(BR2_GNU_MIRROR)/bison
BISON_LICENSE = GPLv3+ BISON_LICENSE = GPLv3+

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
CIFS_UTILS_VERSION = 6.1 CIFS_UTILS_VERSION = 6.2
CIFS_UTILS_SOURCE = cifs-utils-$(CIFS_UTILS_VERSION).tar.bz2 CIFS_UTILS_SOURCE = cifs-utils-$(CIFS_UTILS_VERSION).tar.bz2
CIFS_UTILS_SITE = http://ftp.samba.org/pub/linux-cifs/cifs-utils CIFS_UTILS_SITE = http://ftp.samba.org/pub/linux-cifs/cifs-utils
CIFS_UTILS_LICENSE = GPLv3+ CIFS_UTILS_LICENSE = GPLv3+

View File

@ -19,11 +19,6 @@ config BR2_PACKAGE_CONNMAN
if BR2_PACKAGE_CONNMAN if BR2_PACKAGE_CONNMAN
config BR2_PACKAGE_CONNMAN_THREADS
bool "enable threading support"
depends on BR2_TOOLCHAIN_HAS_THREADS
default y
config BR2_PACKAGE_CONNMAN_ETHERNET config BR2_PACKAGE_CONNMAN_ETHERNET
bool "enable Ethernet support" bool "enable Ethernet support"
default y default y
@ -38,8 +33,13 @@ config BR2_PACKAGE_CONNMAN_BLUETOOTH
config BR2_PACKAGE_CONNMAN_LOOPBACK config BR2_PACKAGE_CONNMAN_LOOPBACK
bool "enable loopback support" bool "enable loopback support"
config BR2_PACKAGE_CONNMAN_NTPD config BR2_PACKAGE_CONNMAN_NEARD
bool "enable ntpd support" bool "enable neard support"
select BR2_PACKAGE_NEARD
config BR2_PACKAGE_CONNMAN_OFONO
bool "enable ofono support"
select BR2_PACKAGE_OFONO
config BR2_PACKAGE_CONNMAN_DEBUG config BR2_PACKAGE_CONNMAN_DEBUG
bool "enable compiling with debugging information" bool "enable compiling with debugging information"

View File

@ -1,19 +0,0 @@
tethering: fix build with kernel headers 3.8+
Highly inspired by:
package/bridge-utils/bridge-utils-001-fix-for-kernel-headers-3.8+.patch
http://www.redhat.com/archives/libvir-list/2013-January/msg01253.html
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
diff -durN connman-1.11.orig/src/tethering.c connman-1.11/src/tethering.c
--- connman-1.11.orig/src/tethering.c 2012-12-22 22:52:47.000000000 +0100
+++ connman-1.11/src/tethering.c 2013-03-21 19:39:17.036029270 +0100
@@ -35,6 +35,7 @@
#include <string.h>
#include <fcntl.h>
#include <linux/if_tun.h>
+#include <netinet/in.h>
#include <linux/if_bridge.h>
#include "connman.h"

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
CONNMAN_VERSION = 1.12 CONNMAN_VERSION = 1.19
CONNMAN_SOURCE = connman-$(CONNMAN_VERSION).tar.xz CONNMAN_SOURCE = connman-$(CONNMAN_VERSION).tar.xz
CONNMAN_SITE = $(BR2_KERNEL_MIRROR)/linux/network/connman/ CONNMAN_SITE = $(BR2_KERNEL_MIRROR)/linux/network/connman/
CONNMAN_DEPENDENCIES = libglib2 dbus iptables gnutls CONNMAN_DEPENDENCIES = libglib2 dbus iptables gnutls
@ -12,13 +12,17 @@ CONNMAN_INSTALL_STAGING = YES
CONNMAN_LICENSE = GPLv2 CONNMAN_LICENSE = GPLv2
CONNMAN_LICENSE_FILES = COPYING CONNMAN_LICENSE_FILES = COPYING
CONNMAN_CONF_OPT += --localstatedir=/var \ CONNMAN_CONF_OPT += --localstatedir=/var \
$(if $(BR2_PACKAGE_CONNMAN_THREADS),--enable-threads,--disable-threads) \
$(if $(BR2_PACKAGE_CONNMAN_DEBUG),--enable-debug,--disable-debug) \ $(if $(BR2_PACKAGE_CONNMAN_DEBUG),--enable-debug,--disable-debug) \
$(if $(BR2_PACKAGE_CONNMAN_ETHERNET),--enable-ethernet,--disable-ethernet) \ $(if $(BR2_PACKAGE_CONNMAN_ETHERNET),--enable-ethernet,--disable-ethernet) \
$(if $(BR2_PACKAGE_CONNMAN_WIFI),--enable-wifi,--disable-wifi) \ $(if $(BR2_PACKAGE_CONNMAN_WIFI),--enable-wifi,--disable-wifi) \
$(if $(BR2_PACKAGE_CONNMAN_BLUETOOTH),--enable-bluetooth,--disable-bluetooth) \ $(if $(BR2_PACKAGE_CONNMAN_BLUETOOTH),--enable-bluetooth,--disable-bluetooth) \
$(if $(BR2_PACKAGE_CONNMAN_LOOPBACK),--enable-loopback,--disable-loopback) \ $(if $(BR2_PACKAGE_CONNMAN_LOOPBACK),--enable-loopback,--disable-loopback) \
$(if $(BR2_PACKAGE_CONNMAN_NTPD),--enable-ntpd,--disable-ntpd) $(if $(BR2_PACKAGE_CONNMAN_NEARD),--enable-neard,--disable-neard) \
$(if $(BR2_PACKAGE_CONNMAN_OFONO),--enable-ofono,--disable-ofono)
CONNMAN_DEPENDENCIES += \
$(if $(BR2_PACKAGE_CONNMAN_NEARD),neard) \
$(if $(BR2_PACKAGE_CONNMAN_OFONO),ofono)
define CONNMAN_INSTALL_INITSCRIPT define CONNMAN_INSTALL_INITSCRIPT
$(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman $(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
DOSFSTOOLS_VERSION = 3.0.23 DOSFSTOOLS_VERSION = 3.0.24
DOSFSTOOLS_SOURCE = dosfstools-$(DOSFSTOOLS_VERSION).tar.xz DOSFSTOOLS_SOURCE = dosfstools-$(DOSFSTOOLS_VERSION).tar.xz
DOSFSTOOLS_SITE = http://daniel-baumann.ch/files/software/dosfstools DOSFSTOOLS_SITE = http://daniel-baumann.ch/files/software/dosfstools
DOSFSTOOLS_LICENSE = GPLv3+ DOSFSTOOLS_LICENSE = GPLv3+

8
package/fping/Config.in Normal file
View File

@ -0,0 +1,8 @@
config BR2_PACKAGE_FPING
bool "fping"
help
fping is a program to send ICMP echo probes to network hosts,
similar to ping, but much better performing when pinging
multiple hosts.
http://fping.org/

12
package/fping/fping.mk Normal file
View File

@ -0,0 +1,12 @@
################################################################################
#
# fping
#
################################################################################
FPING_VERSION = 3.8
FPING_SITE = http://fping.org/dist
FPING_LICENSE = BSD-like
FPING_LICENSE_FILES = COPYING
$(eval $(autotools-package))

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
GNUTLS_VERSION = 3.2.5 GNUTLS_VERSION = 3.2.6
GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
GNUTLS_SITE = ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2 GNUTLS_SITE = ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2
GNUTLS_LICENSE = GPLv3+ LGPLv2.1+ GNUTLS_LICENSE = GPLv3+ LGPLv2.1+

View File

@ -2,14 +2,13 @@ Disable addition of RPATH to the generated libraries
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/SConstruct diff -Nurp a/SConstruct b/SConstruct
=================================================================== --- a/SConstruct 2013-11-22 13:10:01.000000000 +0000
--- a/SConstruct +++ b/SConstruct 2013-11-23 11:26:57.698486777 +0000
+++ b/SConstruct @@ -287,8 +287,6 @@ def installdir(dir, add_destdir=True):
@@ -273,8 +273,6 @@ # Honor the specified installation prefix in link paths.
env.Prepend(LIBPATH=[installdir('libdir')]) if env["sysroot"]:
else: env.Prepend(LIBPATH=[env["sysroot"] + installdir('libdir', add_destdir=False)])
env.Prepend(LIBPATH=[env["sysroot"] + installdir('libdir')])
-if env["shared"]: -if env["shared"]:
- env.Prepend(RPATH=[installdir('libdir')]) - env.Prepend(RPATH=[installdir('libdir')])

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
GPSD_VERSION = 3.9 GPSD_VERSION = 3.10
GPSD_SITE = http://download-mirror.savannah.gnu.org/releases/gpsd/ GPSD_SITE = http://download-mirror.savannah.gnu.org/releases/gpsd/
GPSD_LICENSE = BSD-3c GPSD_LICENSE = BSD-3c
GPSD_LICENSE_FILES = COPYING GPSD_LICENSE_FILES = COPYING

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
GREP_VERSION = 2.14 GREP_VERSION = 2.15
GREP_SITE = $(BR2_GNU_MIRROR)/grep GREP_SITE = $(BR2_GNU_MIRROR)/grep
GREP_SOURCE = grep-$(GREP_VERSION).tar.xz GREP_SOURCE = grep-$(GREP_VERSION).tar.xz
GREP_LICENSE = GPLv3+ GREP_LICENSE = GPLv3+

View File

@ -0,0 +1,9 @@
config BR2_PACKAGE_HAVEGED
bool "haveged"
depends on BR2_USE_MMU # fork()
help
The haveged project is an attempt to provide an easy-to-use,
unpredictable random number generator based upon an adaptation
of the HAVEGE algorithm.
http://www.issihosts.com/haveged/

25
package/haveged/S21haveged Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
[ -x /usr/sbin/haveged ] || exit 0
case "$1" in
start)
echo -n "Starting haveged: "
start-stop-daemon -S -x /usr/sbin/haveged -- -w 1024 -r 0
[ $? == 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping haveged: "
start-stop-daemon -K -x /usr/sbin/haveged
[ $? == 0 ] && echo "OK" || echo "FAIL"
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

View File

@ -0,0 +1,17 @@
################################################################################
#
# haveged
#
################################################################################
HAVEGED_VERSION = 1.7c
HAVEGED_SITE = http://www.issihosts.com/haveged
HAVEGED_LICENSE = GPLv3+
HAVEGED_LICENSE_FILES = COPYING
define HAVEGED_INSTALL_INIT_SYSV
$(INSTALL) -m 755 -D package/haveged/S21haveged \
$(TARGET_DIR)/etc/init.d/S21haveged
endef
$(eval $(autotools-package))

View File

@ -14,6 +14,7 @@ If libnetfilter_conntrack is not found, @libnetfilter_conntrack_CFLAGS@
and @libnetfilter_conntrack_LIBS@ (and their ${} ones) should be empty, and @libnetfilter_conntrack_LIBS@ (and their ${} ones) should be empty,
therefore producing no harm to include unconditionally. therefore producing no harm to include unconditionally.
[Gustavo: update for iptables 1.4.21]
Reported-and-tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reported-and-tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Florian Westphal <fw@strlen.de>
--- ---
@ -25,8 +26,8 @@ index 14e7c57..780e715 100644
kinclude_CPPFLAGS = @kinclude_CPPFLAGS@ kinclude_CPPFLAGS = @kinclude_CPPFLAGS@
AM_CFLAGS = ${regular_CFLAGS} AM_CFLAGS = ${regular_CFLAGS}
-AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_builddir} -I${top_srcdir}/include ${kinclude_CPPFLAGS} -AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_builddir} -I${top_srcdir}/include ${kinclude_CPPFLAGS} ${CPPFLAGS}
+AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_builddir} -I${top_srcdir}/include ${kinclude_CPPFLAGS} @libnetfilter_conntrack_CFLAGS@ +AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_builddir} -I${top_srcdir}/include ${kinclude_CPPFLAGS} ${CPPFLAGS} @libnetfilter_conntrack_CFLAGS@
AM_DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@ AM_DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
AM_LDFLAGS = @noundef_LDFLAGS@ AM_LDFLAGS = @noundef_LDFLAGS@

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
IPTABLES_VERSION = 1.4.20 IPTABLES_VERSION = 1.4.21
IPTABLES_SOURCE = iptables-$(IPTABLES_VERSION).tar.bz2 IPTABLES_SOURCE = iptables-$(IPTABLES_VERSION).tar.bz2
IPTABLES_SITE = http://ftp.netfilter.org/pub/iptables IPTABLES_SITE = http://ftp.netfilter.org/pub/iptables
IPTABLES_INSTALL_STAGING = YES IPTABLES_INSTALL_STAGING = YES

View File

@ -4,9 +4,8 @@
# #
################################################################################ ################################################################################
JQ_VERSION = jq-1.3 JQ_VERSION = 1.3
JQ_SITE = http://github.com/stedolan/jq/tarball/$(JQ_VERSION) JQ_SITE = http://stedolan.github.io/jq/download/source
JQ_AUTORECONF = YES
JQ_DEPENDENCIES = host-flex host-bison JQ_DEPENDENCIES = host-flex host-bison
JQ_LICENSE = MIT (code), CC-BY-3.0 (documentation) JQ_LICENSE = MIT (code), CC-BY-3.0 (documentation)
JQ_LICENSE_FILES = COPYING JQ_LICENSE_FILES = COPYING

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
LIBPCAP_VERSION = 1.4.0 LIBPCAP_VERSION = 1.5.1
LIBPCAP_SITE = http://www.tcpdump.org/release LIBPCAP_SITE = http://www.tcpdump.org/release
LIBPCAP_LICENSE = BSD-3c LIBPCAP_LICENSE = BSD-3c
LIBPCAP_LICENSE_FILES = LICENSE LIBPCAP_LICENSE_FILES = LICENSE

View File

@ -7,7 +7,7 @@
MPG123_VERSION = 1.16.0 MPG123_VERSION = 1.16.0
MPG123_SOURCE = mpg123-$(MPG123_VERSION).tar.bz2 MPG123_SOURCE = mpg123-$(MPG123_VERSION).tar.bz2
MPG123_SITE = http://downloads.sourceforge.net/project/mpg123/mpg123/$(MPG123_VERSION) MPG123_SITE = http://downloads.sourceforge.net/project/mpg123/mpg123/$(MPG123_VERSION)
MPG123_CONF_OPT = --with-optimization=0 --disable-lfs-alias MPG123_CONF_OPT = --disable-lfs-alias
MPG123_INSTALL_STAGING = YES MPG123_INSTALL_STAGING = YES
MPG123_LICENSE = LGPLv2.1 MPG123_LICENSE = LGPLv2.1
MPG123_LICENSE_FILES = COPYING MPG123_LICENSE_FILES = COPYING

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
OFONO_VERSION = 1.12 OFONO_VERSION = 1.13
OFONO_SOURCE = ofono-$(OFONO_VERSION).tar.xz OFONO_SOURCE = ofono-$(OFONO_VERSION).tar.xz
OFONO_SITE = $(BR2_KERNEL_MIRROR)/linux/network/ofono OFONO_SITE = $(BR2_KERNEL_MIRROR)/linux/network/ofono
OFONO_LICENSE = GPLv2 OFONO_LICENSE = GPLv2

View File

@ -20,6 +20,50 @@
# and install the package # 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
# User-supplied script
define step_user
@$(foreach user_hook, $(BR2_INSTRUMENTATION_SCRIPTS), \
$(USER_HOOKS_EXTRA_ENV) $(user_hook) "$(1)" "$(2)" "$(3)"$(sep))
endef
ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
GLOBAL_INSTRUMENTATION_HOOKS += step_user
endif
################################################################################ ################################################################################
# Implicit targets -- produce a stamp file for each step of a package build # Implicit targets -- produce a stamp file for each step of a package build
################################################################################ ################################################################################
@ -55,6 +99,7 @@ endif
# Unpack the archive # Unpack the archive
$(BUILD_DIR)/%/.stamp_extracted: $(BUILD_DIR)/%/.stamp_extracted:
@$(call step_start,extract)
@$(call MESSAGE,"Extracting") @$(call MESSAGE,"Extracting")
$(Q)mkdir -p $(@D) $(Q)mkdir -p $(@D)
$($(PKG)_EXTRACT_CMDS) $($(PKG)_EXTRACT_CMDS)
@ -62,6 +107,7 @@ $(BUILD_DIR)/%/.stamp_extracted:
$(Q)chmod -R +rw $(@D) $(Q)chmod -R +rw $(@D)
$(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@ $(Q)touch $@
@$(call step_end,extract)
# Rsync the source directory if the <pkg>_OVERRIDE_SRCDIR feature is # Rsync the source directory if the <pkg>_OVERRIDE_SRCDIR feature is
# used. # used.
@ -91,6 +137,7 @@ endif
$(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION) $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(RAWNAME) $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(RAWNAME)
$(BUILD_DIR)/%/.stamp_patched: $(BUILD_DIR)/%/.stamp_patched:
@$(call step_start,patch)
@$(call MESSAGE,"Patching") @$(call MESSAGE,"Patching")
$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep)) $(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
@ -107,31 +154,39 @@ $(BUILD_DIR)/%/.stamp_patched:
) )
$(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@ $(Q)touch $@
@$(call step_end,patch)
# Configure # Configure
$(BUILD_DIR)/%/.stamp_configured: $(BUILD_DIR)/%/.stamp_configured:
@$(call step_start,configure)
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
@$(call MESSAGE,"Configuring") @$(call MESSAGE,"Configuring")
$($(PKG)_CONFIGURE_CMDS) $($(PKG)_CONFIGURE_CMDS)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@ $(Q)touch $@
@$(call step_end,configure)
# Build # Build
$(BUILD_DIR)/%/.stamp_built:: $(BUILD_DIR)/%/.stamp_built::
@$(call step_start,build)
@$(call MESSAGE,"Building") @$(call MESSAGE,"Building")
$($(PKG)_BUILD_CMDS) $($(PKG)_BUILD_CMDS)
$(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@ $(Q)touch $@
@$(call step_end,build)
# Install to host dir # Install to host dir
$(BUILD_DIR)/%/.stamp_host_installed: $(BUILD_DIR)/%/.stamp_host_installed:
@$(call step_start,install-host)
@$(call MESSAGE,"Installing to host directory") @$(call MESSAGE,"Installing to host directory")
$($(PKG)_INSTALL_CMDS) $($(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@ $(Q)touch $@
@$(call step_end,install-host)
# Install to staging dir # Install to staging dir
$(BUILD_DIR)/%/.stamp_staging_installed: $(BUILD_DIR)/%/.stamp_staging_installed:
@$(call step_start,install-staging)
@$(call MESSAGE,"Installing to staging directory") @$(call MESSAGE,"Installing to staging directory")
$($(PKG)_INSTALL_STAGING_CMDS) $($(PKG)_INSTALL_STAGING_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
@ -143,16 +198,20 @@ $(BUILD_DIR)/%/.stamp_staging_installed:
$(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\ $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\
fi fi
$(Q)touch $@ $(Q)touch $@
@$(call step_end,install-staging)
# Install to images dir # Install to images dir
$(BUILD_DIR)/%/.stamp_images_installed: $(BUILD_DIR)/%/.stamp_images_installed:
@$(call step_start,install-image)
@$(call MESSAGE,"Installing to images directory") @$(call MESSAGE,"Installing to images directory")
$($(PKG)_INSTALL_IMAGES_CMDS) $($(PKG)_INSTALL_IMAGES_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@ $(Q)touch $@
@$(call step_end,install-image)
# Install to target dir # Install to target dir
$(BUILD_DIR)/%/.stamp_target_installed: $(BUILD_DIR)/%/.stamp_target_installed:
@$(call step_start,install-target)
@$(call MESSAGE,"Installing to target") @$(call MESSAGE,"Installing to target")
$(if $(BR2_INIT_SYSTEMD),\ $(if $(BR2_INIT_SYSTEMD),\
$($(PKG)_INSTALL_INIT_SYSTEMD)) $($(PKG)_INSTALL_INIT_SYSTEMD))
@ -164,6 +223,7 @@ $(BUILD_DIR)/%/.stamp_target_installed:
$(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \ $(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \
fi fi
$(Q)touch $@ $(Q)touch $@
@$(call step_end,install-target)
# Clean package # Clean package
$(BUILD_DIR)/%/.stamp_cleaned: $(BUILD_DIR)/%/.stamp_cleaned:
@ -491,7 +551,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
ifneq ($$($(2)_SITE_METHOD),local) ifneq ($$($(2)_SITE_METHOD),local)
ifneq ($$($(2)_SITE_METHOD),override) ifneq ($$($(2)_SITE_METHOD),override)
# Packages that have a tarball need it downloaded and extracted beforehand # Packages that have a tarball need it downloaded and extracted beforehand
$(1)-legal-info: $(1)-extract $(REDIST_SOURCES_DIR) $(1)-legal-info: $(1)-extract $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5)))
$(2)_MANIFEST_TARBALL = $$($(2)_SOURCE) $(2)_MANIFEST_TARBALL = $$($(2)_SOURCE)
endif endif
endif endif
@ -515,23 +575,23 @@ else
# Save license files if defined # Save license files if defined
ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),) ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),)
@$(call legal-license-nofiles,$$($(2)_RAWNAME)) @$(call legal-license-nofiles,$$($(2)_RAWNAME),$(call UPPERCASE,$(5)))
@$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined)) @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
else else
# Double dollar signs are really needed here, to catch host packages # Double dollar signs are really needed here, to catch host packages
# without explicit HOST_FOO_LICENSE_FILES assignment, also in case they # without explicit HOST_FOO_LICENSE_FILES assignment, also in case they
# have multiple license files. # have multiple license files.
@$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F))$$(sep)) @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F),$(call UPPERCASE,$(5)))$$(sep))
endif # license files endif # license files
ifeq ($$($(2)_REDISTRIBUTE),YES) ifeq ($$($(2)_REDISTRIBUTE),YES)
# Copy the source tarball (just hardlink if possible) # Copy the source tarball (just hardlink if possible)
@cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR) 2>/dev/null || \ @cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5))) 2>/dev/null || \
cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR) cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5)))
endif # redistribute endif # redistribute
endif # other packages endif # other packages
@$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL)) @$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL),$(call UPPERCASE,$(5)))
endif # ifneq ($(call qstrip,$$($(2)_SOURCE)),) endif # ifneq ($(call qstrip,$$($(2)_SOURCE)),)
$(foreach hook,$($(2)_POST_LEGAL_INFO_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(2)_POST_LEGAL_INFO_HOOKS),$(call $(hook))$(sep))

View File

@ -99,23 +99,36 @@ endef
# legal-info helper functions # legal-info helper functions
# #
LEGAL_INFO_SEPARATOR="::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" LEGAL_INFO_SEPARATOR="::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
legal-warning=echo "WARNING: $(1)" >>$(LEGAL_WARNINGS)
legal-warning-pkg=echo "WARNING: $(1): $(2)" >>$(LEGAL_WARNINGS) 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-pkg-savednothing # pkg, {local|override} define legal-warning-pkg-savednothing # pkg, {local|override}
$(call legal-warning-pkg,$(1),sources and license files not saved ($(2) packages not handled)) $(call legal-warning-pkg,$(1),sources and license files not saved ($(2) packages not handled))
endef endef
legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV)
define legal-license-header define legal-manifest # pkg, version, license, license-files, source, {HOST|TARGET}
echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6))
endef
define legal-license-header # pkg, license-file, {HOST|TARGET}
echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \ echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \
"$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT) "$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT_$(3))
endef endef
define legal-license-nofiles
$(call legal-license-header,$(1),unknown license file(s)) define legal-license-nofiles # pkg, {HOST|TARGET}
$(call legal-license-header,$(1),unknown license file(s),$(2))
endef endef
define legal-license-file # pkg, filename, file-fullpath
$(call legal-license-header,$(1),$(2) file) && \ define legal-license-file # pkg, filename, file-fullpath, {HOST|TARGET}
cat $(3) >>$(LEGAL_LICENSES_TXT) && \ $(call legal-license-header,$(1),$(2) file,$(4)) && \
echo >>$(LEGAL_LICENSES_TXT) && \ cat $(3) >>$(LEGAL_LICENSES_TXT_$(4)) && \
mkdir -p $(LICENSE_FILES_DIR)/$(1)/$(dir $(2)) && \ echo >>$(LEGAL_LICENSES_TXT_$(4)) && \
cp $(3) $(LICENSE_FILES_DIR)/$(1)/$(2) mkdir -p $(LICENSE_FILES_DIR_$(4))/$(1)/$(dir $(2)) && \
cp $(3) $(LICENSE_FILES_DIR_$(4))/$(1)/$(2)
endef endef

View File

@ -14,50 +14,17 @@ Index: b/mkspecs/devices/linux-buildroot-g++/qmake.conf
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ b/mkspecs/devices/linux-buildroot-g++/qmake.conf +++ b/mkspecs/devices/linux-buildroot-g++/qmake.conf
@@ -0,0 +1,44 @@ @@ -0,0 +1,11 @@
+MAKEFILE_GENERATOR = UNIX +include(../common/linux_device_pre.conf)
+CONFIG += incremental gdb_dwarf_index
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(../../common/linux.conf)
+include(../../common/gcc-base-unix.conf)
+include(../../common/g++-unix.conf)
+
+load(device_config)
+
+QT_QPA_DEFAULT_PLATFORM = eglfs
+
+BUILDROOT_CROSS_COMPILE =
+BUILDROOT_COMPILER_CFLAGS =
+BUILDROOT_COMPILER_CXXFLAGS =
+BUILDROOT_INCLUDE_PATH =
+
+# modifications to g++.conf
+QMAKE_CC = $${BUILDROOT_CROSS_COMPILE}gcc
+QMAKE_CXX = $${BUILDROOT_CROSS_COMPILE}g++
+QMAKE_LINK = $${QMAKE_CXX}
+QMAKE_LINK_SHLIB = $${QMAKE_CXX}
+
+# modifications to linux.conf
+QMAKE_AR = $${BUILDROOT_CROSS_COMPILE}ar cqs
+QMAKE_OBJCOPY = $${BUILDROOT_CROSS_COMPILE}objcopy
+QMAKE_NM = $${BUILDROOT_CROSS_COMPILE}nm -P
+QMAKE_STRIP = $${BUILDROOT_CROSS_COMPILE}strip
+ +
+#modifications to gcc-base.conf +#modifications to gcc-base.conf
+QMAKE_CFLAGS += $${BUILDROOT_COMPILER_CFLAGS} +QMAKE_CFLAGS += $${BUILDROOT_COMPILER_CFLAGS}
+QMAKE_CXXFLAGS += $${BUILDROOT_COMPILER_CXXFLAGS} +QMAKE_CXXFLAGS += $${BUILDROOT_COMPILER_CXXFLAGS}
+QMAKE_CXXFLAGS_RELEASE += -O3 +QMAKE_CXXFLAGS_RELEASE += -O3
+INCLUDEPATH += $${BUILDROOT_INCLUDE_PATH}
+ +
+QMAKE_LIBS += -lrt -lpthread -ldl +QMAKE_LIBS += -lrt -lpthread -ldl
+ +
+# device specific glue code +include(../common/linux_device_post.conf)
+EGLFS_PLATFORM_HOOKS_SOURCES =
+
+# Sanity check
+deviceSanityCheckCompiler()
+
+load(qt_config) +load(qt_config)
Index: b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h Index: b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
=================================================================== ===================================================================

View File

@ -0,0 +1,37 @@
From 4723f3fd04edf1aad6750ca91fd4648216d8b408 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= <fatih.asici@gmail.com>
Date: Sat, 21 Sep 2013 00:14:39 +0300
Subject: [PATCH] configure: Parse -device-option value correctly
The regular expression does not parse correctly when a device option value
contains the character '=' (e.g. QMAKE_CFLAGS="-D_FILE_OFFSET_BITS=64").
In order to break string at the first equal sign and to simplify code,
use "cut" command as in other places in configure script.
Task-number: QTBUG-33584
Change-Id: I05b474d2ba6bff84c1e40d00475963bab36d94b6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com>
---
configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 64568dd..388899e 100755
--- a/configure
+++ b/configure
@@ -1609,8 +1609,8 @@ while [ "$#" -gt 0 ]; do
[ "$XPLATFORM" = "undefined" ] && exit 101
;;
device-option)
- DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"`
- DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"`
+ DEV_VAR=`echo $VAL | cut -d '=' -f 1`
+ DEV_VAL=`echo $VAL | cut -d '=' -f 2-`
DeviceVar set $DEV_VAR "$DEV_VAL"
;;
qpa)
--
1.8.4.rc3

View File

@ -0,0 +1,107 @@
From f2a611ce6cb0f86d9331641a804de6a507900db7 Mon Sep 17 00:00:00 2001
From: Tomasz Olszak <olszak.tomasz@gmail.com>
Date: Thu, 18 Jul 2013 20:45:47 +0000
Subject: [PATCH] Fixed mkspecs/devices/linux_device_post.conf for non-arm
platforms.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now arm specific -mfloat-abi flag is added to compiler flags
only for arm architecture in linux_arm_device_post.conf.
Change-Id: Ie77ac6e0717d9d1fd9c14e1d6a26e86f08ab418c
Reviewed-by: Jarosław Staniek <staniek@kde.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com>
---
mkspecs/devices/common/linux_arm_device_post.conf | 7 +++++++
mkspecs/devices/common/linux_device_post.conf | 6 ------
mkspecs/devices/linux-imx53qsb-g++/qmake.conf | 2 +-
mkspecs/devices/linux-imx6-g++/qmake.conf | 2 +-
mkspecs/devices/linux-rasp-pi-g++/qmake.conf | 2 +-
mkspecs/devices/linux-tegra2-g++/qmake.conf | 2 +-
6 files changed, 11 insertions(+), 10 deletions(-)
create mode 100644 mkspecs/devices/common/linux_arm_device_post.conf
diff --git a/mkspecs/devices/common/linux_arm_device_post.conf b/mkspecs/devices/common/linux_arm_device_post.conf
new file mode 100644
index 0000000..7ce4759
--- /dev/null
+++ b/mkspecs/devices/common/linux_arm_device_post.conf
@@ -0,0 +1,7 @@
+contains(DISTRO_OPTS, hard-float) {
+ COMPILER_FLAGS += -mfloat-abi=hard
+} else {
+ COMPILER_FLAGS += -mfloat-abi=softfp
+}
+
+include(linux_device_post.conf)
diff --git a/mkspecs/devices/common/linux_device_post.conf b/mkspecs/devices/common/linux_device_post.conf
index f8dbf76..548e75a 100644
--- a/mkspecs/devices/common/linux_device_post.conf
+++ b/mkspecs/devices/common/linux_device_post.conf
@@ -3,12 +3,6 @@ contains(DISTRO_OPTS, deb-multi-arch) {
-Wl,-rpath-link,$$[QT_SYSROOT]/lib/$${GCC_MACHINE_DUMP}
}
-contains(DISTRO_OPTS, hard-float) {
- COMPILER_FLAGS += -mfloat-abi=hard
-} else {
- COMPILER_FLAGS += -mfloat-abi=softfp
-}
-
QMAKE_CFLAGS += $$COMPILER_FLAGS
QMAKE_CXXFLAGS += $$COMPILER_FLAGS
diff --git a/mkspecs/devices/linux-imx53qsb-g++/qmake.conf b/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
index 0a5ed89..3a9766c 100644
--- a/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
+++ b/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
@@ -32,6 +32,6 @@ QMAKE_CXXFLAGS_RELEASE += $$IMX5_CFLAGS_RELEASE
QMAKE_CFLAGS_DEBUG += $$IMX5_CFLAGS
QMAKE_CXXFLAGS_DEBUG += $$IMX5_CFLAGS
-include(../common/linux_device_post.conf)
+include(../common/linux_arm_device_post.conf)
load(qt_config)
diff --git a/mkspecs/devices/linux-imx6-g++/qmake.conf b/mkspecs/devices/linux-imx6-g++/qmake.conf
index 20f6d11..2b8dbf6 100644
--- a/mkspecs/devices/linux-imx6-g++/qmake.conf
+++ b/mkspecs/devices/linux-imx6-g++/qmake.conf
@@ -34,6 +34,6 @@ QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
QMAKE_CFLAGS_DEBUG += $$IMX6_CFLAGS
QMAKE_CXXFLAGS_DEBUG += $$IMX6_CFLAGS
-include(../common/linux_device_post.conf)
+include(../common/linux_arm_device_post.conf)
load(qt_config)
diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
index d6fea47..5f923ad 100644
--- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
+++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
@@ -42,6 +42,6 @@ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_pi.cpp
EGLFS_PLATFORM_HOOKS_LIBS = -lbcm_host
-include(../common/linux_device_post.conf)
+include(../common/linux_arm_device_post.conf)
load(qt_config)
diff --git a/mkspecs/devices/linux-tegra2-g++/qmake.conf b/mkspecs/devices/linux-tegra2-g++/qmake.conf
index 1c7a8cc..320e1b8 100644
--- a/mkspecs/devices/linux-tegra2-g++/qmake.conf
+++ b/mkspecs/devices/linux-tegra2-g++/qmake.conf
@@ -26,6 +26,6 @@ TEGRA2_CFLAGS = -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-a
QMAKE_CFLAGS += $$TEGRA2_CFLAGS
QMAKE_CXXFLAGS += $$TEGRA2_CFLAGS
-include(../common/linux_device_post.conf)
+include(../common/linux_arm_device_post.conf)
load(qt_config)
--
1.8.4.rc3

View File

@ -152,21 +152,7 @@ QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_PRINTSUPPORT) += Qt5PrintSupport
QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus
# Ideally, we could use -device-option to substitute variable values
# in our linux-buildroot-g++/qmake.config, but this mechanism doesn't
# nicely support variable values that contain spaces. So we use the
# good old sed solution here.
define QT5BASE_CONFIG_SET
$(SED) 's%^$(1).*%$(1) = $(2)%g' $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
endef
define QT5BASE_CONFIGURE_CMDS define QT5BASE_CONFIGURE_CMDS
$(call QT5BASE_CONFIG_SET,BUILDROOT_CROSS_COMPILE,$(TARGET_CROSS))
$(call QT5BASE_CONFIG_SET,BUILDROOT_COMPILER_CFLAGS,$(TARGET_CFLAGS))
$(call QT5BASE_CONFIG_SET,BUILDROOT_COMPILER_CXXFLAGS,$(TARGET_CXXFLAGS))
$(call QT5BASE_CONFIG_SET,BUILDROOT_INCLUDE_PATH,$(STAGING_DIR)/usr/include)
$(call QT5BASE_CONFIG_SET,EGLFS_PLATFORM_HOOKS_SOURCES, \
$(QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES))
(cd $(@D); \ (cd $(@D); \
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \ PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
@ -181,6 +167,10 @@ define QT5BASE_CONFIGURE_CMDS
-no-rpath \ -no-rpath \
-nomake examples -nomake tests \ -nomake examples -nomake tests \
-device buildroot \ -device buildroot \
-device-option CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
-device-option BUILDROOT_COMPILER_CFLAGS="$(TARGET_CFLAGS)" \
-device-option BUILDROOT_COMPILER_CXXFLAGS="$(TARGET_CXXFLAGS)" \
-device-option EGLFS_PLATFORM_HOOKS_SOURCES="$(QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES)" \
-no-c++11 \ -no-c++11 \
$(QT5BASE_CONFIGURE_OPTS) \ $(QT5BASE_CONFIGURE_OPTS) \
) )

View File

@ -7,6 +7,7 @@
SAM_BA_SITE = http://www.atmel.com/dyn/resources/prod_documents/ SAM_BA_SITE = http://www.atmel.com/dyn/resources/prod_documents/
SAM_BA_VERSION = 2.12 SAM_BA_VERSION = 2.12
SAM_BA_SOURCE = sam-ba_$(SAM_BA_VERSION).zip SAM_BA_SOURCE = sam-ba_$(SAM_BA_VERSION).zip
SAM_BA_PATCH = sam-ba_$(SAM_BA_VERSION)_patch5.gz
SAM_BA_LICENSE = BSD-like (partly binary-only) SAM_BA_LICENSE = BSD-like (partly binary-only)
SAM_BA_LICENSE_FILES = doc/readme.txt SAM_BA_LICENSE_FILES = doc/readme.txt

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
SQUID_VERSION = 3.3.9 SQUID_VERSION = 3.3.10
SQUID_SOURCE = squid-$(SQUID_VERSION).tar.xz SQUID_SOURCE = squid-$(SQUID_VERSION).tar.xz
SQUID_SITE = http://www.squid-cache.org/Versions/v3/3.3 SQUID_SITE = http://www.squid-cache.org/Versions/v3/3.3
SQUID_LICENSE = GPLv2+ SQUID_LICENSE = GPLv2+

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
TCPDUMP_VERSION = 4.4.0 TCPDUMP_VERSION = 4.5.1
TCPDUMP_SITE = http://www.tcpdump.org/release TCPDUMP_SITE = http://www.tcpdump.org/release
TCPDUMP_LICENSE = BSD-3c TCPDUMP_LICENSE = BSD-3c
TCPDUMP_LICENSE_FILES = LICENSE TCPDUMP_LICENSE_FILES = LICENSE

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
ULOGD_VERSION = 2.0.2 ULOGD_VERSION = 2.0.3
ULOGD_SOURCE = ulogd-$(ULOGD_VERSION).tar.bz2 ULOGD_SOURCE = ulogd-$(ULOGD_VERSION).tar.bz2
ULOGD_SITE = http://www.netfilter.org/projects/ulogd/files ULOGD_SITE = http://www.netfilter.org/projects/ulogd/files
ULOGD_CONF_OPT = --with-dbi=no --with-pgsql=no ULOGD_CONF_OPT = --with-dbi=no --with-pgsql=no

View File

@ -219,7 +219,9 @@ HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses HOSTLOADLIBES_nconf = $(shell \
pkg-config --libs menu panel ncurses 2>/dev/null \
|| echo "-lmenu -lpanel -lncurses" )
$(obj)/qconf.o: $(obj)/.tmp_qtcheck $(obj)/qconf.o: $(obj)/.tmp_qtcheck
ifeq ($(qconf-target),1) ifeq ($(qconf-target),1)

View File

@ -4,7 +4,7 @@ to suit Buildroot.
To update: To update:
cp -r /usr/src/linux/scripts/kconfig support/kconfig.new cp -r /usr/src/linux/scripts/kconfig support/kconfig.new
cd support/kconfig.new cd support/kconfig.new
cp -a ../kconfig/patches ../kconfig/README.buildroot . cp -a ../kconfig/patches ../kconfig/README.buildroot ../kconfig/.gitignore .
quilt push -a quilt push -a
# Fix any conflict # Fix any conflict
cd .. cd ..

View File

@ -13,6 +13,7 @@
#include <getopt.h> #include <getopt.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <errno.h>
#include "lkc.h" #include "lkc.h"
@ -514,14 +515,24 @@ int main(int ac, char **av)
{ {
struct timeval now; struct timeval now;
unsigned int seed; unsigned int seed;
char *seed_env;
/* /*
* Use microseconds derived seed, * Use microseconds derived seed,
* compensate for systems where it may be zero * compensate for systems where it may be zero
*/ */
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1)); seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1));
seed_env = getenv("KCONFIG_SEED");
if( seed_env && *seed_env ) {
char *endp;
int tmp = (int)strtol(seed_env, &endp, 0);
if (*endp == '\0') {
seed = tmp;
}
}
fprintf( stderr, "KCONFIG_SEED=0x%X\n", seed );
srand(seed); srand(seed);
break; break;
} }
@ -642,7 +653,8 @@ int main(int ac, char **av)
conf_set_all_new_symbols(def_default); conf_set_all_new_symbols(def_default);
break; break;
case randconfig: case randconfig:
conf_set_all_new_symbols(def_random); /* Really nothing to do in this loop */
while (conf_set_all_new_symbols(def_random)) ;
break; break;
case defconfig: case defconfig:
conf_set_all_new_symbols(def_default); conf_set_all_new_symbols(def_default);

View File

@ -139,7 +139,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
sym->flags |= def_flags; sym->flags |= def_flags;
break; break;
} }
conf_warning("symbol value '%s' invalid for %s", p, sym->name); if (def != S_DEF_AUTO)
conf_warning("symbol value '%s' invalid for %s",
p, sym->name);
return 1; return 1;
case S_OTHER: case S_OTHER:
if (*p != '"') { if (*p != '"') {
@ -160,7 +162,8 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
memmove(p2, p2 + 1, strlen(p2)); memmove(p2, p2 + 1, strlen(p2));
} }
if (!p2) { if (!p2) {
conf_warning("invalid string found"); if (def != S_DEF_AUTO)
conf_warning("invalid string found");
return 1; return 1;
} }
/* fall through */ /* fall through */
@ -171,7 +174,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
sym->def[def].val = strdup(p); sym->def[def].val = strdup(p);
sym->flags |= def_flags; sym->flags |= def_flags;
} else { } else {
conf_warning("symbol value '%s' invalid for %s", p, sym->name); if (def != S_DEF_AUTO)
conf_warning("symbol value '%s' invalid for %s",
p, sym->name);
return 1; return 1;
} }
break; break;
@ -1073,7 +1078,7 @@ void conf_set_changed_callback(void (*fn)(void))
conf_changed_callback = fn; conf_changed_callback = fn;
} }
static void randomize_choice_values(struct symbol *csym) static bool randomize_choice_values(struct symbol *csym)
{ {
struct property *prop; struct property *prop;
struct symbol *sym; struct symbol *sym;
@ -1086,7 +1091,7 @@ static void randomize_choice_values(struct symbol *csym)
* In both cases stop. * In both cases stop.
*/ */
if (csym->curr.tri != yes) if (csym->curr.tri != yes)
return; return false;
prop = sym_get_choice_prop(csym); prop = sym_get_choice_prop(csym);
@ -1110,13 +1115,18 @@ static void randomize_choice_values(struct symbol *csym)
else { else {
sym->def[S_DEF_USER].tri = no; sym->def[S_DEF_USER].tri = no;
} }
sym->flags |= SYMBOL_DEF_USER;
/* clear VALID to get value calculated */
sym->flags &= ~SYMBOL_VALID;
} }
csym->flags |= SYMBOL_DEF_USER; csym->flags |= SYMBOL_DEF_USER;
/* clear VALID to get value calculated */ /* clear VALID to get value calculated */
csym->flags &= ~(SYMBOL_VALID); csym->flags &= ~(SYMBOL_VALID);
return true;
} }
static void set_all_choice_values(struct symbol *csym) void set_all_choice_values(struct symbol *csym)
{ {
struct property *prop; struct property *prop;
struct symbol *sym; struct symbol *sym;
@ -1133,29 +1143,66 @@ static void set_all_choice_values(struct symbol *csym)
} }
csym->flags |= SYMBOL_DEF_USER; csym->flags |= SYMBOL_DEF_USER;
/* clear VALID to get value calculated */ /* clear VALID to get value calculated */
csym->flags &= ~(SYMBOL_VALID); csym->flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES);
} }
void conf_set_all_new_symbols(enum conf_def_mode mode) bool conf_set_all_new_symbols(enum conf_def_mode mode)
{ {
struct symbol *sym, *csym; struct symbol *sym, *csym;
int i, cnt, prob = 50; int i, cnt, pby, pty, ptm; /* pby: probability of boolean = y
* pty: probability of tristate = y
* ptm: probability of tristate = m
*/
pby = 50; pty = ptm = 33; /* can't go as the default in switch-case
* below, otherwise gcc whines about
* -Wmaybe-uninitialized */
if (mode == def_random) { if (mode == def_random) {
char *endp, *env = getenv("KCONFIG_PROBABILITY"); int n, p[3];
if (env && *env) { char *env = getenv("KCONFIG_PROBABILITY");
int tmp = (int)strtol(env, &endp, 10); n = 0;
if (*endp == '\0' && tmp >= 0 && tmp <= 100) while( env && *env ) {
prob = tmp; char *endp;
int tmp = strtol( env, &endp, 10 );
if( tmp >= 0 && tmp <= 100 ) {
p[n++] = tmp;
} else {
errno = ERANGE;
perror( "KCONFIG_PROBABILITY" );
exit( 1 );
}
env = (*endp == ':') ? endp+1 : endp;
if( n >=3 ) {
break;
}
}
switch( n ) {
case 1:
pby = p[0]; ptm = pby/2; pty = pby-ptm;
break;
case 2:
pty = p[0]; ptm = p[1]; pby = pty + ptm;
break;
case 3:
pby = p[0]; pty = p[1]; ptm = p[2];
break;
}
if( pty+ptm > 100 ) {
errno = ERANGE;
perror( "KCONFIG_PROBABILITY" );
exit( 1 );
} }
} }
bool has_changed = false;
for_all_symbols(i, sym) { for_all_symbols(i, sym) {
if (sym_has_value(sym)) if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
continue; continue;
switch (sym_get_type(sym)) { switch (sym_get_type(sym)) {
case S_BOOLEAN: case S_BOOLEAN:
case S_TRISTATE: case S_TRISTATE:
has_changed = true;
switch (mode) { switch (mode) {
case def_yes: case def_yes:
sym->def[S_DEF_USER].tri = yes; sym->def[S_DEF_USER].tri = yes;
@ -1167,15 +1214,15 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
sym->def[S_DEF_USER].tri = no; sym->def[S_DEF_USER].tri = no;
break; break;
case def_random: case def_random:
cnt = (rand() % 100) - (100 - prob); sym->def[S_DEF_USER].tri = no;
if (cnt < 0) cnt = rand() % 100;
sym->def[S_DEF_USER].tri = no; if (sym->type == S_TRISTATE) {
else if (cnt < pty)
if ((sym_get_type(sym) == S_TRISTATE)
&& (cnt > prob/2))
sym->def[S_DEF_USER].tri = mod;
else
sym->def[S_DEF_USER].tri = yes; sym->def[S_DEF_USER].tri = yes;
else if (cnt < (pty+ptm))
sym->def[S_DEF_USER].tri = mod;
} else if (cnt < pby)
sym->def[S_DEF_USER].tri = yes;
break; break;
default: default:
continue; continue;
@ -1200,14 +1247,26 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
* selected in a choice block and we set it to yes, * selected in a choice block and we set it to yes,
* and the rest to no. * and the rest to no.
*/ */
if (mode != def_random) {
for_all_symbols(i, csym) {
if ((sym_is_choice(csym) && !sym_has_value(csym)) ||
sym_is_choice_value(csym))
csym->flags |= SYMBOL_NEED_SET_CHOICE_VALUES;
}
}
for_all_symbols(i, csym) { for_all_symbols(i, csym) {
if (sym_has_value(csym) || !sym_is_choice(csym)) if (sym_has_value(csym) || !sym_is_choice(csym))
continue; continue;
sym_calc_value(csym); sym_calc_value(csym);
if (mode == def_random) if (mode == def_random)
randomize_choice_values(csym); has_changed = randomize_choice_values(csym);
else else {
set_all_choice_values(csym); set_all_choice_values(csym);
has_changed = true;
}
} }
return has_changed;
} }

View File

@ -326,7 +326,7 @@ struct expr *expr_trans_bool(struct expr *e)
e->right.expr = expr_trans_bool(e->right.expr); e->right.expr = expr_trans_bool(e->right.expr);
break; break;
case E_UNEQUAL: case E_UNEQUAL:
/* FOO!=n -> FOO */ // FOO!=n -> FOO
if (e->left.sym->type == S_TRISTATE) { if (e->left.sym->type == S_TRISTATE) {
if (e->right.sym == &symbol_no) { if (e->right.sym == &symbol_no) {
e->type = E_SYMBOL; e->type = E_SYMBOL;
@ -375,19 +375,19 @@ static struct expr *expr_join_or(struct expr *e1, struct expr *e2)
if (e1->type == E_EQUAL && e2->type == E_EQUAL && if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
(e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
/* (a='y') || (a='m') -> (a!='n') */ // (a='y') || (a='m') -> (a!='n')
return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no); return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
} }
if (e1->type == E_EQUAL && e2->type == E_EQUAL && if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
/* (a='y') || (a='n') -> (a!='m') */ // (a='y') || (a='n') -> (a!='m')
return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod); return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
} }
if (e1->type == E_EQUAL && e2->type == E_EQUAL && if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
/* (a='m') || (a='n') -> (a!='y') */ // (a='m') || (a='n') -> (a!='y')
return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes); return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
} }
} }
@ -438,29 +438,29 @@ static struct expr *expr_join_and(struct expr *e1, struct expr *e2)
if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
(e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
/* (a) && (a='y') -> (a='y') */ // (a) && (a='y') -> (a='y')
return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
(e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
/* (a) && (a!='n') -> (a) */ // (a) && (a!='n') -> (a)
return expr_alloc_symbol(sym1); return expr_alloc_symbol(sym1);
if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
(e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
/* (a) && (a!='m') -> (a='y') */ // (a) && (a!='m') -> (a='y')
return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
if (sym1->type == S_TRISTATE) { if (sym1->type == S_TRISTATE) {
if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) { if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
/* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */ // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
sym2 = e1->right.sym; sym2 = e1->right.sym;
if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
: expr_alloc_symbol(&symbol_no); : expr_alloc_symbol(&symbol_no);
} }
if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) { if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
/* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */ // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
sym2 = e2->right.sym; sym2 = e2->right.sym;
if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
@ -469,19 +469,19 @@ static struct expr *expr_join_and(struct expr *e1, struct expr *e2)
if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
/* (a!='y') && (a!='n') -> (a='m') */ // (a!='y') && (a!='n') -> (a='m')
return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod); return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
(e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
/* (a!='y') && (a!='m') -> (a='n') */ // (a!='y') && (a!='m') -> (a='n')
return expr_alloc_comp(E_EQUAL, sym1, &symbol_no); return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
/* (a!='m') && (a!='n') -> (a='m') */ // (a!='m') && (a!='n') -> (a='m')
return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
@ -574,7 +574,7 @@ static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct
switch (e1->type) { switch (e1->type) {
case E_OR: case E_OR:
expr_eliminate_dups2(e1->type, &e1, &e1); expr_eliminate_dups2(e1->type, &e1, &e1);
/* (FOO || BAR) && (!FOO && !BAR) -> n */ // (FOO || BAR) && (!FOO && !BAR) -> n
tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1))); tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
tmp2 = expr_copy(e2); tmp2 = expr_copy(e2);
tmp = expr_extract_eq_and(&tmp1, &tmp2); tmp = expr_extract_eq_and(&tmp1, &tmp2);
@ -589,7 +589,7 @@ static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct
break; break;
case E_AND: case E_AND:
expr_eliminate_dups2(e1->type, &e1, &e1); expr_eliminate_dups2(e1->type, &e1, &e1);
/* (FOO && BAR) || (!FOO || !BAR) -> y */ // (FOO && BAR) || (!FOO || !BAR) -> y
tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1))); tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
tmp2 = expr_copy(e2); tmp2 = expr_copy(e2);
tmp = expr_extract_eq_or(&tmp1, &tmp2); tmp = expr_extract_eq_or(&tmp1, &tmp2);
@ -698,7 +698,7 @@ struct expr *expr_transform(struct expr *e)
case E_NOT: case E_NOT:
switch (e->left.expr->type) { switch (e->left.expr->type) {
case E_NOT: case E_NOT:
/* !!a -> a */ // !!a -> a
tmp = e->left.expr->left.expr; tmp = e->left.expr->left.expr;
free(e->left.expr); free(e->left.expr);
free(e); free(e);
@ -707,14 +707,14 @@ struct expr *expr_transform(struct expr *e)
break; break;
case E_EQUAL: case E_EQUAL:
case E_UNEQUAL: case E_UNEQUAL:
/* !a='x' -> a!='x' */ // !a='x' -> a!='x'
tmp = e->left.expr; tmp = e->left.expr;
free(e); free(e);
e = tmp; e = tmp;
e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL; e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
break; break;
case E_OR: case E_OR:
/* !(a || b) -> !a && !b */ // !(a || b) -> !a && !b
tmp = e->left.expr; tmp = e->left.expr;
e->type = E_AND; e->type = E_AND;
e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr); e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@ -723,7 +723,7 @@ struct expr *expr_transform(struct expr *e)
e = expr_transform(e); e = expr_transform(e);
break; break;
case E_AND: case E_AND:
/* !(a && b) -> !a || !b */ // !(a && b) -> !a || !b
tmp = e->left.expr; tmp = e->left.expr;
e->type = E_OR; e->type = E_OR;
e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr); e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@ -733,7 +733,7 @@ struct expr *expr_transform(struct expr *e)
break; break;
case E_SYMBOL: case E_SYMBOL:
if (e->left.expr->left.sym == &symbol_yes) { if (e->left.expr->left.sym == &symbol_yes) {
/* !'y' -> 'n' */ // !'y' -> 'n'
tmp = e->left.expr; tmp = e->left.expr;
free(e); free(e);
e = tmp; e = tmp;
@ -742,7 +742,7 @@ struct expr *expr_transform(struct expr *e)
break; break;
} }
if (e->left.expr->left.sym == &symbol_mod) { if (e->left.expr->left.sym == &symbol_mod) {
/* !'m' -> 'm' */ // !'m' -> 'm'
tmp = e->left.expr; tmp = e->left.expr;
free(e); free(e);
e = tmp; e = tmp;
@ -751,7 +751,7 @@ struct expr *expr_transform(struct expr *e)
break; break;
} }
if (e->left.expr->left.sym == &symbol_no) { if (e->left.expr->left.sym == &symbol_no) {
/* !'n' -> 'y' */ // !'n' -> 'y'
tmp = e->left.expr; tmp = e->left.expr;
free(e); free(e);
e = tmp; e = tmp;

View File

@ -106,6 +106,9 @@ struct symbol {
#define SYMBOL_DEF3 0x40000 /* symbol.def[S_DEF_3] is valid */ #define SYMBOL_DEF3 0x40000 /* symbol.def[S_DEF_3] is valid */
#define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */ #define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */
/* choice values need to be set before calculating this symbol value */
#define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000
#define SYMBOL_MAXLENGTH 256 #define SYMBOL_MAXLENGTH 256
#define SYMBOL_HASHSIZE 9973 #define SYMBOL_HASHSIZE 9973

View File

@ -50,6 +50,19 @@ struct list_head {
&pos->member != (head); \ &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member)) pos = list_entry(pos->member.next, typeof(*pos), member))
/**
* list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
* @pos: the type * to use as a loop cursor.
* @n: another type * to use as temporary storage
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry_safe(pos, n, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
/** /**
* list_empty - tests whether a list is empty * list_empty - tests whether a list is empty
* @head: the list to test. * @head: the list to test.
@ -88,4 +101,31 @@ static inline void list_add_tail(struct list_head *_new, struct list_head *head)
__list_add(_new, head->prev, head); __list_add(_new, head->prev, head);
} }
/*
* Delete a list entry by making the prev/next entries
* point to each other.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static inline void __list_del(struct list_head *prev, struct list_head *next)
{
next->prev = prev;
prev->next = next;
}
#define LIST_POISON1 ((void *) 0x00100100)
#define LIST_POISON2 ((void *) 0x00200200)
/**
* list_del - deletes entry from list.
* @entry: the element to delete from the list.
* Note: list_empty() on entry does not return true after this, the entry is
* in an undefined state.
*/
static inline void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
entry->next = (struct list_head*)LIST_POISON1;
entry->prev = (struct list_head*)LIST_POISON2;
}
#endif #endif

View File

@ -86,7 +86,8 @@ const char *conf_get_autoconfig_name(void);
char *conf_get_default_confname(void); char *conf_get_default_confname(void);
void sym_set_change_count(int count); void sym_set_change_count(int count);
void sym_add_change_count(int count); void sym_add_change_count(int count);
void conf_set_all_new_symbols(enum conf_def_mode mode); bool conf_set_all_new_symbols(enum conf_def_mode mode);
void set_all_choice_values(struct symbol *csym);
struct conf_printer { struct conf_printer {
void (*print_symbol)(FILE *, struct symbol *, const char *, void *); void (*print_symbol)(FILE *, struct symbol *, const char *, void *);

View File

@ -14,6 +14,7 @@ P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap)));
/* menu.c */ /* menu.c */
P(rootmenu,struct menu,); P(rootmenu,struct menu,);
P(menu_is_empty, bool, (struct menu *menu));
P(menu_is_visible, bool, (struct menu *menu)); P(menu_is_visible, bool, (struct menu *menu));
P(menu_has_prompt, bool, (struct menu *menu)); P(menu_has_prompt, bool, (struct menu *menu));
P(menu_get_prompt,const char *,(struct menu *menu)); P(menu_get_prompt,const char *,(struct menu *menu));

View File

@ -4,6 +4,8 @@
# What library to link # What library to link
ldflags() ldflags()
{ {
pkg-config --libs ncursesw 2>/dev/null && exit
pkg-config --libs ncurses 2>/dev/null && exit
for ext in so a dll.a dylib ; do for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses ; do for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q / $cc -print-file-name=lib${lib}.${ext} | grep -q /
@ -20,12 +22,12 @@ ldflags()
ccflags() ccflags()
{ {
if [ -f /usr/include/ncursesw/curses.h ]; then if [ -f /usr/include/ncursesw/curses.h ]; then
echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
echo ' -DNCURSES_WIDECHAR=1' echo ' -DNCURSES_WIDECHAR=1'
elif [ -f /usr/include/ncurses/ncurses.h ]; then elif [ -f /usr/include/ncurses/ncurses.h ]; then
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
elif [ -f /usr/include/ncurses/curses.h ]; then elif [ -f /usr/include/ncurses/curses.h ]; then
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' echo '-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"'
elif [ -f /usr/include/ncurses.h ]; then elif [ -f /usr/include/ncurses.h ]; then
echo '-DCURSES_LOC="<ncurses.h>"' echo '-DCURSES_LOC="<ncurses.h>"'
else else

View File

@ -132,16 +132,16 @@ int dialog_checklist(const char *title, const char *prompt, int height,
} }
do_resize: do_resize:
if (getmaxy(stdscr) < (height + 6)) if (getmaxy(stdscr) < (height + CHECKLIST_HEIGTH_MIN))
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
if (getmaxx(stdscr) < (width + 6)) if (getmaxx(stdscr) < (width + CHECKLIST_WIDTH_MIN))
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
max_choice = MIN(list_height, item_count()); max_choice = MIN(list_height, item_count());
/* center dialog box on screen */ /* center dialog box on screen */
x = (COLS - width) / 2; x = (getmaxx(stdscr) - width) / 2;
y = (LINES - height) / 2; y = (getmaxy(stdscr) - height) / 2;
draw_shadow(stdscr, y, x, height, width); draw_shadow(stdscr, y, x, height, width);

View File

@ -106,8 +106,14 @@ struct dialog_color {
int hl; /* highlight this item */ int hl; /* highlight this item */
}; };
struct subtitle_list {
struct subtitle_list *next;
const char *text;
};
struct dialog_info { struct dialog_info {
const char *backtitle; const char *backtitle;
struct subtitle_list *subtitles;
struct dialog_color screen; struct dialog_color screen;
struct dialog_color shadow; struct dialog_color shadow;
struct dialog_color dialog; struct dialog_color dialog;
@ -194,8 +200,23 @@ int item_is_tag(char tag);
int on_key_esc(WINDOW *win); int on_key_esc(WINDOW *win);
int on_key_resize(void); int on_key_resize(void);
/* minimum (re)size values */
#define CHECKLIST_HEIGTH_MIN 6 /* For dialog_checklist() */
#define CHECKLIST_WIDTH_MIN 6
#define INPUTBOX_HEIGTH_MIN 2 /* For dialog_inputbox() */
#define INPUTBOX_WIDTH_MIN 2
#define MENUBOX_HEIGTH_MIN 15 /* For dialog_menu() */
#define MENUBOX_WIDTH_MIN 65
#define TEXTBOX_HEIGTH_MIN 8 /* For dialog_textbox() */
#define TEXTBOX_WIDTH_MIN 8
#define YESNO_HEIGTH_MIN 4 /* For dialog_yesno() */
#define YESNO_WIDTH_MIN 4
#define WINDOW_HEIGTH_MIN 19 /* For init_dialog() */
#define WINDOW_WIDTH_MIN 80
int init_dialog(const char *backtitle); int init_dialog(const char *backtitle);
void set_dialog_backtitle(const char *backtitle); void set_dialog_backtitle(const char *backtitle);
void set_dialog_subtitles(struct subtitle_list *subtitles);
void end_dialog(int x, int y); void end_dialog(int x, int y);
void attr_clear(WINDOW * win, int height, int width, chtype attr); void attr_clear(WINDOW * win, int height, int width, chtype attr);
void dialog_clear(void); void dialog_clear(void);

View File

@ -56,14 +56,14 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
strcpy(instr, init); strcpy(instr, init);
do_resize: do_resize:
if (getmaxy(stdscr) <= (height - 2)) if (getmaxy(stdscr) <= (height - INPUTBOX_HEIGTH_MIN))
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
if (getmaxx(stdscr) <= (width - 2)) if (getmaxx(stdscr) <= (width - INPUTBOX_WIDTH_MIN))
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
/* center dialog box on screen */ /* center dialog box on screen */
x = (COLS - width) / 2; x = (getmaxx(stdscr) - width) / 2;
y = (LINES - height) / 2; y = (getmaxy(stdscr) - height) / 2;
draw_shadow(stdscr, y, x, height, width); draw_shadow(stdscr, y, x, height, width);

View File

@ -193,7 +193,7 @@ int dialog_menu(const char *title, const char *prompt,
do_resize: do_resize:
height = getmaxy(stdscr); height = getmaxy(stdscr);
width = getmaxx(stdscr); width = getmaxx(stdscr);
if (height < 15 || width < 65) if (height < MENUBOX_HEIGTH_MIN || width < MENUBOX_WIDTH_MIN)
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
height -= 4; height -= 4;
@ -203,8 +203,8 @@ do_resize:
max_choice = MIN(menu_height, item_count()); max_choice = MIN(menu_height, item_count());
/* center dialog box on screen */ /* center dialog box on screen */
x = (COLS - width) / 2; x = (getmaxx(stdscr) - width) / 2;
y = (LINES - height) / 2; y = (getmaxy(stdscr) - height) / 2;
draw_shadow(stdscr, y, x, height, width); draw_shadow(stdscr, y, x, height, width);
@ -285,7 +285,7 @@ do_resize:
if (key < 256 && isalpha(key)) if (key < 256 && isalpha(key))
key = tolower(key); key = tolower(key);
if (strchr("ynmh", key)) if (strchr("ynmh ", key))
i = max_choice; i = max_choice;
else { else {
for (i = choice + 1; i < max_choice; i++) { for (i = choice + 1; i < max_choice; i++) {
@ -303,10 +303,11 @@ do_resize:
} }
} }
if (i < max_choice || if (item_count() != 0 &&
key == KEY_UP || key == KEY_DOWN || (i < max_choice ||
key == '-' || key == '+' || key == KEY_UP || key == KEY_DOWN ||
key == KEY_PPAGE || key == KEY_NPAGE) { key == '-' || key == '+' ||
key == KEY_PPAGE || key == KEY_NPAGE)) {
/* Remove highligt of current item */ /* Remove highligt of current item */
print_item(scroll + choice, choice, FALSE); print_item(scroll + choice, choice, FALSE);

View File

@ -80,7 +80,7 @@ int dialog_textbox(const char *title, char *tbuf, int initial_height,
do_resize: do_resize:
getmaxyx(stdscr, height, width); getmaxyx(stdscr, height, width);
if (height < 8 || width < 8) if (height < TEXTBOX_HEIGTH_MIN || width < TEXTBOX_WIDTH_MIN)
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
if (initial_height != 0) if (initial_height != 0)
height = initial_height; height = initial_height;
@ -98,8 +98,8 @@ do_resize:
width = 0; width = 0;
/* center dialog box on screen */ /* center dialog box on screen */
x = (COLS - width) / 2; x = (getmaxx(stdscr) - width) / 2;
y = (LINES - height) / 2; y = (getmaxy(stdscr) - height) / 2;
draw_shadow(stdscr, y, x, height, width); draw_shadow(stdscr, y, x, height, width);

View File

@ -254,15 +254,56 @@ void attr_clear(WINDOW * win, int height, int width, chtype attr)
void dialog_clear(void) void dialog_clear(void)
{ {
attr_clear(stdscr, LINES, COLS, dlg.screen.atr); int lines, columns;
lines = getmaxy(stdscr);
columns = getmaxx(stdscr);
attr_clear(stdscr, lines, columns, dlg.screen.atr);
/* Display background title if it exists ... - SLH */ /* Display background title if it exists ... - SLH */
if (dlg.backtitle != NULL) { if (dlg.backtitle != NULL) {
int i; int i, len = 0, skip = 0;
struct subtitle_list *pos;
wattrset(stdscr, dlg.screen.atr); wattrset(stdscr, dlg.screen.atr);
mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle); mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle);
for (pos = dlg.subtitles; pos != NULL; pos = pos->next) {
/* 3 is for the arrow and spaces */
len += strlen(pos->text) + 3;
}
wmove(stdscr, 1, 1); wmove(stdscr, 1, 1);
for (i = 1; i < COLS - 1; i++) if (len > columns - 2) {
const char *ellipsis = "[...] ";
waddstr(stdscr, ellipsis);
skip = len - (columns - 2 - strlen(ellipsis));
}
for (pos = dlg.subtitles; pos != NULL; pos = pos->next) {
if (skip == 0)
waddch(stdscr, ACS_RARROW);
else
skip--;
if (skip == 0)
waddch(stdscr, ' ');
else
skip--;
if (skip < strlen(pos->text)) {
waddstr(stdscr, pos->text + skip);
skip = 0;
} else
skip -= strlen(pos->text);
if (skip == 0)
waddch(stdscr, ' ');
else
skip--;
}
for (i = len + 1; i < columns - 1; i++)
waddch(stdscr, ACS_HLINE); waddch(stdscr, ACS_HLINE);
} }
wnoutrefresh(stdscr); wnoutrefresh(stdscr);
@ -281,7 +322,7 @@ int init_dialog(const char *backtitle)
getyx(stdscr, saved_y, saved_x); getyx(stdscr, saved_y, saved_x);
getmaxyx(stdscr, height, width); getmaxyx(stdscr, height, width);
if (height < 19 || width < 80) { if (height < WINDOW_HEIGTH_MIN || width < WINDOW_WIDTH_MIN) {
endwin(); endwin();
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
} }
@ -302,6 +343,11 @@ void set_dialog_backtitle(const char *backtitle)
dlg.backtitle = backtitle; dlg.backtitle = backtitle;
} }
void set_dialog_subtitles(struct subtitle_list *subtitles)
{
dlg.subtitles = subtitles;
}
/* /*
* End using dialog functions. * End using dialog functions.
*/ */
@ -330,27 +376,19 @@ void print_title(WINDOW *dialog, const char *title, int width)
/* /*
* Print a string of text in a window, automatically wrap around to the * Print a string of text in a window, automatically wrap around to the
* next line if the string is too long to fit on one line. Newline * next line if the string is too long to fit on one line. Newline
* characters '\n' are replaced by spaces. We start on a new line * characters '\n' are propperly processed. We start on a new line
* if there is no room for at least 4 nonblanks following a double-space. * if there is no room for at least 4 nonblanks following a double-space.
*/ */
void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
{ {
int newl, cur_x, cur_y; int newl, cur_x, cur_y;
int i, prompt_len, room, wlen; int prompt_len, room, wlen;
char tempstr[MAX_LEN + 1], *word, *sp, *sp2; char tempstr[MAX_LEN + 1], *word, *sp, *sp2, *newline_separator = 0;
strcpy(tempstr, prompt); strcpy(tempstr, prompt);
prompt_len = strlen(tempstr); prompt_len = strlen(tempstr);
/*
* Remove newlines
*/
for (i = 0; i < prompt_len; i++) {
if (tempstr[i] == '\n')
tempstr[i] = ' ';
}
if (prompt_len <= width - x * 2) { /* If prompt is short */ if (prompt_len <= width - x * 2) { /* If prompt is short */
wmove(win, y, (width - prompt_len) / 2); wmove(win, y, (width - prompt_len) / 2);
waddstr(win, tempstr); waddstr(win, tempstr);
@ -360,7 +398,10 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
newl = 1; newl = 1;
word = tempstr; word = tempstr;
while (word && *word) { while (word && *word) {
sp = strchr(word, ' '); sp = strpbrk(word, "\n ");
if (sp && *sp == '\n')
newline_separator = sp;
if (sp) if (sp)
*sp++ = 0; *sp++ = 0;
@ -372,7 +413,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
if (wlen > room || if (wlen > room ||
(newl && wlen < 4 && sp (newl && wlen < 4 && sp
&& wlen + 1 + strlen(sp) > room && wlen + 1 + strlen(sp) > room
&& (!(sp2 = strchr(sp, ' ')) && (!(sp2 = strpbrk(sp, "\n "))
|| wlen + 1 + (sp2 - sp) > room))) { || wlen + 1 + (sp2 - sp) > room))) {
cur_y++; cur_y++;
cur_x = x; cur_x = x;
@ -380,7 +421,15 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
wmove(win, cur_y, cur_x); wmove(win, cur_y, cur_x);
waddstr(win, word); waddstr(win, word);
getyx(win, cur_y, cur_x); getyx(win, cur_y, cur_x);
cur_x++;
/* Move to the next line if the word separator was a newline */
if (newline_separator) {
cur_y++;
cur_x = x;
newline_separator = 0;
} else
cur_x++;
if (sp && *sp == ' ') { if (sp && *sp == ' ') {
cur_x++; /* double space */ cur_x++; /* double space */
while (*++sp == ' ') ; while (*++sp == ' ') ;

View File

@ -45,14 +45,14 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width)
WINDOW *dialog; WINDOW *dialog;
do_resize: do_resize:
if (getmaxy(stdscr) < (height + 4)) if (getmaxy(stdscr) < (height + YESNO_HEIGTH_MIN))
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
if (getmaxx(stdscr) < (width + 4)) if (getmaxx(stdscr) < (width + YESNO_WIDTH_MIN))
return -ERRDISPLAYTOOSMALL; return -ERRDISPLAYTOOSMALL;
/* center dialog box on screen */ /* center dialog box on screen */
x = (COLS - width) / 2; x = (getmaxx(stdscr) - width) / 2;
y = (LINES - height) / 2; y = (getmaxy(stdscr) - height) / 2;
draw_shadow(stdscr, y, x, height, width); draw_shadow(stdscr, y, x, height, width);

View File

@ -48,7 +48,7 @@ static const char mconf_readme[] = N_(
"----------\n" "----------\n"
"o Use the Up/Down arrow keys (cursor keys) to highlight the item\n" "o Use the Up/Down arrow keys (cursor keys) to highlight the item\n"
" you wish to change or submenu wish to select and press <Enter>.\n" " you wish to change or submenu wish to select and press <Enter>.\n"
" Submenus are designated by \"--->\".\n" " Submenus are designated by \"--->\", empty ones by \"----\".\n"
"\n" "\n"
" Shortcut: Press the option's highlighted letter (hotkey).\n" " Shortcut: Press the option's highlighted letter (hotkey).\n"
" Pressing a hotkey more than once will sequence\n" " Pressing a hotkey more than once will sequence\n"
@ -176,7 +176,7 @@ static const char mconf_readme[] = N_(
"\n"), "\n"),
menu_instructions[] = N_( menu_instructions[] = N_(
"Arrow keys navigate the menu. " "Arrow keys navigate the menu. "
"<Enter> selects submenus --->. " "<Enter> selects submenus ---> (or empty submenus ----). "
"Highlighted letters are hotkeys. " "Highlighted letters are hotkeys. "
"Pressing <Y> selectes a feature, while <N> will exclude a feature. " "Pressing <Y> selectes a feature, while <N> will exclude a feature. "
"Press <Esc><Esc> to exit, <?> for Help, </> for Search. " "Press <Esc><Esc> to exit, <?> for Help, </> for Search. "
@ -311,6 +311,50 @@ static void set_config_filename(const char *config_filename)
filename[sizeof(filename)-1] = '\0'; filename[sizeof(filename)-1] = '\0';
} }
struct subtitle_part {
struct list_head entries;
const char *text;
};
static LIST_HEAD(trail);
static struct subtitle_list *subtitles;
static void set_subtitle(void)
{
struct subtitle_part *sp;
struct subtitle_list *pos, *tmp;
for (pos = subtitles; pos != NULL; pos = tmp) {
tmp = pos->next;
free(pos);
}
subtitles = NULL;
list_for_each_entry(sp, &trail, entries) {
if (sp->text) {
if (pos) {
pos->next = xcalloc(sizeof(*pos), 1);
pos = pos->next;
} else {
subtitles = pos = xcalloc(sizeof(*pos), 1);
}
pos->text = sp->text;
}
}
set_dialog_subtitles(subtitles);
}
static void reset_subtitle(void)
{
struct subtitle_list *pos, *tmp;
for (pos = subtitles; pos != NULL; pos = tmp) {
tmp = pos->next;
free(pos);
}
subtitles = NULL;
set_dialog_subtitles(subtitles);
}
struct search_data { struct search_data {
struct list_head *head; struct list_head *head;
@ -353,10 +397,12 @@ static void search_conf(void)
char *dialog_input; char *dialog_input;
int dres, vscroll = 0, hscroll = 0; int dres, vscroll = 0, hscroll = 0;
bool again; bool again;
struct gstr sttext;
struct subtitle_part stpart;
title = str_new(); title = str_new();
str_printf( &title, _("Enter %s (sub)string to search for " str_printf( &title, _("Enter (sub)string or regexp to search for "
"(with or without \"%s\")"), CONFIG_, CONFIG_); "(with or without \"%s\")"), CONFIG_);
again: again:
dialog_clear(); dialog_clear();
@ -379,6 +425,11 @@ again:
if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
dialog_input += strlen(CONFIG_); dialog_input += strlen(CONFIG_);
sttext = str_new();
str_printf(&sttext, "Search (%s)", dialog_input_result);
stpart.text = str_get(&sttext);
list_add_tail(&stpart.entries, &trail);
sym_arr = sym_re_search(dialog_input); sym_arr = sym_re_search(dialog_input);
do { do {
LIST_HEAD(head); LIST_HEAD(head);
@ -389,8 +440,10 @@ again:
.targets = targets, .targets = targets,
.keys = keys, .keys = keys,
}; };
struct jump_key *pos, *tmp;
res = get_relations_str(sym_arr, &head); res = get_relations_str(sym_arr, &head);
set_subtitle();
dres = show_textbox_ext(_("Search Results"), (char *) dres = show_textbox_ext(_("Search Results"), (char *)
str_get(&res), 0, 0, keys, &vscroll, str_get(&res), 0, 0, keys, &vscroll,
&hscroll, &update_text, (void *) &hscroll, &update_text, (void *)
@ -402,9 +455,13 @@ again:
again = true; again = true;
} }
str_free(&res); str_free(&res);
list_for_each_entry_safe(pos, tmp, &head, entries)
free(pos);
} while (again); } while (again);
free(sym_arr); free(sym_arr);
str_free(&title); str_free(&title);
list_del(trail.prev);
str_free(&sttext);
} }
static void build_conf(struct menu *menu) static void build_conf(struct menu *menu)
@ -441,8 +498,9 @@ static void build_conf(struct menu *menu)
menu->data ? "-->" : "++>", menu->data ? "-->" : "++>",
indent + 1, ' ', prompt); indent + 1, ' ', prompt);
} else } else
item_make(" %*c%s --->", indent + 1, ' ', prompt); item_make(" %*c%s %s",
indent + 1, ' ', prompt,
menu_is_empty(menu) ? "----" : "--->");
item_set_tag('m'); item_set_tag('m');
item_set_data(menu); item_set_data(menu);
if (single_menu_mode && menu->data) if (single_menu_mode && menu->data)
@ -573,7 +631,7 @@ static void build_conf(struct menu *menu)
(sym_has_value(sym) || !sym_is_changable(sym)) ? (sym_has_value(sym) || !sym_is_changable(sym)) ?
"" : _(" (NEW)")); "" : _(" (NEW)"));
if (menu->prompt->type == P_MENU) { if (menu->prompt->type == P_MENU) {
item_add_str(" --->"); item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
return; return;
} }
} }
@ -589,27 +647,36 @@ static void conf(struct menu *menu, struct menu *active_menu)
{ {
struct menu *submenu; struct menu *submenu;
const char *prompt = menu_get_prompt(menu); const char *prompt = menu_get_prompt(menu);
struct subtitle_part stpart;
struct symbol *sym; struct symbol *sym;
int res; int res;
int s_scroll = 0; int s_scroll = 0;
if (menu != &rootmenu)
stpart.text = menu_get_prompt(menu);
else
stpart.text = NULL;
list_add_tail(&stpart.entries, &trail);
while (1) { while (1) {
item_reset(); item_reset();
current_menu = menu; current_menu = menu;
build_conf(menu); build_conf(menu);
if (!child_count) if (!child_count)
break; break;
set_subtitle();
dialog_clear(); dialog_clear();
res = dialog_menu(prompt ? _(prompt) : _("Main Menu"), res = dialog_menu(prompt ? _(prompt) : _("Main Menu"),
_(menu_instructions), _(menu_instructions),
active_menu, &s_scroll); active_menu, &s_scroll);
if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
break; break;
if (!item_activate_selected()) if (item_count() != 0) {
continue; if (!item_activate_selected())
if (!item_tag()) continue;
continue; if (!item_tag())
continue;
}
submenu = item_data(); submenu = item_data();
active_menu = item_data(); active_menu = item_data();
if (submenu) if (submenu)
@ -640,13 +707,17 @@ static void conf(struct menu *menu, struct menu *active_menu)
case 2: case 2:
if (sym) if (sym)
show_help(submenu); show_help(submenu);
else else {
reset_subtitle();
show_helptext(_("README"), _(mconf_readme)); show_helptext(_("README"), _(mconf_readme));
}
break; break;
case 3: case 3:
reset_subtitle();
conf_save(); conf_save();
break; break;
case 4: case 4:
reset_subtitle();
conf_load(); conf_load();
break; break;
case 5: case 5:
@ -679,6 +750,8 @@ static void conf(struct menu *menu, struct menu *active_menu)
break; break;
} }
} }
list_del(trail.prev);
} }
static int show_textbox_ext(const char *title, char *text, int r, int c, int static int show_textbox_ext(const char *title, char *text, int r, int c, int
@ -754,7 +827,9 @@ static void conf_choice(struct menu *menu)
dialog_clear(); dialog_clear();
res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"), res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"),
_(radiolist_instructions), _(radiolist_instructions),
15, 70, 6); MENUBOX_HEIGTH_MIN,
MENUBOX_WIDTH_MIN,
CHECKLIST_HEIGTH_MIN);
selected = item_activate_selected(); selected = item_activate_selected();
switch (res) { switch (res) {
case 0: case 0:
@ -881,11 +956,12 @@ static int handle_exit(void)
int res; int res;
save_and_exit = 1; save_and_exit = 1;
reset_subtitle();
dialog_clear(); dialog_clear();
if (conf_get_changed()) if (conf_get_changed())
res = dialog_yesno(NULL, res = dialog_yesno(NULL,
_("Do you wish to save your new configuration ?\n" _("Do you wish to save your new configuration?\n"
"<ESC><ESC> to continue."), "(Press <ESC><ESC> to continue kernel configuration.)"),
6, 60); 6, 60);
else else
res = -1; res = -1;

View File

@ -146,11 +146,24 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
struct menu *menu = current_entry; struct menu *menu = current_entry;
while ((menu = menu->parent) != NULL) { while ((menu = menu->parent) != NULL) {
struct expr *dup_expr;
if (!menu->visibility) if (!menu->visibility)
continue; continue;
/*
* Do not add a reference to the
* menu's visibility expression but
* use a copy of it. Otherwise the
* expression reduction functions
* will modify expressions that have
* multiple references which can
* cause unwanted side effects.
*/
dup_expr = expr_copy(menu->visibility);
prop->visible.expr prop->visible.expr
= expr_alloc_and(prop->visible.expr, = expr_alloc_and(prop->visible.expr,
menu->visibility); dup_expr);
} }
} }
@ -184,12 +197,15 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
void menu_add_option(int token, char *arg) void menu_add_option(int token, char *arg)
{ {
struct property *prop;
switch (token) { switch (token) {
case T_OPT_MODULES: case T_OPT_MODULES:
prop = prop_alloc(P_DEFAULT, modules_sym); if (modules_sym)
prop->expr = expr_alloc_symbol(current_entry->sym); zconf_error("symbol '%s' redefines option 'modules'"
" already defined by symbol '%s'",
current_entry->sym->name,
modules_sym->name
);
modules_sym = current_entry->sym;
break; break;
case T_OPT_DEFCONFIG_LIST: case T_OPT_DEFCONFIG_LIST:
if (!sym_defconfig_list) if (!sym_defconfig_list)
@ -430,6 +446,22 @@ bool menu_has_prompt(struct menu *menu)
return true; return true;
} }
/*
* Determine if a menu is empty.
* A menu is considered empty if it contains no or only
* invisible entries.
*/
bool menu_is_empty(struct menu *menu)
{
struct menu *child;
for (child = menu->list; child; child = child->next) {
if (menu_is_visible(child))
return(false);
}
return(true);
}
bool menu_is_visible(struct menu *menu) bool menu_is_visible(struct menu *menu)
{ {
struct menu *child; struct menu *child;
@ -515,13 +547,6 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
struct jump_key *jump; struct jump_key *jump;
str_printf(r, _("Prompt: %s\n"), _(prop->text)); str_printf(r, _("Prompt: %s\n"), _(prop->text));
str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
prop->menu->lineno);
if (!expr_is_yes(prop->visible.expr)) {
str_append(r, _(" Depends on: "));
expr_gstr_print(prop->visible.expr, r);
str_append(r, "\n");
}
menu = prop->menu->parent; menu = prop->menu->parent;
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) { for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
bool accessible = menu_is_visible(menu); bool accessible = menu_is_visible(menu);
@ -571,6 +596,18 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
} }
} }
/*
* get peoperty of type P_SYMBOL
*/
static struct property *get_symbol_prop(struct symbol *sym)
{
struct property *prop = NULL;
for_all_properties(sym, prop, P_SYMBOL)
break;
return prop;
}
/* /*
* head is optional and may be NULL * head is optional and may be NULL
*/ */
@ -595,6 +632,18 @@ void get_symbol_str(struct gstr *r, struct symbol *sym,
} }
for_all_prompts(sym, prop) for_all_prompts(sym, prop)
get_prompt_str(r, prop, head); get_prompt_str(r, prop, head);
prop = get_symbol_prop(sym);
if (prop) {
str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
prop->menu->lineno);
if (!expr_is_yes(prop->visible.expr)) {
str_append(r, _(" Depends on: "));
expr_gstr_print(prop->visible.expr, r);
str_append(r, "\n");
}
}
hit = false; hit = false;
for_all_properties(sym, prop, P_SELECT) { for_all_properties(sym, prop, P_SELECT) {
if (!hit) { if (!hit) {

View File

@ -120,10 +120,18 @@ if [ "$MAKE" = "false" ]; then
exit exit
fi fi
# If we have an output dir, setup the O= argument, otherwise leave
# it blank, since O=. will create an unnecessary ./source softlink
OUTPUT_ARG=""
if [ "$OUTPUT" != "." ] ; then
OUTPUT_ARG="O=$OUTPUT"
fi
# Use the merged file as the starting point for: # Use the merged file as the starting point for:
# alldefconfig: Fills in any missing symbols with Kconfig default # alldefconfig: Fills in any missing symbols with Kconfig default
# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
make KCONFIG_ALLCONFIG=$TMP_FILE O=$OUTPUT $ALLTARGET make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
# Check all specified config values took (might have missed-dependency issues) # Check all specified config values took (might have missed-dependency issues)

View File

@ -45,8 +45,8 @@ static const char nconf_global_help[] = N_(
"<n> to remove it. You may press the <Space> key to cycle through the\n" "<n> to remove it. You may press the <Space> key to cycle through the\n"
"available options.\n" "available options.\n"
"\n" "\n"
"A trailing \"--->\" designates a submenu.\n" "A trailing \"--->\" designates a submenu, a trailing \"----\" an\n"
"\n" "empty submenu.\n"
"\n" "\n"
"Menu navigation keys\n" "Menu navigation keys\n"
"----------------------------------------------------------------------\n" "----------------------------------------------------------------------\n"
@ -131,7 +131,7 @@ static const char nconf_global_help[] = N_(
"\n"), "\n"),
menu_no_f_instructions[] = N_( menu_no_f_instructions[] = N_(
"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
"Submenus are designated by a trailing \"--->\".\n" "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
"\n" "\n"
"Use the following keys to navigate the menus:\n" "Use the following keys to navigate the menus:\n"
"Move up or down with <Up> and <Down>.\n" "Move up or down with <Up> and <Down>.\n"
@ -148,7 +148,7 @@ menu_no_f_instructions[] = N_(
"For help related to the current menu entry press <?> or <h>.\n"), "For help related to the current menu entry press <?> or <h>.\n"),
menu_instructions[] = N_( menu_instructions[] = N_(
"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
"Submenus are designated by a trailing \"--->\".\n" "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
"\n" "\n"
"Use the following keys to navigate the menus:\n" "Use the following keys to navigate the menus:\n"
"Move up or down with <Up> or <Down>.\n" "Move up or down with <Up> or <Down>.\n"
@ -365,15 +365,16 @@ static void print_function_line(void)
int i; int i;
int offset = 1; int offset = 1;
const int skip = 1; const int skip = 1;
int lines = getmaxy(stdscr);
for (i = 0; i < function_keys_num; i++) { for (i = 0; i < function_keys_num; i++) {
(void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); (void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]);
mvwprintw(main_window, LINES-3, offset, mvwprintw(main_window, lines-3, offset,
"%s", "%s",
function_keys[i].key_str); function_keys[i].key_str);
(void) wattrset(main_window, attributes[FUNCTION_TEXT]); (void) wattrset(main_window, attributes[FUNCTION_TEXT]);
offset += strlen(function_keys[i].key_str); offset += strlen(function_keys[i].key_str);
mvwprintw(main_window, LINES-3, mvwprintw(main_window, lines-3,
offset, "%s", offset, "%s",
function_keys[i].func); function_keys[i].func);
offset += strlen(function_keys[i].func) + skip; offset += strlen(function_keys[i].func) + skip;
@ -694,8 +695,8 @@ static void search_conf(void)
int dres; int dres;
title = str_new(); title = str_new();
str_printf( &title, _("Enter %s (sub)string to search for " str_printf( &title, _("Enter (sub)string or regexp to search for "
"(with or without \"%s\")"), CONFIG_, CONFIG_); "(with or without \"%s\")"), CONFIG_);
again: again:
dres = dialog_inputbox(main_window, dres = dialog_inputbox(main_window,
@ -759,9 +760,9 @@ static void build_conf(struct menu *menu)
indent + 1, ' ', prompt); indent + 1, ' ', prompt);
} else } else
item_make(menu, 'm', item_make(menu, 'm',
" %*c%s --->", " %*c%s %s",
indent + 1, indent + 1, ' ', prompt,
' ', prompt); menu_is_empty(menu) ? "----" : "--->");
if (single_menu_mode && menu->data) if (single_menu_mode && menu->data)
goto conf_childs; goto conf_childs;
@ -903,7 +904,7 @@ static void build_conf(struct menu *menu)
(sym_has_value(sym) || !sym_is_changable(sym)) ? (sym_has_value(sym) || !sym_is_changable(sym)) ?
"" : _(" (NEW)")); "" : _(" (NEW)"));
if (menu->prompt && menu->prompt->type == P_MENU) { if (menu->prompt && menu->prompt->type == P_MENU) {
item_add_str(" --->"); item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
return; return;
} }
} }
@ -954,7 +955,7 @@ static void show_menu(const char *prompt, const char *instructions,
clear(); clear();
(void) wattrset(main_window, attributes[NORMAL]); (void) wattrset(main_window, attributes[NORMAL]);
print_in_middle(stdscr, 1, 0, COLS, print_in_middle(stdscr, 1, 0, getmaxx(stdscr),
menu_backtitle, menu_backtitle,
attributes[MAIN_HEADING]); attributes[MAIN_HEADING]);
@ -1455,14 +1456,18 @@ static void conf_save(void)
void setup_windows(void) void setup_windows(void)
{ {
int lines, columns;
getmaxyx(stdscr, lines, columns);
if (main_window != NULL) if (main_window != NULL)
delwin(main_window); delwin(main_window);
/* set up the menu and menu window */ /* set up the menu and menu window */
main_window = newwin(LINES-2, COLS-2, 2, 1); main_window = newwin(lines-2, columns-2, 2, 1);
keypad(main_window, TRUE); keypad(main_window, TRUE);
mwin_max_lines = LINES-7; mwin_max_lines = lines-7;
mwin_max_cols = COLS-6; mwin_max_cols = columns-6;
/* panels order is from bottom to top */ /* panels order is from bottom to top */
new_panel(main_window); new_panel(main_window);
@ -1470,6 +1475,7 @@ void setup_windows(void)
int main(int ac, char **av) int main(int ac, char **av)
{ {
int lines, columns;
char *mode; char *mode;
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
@ -1495,7 +1501,8 @@ int main(int ac, char **av)
keypad(stdscr, TRUE); keypad(stdscr, TRUE);
curs_set(0); curs_set(0);
if (COLS < 75 || LINES < 20) { getmaxyx(stdscr, lines, columns);
if (columns < 75 || lines < 20) {
endwin(); endwin();
printf("Your terminal should have at " printf("Your terminal should have at "
"least 20 lines and 75 columns\n"); "least 20 lines and 75 columns\n");

View File

@ -276,8 +276,8 @@ int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...)
total_width = max(msg_width, btns_width); total_width = max(msg_width, btns_width);
/* place dialog in middle of screen */ /* place dialog in middle of screen */
y = (LINES-(msg_lines+4))/2; y = (getmaxy(stdscr)-(msg_lines+4))/2;
x = (COLS-(total_width+4))/2; x = (getmaxx(stdscr)-(total_width+4))/2;
/* create the windows */ /* create the windows */
@ -387,8 +387,8 @@ int dialog_inputbox(WINDOW *main_window,
prompt_width = max(prompt_width, strlen(title)); prompt_width = max(prompt_width, strlen(title));
/* place dialog in middle of screen */ /* place dialog in middle of screen */
y = (LINES-(prompt_lines+4))/2; y = (getmaxy(stdscr)-(prompt_lines+4))/2;
x = (COLS-(prompt_width+4))/2; x = (getmaxx(stdscr)-(prompt_width+4))/2;
strncpy(result, init, *result_len); strncpy(result, init, *result_len);
@ -545,7 +545,7 @@ void show_scroll_win(WINDOW *main_window,
{ {
int res; int res;
int total_lines = get_line_no(text); int total_lines = get_line_no(text);
int x, y; int x, y, lines, columns;
int start_x = 0, start_y = 0; int start_x = 0, start_y = 0;
int text_lines = 0, text_cols = 0; int text_lines = 0, text_cols = 0;
int total_cols = 0; int total_cols = 0;
@ -556,6 +556,8 @@ void show_scroll_win(WINDOW *main_window,
WINDOW *pad; WINDOW *pad;
PANEL *panel; PANEL *panel;
getmaxyx(stdscr, lines, columns);
/* find the widest line of msg: */ /* find the widest line of msg: */
total_lines = get_line_no(text); total_lines = get_line_no(text);
for (i = 0; i < total_lines; i++) { for (i = 0; i < total_lines; i++) {
@ -569,14 +571,14 @@ void show_scroll_win(WINDOW *main_window,
(void) wattrset(pad, attributes[SCROLLWIN_TEXT]); (void) wattrset(pad, attributes[SCROLLWIN_TEXT]);
fill_window(pad, text); fill_window(pad, text);
win_lines = min(total_lines+4, LINES-2); win_lines = min(total_lines+4, lines-2);
win_cols = min(total_cols+2, COLS-2); win_cols = min(total_cols+2, columns-2);
text_lines = max(win_lines-4, 0); text_lines = max(win_lines-4, 0);
text_cols = max(win_cols-2, 0); text_cols = max(win_cols-2, 0);
/* place window in middle of screen */ /* place window in middle of screen */
y = (LINES-win_lines)/2; y = (lines-win_lines)/2;
x = (COLS-win_cols)/2; x = (columns-win_cols)/2;
win = newwin(win_lines, win_cols, y, x); win = newwin(win_lines, win_cols, y, x);
keypad(win, TRUE); keypad(win, TRUE);

View File

@ -25,7 +25,7 @@ Index: b/mconf.c
+++ b/mconf.c +++ b/mconf.c
@@ -178,9 +178,9 @@ @@ -178,9 +178,9 @@
"Arrow keys navigate the menu. " "Arrow keys navigate the menu. "
"<Enter> selects submenus --->. " "<Enter> selects submenus ---> (or empty submenus ----). "
"Highlighted letters are hotkeys. " "Highlighted letters are hotkeys. "
- "Pressing <Y> includes, <N> excludes, <M> modularizes features. " - "Pressing <Y> includes, <N> excludes, <M> modularizes features. "
+ "Pressing <Y> selectes a feature, while <N> will exclude a feature. " + "Pressing <Y> selectes a feature, while <N> will exclude a feature. "
@ -39,10 +39,10 @@ Index: b/zconf.tab.c_shipped
=================================================================== ===================================================================
--- a/zconf.tab.c_shipped --- a/zconf.tab.c_shipped
+++ b/zconf.tab.c_shipped +++ b/zconf.tab.c_shipped
@@ -2259,7 +2259,7 @@ @@ -2297,7 +2297,7 @@
modules_sym = sym_lookup(NULL, 0);
modules_sym->type = S_BOOLEAN; sym_init();
modules_sym->flags |= SYMBOL_AUTO; _menu_init();
- rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
+ rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL);
@ -52,10 +52,10 @@ Index: b/zconf.y
=================================================================== ===================================================================
--- a/zconf.y --- a/zconf.y
+++ b/zconf.y +++ b/zconf.y
@@ -496,7 +496,7 @@ @@ -493,7 +493,7 @@
modules_sym = sym_lookup(NULL, 0);
modules_sym->type = S_BOOLEAN; sym_init();
modules_sym->flags |= SYMBOL_AUTO; _menu_init();
- rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
+ rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL);
@ -65,7 +65,7 @@ Index: b/confdata.c
=================================================================== ===================================================================
--- a/confdata.c --- a/confdata.c
+++ b/confdata.c +++ b/confdata.c
@@ -25,7 +26,7 @@ @@ -25,7 +25,7 @@
static const char *conf_filename; static const char *conf_filename;
static int conf_lineno, conf_warnings, conf_unsaved; static int conf_lineno, conf_warnings, conf_unsaved;
@ -74,7 +74,7 @@ Index: b/confdata.c
static void conf_warning(const char *fmt, ...) static void conf_warning(const char *fmt, ...)
{ {
@@ -63,7 +64,7 @@ @@ -63,7 +63,7 @@
const char *conf_get_configname(void) const char *conf_get_configname(void)
{ {

View File

@ -1,178 +0,0 @@
---
expr.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
Index: b/expr.c
===================================================================
--- a/expr.c
+++ b/expr.c
@@ -326,7 +326,7 @@
e->right.expr = expr_trans_bool(e->right.expr);
break;
case E_UNEQUAL:
- // FOO!=n -> FOO
+ /* FOO!=n -> FOO */
if (e->left.sym->type == S_TRISTATE) {
if (e->right.sym == &symbol_no) {
e->type = E_SYMBOL;
@@ -375,19 +375,19 @@
if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
(e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
- // (a='y') || (a='m') -> (a!='n')
+ /* (a='y') || (a='m') -> (a!='n') */
return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
}
if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
- // (a='y') || (a='n') -> (a!='m')
+ /* (a='y') || (a='n') -> (a!='m') */
return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
}
if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
- // (a='m') || (a='n') -> (a!='y')
+ /* (a='m') || (a='n') -> (a!='y') */
return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
}
}
@@ -438,29 +438,29 @@
if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
(e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
- // (a) && (a='y') -> (a='y')
+ /* (a) && (a='y') -> (a='y') */
return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
(e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
- // (a) && (a!='n') -> (a)
+ /* (a) && (a!='n') -> (a) */
return expr_alloc_symbol(sym1);
if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
(e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
- // (a) && (a!='m') -> (a='y')
+ /* (a) && (a!='m') -> (a='y') */
return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
if (sym1->type == S_TRISTATE) {
if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
- // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+ /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
sym2 = e1->right.sym;
if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
: expr_alloc_symbol(&symbol_no);
}
if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
- // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+ /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
sym2 = e2->right.sym;
if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
@@ -469,19 +469,19 @@
if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
- // (a!='y') && (a!='n') -> (a='m')
+ /* (a!='y') && (a!='n') -> (a='m') */
return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
(e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
- // (a!='y') && (a!='m') -> (a='n')
+ /* (a!='y') && (a!='m') -> (a='n') */
return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
(e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
- // (a!='m') && (a!='n') -> (a='m')
+ /* (a!='m') && (a!='n') -> (a='m') */
return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
@@ -574,7 +574,7 @@
switch (e1->type) {
case E_OR:
expr_eliminate_dups2(e1->type, &e1, &e1);
- // (FOO || BAR) && (!FOO && !BAR) -> n
+ /* (FOO || BAR) && (!FOO && !BAR) -> n */
tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
tmp2 = expr_copy(e2);
tmp = expr_extract_eq_and(&tmp1, &tmp2);
@@ -589,7 +589,7 @@
break;
case E_AND:
expr_eliminate_dups2(e1->type, &e1, &e1);
- // (FOO && BAR) || (!FOO || !BAR) -> y
+ /* (FOO && BAR) || (!FOO || !BAR) -> y */
tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
tmp2 = expr_copy(e2);
tmp = expr_extract_eq_or(&tmp1, &tmp2);
@@ -698,7 +698,7 @@
case E_NOT:
switch (e->left.expr->type) {
case E_NOT:
- // !!a -> a
+ /* !!a -> a */
tmp = e->left.expr->left.expr;
free(e->left.expr);
free(e);
@@ -707,14 +707,14 @@
break;
case E_EQUAL:
case E_UNEQUAL:
- // !a='x' -> a!='x'
+ /* !a='x' -> a!='x' */
tmp = e->left.expr;
free(e);
e = tmp;
e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
break;
case E_OR:
- // !(a || b) -> !a && !b
+ /* !(a || b) -> !a && !b */
tmp = e->left.expr;
e->type = E_AND;
e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@@ -723,7 +723,7 @@
e = expr_transform(e);
break;
case E_AND:
- // !(a && b) -> !a || !b
+ /* !(a && b) -> !a || !b */
tmp = e->left.expr;
e->type = E_OR;
e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@@ -733,7 +733,7 @@
break;
case E_SYMBOL:
if (e->left.expr->left.sym == &symbol_yes) {
- // !'y' -> 'n'
+ /* !'y' -> 'n' */
tmp = e->left.expr;
free(e);
e = tmp;
@@ -742,7 +742,7 @@
break;
}
if (e->left.expr->left.sym == &symbol_mod) {
- // !'m' -> 'm'
+ /* !'m' -> 'm' */
tmp = e->left.expr;
free(e);
e = tmp;
@@ -751,7 +751,7 @@
break;
}
if (e->left.expr->left.sym == &symbol_no) {
- // !'n' -> 'y'
+ /* !'n' -> 'y' */
tmp = e->left.expr;
free(e);
e = tmp;

View File

@ -1,44 +0,0 @@
---
confdata.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
Index: b/confdata.c
===================================================================
--- a/confdata.c
+++ b/confdata.c
@@ -1106,7 +1106,16 @@
void conf_set_all_new_symbols(enum conf_def_mode mode)
{
struct symbol *sym, *csym;
- int i, cnt;
+ int i, cnt, prob = 50;
+
+ if (mode == def_random) {
+ char *endp, *env = getenv("KCONFIG_PROBABILITY");
+ if (env && *env) {
+ int tmp = (int)strtol(env, &endp, 10);
+ if (*endp == '\0' && tmp >= 0 && tmp <= 100)
+ prob = tmp;
+ }
+ }
for_all_symbols(i, sym) {
if (sym_has_value(sym))
@@ -1125,8 +1134,15 @@
sym->def[S_DEF_USER].tri = no;
break;
case def_random:
- cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
- sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
+ cnt = (rand() % 100) - (100 - prob);
+ if (cnt < 0)
+ sym->def[S_DEF_USER].tri = no;
+ else
+ if ((sym_get_type(sym) == S_TRISTATE)
+ && (cnt > prob/2))
+ sym->def[S_DEF_USER].tri = mod;
+ else
+ sym->def[S_DEF_USER].tri = yes;
break;
default:
continue;

View File

@ -6,7 +6,7 @@ Index: b/lxdialog/check-lxdialog.sh
=================================================================== ===================================================================
--- a/lxdialog/check-lxdialog.sh --- a/lxdialog/check-lxdialog.sh
+++ b/lxdialog/check-lxdialog.sh +++ b/lxdialog/check-lxdialog.sh
@@ -34,7 +34,7 @@ @@ -36,7 +36,7 @@
} }
# Temp file, try to clean up after us # Temp file, try to clean up after us

View File

@ -8,7 +8,7 @@ Index: b/conf.c
=================================================================== ===================================================================
--- a/conf.c --- a/conf.c
+++ b/conf.c +++ b/conf.c
@@ -547,7 +547,6 @@ @@ -558,7 +558,6 @@
} }
name = av[optind]; name = av[optind];
conf_parse(name); conf_parse(name);
@ -39,7 +39,7 @@ Index: b/confdata.c
} }
static char *conf_expand_value(const char *in) static char *conf_expand_value(const char *in)
@@ -737,6 +736,9 @@ @@ -742,6 +741,9 @@
char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
char *env; char *env;
@ -49,7 +49,7 @@ Index: b/confdata.c
dirname[0] = 0; dirname[0] = 0;
if (name && name[0]) { if (name && name[0]) {
struct stat st; struct stat st;
@@ -831,6 +833,7 @@ @@ -836,6 +838,7 @@
{ {
const char *name; const char *name;
char path[PATH_MAX+1]; char path[PATH_MAX+1];
@ -57,7 +57,7 @@ Index: b/confdata.c
char *s, *d, c; char *s, *d, c;
struct symbol *sym; struct symbol *sym;
struct stat sb; struct stat sb;
@@ -839,8 +842,20 @@ @@ -844,8 +847,20 @@
name = conf_get_autoconfig_name(); name = conf_get_autoconfig_name();
conf_read_simple(name, S_DEF_AUTO); conf_read_simple(name, S_DEF_AUTO);
@ -80,7 +80,7 @@ Index: b/confdata.c
res = 0; res = 0;
for_all_symbols(i, sym) { for_all_symbols(i, sym) {
@@ -933,9 +948,11 @@ @@ -938,9 +953,11 @@
close(fd); close(fd);
} }
out: out:
@ -95,7 +95,7 @@ Index: b/confdata.c
return res; return res;
} }
@@ -945,25 +962,38 @@ @@ -950,25 +967,38 @@
const char *name; const char *name;
FILE *out, *tristate, *out_h; FILE *out, *tristate, *out_h;
int i; int i;
@ -138,7 +138,7 @@ Index: b/confdata.c
if (!out_h) { if (!out_h) {
fclose(out); fclose(out);
fclose(tristate); fclose(tristate);
@@ -995,19 +1025,22 @@ @@ -1000,19 +1030,22 @@
name = getenv("KCONFIG_AUTOHEADER"); name = getenv("KCONFIG_AUTOHEADER");
if (!name) if (!name)
name = "include/generated/autoconf.h"; name = "include/generated/autoconf.h";

View File

@ -9,7 +9,7 @@ Index: b/Makefile
=================================================================== ===================================================================
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -307,11 +307,8 @@ @@ -309,11 +309,8 @@
$(obj)/qconf.o: $(obj)/qconf.moc $(obj)/qconf.o: $(obj)/qconf.moc

View File

@ -0,0 +1,41 @@
commit 6faa447282fe90d42e0513af46c13f20b4b327d4
Author: Yann E. MORIN <yann.morin.1998@free.fr>
Date: Wed Nov 13 22:45:02 2013 +0100
support/kconfig: fix 'space' to (de)select options
In case a menu has comment without letters/numbers (eg. characters
matching the regexp '^[^[:alpha:][:digit:]]+$', for example - or *),
hitting space will cycle through those comments, rather than
selecting/deselecting the currently-highlighted option.
This is the behaviour of hitting any letter/digit: jump to the next
option which prompt starts with that letter. The only letters that
do not behave as such are 'y' 'm' and 'n'. Prompts that start with
one of those three letters are instead matched on the first letter
that is not 'y', 'm' or 'n'.
Fix that by treating 'space' as we treat y/m/n, ie. as an action key,
not as shortcut to jump to prompt.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Samuel Martin <s.martin49@gmail.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
---
Note: I'll be running this upstream soonish.
diff --git a/support/kconfig/lxdialog/menubox.c b/support/kconfig/lxdialog/menubox.c
index 48d382e..6fc7e78 100644
--- a/lxdialog/menubox.c
+++ b/lxdialog/menubox.c
@@ -285,7 +285,7 @@ do_resize:
if (key < 256 && isalpha(key))
key = tolower(key);
- if (strchr("ynmh", key))
+ if (strchr("ynmh ", key))
i = max_choice;
else {
for (i = choice + 1; i < max_choice; i++) {

View File

@ -1,9 +1,8 @@
01-kconfig-kernel-to-buildroot.patch 01-kconfig-kernel-to-buildroot.patch
02-cpp-comments-to-c-comments.patch
06-br-build-system-integration.patch 06-br-build-system-integration.patch
09-implement-kconfig-probability.patch
10-br-build-system.patch 10-br-build-system.patch
11-use-mktemp-for-lxdialog.patch 11-use-mktemp-for-lxdialog.patch
12-fix-glade-file-path.patch 12-fix-glade-file-path.patch
14-support-out-of-tree-config.patch 14-support-out-of-tree-config.patch
15-fix-qconf-moc-rule.patch 15-fix-qconf-moc-rule.patch
16-fix-space-to-de-select-options.patch

View File

@ -156,7 +156,6 @@ sub read_kconfig {
my $state = "NONE"; my $state = "NONE";
my $config; my $config;
my @kconfigs;
my $cont = 0; my $cont = 0;
my $line; my $line;
@ -190,7 +189,13 @@ sub read_kconfig {
# collect any Kconfig sources # collect any Kconfig sources
if (/^source\s*"(.*)"/) { if (/^source\s*"(.*)"/) {
$kconfigs[$#kconfigs+1] = $1; my $kconfig = $1;
# prevent reading twice.
if (!defined($read_kconfigs{$kconfig})) {
$read_kconfigs{$kconfig} = 1;
read_kconfig($kconfig);
}
next;
} }
# configs found # configs found
@ -250,14 +255,6 @@ sub read_kconfig {
} }
} }
close($kinfile); close($kinfile);
# read in any configs that were found.
foreach my $kconfig (@kconfigs) {
if (!defined($read_kconfigs{$kconfig})) {
$read_kconfigs{$kconfig} = 1;
read_kconfig($kconfig);
}
}
} }
if ($kconfig) { if ($kconfig) {
@ -396,6 +393,15 @@ foreach my $module (keys(%modules)) {
foreach my $conf (@arr) { foreach my $conf (@arr) {
$configs{$conf} = $module; $configs{$conf} = $module;
dprint "$conf added by direct ($module)\n"; dprint "$conf added by direct ($module)\n";
if ($debugprint) {
my $c=$conf;
$c =~ s/^CONFIG_//;
if (defined($depends{$c})) {
dprint " deps = $depends{$c}\n";
} else {
dprint " no deps\n";
}
}
} }
} else { } else {
# Most likely, someone has a custom (binary?) module loaded. # Most likely, someone has a custom (binary?) module loaded.

View File

@ -136,7 +136,7 @@ static struct property *sym_get_range_prop(struct symbol *sym)
return NULL; return NULL;
} }
static int sym_get_range_val(struct symbol *sym, int base) static long long sym_get_range_val(struct symbol *sym, int base)
{ {
sym_calc_value(sym); sym_calc_value(sym);
switch (sym->type) { switch (sym->type) {
@ -149,13 +149,14 @@ static int sym_get_range_val(struct symbol *sym, int base)
default: default:
break; break;
} }
return strtol(sym->curr.val, NULL, base); return strtoll(sym->curr.val, NULL, base);
} }
static void sym_validate_range(struct symbol *sym) static void sym_validate_range(struct symbol *sym)
{ {
struct property *prop; struct property *prop;
int base, val, val2; int base;
long long val, val2;
char str[64]; char str[64];
switch (sym->type) { switch (sym->type) {
@ -171,7 +172,7 @@ static void sym_validate_range(struct symbol *sym)
prop = sym_get_range_prop(sym); prop = sym_get_range_prop(sym);
if (!prop) if (!prop)
return; return;
val = strtol(sym->curr.val, NULL, base); val = strtoll(sym->curr.val, NULL, base);
val2 = sym_get_range_val(prop->expr->left.sym, base); val2 = sym_get_range_val(prop->expr->left.sym, base);
if (val >= val2) { if (val >= val2) {
val2 = sym_get_range_val(prop->expr->right.sym, base); val2 = sym_get_range_val(prop->expr->right.sym, base);
@ -179,9 +180,9 @@ static void sym_validate_range(struct symbol *sym)
return; return;
} }
if (sym->type == S_INT) if (sym->type == S_INT)
sprintf(str, "%d", val2); sprintf(str, "%lld", val2);
else else
sprintf(str, "0x%x", val2); sprintf(str, "0x%llx", val2);
sym->curr.val = strdup(str); sym->curr.val = strdup(str);
} }
@ -300,6 +301,14 @@ void sym_calc_value(struct symbol *sym)
if (sym->flags & SYMBOL_VALID) if (sym->flags & SYMBOL_VALID)
return; return;
if (sym_is_choice_value(sym) &&
sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES) {
sym->flags &= ~SYMBOL_NEED_SET_CHOICE_VALUES;
prop = sym_get_choice_prop(sym);
sym_calc_value(prop_get_symbol(prop));
}
sym->flags |= SYMBOL_VALID; sym->flags |= SYMBOL_VALID;
oldval = sym->curr; oldval = sym->curr;
@ -425,6 +434,9 @@ void sym_calc_value(struct symbol *sym)
if (sym->flags & SYMBOL_AUTO) if (sym->flags & SYMBOL_AUTO)
sym->flags &= ~SYMBOL_WRITE; sym->flags &= ~SYMBOL_WRITE;
if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)
set_all_choice_values(sym);
} }
void sym_clear_all_valid(void) void sym_clear_all_valid(void)
@ -583,7 +595,7 @@ bool sym_string_valid(struct symbol *sym, const char *str)
bool sym_string_within_range(struct symbol *sym, const char *str) bool sym_string_within_range(struct symbol *sym, const char *str)
{ {
struct property *prop; struct property *prop;
int val; long long val;
switch (sym->type) { switch (sym->type) {
case S_STRING: case S_STRING:
@ -594,7 +606,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str)
prop = sym_get_range_prop(sym); prop = sym_get_range_prop(sym);
if (!prop) if (!prop)
return true; return true;
val = strtol(str, NULL, 10); val = strtoll(str, NULL, 10);
return val >= sym_get_range_val(prop->expr->left.sym, 10) && return val >= sym_get_range_val(prop->expr->left.sym, 10) &&
val <= sym_get_range_val(prop->expr->right.sym, 10); val <= sym_get_range_val(prop->expr->right.sym, 10);
case S_HEX: case S_HEX:
@ -603,7 +615,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str)
prop = sym_get_range_prop(sym); prop = sym_get_range_prop(sym);
if (!prop) if (!prop)
return true; return true;
val = strtol(str, NULL, 16); val = strtoll(str, NULL, 16);
return val >= sym_get_range_val(prop->expr->left.sym, 16) && return val >= sym_get_range_val(prop->expr->left.sym, 16) &&
val <= sym_get_range_val(prop->expr->right.sym, 16); val <= sym_get_range_val(prop->expr->right.sym, 16);
case S_BOOLEAN: case S_BOOLEAN:
@ -943,38 +955,89 @@ const char *sym_escape_string_value(const char *in)
return res; return res;
} }
struct sym_match {
struct symbol *sym;
off_t so, eo;
};
/* Compare matched symbols as thus:
* - first, symbols that match exactly
* - then, alphabetical sort
*/
static int sym_rel_comp(const void *sym1, const void *sym2)
{
const struct sym_match *s1 = sym1;
const struct sym_match *s2 = sym2;
int exact1, exact2;
/* Exact match:
* - if matched length on symbol s1 is the length of that symbol,
* then this symbol should come first;
* - if matched length on symbol s2 is the length of that symbol,
* then this symbol should come first.
* Note: since the search can be a regexp, both symbols may match
* exactly; if this is the case, we can't decide which comes first,
* and we fallback to sorting alphabetically.
*/
exact1 = (s1->eo - s1->so) == strlen(s1->sym->name);
exact2 = (s2->eo - s2->so) == strlen(s2->sym->name);
if (exact1 && !exact2)
return -1;
if (!exact1 && exact2)
return 1;
/* As a fallback, sort symbols alphabetically */
return strcmp(s1->sym->name, s2->sym->name);
}
struct symbol **sym_re_search(const char *pattern) struct symbol **sym_re_search(const char *pattern)
{ {
struct symbol *sym, **sym_arr = NULL; struct symbol *sym, **sym_arr = NULL;
struct sym_match *sym_match_arr = NULL;
int i, cnt, size; int i, cnt, size;
regex_t re; regex_t re;
regmatch_t match[1];
cnt = size = 0; cnt = size = 0;
/* Skip if empty */ /* Skip if empty */
if (strlen(pattern) == 0) if (strlen(pattern) == 0)
return NULL; return NULL;
if (regcomp(&re, pattern, REG_EXTENDED|REG_NOSUB|REG_ICASE)) if (regcomp(&re, pattern, REG_EXTENDED|REG_ICASE))
return NULL; return NULL;
for_all_symbols(i, sym) { for_all_symbols(i, sym) {
if (sym->flags & SYMBOL_CONST || !sym->name) if (sym->flags & SYMBOL_CONST || !sym->name)
continue; continue;
if (regexec(&re, sym->name, 0, NULL, 0)) if (regexec(&re, sym->name, 1, match, 0))
continue; continue;
if (cnt + 1 >= size) { if (cnt >= size) {
void *tmp = sym_arr; void *tmp;
size += 16; size += 16;
sym_arr = realloc(sym_arr, size * sizeof(struct symbol *)); tmp = realloc(sym_match_arr, size * sizeof(struct sym_match));
if (!sym_arr) { if (!tmp)
free(tmp); goto sym_re_search_free;
return NULL; sym_match_arr = tmp;
}
} }
sym_calc_value(sym); sym_calc_value(sym);
sym_arr[cnt++] = sym; /* As regexec returned 0, we know we have a match, so
* we can use match[0].rm_[se]o without further checks
*/
sym_match_arr[cnt].so = match[0].rm_so;
sym_match_arr[cnt].eo = match[0].rm_eo;
sym_match_arr[cnt++].sym = sym;
} }
if (sym_arr) if (sym_match_arr) {
qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp);
sym_arr = malloc((cnt+1) * sizeof(struct symbol));
if (!sym_arr)
goto sym_re_search_free;
for (i = 0; i < cnt; i++)
sym_arr[i] = sym_match_arr[i].sym;
sym_arr[cnt] = NULL; sym_arr[cnt] = NULL;
}
sym_re_search_free:
/* sym_match_arr can be NULL if no match, but free(NULL) is OK */
free(sym_match_arr);
regfree(&re); regfree(&re);
return sym_arr; return sym_arr;

File diff suppressed because it is too large Load Diff

View File

@ -493,9 +493,6 @@ void conf_parse(const char *name)
sym_init(); sym_init();
_menu_init(); _menu_init();
modules_sym = sym_lookup(NULL, 0);
modules_sym->type = S_BOOLEAN;
modules_sym->flags |= SYMBOL_AUTO;
rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL); rootmenu.prompt = menu_add_prompt(P_MENU, "Buildroot Configuration", NULL);
if (getenv("ZCONF_DEBUG")) if (getenv("ZCONF_DEBUG"))
@ -503,12 +500,8 @@ void conf_parse(const char *name)
zconfparse(); zconfparse();
if (zconfnerrs) if (zconfnerrs)
exit(1); exit(1);
if (!modules_sym->prop) { if (!modules_sym)
struct property *prop; modules_sym = sym_find( "n" );
prop = prop_alloc(P_DEFAULT, modules_sym);
prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
}
rootmenu.prompt->text = _(rootmenu.prompt->text); rootmenu.prompt->text = _(rootmenu.prompt->text);
rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);

View File

@ -5,6 +5,7 @@ source "package/linux-headers/Config.in.host"
choice choice
prompt "C library" prompt "C library"
default BR2_TOOLCHAIN_BUILDROOT_EGLIBC if BR2_mips64 || BR2_mips64el
config BR2_TOOLCHAIN_BUILDROOT_UCLIBC config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
bool "uClibc" bool "uClibc"