From 567277099a487508fd228a4c56f3583db3fa96c9 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 29 May 2017 22:32:38 -0700 Subject: Fix the references to old config variables Signed-off-by: Alexey Neyman --- scripts/build/binutils/binutils.sh | 44 ++++++++------------------------------ 1 file changed, 9 insertions(+), 35 deletions(-) (limited to 'scripts/build/binutils') diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index f378b4f1..74139bc3 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -4,44 +4,18 @@ # Download binutils do_binutils_get() { - if [ "${CT_BINUTILS_CUSTOM}" = "y" ]; then - CT_GetCustom "binutils" "${CT_BINUTILS_CUSTOM_VERSION}" \ - "${CT_BINUTILS_CUSTOM_LOCATION}" - else - case "${CT_BINUTILS_VERSION}" in - linaro-*) - CT_GetLinaro "binutils" "${CT_BINUTILS_VERSION}" - ;; - *) - CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \ - {http,ftp}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils \ - ftp://{sourceware.org,gcc.gnu.org}/pub/binutils/{releases,snapshots} - ;; - esac - fi - + CT_Fetch BINUTILS if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then - if [ "${CT_ELF2FLT_CUSTOM}" = "y" ]; then - CT_GetCustom "elf2flt" "${CT_ELF2FLT_CUSTOM_VERSION}" \ - "${CT_ELF2FLT_CUSTOM_LOCATION}" - else - CT_GetGit elf2flt "${CT_ELF2FLT_GIT_CSET}" https://github.com/uclinux-dev/elf2flt.git - fi + CT_Fetch ELF2FLT fi } # Extract binutils do_binutils_extract() { - CT_Extract "binutils-${CT_BINUTILS_VERSION}" - CT_Patch "binutils" "${CT_BINUTILS_VERSION}" - + # TBD handle xtensa overlays in CT_ExtractPatch + CT_ExtractPatch BINUTILS if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then - CT_Extract "elf2flt-${CT_ELF2FLT_GIT_CSET}" - CT_Patch "elf2flt" "${CT_ELF2FLT_GIT_CSET}" - fi - - if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then - CT_ConfigureXtensa "binutils" "${CT_BINUTILS_VERSION}" + CT_ExtractPatch ELF2FLT fi } @@ -67,7 +41,7 @@ do_binutils_for_build() { if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then # We re-use binutils' options, plus our owns - binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" ) + binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils" ) binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_BUILD}" ) CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}" @@ -100,7 +74,7 @@ do_binutils_for_host() { if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then # We re-use binutils' options, plus our owns - binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" ) + binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils" ) binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" ) CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-host-${CT_HOST}" @@ -207,7 +181,7 @@ do_binutils_backend() { CXXFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure" \ + "${CT_SRC_DIR}/binutils/configure" \ --build=${CT_BUILD} \ --host=${host} \ --target=${CT_TARGET} \ @@ -351,7 +325,7 @@ do_binutils_for_target() { CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure" \ + "${CT_SRC_DIR}/binutils/configure" \ --build=${CT_BUILD} \ --host=${CT_TARGET} \ --target=${CT_TARGET} \ -- cgit v1.2.3 From f63fbd356f4e80b2f597796039eb79a69121fb4d Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 2 Jul 2017 13:12:53 -0700 Subject: Allow for custom archive names ... and directories therein. Signed-off-by: Alexey Neyman --- config/companion_libs/isl.in | 1 - maintainer/gen-versions.sh | 11 ++++++++--- maintainer/kconfig-versions.template | 8 ++++++-- packages/android-ndk/package.desc | 2 +- packages/duma/package.desc | 2 ++ packages/ltrace/package.desc | 2 ++ scripts/build/binutils/binutils.sh | 2 +- scripts/functions | 29 +++++++++++++++++++++-------- 8 files changed, 41 insertions(+), 16 deletions(-) (limited to 'scripts/build/binutils') diff --git a/config/companion_libs/isl.in b/config/companion_libs/isl.in index b617aa39..9c74078f 100644 --- a/config/companion_libs/isl.in +++ b/config/companion_libs/isl.in @@ -16,7 +16,6 @@ config ISL_CLOOG_auto_select_2 def_bool y depends on CLOOG_NEEDED && !ISL_0_13_or_older select CLOOG_REQUIRE_0_18_4_or_later -# TBD 0.12.2 should allow both! config ISL_NEEDS_WITH_GMP bool diff --git a/maintainer/gen-versions.sh b/maintainer/gen-versions.sh index 8144b62c..09ebc0b7 100755 --- a/maintainer/gen-versions.sh +++ b/maintainer/gen-versions.sh @@ -132,7 +132,7 @@ run_lines() { local start="${1}" local end="${2}" - local l lnext s v + local l lnext s s1 v debug "Running lines ${start}..${end}" l=${start} @@ -142,6 +142,7 @@ run_lines() # Expand @@foo@@ to ${info[foo]}. First escape variables/backslashes for evals below. s="${s//\\/\\\\}" s="${s//\$/\\\$}" + s1= while [ -n "${s}" ]; do case "${s}" in *@@*@@*) @@ -150,16 +151,19 @@ run_lines() if [ "${info[${v}]+set}" != "set" ]; then error "line ${l}: reference to undefined variable '${v}'" fi - s="${s%%@@*}\${info[${v}]}${s#*@@*@@}" + s1="${s1}${s%%@@*}\${info[${v}]}" + s="${s#*@@*@@}" ;; *@@*) error "line ${l}: non-paired @@ markers" ;; *) + s1="${s1}${s}" break ;; esac done + s=${s1} debug "Evaluate: ${s}" case "${s}" in @@ -448,7 +452,8 @@ enter_fork() info[fork]=${fork} info[name]=${fork} info[mirrors]= - info[archivesuffix]= + info[archive_filename]='@{pkg_name}-@{version}' + info[archive_dirname]='@{pkg_name}-@{version}' eval `read_package_desc ${fork}` diff --git a/maintainer/kconfig-versions.template b/maintainer/kconfig-versions.template index c7ab461f..af78f3cb 100644 --- a/maintainer/kconfig-versions.template +++ b/maintainer/kconfig-versions.template @@ -172,9 +172,13 @@ config @@pfx@@_MIRRORS string default "@@mirrors@@" -config @@pfx@@_ARCHIVE_SUFFIX +config @@pfx@@_ARCHIVE_FILENAME string - default "@@archivesuffix@@" + default "@@archive_filename@@" + +config @@pfx@@_ARCHIVE_DIRNAME + string + default "@@archive_dirname@@" #!end-if diff --git a/packages/android-ndk/package.desc b/packages/android-ndk/package.desc index a422ee83..c51775b1 100644 --- a/packages/android-ndk/package.desc +++ b/packages/android-ndk/package.desc @@ -1,3 +1,3 @@ # We don't support building bionic (yet) so no official repository -archivesuffix='-linux-x86_64' mirrors='https://dl.google.com/android/repository' +archive_filename='@{pkg_name}-@{version}-linux-x86_64' diff --git a/packages/duma/package.desc b/packages/duma/package.desc index 5b5ae8a8..7bae98ca 100644 --- a/packages/duma/package.desc +++ b/packages/duma/package.desc @@ -1,2 +1,4 @@ repository='cvs :pserver:anonymous@duma.cvs.sourceforge.net:/cvsroot/duma duma' mirrors='http://downloads.sourceforge.net/project/duma/duma/${CT_DUMA_VERSION}' +archive_filename='@{pkg_name}_@{version}' +archive_dirname='@{pkg_name}_@{version}' diff --git a/packages/ltrace/package.desc b/packages/ltrace/package.desc index 5941f299..475c56b2 100644 --- a/packages/ltrace/package.desc +++ b/packages/ltrace/package.desc @@ -1,3 +1,5 @@ repository='git git://git.debian.org/git/collab-maint/ltrace.git' bootstrap='./autogen.sh' mirrors='http://ftp.debian.org/debian/pool/main/l/ltrace ftp:://ftp.debian.org/debian/pool/main/l/ltrace' +archive_filename='@{pkg_name}_@{version}.orig' +archive_dirname='@{pkg_name}-@{version}' diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index 74139bc3..d229a537 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -265,7 +265,7 @@ do_elf2flt_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/elf2flt-${CT_ELF2FLT_VERSION}/configure" \ + "${CT_SRC_DIR}/elf2flt/configure" \ --build=${CT_BUILD} \ --host=${host} \ --target=${CT_TARGET} \ diff --git a/scripts/functions b/scripts/functions index e3c04efd..45883156 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1688,12 +1688,20 @@ CT_PackageRun() use="${use:-${sym}}" # Variables that are per-fork - for v in basename pkg_name version src_release mirrors archive_suffix src_devel src_custom \ - devel_vcs devel_url devel_branch devel_revision devel_subdir devel_bootstrap \ - custom_location; do + for v in basename pkg_name version src_release mirrors archive_filename archive_dirname \ + src_devel src_custom devel_vcs devel_url devel_branch devel_revision \ + devel_subdir devel_bootstrap custom_location; do eval "local ${v}=\${CT_${use}_${v^^}}" done + for v in archive_filename archive_dirname; do + # kconfig and shell have different quoting rules, so it seems impossible to make + # kconfig quote '$' properly for eval (i.e. not have it expanded when loading the + # .config). Therefore, use '@' instead of '$' in kconfig files and substitute it + # here for select variables. + eval "eval ${v}=\${${v}//@/$}" + done + ${run} "$@" # Save certain variables that may be modified by the callback. @@ -1710,8 +1718,8 @@ CT_DoFetch() local tmp_dir if [ "${src_release}" = "y" ]; then - basename="${pkg_name}-${version}" - if ! CT_GetFile "${basename}${archive_suffix}" ${mirrors}; then + basename="${archive_dirname}" + if ! CT_GetFile "${archive_filename}" ${mirrors}; then CT_Abort "${pkg_name}: download failed" fi @@ -1834,7 +1842,7 @@ CT_Extract() CT_DoExtractPatch() { local patchfunc="${1}" - local ext + local archive ext local -a patch_dirs local bundled_patch_dir local local_patch_dir @@ -1854,9 +1862,14 @@ CT_DoExtractPatch() else CT_DoLog EXTRA "Extracting ${basename}" CT_DoExecLog ALL touch "${CT_COMMON_SRC_DIR}/.${basename}.extracting" + if [ "${src_release}" = "y" ]; then + archive="${archive_filename}" + else + archive="${basename}" + fi # TBD save/discover the extension while fetching - ext=`CT_GetFileExtension "${basename}${archive_suffix}"` - CT_Extract "${CT_TARBALLS_DIR}/${basename}${archive_suffix}${ext}" "${CT_COMMON_SRC_DIR}" + ext=`CT_GetFileExtension "${archive}"` + CT_Extract "${CT_TARBALLS_DIR}/${archive}${ext}" "${CT_COMMON_SRC_DIR}" CT_DoExecLog ALL touch "${CT_COMMON_SRC_DIR}/.${basename}.extracted" CT_DoExecLog ALL rm -f "${CT_COMMON_SRC_DIR}/.${basename}.extracting" fi -- cgit v1.2.3 From 9d91f44bc8d973d40b1cd972464a7fd93bddfe35 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 8 Jul 2017 10:54:53 -0700 Subject: Separate the notions of package name/label Also, remove resolved TBDs. Signed-off-by: Alexey Neyman --- bootstrap | 3 ++- maintainer/kconfig-versions.template | 12 ++++++------ packages/cloog/package.desc | 2 +- scripts/build/binutils/binutils.sh | 1 - scripts/build/debug/300-gdb.sh | 1 - scripts/build/libc/newlib.sh | 1 - scripts/upgrade.sed | 2 -- 7 files changed, 9 insertions(+), 13 deletions(-) (limited to 'scripts/build/binutils') diff --git a/bootstrap b/bootstrap index d37a8d21..e32feaa1 100755 --- a/bootstrap +++ b/bootstrap @@ -473,7 +473,8 @@ enter_fork() info[repository_subdir]= info[bootstrap]= info[fork]=${fork} - info[name]=${fork} + info[pkg_name]=${fork} + info[pkg_label]=${fork} info[mirrors]= info[archive_filename]='@{pkg_name}-@{version}' info[archive_dirname]='@{pkg_name}-@{version}' diff --git a/maintainer/kconfig-versions.template b/maintainer/kconfig-versions.template index af78f3cb..e7e01212 100644 --- a/maintainer/kconfig-versions.template +++ b/maintainer/kconfig-versions.template @@ -42,14 +42,14 @@ if @@masterpfx@@_USE_@@originpfx@@ config @@pfx@@_PKG_NAME string - default "@@name@@" + 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 @@name@@" + bool "Source of @@pkg_label@@" #!if [ -n "@@all_versions@@" ] config @@pfx@@_SRC_RELEASE @@ -78,7 +78,7 @@ choice #!end-if help Version control system from which the sources will be checked out. - The default value points to the development repository for @@name@@. + The default value points to the development repository for @@pkg_label@@. config @@pfx@@_DEVEL_VCS_git bool "Git" @@ -191,13 +191,13 @@ config @@pfx@@_ARCHIVE_DIRNAME #!// #!if [ -n "@@all_versions@@" -a -z "@@versionlocked@@" ] choice - bool "Version of @@name@@" + bool "Version of @@pkg_label@@" help - For a released version, select the version of @@name@@ to download + 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 @@name@@. + quirks while building @@pkg_label@@. config @@pfx@@_VERY_NEW bool "newer than anything below" diff --git a/packages/cloog/package.desc b/packages/cloog/package.desc index 76252ae2..333a45c6 100644 --- a/packages/cloog/package.desc +++ b/packages/cloog/package.desc @@ -1,4 +1,4 @@ -name='CLooG' +pkg_label='CLooG' repository='git git://repo.or.cz/cloog.git' mirrors='http://www.bastoul.net/cloog/pages/download ftp://gcc.gnu.org/pub/gcc/infrastructure' milestones='0.18 0.18.1 0.18.4' diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index d229a537..8fb51b8d 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -12,7 +12,6 @@ do_binutils_get() { # Extract binutils do_binutils_extract() { - # TBD handle xtensa overlays in CT_ExtractPatch CT_ExtractPatch BINUTILS if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then CT_ExtractPatch ELF2FLT diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index cdc70474..19d9d6dc 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -5,7 +5,6 @@ do_debug_gdb_get() { } do_debug_gdb_extract() { - # TBD xtensa overlays CT_ExtractPatch GDB } diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh index 05f98307..5c4a3562 100644 --- a/scripts/build/libc/newlib.sh +++ b/scripts/build/libc/newlib.sh @@ -10,7 +10,6 @@ do_libc_get() { } do_libc_extract() { - # TBD xtensa overlays CT_ExtractPatch NEWLIB } diff --git a/scripts/upgrade.sed b/scripts/upgrade.sed index 2a05192c..995b804e 100644 --- a/scripts/upgrade.sed +++ b/scripts/upgrade.sed @@ -19,8 +19,6 @@ s/\