diff options
Diffstat (limited to 'maintainer')
-rwxr-xr-x | maintainer/addToolVersion.sh | 238 | ||||
-rwxr-xr-x | maintainer/gen-kconfig.sh | 160 | ||||
-rw-r--r-- | maintainer/kconfig-choice.template | 32 | ||||
-rw-r--r-- | maintainer/kconfig-menu.template | 20 | ||||
-rw-r--r-- | maintainer/kconfig-versions.template | 301 | ||||
-rw-r--r-- | maintainer/package-versions.template | 13 | ||||
-rwxr-xr-x | maintainer/test-packages.sh | 196 |
7 files changed, 562 insertions, 398 deletions
diff --git a/maintainer/addToolVersion.sh b/maintainer/addToolVersion.sh deleted file mode 100755 index 38c2e55..0000000 --- a/maintainer/addToolVersion.sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -set -e - -# Adds a new version to one of the toolchain component -myname="$0" - -# Parse the tools' paths configuration -# It is expected that this script is only to be run from the -# source directory of crosstool-NG, so it is trivial to find -# paths.sh (we can't use ". paths.sh", as POSIX states that -# $PATH should be searched for, and $PATH most probably doe -# not include "."), hence the "./". -. "./paths.sh" - -doHelp() { - cat <<-EOF - Usage: ${myname} <--tool> <[options] version [...]> ... - 'tool' in one of: - gcc, binutils, glibc, uClibc, uClibc-ng, newlib, linux, gdb, - duma, strace, ltrace, libelf, gmp, mpfr, isl, cloog, mpc, - mingw-w64, expat, ncurses, musl, gettext, zlib, libiconv - - Valid options for all tools: - --stable, -s, +x (default) - mark the version as being stable (as opposed to experimental, below) - - --experimental, -x, +s - mark the version as being experimental (as opposed to stable, above) - - --current, -c, +o (default) - mark the version as being cuurent (as opposed to obsolete, below) - - --obsolete, -o, +c - mark the version as being obsolete (as opposed to current, above) - - Note: setting a new tool resets to the defaults: 'stable' and 'current'. - - 'version' is a valid version for the specified tool. - - Examples: - add stable current version 2.6.19.2 to linux kernel: - ${myname} --linux 2.6.19.2 - - add experimental obsolete version 2.3.5 and stable current versions 2.6.1 - and 2.6.2 to glibc, add stable obsolete version 3.3.3 to gcc: - ${myname} --glibc -x -o 2.3.5 -s -c 2.6.1 2.6.2 --gcc -o 3.3.3 -EOF -} - -# Extract field $3 from version $1 with separator $2 -getVersionField() { - local version="$1" - local sep="$2" - local field="$3" - - echo "${version}${sep}${sep}${sep}${sep}" |cut -d ${sep} -f ${field} -} - -# Effectively add a version to the specified tool -# $cat : tool category -# $tool : tool name -# $tool_prefix : tool directory prefix -# $EXP : set to non empty if experimental, to empty otherwise -# OBS : set to non empty if obsolete, to empty otherwise -# $1 : version string to add -addToolVersion() { - local version="$1" - local file="$2" - local config_ver_option - local exp_obs_prompt - local deps v ver_M ver_m ver_p - local SedExpr1 SedExpr2 - - [ -f "${file}" ] || return 0 - - v=$(echo "${version}" |"${sed}" -r -e 's/-/_/g; s/\./_/g;') - - config_ver_option="${cat}_V_${v}" - - # Check for existing version: it can be legitimitate for an end-user - # to try adding a new version if the one he/she wants is not listed. - # But it can be the case where the version is hidden behind either one - # of EXPERIMENTAL or OBSOLETE, so warn if the version is already listed. - if ${grep} -E "^config ${config_ver_option}$" "${file}" >/dev/null 2>&1; then - echo "'${tool}': version '${version}' already present:" - ${grep} -A1 -B0 -n \ - -E "^(config ${config_ver_option}| {4}prompt \"${version}\")$" \ - "${file}" /dev/null - return 0 - fi - - SedExpr1="${SedExpr1}config ${config_ver_option}\n" - SedExpr1="${SedExpr1} bool\n" - SedExpr1="${SedExpr1} prompt \"${version}" - case "${EXP},${OBS}" in - ,) ;; - ,*) exp_obs_prompt=" (OBSOLETE)" - deps=" depends on OBSOLETE" - ;; - *,) exp_obs_prompt=" (EXPERIMENTAL)" - deps=" depends on EXPERIMENTAL" - ;; - *) exp_obs_prompt=" (EXPERIMENTAL, OBSOLETE)" - deps=" depends on EXPERIMENTAL \\&\\& OBSOLETE" - ;; - esac - [ -n "${exp_obs_prompt}" ] && SedExpr1="${SedExpr1}${exp_obs_prompt}" - SedExpr1="${SedExpr1}\"" - [ -n "${deps}" ] && SedExpr1="${SedExpr1}\n${deps}" - case "${tool}" in - gcc) - # Extract 'M'ajor and 'm'inor from version string - ver_M=$(getVersionField "${version}" . 1) - ver_m=$(getVersionField "${version}" . 2) - if [ ${ver_M} -ge 4 ] && [ ${ver_m} -ge 2 ]; then - SedExpr1="${SedExpr1}\n select CC_GCC_${ver_M}_${ver_m}" - fi - ;; - binutils) - # Extract 'M'ajor, 'm'inor, sometimes 'p'atch from version string - # TODO: Rework this - ver_M=$(getVersionField "${version}" . 1) - ver_m=$(getVersionField "${version}" . 2) - ver_p=$(getVersionField "${version}" . 3) - if [ ${ver_M} -eq 2 -a ${ver_m} -eq 27 ]; then - SedExpr1="${SedExpr1}\n select BINUTILS_2_27_or_later" - elif [ ${ver_M} -eq 2 -a ${ver_m} -eq 26 ]; then - SedExpr1="${SedExpr1}\n select BINUTILS_2_26_or_later" - elif [ ${ver_M} -eq 2 -a ${ver_m} -eq 25 -a ${ver_p} -eq 1 ]; then - SedExpr1="${SedExpr1}\n select BINUTILS_2_25_1_or_later" - elif [ ${ver_M} -eq 2 -a ${ver_m} -eq 25 -a -z ${ver_p} ]; then - SedExpr1="${SedExpr1}\n select BINUTILS_2_25_or_later" - elif [ ${ver_M} -eq 2 -a ${ver_m} -eq 24 ]; then - SedExpr1="${SedExpr1}\n select BINUTILS_2_24_or_later" - elif [ ${ver_M} -eq 2 -a ${ver_m} -eq 23 -a ${ver_p} -eq 2 ]; then - SedExpr1="${SedExpr1}\n select BINUTILS_2_23_2_or_later" - fi - ;; - uClibc) - # uClibc-0.9.33.2 needs some love - ver_M=$(getVersionField "${version}" . 1) - ver_m=$(getVersionField "${version}" . 2) - ver_p=$(getVersionField "${version}" . 3) - if [ ${ver_M} -eq 0 -a ${ver_m} -eq 9 -a ${ver_p} -eq 33 ]; then - SedExpr1="${SedExpr1}\n select LIBC_UCLIBC_0_9_33_2_or_later" - fi - ;; - uClibc-ng) - # uClibc-ng-1.0.15 changed threading configuration, no longer compatible - # with the rest of uClibc gang. - ver_M=$(getVersionField "${version}" . 1) - ver_m=$(getVersionField "${version}" . 2) - ver_p=$(getVersionField "${version}" . 3) - if [ ${ver_M} -eq 1 -a ${ver_m} -eq 0 -a ${ver_p} -eq 15 ]; then - SedExpr1="${SedExpr1}\n select LIBC_UCLIBC_NG_1_0_15_or_later" - fi - ;; - gdb) - # gdb-7.0 and above have special handling - ver_M=$(getVersionField "${version}" . 1) - ver_m=$(getVersionField "${version}" . 2) - if [ ${ver_M} -ge 7 ]; then - if [ ${ver_m} -ge 2 ]; then - SedExpr1="${SedExpr1}\n select GDB_7_2_or_later" - else - SedExpr1="${SedExpr1}\n select GDB_7_0_or_later" - fi - fi - ;; - esac - SedExpr2=" default \"${version}\" if ${config_ver_option}" - "${sed}" -r -i -e 's/^(# CT_INSERT_VERSION_BELOW)$/\1\n\n'"${SedExpr1}"'/;' "${file}" - "${sed}" -r -i -e 's/^(# CT_INSERT_VERSION_STRING_BELOW)$/\1\n'"${SedExpr2}"'/;' "${file}" -} - -cat= -tool= -tool_prefix= -VERSION= -EXP= -OBS= - -if [ $# -eq 0 ]; then - doHelp - exit 1 -fi - -while [ $# -gt 0 ]; do - case "$1" in - # Tools: - --gcc) EXP=; OBS=; cat=CC_GCC; tool=gcc; tool_prefix=cc; dot2suffix=;; - --binutils) EXP=; OBS=; cat=BINUTILS; tool=binutils; tool_prefix=binutils; dot2suffix=;; - --glibc) EXP=; OBS=; cat=LIBC_GLIBC; tool=glibc; tool_prefix=libc; dot2suffix=;; - --uClibc) EXP=; OBS=; cat=LIBC_UCLIBC; tool=uClibc; tool_prefix=libc; dot2suffix=;; - --uClibc-ng)EXP=; OBS=; cat=LIBC_UCLIBC_NG; tool=uClibc; tool_prefix=libc; dot2suffix=;; - --newlib) EXP=; OBS=; cat=LIBC_NEWLIB; tool=newlib; tool_prefix=libc; dot2suffix=;; - --mingw-w64)EXP=; OBS=; cat=WINAPI; tool=mingw; tool_prefix=libc; dot2suffix=;; - --musl) EXP=; OBS=; cat=LIBC_MUSL; tool=musl; tool_prefix=libc; dot2suffix=;; - --linux) EXP=; OBS=; cat=KERNEL; tool=linux; tool_prefix=kernel; dot2suffix=;; - --gdb) EXP=; OBS=; cat=GDB; tool=gdb; tool_prefix=debug; dot2suffix=;; - --duma) EXP=; OBS=; cat=DUMA; tool=duma; tool_prefix=debug; dot2suffix=;; - --strace) EXP=; OBS=; cat=STRACE; tool=strace; tool_prefix=debug; dot2suffix=;; - --ltrace) EXP=; OBS=; cat=LTRACE; tool=ltrace; tool_prefix=debug; dot2suffix=;; - --gmp) EXP=; OBS=; cat=GMP; tool=gmp; tool_prefix=companion_libs; dot2suffix=;; - --mpfr) EXP=; OBS=; cat=MPFR; tool=mpfr; tool_prefix=companion_libs; dot2suffix=;; - --isl) EXP=; OBS=; cat=ISL; tool=isl; tool_prefix=companion_libs; dot2suffix=;; - --cloog) EXP=; OBS=; cat=CLOOG; tool=cloog; tool_prefix=companion_libs; dot2suffix=;; - --mpc) EXP=; OBS=; cat=MPC; tool=mpc; tool_prefix=companion_libs; dot2suffix=;; - --libelf) EXP=; OBS=; cat=LIBELF; tool=libelf; tool_prefix=companion_libs; dot2suffix=;; - --expat) EXP=; OBS=; cat=EXPAT; tool=expat; tool_prefix=companion_libs; dot2suffix=;; - --ncurses) EXP=; OBS=; cat=NCURSES; tool=ncurses; tool_prefix=companion_libs; dot2suffix=;; - --gettext) EXP=; OBS=; cat=GETTEXT; tool=gettext; tool_prefix=companion_libs; dot2suffix=;; - --libiconv) EXP=; OBS=; cat=LIBICONV; tool=libiconv; tool_prefix=companion_libs; dot2suffix=;; - --zlib) EXP=; OBS=; cat=ZLIB; tool=zlib; tool_prefix=companion_tools; dot2suffix=;; - --make) EXP=; OBS=; cat=MAKE; tool=make; tool_prefix=companion_tools; dot2suffix=;; - --m4) EXP=; OBS=; cat=M4; tool=m4; tool_prefix=companion_tools; dot2suffix=;; - --autoconf) EXP=; OBS=; cat=AUTOCONF; tool=autoconf; tool_prefix=companion_tools; dot2suffix=;; - --automake) EXP=; OBS=; cat=AUTOMAKE; tool=automake; tool_prefix=companion_tools; dot2suffix=;; - --libtool) EXP=; OBS=; cat=LIBTOOL; tool=libtool; tool_prefix=companion_tools; dot2suffix=;; - - # Tools options: - -x|--experimental|+s) EXP=1;; - -s|--stable|+x) EXP=;; - -o|--obsolete|+c) OBS=1;; - -c|--current|+o) OBS=;; - - # Misc: - -h|--help) doHelp; exit 0;; - -*) echo "Unknown option: '$1' (use -h/--help for help)."; exit 1;; - - # Version string: - *) [ -n "${tool}" ] || { doHelp; exit 1; } - file_base="config/${tool_prefix}/${tool}.in" - addToolVersion "$1" "${file_base}${dot2suffix}" - ;; - esac - shift -done diff --git a/maintainer/gen-kconfig.sh b/maintainer/gen-kconfig.sh deleted file mode 100755 index 364844d..0000000 --- a/maintainer/gen-kconfig.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash - -set -e - -# Accept overrides from command line if needed -sed=${SED:-sed} -grep=${GREP:-grep} - -# Generate either a choice or a menuconfig with the specified entries. -# -# Usage: -# generate a choice: -# gen_choice <out-file> <label> <config-prefix> <base-dir> -# -# generate a menuconfig: -# gen_menu <out-file> <label> <config-prefix> <base-dir> -# -# where: -# out-file -# put the generated choice/menuconfig into that file -# for choices, it acts as the base bname of the file, the secondary -# parts (the .in.2) are put in out-file.2 -# -# label -# name for the entries family -# eg. Architecture, Kernel... -# -# config-prefix -# prefix for the choice entries -# eg. ARCH, KERNEL... -# -# base-dir -# base directory containing config files -# eg. config/arch, config/kernel... -# - -# Helper: find the base names of all *.in files in a given directory -get_components() { - local dir="${1}" - local f b - - for f in ${dir}/*.in; do - b=${f#${dir}/} - echo ${b%.in} - done -} - -# Generate a choice -# See above for usage -gen_choice() { - local out_file="${1}" - local label="${2}" - local cfg_prefix="${3}" - local base_dir="${4}" - local file entry _entry - - # Generate the part-1 - exec >"${out_file}" - printf '# %s menu\n' "${label}" - printf '# Generated file, do not edit!!!\n' - printf '\n' - printf 'choice GEN_CHOICE_%s\n' "${cfg_prefix}" - printf ' bool\n' - printf ' prompt "%s"\n' "${label}" - printf '\n' - for entry in `get_components ${base_dir}`; do - file="${base_dir}/${entry}.in" - _entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;') - printf 'config %s_%s\n' "${cfg_prefix}" "${_entry}" - printf ' bool\n' - printf ' prompt "%s"\n' "${entry}" - "${sed}" -r -e '/^## depends on /!d; s/^## / /;' ${file} 2>/dev/null - "${sed}" -r -e '/^## select /!d; s/^## / /;' ${file} 2>/dev/null - if "${grep}" -E '^## help' ${file} >/dev/null 2>&1; then - printf ' help\n' - "${sed}" -r -e '/^## help ?/!d; s/^## help ?/ /;' ${file} 2>/dev/null - fi - printf '\n' - done - printf 'endchoice\n' - - printf '\n' - printf 'config %s\n' "${cfg_prefix}" - for entry in `get_components ${base_dir}`; do - file="${base_dir}/${entry}.in" - _entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;') - printf ' default "%s" if %s_%s\n' "${entry}" "${cfg_prefix}" "${_entry}" - done - - printf '\n' - for entry in `get_components ${base_dir}`; do - file="${base_dir}/${entry}.in" - _entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;') - printf 'if %s_%s\n' "${cfg_prefix}" "${_entry}" - printf 'source "%s"\n' "${file}" - printf 'endif\n' - done - - # Generate the part-2 - exec >"${out_file}.2" - printf '# %s second part options\n' "${label}" - printf '# Generated file, do not edit!!!\n' - for entry in `get_components ${base_dir}`; do - file="${base_dir}/${entry}.in" - _entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;') - if [ -f "${file}.2" ]; then - printf '\n' - printf 'if %s_%s\n' "${cfg_prefix}" "${_entry}" - printf 'comment "%s other options"\n' "${entry}" - printf 'source "%s.2"\n' "${file}" - printf 'endif\n' - fi - done -} - -# Generate a menuconfig -# See above for usage -gen_menu() { - local out_file="${1}" - local label="${2}" - local cfg_prefix="${3}" - local base_dir="${4}" - local file entry _entry - - # Generate the menuconfig - exec >"${out_file}" - printf '# %s menu\n' "${label}" - printf '# Generated file, do not edit!!!\n' - printf '\n' - for entry in `get_components ${base_dir}`; do - file="${base_dir}/${entry}.in" - _entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;') - printf 'menuconfig %s_%s\n' "${cfg_prefix}" "${_entry}" - printf ' bool\n' - if "${grep}" -E '^## default' ${file} >/dev/null 2>&1; then - "${sed}" -r -e '/^## default ?/!d; s/^## default ?/ default /;' ${file} 2>/dev/null - fi - printf ' prompt "%s"\n' "${entry}" - "${sed}" -r -e '/^## depends on /!d; s/^## / /;' ${file} 2>/dev/null - "${sed}" -r -e '/^## select /!d; s/^## / /;' ${file} 2>/dev/null - if "${grep}" -E '^## help' ${file} >/dev/null 2>&1; then - printf ' help\n' - "${sed}" -r -e '/^## help ?/!d; s/^## help ?/ /;' ${file} 2>/dev/null - fi - printf '\n' - printf 'if %s_%s\n' "${cfg_prefix}" "${_entry}" - printf 'source "%s"\n' "${file}" - printf 'endif\n' - printf '\n' - done -} - -mkdir -p config/gen -gen_choice config/gen/arch.in "Target Architecture" "ARCH" "config/arch" -gen_choice config/gen/kernel.in "Target OS" "KERNEL" "config/kernel" -gen_choice config/gen/cc.in "Compiler" "CC" "config/cc" -gen_choice config/gen/binutils.in "Binutils" "BINUTILS" "config/binutils" -gen_choice config/gen/libc.in "C library" "LIBC" "config/libc" -gen_menu config/gen/debug.in "Debug facilities" "DEBUG" "config/debug" -gen_menu config/gen/companion_tools.in "Companion tools" "COMP_TOOLS" "config/companion_tools" diff --git a/maintainer/kconfig-choice.template b/maintainer/kconfig-choice.template new file mode 100644 index 0000000..b2ca217 --- /dev/null +++ b/maintainer/kconfig-choice.template @@ -0,0 +1,32 @@ +# +# DO NOT EDIT! This file is automatically generated. +# + +choice GEN_CHOICE_@@dir|@@ + bool "@@label@@" + +#!foreach choice +config @@dir|@@_@@choice|@@ + bool "@@choice@@" +#!foreach dependency + @@depline@@ +#!end-foreach + help +#!foreach help + @@helpline@@ +#!end-foreach + +#!end-foreach +endchoice + +config @@dir|@@ + string +#!foreach choice + default "@@choice@@" if @@dir|@@_@@choice|@@ +#!end-foreach + +#!foreach choice +if @@dir|@@_@@choice|@@ +source "config/@@dir@@/@@choice@@.in" +endif +#!end-foreach diff --git a/maintainer/kconfig-menu.template b/maintainer/kconfig-menu.template new file mode 100644 index 0000000..1a7daa5 --- /dev/null +++ b/maintainer/kconfig-menu.template @@ -0,0 +1,20 @@ +# +# DO NOT EDIT! This file is automatically generated. +# + +#!foreach choice +menuconfig @@dir|@@_@@choice|@@ + bool "@@choice@@" +#!foreach dependency + @@depline@@ +#!end-foreach + help +#!foreach help + @@helpline@@ +#!end-foreach + +if @@dir|@@_@@choice|@@ +source "config/@@dir@@/@@choice@@.in" +endif + +#!end-foreach diff --git a/maintainer/kconfig-versions.template b/maintainer/kconfig-versions.template new file mode 100644 index 0000000..0e0ceb0 --- /dev/null +++ b/maintainer/kconfig-versions.template @@ -0,0 +1,301 @@ +# +# DO NOT EDIT! This file is automatically generated. +# + +# The component directory name +config @@master|@@_DIR_NAME + string + default "@@master@@" + +#!if [ "@@nforks@@" -ge 2 ] + +choice + bool "Show @@master@@ versions from" + +#!foreach fork +config @@master|@@_USE_@@origin|@@ + bool "@@origin@@" +#!if [ -n "@@only_obsolete@@" ] + depends on OBSOLETE +#!end-if +#!if [ -n "@@only_experimental@@" ] + depends on EXPERIMENTAL +#!end-if + help +@@originhelp@@ + +#!end-foreach +endchoice + +config @@master|@@_USE + string +#!foreach fork + default "@@fork|@@" if @@master|@@_USE_@@origin|@@ +#!end-foreach + +#!end-if + +#!foreach fork +#!if [ "@@nforks@@" -ge 2 ] +if @@master|@@_USE_@@origin|@@ +#!end-if + +config @@fork|@@_PKG_NAME + string + default "@@pkg_name@@" + +#!// If a project makes official releases, using "bleeding edge" +#!// from a development repository is experimental. However, there +#!// are projects that consider its HEAD a "rolling release". For +#!// those, checking out from a repository is the regular method. +choice + bool "Source of @@pkg_label@@" + +#!if [ "@@#version@@" -gt 0 ] +config @@fork|@@_SRC_RELEASE + bool "Released tarball" + help + Download a released tarball. + +#!end-if +config @@fork|@@_SRC_DEVEL + bool "Vendor/custom repository" +#!if [ "@@#version@@" -gt 0 ] + depends on EXPERIMENTAL +#!end-if + help + Check out from a repository. +#!if [ -n "@@repository@@" ] + Default is the vendor repository at @@repository_url@@ +#!end-if + +if @@fork|@@_SRC_DEVEL + +choice + bool "VCS type" +#!if [ -n "@@repository@@" ] + default @@fork|@@_DEVEL_VCS_@@vcs@@ +#!end-if + help + Version control system from which the sources will be checked out. + The default value points to the development repository for @@pkg_label@@. + +config @@fork|@@_DEVEL_VCS_git + bool "Git" + +config @@fork|@@_DEVEL_VCS_svn + bool "Subversion" + +config @@fork|@@_DEVEL_VCS_hg + bool "Mercurial" + +config @@fork|@@_DEVEL_VCS_cvs + bool "CVS" + +endchoice + +config @@fork|@@_DEVEL_VCS + string + default "git" if @@fork|@@_DEVEL_VCS_git + default "svn" if @@fork|@@_DEVEL_VCS_svn + default "hg" if @@fork|@@_DEVEL_VCS_hg + default "cvs" if @@fork|@@_DEVEL_VCS_cvs + +config @@fork|@@_DEVEL_URL + string "Repository URL" +#!if [ -n "@@repository@@" ] + default "@@repository_url@@" +#!end-if + help + Repository URL. + + For CVS, enter both the value of CVS root and the module name, separated + by a space. + +config @@fork|@@_DEVEL_BRANCH + string "Branch/tag to check out" + default "@@repository_branch@@" + help + Git/CVS: branch/tag to be checked out + Subversion: directories to append to the repository URL (i.e. branch or tag) + Mercurial: official guide recommends using separate repositories to maintain + stable branches. You likely need to change the repository URL, rather than + enter anything here. + +config @@fork|@@_DEVEL_REVISION + string "Revision/changeset" + default "@@repository_cset@@" + help + Commit ID or revision ID to check out. + Git: enter the commit ID to check out a commit. + CVS: enter the date in "YYYY/MM/DD HH:MM:SS" format (UTC) to check out certain date. + Subversion: enter the revision. + +config @@fork|@@_DEVEL_SUBDIR + string "Subdirectory in the repository" + default "@@repository_subdir@@" + help + Some projects produce releases not from the top-level directory in the + repository, but rather from some subdirectory. If it is the case, + specify this subdirectory here. + +config @@fork|@@_DEVEL_BOOTSTRAP + string "Bootstrap command" + default "@@bootstrap@@" + help + Command to run after checking out. Some projects don't store the generated + files like configure script in the repository; building out of a checked out + working copy thus requires some extra steps. Separate multiple shell commands + with &&. + +endif + +config @@fork|@@_SRC_CUSTOM + bool "Custom location" + depends on EXPERIMENTAL + help + Custom directory or tarball. + +if @@fork|@@_SRC_CUSTOM + +config @@fork|@@_CUSTOM_LOCATION + string "Custom source location" + help + Path to the directory or tarball with the sources. + +endif + +endchoice + +#!// Below, we explicitly select all milestones to which a given version +#!// compares greater-or-equal. We don't select just the latest applicable +#!// (and letting milestones chain-select each other, with FOO_6_or_later +#!// selecting FOO_5_or_later and so on) so that we can handle the cases +#!// where we need to identify a range of releases on a branch, for example, +#!// "all FOO releases after 4.9.1 but before 4.9.3". +#!// +#!if [ "@@#version@@" -gt 0 -a -z "@@versionlocked@@" ] +choice + bool "Version of @@pkg_label@@" + help + For a released version, select the version of @@pkg_label@@ to download + and build. For sources out of the vendor repository or from a custom + location, select the version that describes those custom sources. + Based on this version, crosstool-NG may apply some version-specific + quirks while building @@pkg_label@@. + +config @@fork|@@_VERY_NEW + bool "newer than anything below" + depends on EXPERIMENTAL + depends on @@fork|@@_SRC_DEVEL || @@fork|@@_SRC_CUSTOM +#!foreach milestone + select @@master|@@_@@ms|@@_or_later + depends on !@@master|@@_REQUIRE_@@ms|@@_or_older +#!end-foreach + +#!foreach version +config @@fork|@@_V_@@ver_sel|@@ + bool "@@ver@@@@obsolete? (OBSOLETE)@@@@experimental? (EXPERIMENTAL)@@" +#!if [ "@@obsolete@@" = "yes" ] + depends on OBSOLETE +#!end-if +#!if [ "@@experimental@@" = "yes" ] + depends on EXPERIMENTAL +#!end-if +#!foreach milestone +#!if [ "@@version_cmp_milestone@@" -ge 0 ] + select @@master|@@_@@ms|@@_or_later +#!end-if +#!if [ "@@version_cmp_milestone@@" -le 0 ] + select @@master|@@_@@ms|@@_or_older +#!end-if +#!if [ "@@version_cmp_milestone@@" -gt 0 ] + depends on !@@master|@@_REQUIRE_@@ms|@@_or_older +#!end-if +#!if [ "@@version_cmp_milestone@@" -lt 0 ] + depends on !@@master|@@_REQUIRE_@@ms|@@_or_later +#!end-if +#!end-foreach + +#!end-foreach +config @@fork|@@_VERY_OLD + bool "older than anything above" + depends on OBSOLETE && EXPERIMENTAL + depends on @@fork|@@_SRC_DEVEL || @@fork|@@_SRC_CUSTOM +#!foreach milestone + depends on !@@master|@@_REQUIRE_@@ms|@@_or_later +#!end-foreach + +endchoice +#!end-if + +#!if [ -n "@@versionlocked@@" ] +#!foreach version +config @@fork|@@_V_@@ver_sel|@@ + def_bool y + depends on @@versionlocked|@@_V_@@ver_sel|@@ + +#!end-foreach +#!end-if + +config @@fork|@@_VERSION + string +#!foreach version + default "@@ver@@" if @@fork|@@_V_@@ver_sel|@@ +#!end-foreach + default "unknown" + +#!if [ "@@#version@@" -gt 0 ] +config @@fork|@@_MIRRORS + string +#!foreach version if-differs mirrors + default "@@mirrors@@" if @@fork|@@_V_@@ver_sel|@@ +#!end-foreach + default "@@mirrors@@" + +config @@fork|@@_ARCHIVE_FILENAME + string +#!foreach version if-differs archive_filename + default "@@archive_filename@@" if @@fork|@@_V_@@ver_sel|@@ +#!end-foreach + default "@@archive_filename@@" + +config @@fork|@@_ARCHIVE_DIRNAME + string +#!foreach version if-differs archive_dirname + default "@@archive_dirname@@" if @@fork|@@_V_@@ver_sel|@@ +#!end-foreach + default "@@archive_dirname@@" + +config @@fork|@@_ARCHIVE_FORMATS + string +#!foreach version if-differs archive_formats + default "@@archive_formats@@" if @@fork|@@_V_@@ver_sel|@@ +#!end-foreach + default "@@archive_formats@@" + +#!end-if + +#!if [ "@@nforks@@" -ge 2 ] +endif +#!end-if + +#!end-foreach + +#!foreach milestone +#!// Milestones selected by a chosen version of this package +config @@master|@@_@@ms|@@_or_later + bool + +config @@master|@@_@@ms|@@_or_older + bool + +#!// Milestone requirements selected by other packages that restrict +#!// the choices in this package +config @@master|@@_REQUIRE_@@ms|@@_or_later + bool + +config @@master|@@_REQUIRE_@@ms|@@_or_older + bool + +#!end-foreach diff --git a/maintainer/package-versions.template b/maintainer/package-versions.template new file mode 100644 index 0000000..61f938f --- /dev/null +++ b/maintainer/package-versions.template @@ -0,0 +1,13 @@ +#!foreach fork +#!foreach version +run_pkgversion \ + master=@@master@@ \ + masterpfx=@@master|@@ \ + originpfx=@@origin|@@ \ + pkg_name=@@pkg_name@@ \ + pfx=@@fork|@@ \ + versionlocked=@@versionlocked|@@ \ + ver=@@ver@@ \ + kcfg=@@ver_sel|@@ +#!end-foreach +#!end-foreach diff --git a/maintainer/test-packages.sh b/maintainer/test-packages.sh new file mode 100755 index 0000000..42aaad7 --- /dev/null +++ b/maintainer/test-packages.sh @@ -0,0 +1,196 @@ +#!/bin/bash + +selected= + +usage() +{ + cat <<EOF +$0 -- Test packages in crosstool-NG + +Verifies that the release tarballs can be downloaded for the packages +available in crosstoo-NG and check that the patches apply cleanly. +Requires crosstool-NG to be configured and built prior to running. + +Options: + --help, -? + Display this help message. + + --download, -d + Download all packages to the default directory (\$HOME/src). + + --apply-patches, -a + Implies -d. Unpack and apply the bundled patches. + + --verify-urls, -u + Check *all* the download URLs for accessibility, without + actually downloading anything. + + --select MASK, -s MASK + Specify the package to operate upon. MASK can be either package + name ("-s foo"), or package name + version ("-s foo-1.1"). + +EOF +} + +while [ -n "${1}" ]; do + case "${1}" in + --download|-d) + download_pkgs=y + ;; + --verify-urls|-u) + verify_urls=y + ;; + --apply-patches|-a) + apply_patches=y + download_pkgs=y + ;; + --select|-s) + shift + [ -n "${1}" ] || { echo "argument required for --select" >&2; exit 1; } + selected="${1}" + ;; + --help|-?) + usage + exit 0 + ;; + *) + echo "Unknown option ${1}" >&2 + exit 1 + ;; + esac + shift +done + +CT_LIB_DIR=`pwd` +CT_TOP_DIR=`pwd` +CT_TARBALLS_DIR=`pwd`/temp.tarballs +CT_COMMON_SRC_DIR=`pwd`/temp.src +CT_SRC_DIR=`pwd`/temp.src +CT_LOG_LEVEL_MAX=EXTRA +mkdir -p ${CT_TARBALLS_DIR} + +# Does not matter, just to make the scripts load +CT_ARCH=arm +CT_KERNEL=bare-metal +CT_BINUTILS=binutils +CT_LIBC=none +CT_CC=gcc + +. paths.sh +. scripts/functions + +rm -f build.log +CT_LogEnable + +check_pkg_urls() +{ + local e m mh url + + for e in ${archive_formats}; do + local -A mirror_status=( ) + + CT_DoStep EXTRA "Looking for ${archive_filename}${e}" + for m in ${mirrors}; do + url="${m}/${archive_filename}${e}" + case "${url}" in + # WGET always returns success for FTP URLs in spider mode :( + ftp://*) CT_DoLog DEBUG "Skipping '${url}': FTP not supported"; continue;; + esac + mh="${url#*://}" + mh="${mh%%[:/]*}" + if [ -n "${mirror_status[${mh}]}" ]; then + CT_DoLog DEBUG "Skipping '${url}': already found on this host at '${mirror_status[${mh}]}'" + continue + fi + if CT_DoExecLog ALL wget --spider "${url}"; then + mirror_status[${mh}]="${url}" + else + mirror_status[${mh}]= + fi + done + for mh in "${!mirror_status[@]}"; do + if [ -n "${mirror_status[${mh}]}" ]; then + CT_DoLog EXTRA "OK ${mh} [${archive_filename}${e}]" + else + CT_DoLog ERROR "FAIL ${mh} [${archive_filename}${e}]" + fi + done + CT_EndStep + done +} + +run_pkgversion() +{ + while [ -n "${1}" ]; do + eval "local ${1}" + shift + done + + if [ -n "${selected}" ]; then + case "${selected}" in + ${pkg_name}|${pkg_name}-${ver}) + ;; + *) + return + ;; + esac + fi + + CT_DoStep INFO "Handling ${pkg_name}-${ver}" + + # Create a temporary configuration head file + cat >temp.in <<EOF +config OBSOLETE + def_bool y + +config EXPERIMENTAL + def_bool y + +config CONFIGURE_has_wget + def_bool y + +config CONFIGURE_has_curl + def_bool y + +config ${versionlocked}_V_${kcfg} + def_bool y + +source "config/global/paths.in" +source "config/global/download.in" +source "config/global/extract.in" +source "config/versions/${master}.in" +EOF + + cat >temp.defconfig <<EOF +CT_${masterpfx}_USE_${originpfx}=y +CT_${pfx}_SRC_RELEASE=y +CT_${pfx}_V_${kcfg}=y +CT_SAVE_TARBALLS=y +EOF + + ./kconfig/conf --defconfig=temp.defconfig temp.in >/dev/null + + CT_LoadConfig + rm -f .config .config.old temp.defconfig temp.in + if [ -n "${verify_urls}" ]; then + CT_DoLog EXTRA "Verifying URLs for ${pkg_name}-${ver}" + CT_PackageRun "${masterpfx}" check_pkg_urls + fi + if [ -n "${download_pkgs}" ]; then + CT_DoLog EXTRA "Downloading ${pkg_name}-${ver}" + CT_Fetch "${masterpfx}" + fi + if [ -n "${apply_patches}" ]; then + rm -rf ${CT_COMMON_SRC_DIR} + mkdir -p ${CT_COMMON_SRC_DIR} + CT_ExtractPatch "${masterpfx}" + fi + + CT_EndStep +} + +[ -r .config ] && mv .config .config-saved +. maintainer/package-versions +[ -r .config-saved ] && mv .config-saved .config + +rm -rf ${CT_TARBALLS_DIR} ${CT_COMMON_SRC_DIR} |