diff options
Diffstat (limited to 'scripts/build/companion_tools')
-rw-r--r-- | scripts/build/companion_tools/050-make.sh | 38 | ||||
-rw-r--r-- | scripts/build/companion_tools/100-m4.sh | 31 | ||||
-rw-r--r-- | scripts/build/companion_tools/200-autoconf.sh | 24 | ||||
-rw-r--r-- | scripts/build/companion_tools/300-automake.sh | 24 | ||||
-rw-r--r-- | scripts/build/companion_tools/400-libtool.sh | 24 | ||||
-rw-r--r-- | scripts/build/companion_tools/500-dtc.sh | 87 | ||||
-rw-r--r-- | scripts/build/companion_tools/510-bison.sh | 66 |
7 files changed, 239 insertions, 55 deletions
diff --git a/scripts/build/companion_tools/050-make.sh b/scripts/build/companion_tools/050-make.sh index 44487c1..df77d5b 100644 --- a/scripts/build/companion_tools/050-make.sh +++ b/scripts/build/companion_tools/050-make.sh @@ -1,17 +1,17 @@ # Build script for make -do_companion_tools_make_get() { - CT_GetFile "make-${CT_MAKE_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/make +do_companion_tools_make_get() +{ + CT_Fetch MAKE } -do_companion_tools_make_extract() { - CT_Extract "make-${CT_MAKE_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/make-${CT_MAKE_VERSION}" - CT_Patch "make" "${CT_MAKE_VERSION}" +do_companion_tools_make_extract() +{ + CT_ExtractPatch MAKE } -do_companion_tools_make_for_build() { +do_companion_tools_make_for_build() +{ CT_DoStep INFO "Installing make for build" CT_mkdir_pushd "${CT_BUILD_DIR}/build-make-build" do_make_backend \ @@ -23,10 +23,14 @@ do_companion_tools_make_for_build() { if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then CT_DoExecLog ALL ln -sv make "${CT_BUILD_COMPTOOLS_DIR}/bin/gmake" fi + if [ "${CT_MAKE_GNUMAKE_SYMLINK}" = "y" ]; then + CT_DoExecLog ALL ln -sv make "${CT_BUILD_COMPTOOLS_DIR}/bin/gnumake" + fi CT_EndStep } -do_companion_tools_make_for_host() { +do_companion_tools_make_for_host() +{ CT_DoStep INFO "Installing make for host" CT_mkdir_pushd "${CT_BUILD_DIR}/build-make-host" do_make_backend \ @@ -38,27 +42,37 @@ do_companion_tools_make_for_host() { if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then CT_DoExecLog ALL ln -sv make "${CT_PREFIX_DIR}/bin/gmake" fi + if [ "${CT_MAKE_GNUMAKE_SYMLINK}" = "y" ]; then + CT_DoExecLog ALL ln -sv make "${CT_PREFIX_DIR}/bin/gnumake" + fi CT_EndStep } -do_make_backend() { +do_make_backend() +{ local host local prefix local cflags local ldflags + local -a extra_config for arg in "$@"; do eval "${arg// /\\ }" done + if [ "${host}" != "${CT_BUILD}" ]; then + extra_config+=( --without-guile ) + fi + CT_DoLog EXTRA "Configuring make" CT_DoExecLog CFG \ CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/make-${CT_MAKE_VERSION}/configure" \ + "${CT_SRC_DIR}/make/configure" \ --host="${host}" \ - --prefix="${prefix}" + --prefix="${prefix}" \ + "${extra_config[@]}" CT_DoLog EXTRA "Building make" CT_DoExecLog ALL make diff --git a/scripts/build/companion_tools/100-m4.sh b/scripts/build/companion_tools/100-m4.sh index e0fccd7..7d9044f 100644 --- a/scripts/build/companion_tools/100-m4.sh +++ b/scripts/build/companion_tools/100-m4.sh @@ -1,16 +1,17 @@ # Build script for m4 -do_companion_tools_m4_get() { - CT_GetFile "m4-${CT_M4_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/m4 +do_companion_tools_m4_get() +{ + CT_Fetch M4 } -do_companion_tools_m4_extract() { - CT_Extract "m4-${CT_M4_VERSION}" - CT_Patch "m4" "${CT_M4_VERSION}" +do_companion_tools_m4_extract() +{ + CT_ExtractPatch M4 } -do_companion_tools_m4_for_build() { +do_companion_tools_m4_for_build() +{ CT_DoStep INFO "Installing m4 for build" CT_mkdir_pushd "${CT_BUILD_DIR}/build-m4-build" do_m4_backend \ @@ -22,7 +23,8 @@ do_companion_tools_m4_for_build() { CT_EndStep } -do_companion_tools_m4_for_host() { +do_companion_tools_m4_for_host() +{ CT_DoStep INFO "Installing m4 for host" CT_mkdir_pushd "${CT_BUILD_DIR}/build-m4-host" do_m4_backend \ @@ -34,11 +36,13 @@ do_companion_tools_m4_for_host() { CT_EndStep } -do_m4_backend() { +do_m4_backend() +{ local host local prefix local cflags local ldflags + local libs for arg in "$@"; do eval "${arg// /\\ }" @@ -51,14 +55,21 @@ do_m4_backend() { # it includes system <spawn.h> but expects a locally-built # posix_spawn(). ldflags="${ldflags} -lrt" + ;; + *-mingw32) + # m4 is built with stack smashing protection enabled which + # is not part of mingw-w64 c library in v7.0.0 and later. + libs="${libs} -lssp" + ;; esac CT_DoLog EXTRA "Configuring m4" CT_DoExecLog CFG \ CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ + LIBS="${libs}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/m4-${CT_M4_VERSION}/configure" \ + "${CT_SRC_DIR}/m4/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/companion_tools/200-autoconf.sh b/scripts/build/companion_tools/200-autoconf.sh index bccef75..28ff651 100644 --- a/scripts/build/companion_tools/200-autoconf.sh +++ b/scripts/build/companion_tools/200-autoconf.sh @@ -1,17 +1,17 @@ # Build script for autoconf -do_companion_tools_autoconf_get() { - CT_GetFile "autoconf-${CT_AUTOCONF_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/autoconf +do_companion_tools_autoconf_get() +{ + CT_Fetch AUTOCONF } -do_companion_tools_autoconf_extract() { - CT_Extract "autoconf-${CT_AUTOCONF_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}" - CT_Patch "autoconf" "${CT_AUTOCONF_VERSION}" +do_companion_tools_autoconf_extract() +{ + CT_ExtractPatch AUTOCONF } -do_companion_tools_autoconf_for_build() { +do_companion_tools_autoconf_for_build() +{ CT_DoStep INFO "Installing autoconf for build" CT_mkdir_pushd "${CT_BUILD_DIR}/build-autoconf-build" do_autoconf_backend host=${CT_BUILD} prefix="${CT_BUILD_COMPTOOLS_DIR}" @@ -19,7 +19,8 @@ do_companion_tools_autoconf_for_build() { CT_EndStep } -do_companion_tools_autoconf_for_host() { +do_companion_tools_autoconf_for_host() +{ CT_DoStep INFO "Installing autoconf for host" CT_mkdir_pushd "${CT_BUILD_DIR}/build-autoconf-host" do_autoconf_backend host=${CT_HOST} prefix="${CT_PREFIX_DIR}" @@ -27,7 +28,8 @@ do_companion_tools_autoconf_for_host() { CT_EndStep } -do_autoconf_backend() { +do_autoconf_backend() +{ local host local prefix @@ -42,7 +44,7 @@ do_autoconf_backend() { CT_DoLog EXTRA "Configuring autoconf" CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}/configure" \ + "${CT_SRC_DIR}/autoconf/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/companion_tools/300-automake.sh b/scripts/build/companion_tools/300-automake.sh index ee76463..9f7dd49 100644 --- a/scripts/build/companion_tools/300-automake.sh +++ b/scripts/build/companion_tools/300-automake.sh @@ -1,17 +1,17 @@ # Build script for automake -do_companion_tools_automake_get() { - CT_GetFile "automake-${CT_AUTOMAKE_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/automake +do_companion_tools_automake_get() +{ + CT_Fetch AUTOMAKE } -do_companion_tools_automake_extract() { - CT_Extract "automake-${CT_AUTOMAKE_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/automake-${CT_AUTOMAKE_VERSION}" - CT_Patch "automake" "${CT_AUTOMAKE_VERSION}" +do_companion_tools_automake_extract() +{ + CT_ExtractPatch AUTOMAKE } -do_companion_tools_automake_for_build() { +do_companion_tools_automake_for_build() +{ CT_DoStep INFO "Installing automake for build" CT_mkdir_pushd "${CT_BUILD_DIR}/build-automake-build" do_automake_backend host=${CT_BUILD} prefix="${CT_BUILD_COMPTOOLS_DIR}" @@ -19,7 +19,8 @@ do_companion_tools_automake_for_build() { CT_EndStep } -do_companion_tools_automake_for_host() { +do_companion_tools_automake_for_host() +{ CT_DoStep INFO "Installing automake for host" CT_mkdir_pushd "${CT_BUILD_DIR}/build-automake-host" do_automake_backend host=${CT_HOST} prefix="${CT_PREFIX_DIR}" @@ -27,7 +28,8 @@ do_companion_tools_automake_for_host() { CT_EndStep } -do_automake_backend() { +do_automake_backend() +{ local host local prefix @@ -38,7 +40,7 @@ do_automake_backend() { CT_DoLog EXTRA "Configuring automake" CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/automake-${CT_AUTOMAKE_VERSION}/configure" \ + "${CT_SRC_DIR}/automake/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/companion_tools/400-libtool.sh b/scripts/build/companion_tools/400-libtool.sh index 4461207..f7aeb6c 100644 --- a/scripts/build/companion_tools/400-libtool.sh +++ b/scripts/build/companion_tools/400-libtool.sh @@ -1,17 +1,17 @@ # Build script for libtool -do_companion_tools_libtool_get() { - CT_GetFile "libtool-${CT_LIBTOOL_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/libtool +do_companion_tools_libtool_get() +{ + CT_Fetch LIBTOOL } -do_companion_tools_libtool_extract() { - CT_Extract "libtool-${CT_LIBTOOL_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/libtool-${CT_LIBTOOL_VERSION}" - CT_Patch "libtool" "${CT_LIBTOOL_VERSION}" +do_companion_tools_libtool_extract() +{ + CT_ExtractPatch LIBTOOL } -do_companion_tools_libtool_for_build() { +do_companion_tools_libtool_for_build() +{ CT_DoStep INFO "Installing libtool for build" CT_mkdir_pushd "${CT_BUILD_DIR}/build-libtool-build" do_libtool_backend host=${CT_BUILD} prefix="${CT_BUILD_COMPTOOLS_DIR}" @@ -19,7 +19,8 @@ do_companion_tools_libtool_for_build() { CT_EndStep } -do_companion_tools_libtool_for_host() { +do_companion_tools_libtool_for_host() +{ CT_DoStep INFO "Installing libtool for host" CT_mkdir_pushd "${CT_BUILD_DIR}/build-libtool-host" do_libtool_backend host=${CT_HOST} prefix="${CT_PREFIX_DIR}" @@ -27,7 +28,8 @@ do_companion_tools_libtool_for_host() { CT_EndStep } -do_libtool_backend() { +do_libtool_backend() +{ local host local prefix @@ -38,7 +40,7 @@ do_libtool_backend() { CT_DoLog EXTRA "Configuring libtool" CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/libtool-${CT_LIBTOOL_VERSION}/configure" \ + "${CT_SRC_DIR}/libtool/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/companion_tools/500-dtc.sh b/scripts/build/companion_tools/500-dtc.sh new file mode 100644 index 0000000..a16ff62 --- /dev/null +++ b/scripts/build/companion_tools/500-dtc.sh @@ -0,0 +1,87 @@ +# Build script for DTC (device tree compiler) + +do_companion_tools_dtc_get() +{ + CT_Fetch DTC +} + +do_companion_tools_dtc_extract() +{ + CT_ExtractPatch DTC +} + +do_companion_tools_dtc_for_build() +{ + CT_DoStep INFO "Installing dtc for build" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-dtc-build" + do_dtc_backend \ + host=${CT_BUILD} \ + prefix="${CT_BUILD_COMPTOOLS_DIR}" \ + cflags="${CT_CFLAGS_FOR_BUILD}" \ + ldflags="${CT_LDFLAGS_FOR_BUILD}" + CT_Popd + CT_EndStep +} + +do_companion_tools_dtc_for_host() +{ + CT_DoStep INFO "Installing dtc for host" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-dtc-host" + do_dtc_backend \ + host=${CT_HOST} \ + prefix="${CT_PREFIX_DIR}" \ + cflags="${CT_CFLAGS_FOR_HOST}" \ + ldflags="${CT_LDFLAGS_FOR_HOST}" + CT_Popd + CT_EndStep +} + +do_dtc_backend() +{ + local host + local prefix + local cflags + local ldflags + local -a extra_opts + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + # Override PKG_CONFIG: if pkg-config is not installed, DTC's makefile + # misinterprets the error code and tries to enable YAML support while + # not linking against libyaml. NO_YAML=1 is sufficient to make the build + # pass; PKG_CONFIG=/bin/true just suppresses some scary error messages. + extra_opts=( \ + CC="${host}-gcc" \ + AR="${host}-ar" \ + PREFIX="${prefix}" \ + PKG_CONFIG=/bin/true \ + NO_PYTHON=1 \ + NO_YAML=1 \ + BIN=dtc \ + ) + if [ -n "${CT_DTC_VERBOSE}" ]; then + extra_opts+=( V=1 ) + fi + case "${host}" in + *-mingw32) + # Turn off warnings: mingw32 hosts complain about %zd formats even though + # they seem to be supported by mingw32. Only build 'dtc', again, because + # other binaries use syscalls not available under mingw32, but we also + # do not need them. Hijack WARNINGS to override lstat with stat (Windows + # does not have symlinks). + extra_opts+=( BIN=dtc WARNINGS=-Dlstat=stat ) + ;; + esac + + CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/dtc/." . + + CT_DoLog EXTRA "Building dtc" + CT_DoExecLog ALL make all "${extra_opts[@]}" + + # Only install binaries, we don't support shared libraries in installation + # directory yet. + CT_DoLog EXTRA "Installing dtc" + CT_DoExecLog ALL make install-bin "${extra_opts[@]}" +} diff --git a/scripts/build/companion_tools/510-bison.sh b/scripts/build/companion_tools/510-bison.sh new file mode 100644 index 0000000..90bf9ec --- /dev/null +++ b/scripts/build/companion_tools/510-bison.sh @@ -0,0 +1,66 @@ +# Build script for bison + +do_companion_tools_bison_get() +{ + CT_Fetch BISON +} + +do_companion_tools_bison_extract() +{ + CT_ExtractPatch BISON +} + +do_companion_tools_bison_for_build() +{ + CT_DoStep INFO "Installing bison for build" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-bison-build" + do_bison_backend \ + host=${CT_BUILD} \ + prefix="${CT_BUILD_COMPTOOLS_DIR}" \ + cflags="${CT_CFLAGS_FOR_BUILD}" \ + ldflags="${CT_LDFLAGS_FOR_BUILD}" + CT_Popd + CT_EndStep +} + +do_companion_tools_bison_for_host() +{ + CT_DoStep INFO "Installing bison for host" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-bison-host" + do_bison_backend \ + host=${CT_HOST} \ + prefix="${CT_PREFIX_DIR}" \ + cflags="${CT_CFLAGS_FOR_HOST}" \ + ldflags="${CT_LDFLAGS_FOR_HOST}" + CT_Popd + CT_EndStep +} + +do_bison_backend() +{ + local host + local prefix + local cflags + local ldflags + local -a extra_config + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + CT_DoLog EXTRA "Configuring bison" + CT_DoExecLog CFG \ + CFLAGS="${cflags}" \ + LDFLAGS="${ldflags}" \ + ${CONFIG_SHELL} \ + "${CT_SRC_DIR}/bison/configure" \ + --host="${host}" \ + --prefix="${prefix}" \ + "${extra_config[@]}" + + CT_DoLog EXTRA "Building bison" + CT_DoExecLog ALL make + + CT_DoLog EXTRA "Installing bison" + CT_DoExecLog ALL make install +} |