diff --git a/config.sh b/config.sh index b023610618dfcdc5b73737ab61b4dcc486197454..ad8d6307ed6851d05cfea3176686b8d7062f30be 100755 --- a/config.sh +++ b/config.sh @@ -2,7 +2,10 @@ set -e # Configuration -export TARGET=x86_64-unknown-redox +ARCH=x86_64 +export TARGET=$ARCH-unknown-redox +HOST=$ARCH-elf-redox +RUST_HOST=$ARCH-unknown-redox # Automatic variables ROOT="$(cd `dirname "$0"` && pwd)" diff --git a/recipes/curl/recipe.sh b/recipes/curl/recipe.sh index e3ec678872abe9d1f26386afb83506b4f2a8f6b1..cc11e1e63b49d859534f7a4e6117257d0770fd02 100644 --- a/recipes/curl/recipe.sh +++ b/recipes/curl/recipe.sh @@ -2,8 +2,6 @@ GIT=https://github.com/ids1024/curl.git BRANCH=redox BUILD_DEPENDS=(openssl) -HOST=x86_64-elf-redox - function recipe_version { printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" skip=1 diff --git a/recipes/dash/recipe.sh b/recipes/dash/recipe.sh index 26c147b787efd89811549f835e9286caa4fc20dc..83bc8687793e682101ea08b0406f7a46f87245eb 100644 --- a/recipes/dash/recipe.sh +++ b/recipes/dash/recipe.sh @@ -1,7 +1,6 @@ GIT=https://github.com/redox-os/dash.git BRANCH=redox -HOST=x86_64-elf-redox export AR="${HOST}-ar" export AS="${HOST}-as" export CC="${HOST}-gcc" diff --git a/recipes/diffutils/recipe.sh b/recipes/diffutils/recipe.sh index f96a833c6fe73d89712ef2ad755d0dd0bca52abb..ea089587f65df48aed49b56c85b27677280953e2 100644 --- a/recipes/diffutils/recipe.sh +++ b/recipes/diffutils/recipe.sh @@ -1,8 +1,6 @@ VERSION=3.6 TAR=http://ftp.gnu.org/gnu/diffutils/diffutils-$VERSION.tar.xz -HOST=x86_64-elf-redox - function recipe_version { echo "$VERSION" skip=1 diff --git a/recipes/expat/recipe.sh b/recipes/expat/recipe.sh index 672180052f4e1f631ac6e6eae1d9ac27ef2bbb0b..99a07049e09496a3fdeea772a5c53b8d927f4ba4 100644 --- a/recipes/expat/recipe.sh +++ b/recipes/expat/recipe.sh @@ -1,8 +1,6 @@ VERSION=2.2.1 TAR=http://downloads.sourceforge.net/project/expat/expat/$VERSION/expat-$VERSION.tar.bz2 -HOST=x86_64-elf-redox - function recipe_version { echo "$VERSION" skip=1 diff --git a/recipes/gawk/recipe.sh b/recipes/gawk/recipe.sh index 93a242f8cf5500cb43821698a78769cfe29e6bae..0658bdd60a604e53ab3f1f587b5fbc41fa31b8c6 100644 --- a/recipes/gawk/recipe.sh +++ b/recipes/gawk/recipe.sh @@ -1,8 +1,6 @@ GIT=https://github.com/redox-os/gawk BRANCH=redox -HOST=x86_64-elf-redox - function recipe_update { echo "skipping update" skip=1 diff --git a/recipes/gcc/recipe.sh b/recipes/gcc/recipe.sh index 93c1818b099161c64de2e83690d08dcf9c1e9b27..760fcf7cf1836d4df3fc0df7a422fc5f5528f939 100644 --- a/recipes/gcc/recipe.sh +++ b/recipes/gcc/recipe.sh @@ -1,7 +1,6 @@ GIT=https://github.com/redox-os/gcc.git BRANCH=redox -HOST=x86_64-elf-redox export AR="${HOST}-ar" export AS="${HOST}-as" export CC="${HOST}-gcc" @@ -52,7 +51,7 @@ function recipe_clean { function recipe_stage { dest="$(realpath $1)" make DESTDIR="$dest" install-gcc install-target-libgcc install-target-libstdc++-v3 - find "$dest"/{bin,libexec} -exec x86_64-elf-redox-strip {} ';' 2> /dev/null + find "$dest"/{bin,libexec} -exec $STRIP {} ';' 2> /dev/null ln -s "gcc" "$1/bin/cc" skip=1 } diff --git a/recipes/git/recipe.sh b/recipes/git/recipe.sh index 85699f0c87f703ca586cd5b496c9826ad8b5aa71..f9b212c4f0e9f86f244a54600f10c931baf00285 100644 --- a/recipes/git/recipe.sh +++ b/recipes/git/recipe.sh @@ -2,8 +2,6 @@ VERSION=2.13.1 TAR=https://www.kernel.org/pub/software/scm/git/git-$VERSION.tar.xz BUILD_DEPENDS=(zlib curl openssl expat) -HOST=x86_64-elf-redox - export AR="${HOST}-ar" export AS="${HOST}-as" export CC="${HOST}-gcc" diff --git a/recipes/gnu-binutils/recipe.sh b/recipes/gnu-binutils/recipe.sh index 8bbe558c9651a7e57e02ca3506700e0938330c32..4475c0c09e9d0b6af087a4edf5ce78334faf61e0 100644 --- a/recipes/gnu-binutils/recipe.sh +++ b/recipes/gnu-binutils/recipe.sh @@ -1,6 +1,5 @@ GIT=https://github.com/redox-os/binutils-gdb.git -HOST=x86_64-elf-redox export AR="${HOST}-ar" export AS="${HOST}-as" export CC="${HOST}-gcc" @@ -24,7 +23,7 @@ function recipe_update { } function recipe_build { - ./configure --host=${HOST} --target=${HOST} --prefix=/ --with-sysroot=/usr/x86_64-elf-redox --disable-gdb --disable-nls --disable-werror + ./configure --host=${HOST} --target=${HOST} --prefix=/ --with-sysroot=/usr/$HOST --disable-gdb --disable-nls --disable-werror make skip=1 } @@ -42,6 +41,6 @@ function recipe_clean { function recipe_stage { dest="$(realpath $1)" make DESTDIR="$dest" install - find "$dest/bin" -exec x86_64-elf-redox-strip {} ';' 2> /dev/null + find "$dest/bin" -exec $STRIP {} ';' 2> /dev/null skip=1 } diff --git a/recipes/gnu-grep/recipe.sh b/recipes/gnu-grep/recipe.sh index 938b1812413c132de8df3c4e713a422bfc33d525..6795cc2a396b30e2a64787131d2a9aaf0392a3c4 100644 --- a/recipes/gnu-grep/recipe.sh +++ b/recipes/gnu-grep/recipe.sh @@ -1,8 +1,6 @@ VERSION=3.1 TAR=https://ftp.gnu.org/gnu/grep/grep-$VERSION.tar.xz -HOST=x86_64-elf-redox - function recipe_version { echo "$VERSION" skip=1 diff --git a/recipes/gnu-make/recipe.sh b/recipes/gnu-make/recipe.sh index 9c0f0c3ea2c6833e11356f3e255dfd8a416b79b1..2d41262f432f5f5b41965c5c777acbef4737e535 100644 --- a/recipes/gnu-make/recipe.sh +++ b/recipes/gnu-make/recipe.sh @@ -1,8 +1,6 @@ VERSION=4.2.1 TAR=https://ftp.gnu.org/gnu/make/make-$VERSION.tar.gz -HOST=x86_64-elf-redox - export AR="${HOST}-ar" export AS="${HOST}-as" export CC="${HOST}-gcc" diff --git a/recipes/lua/recipe.sh b/recipes/lua/recipe.sh index d976d114cc4fcf04812ff07a17aa9a9eadf7675e..543b08c8f520ca65a31dcd820f84cf73446e5562 100644 --- a/recipes/lua/recipe.sh +++ b/recipes/lua/recipe.sh @@ -1,8 +1,6 @@ VERSION=5.3.1 TAR=http://www.lua.org/ftp/lua-$VERSION.tar.gz -HOST=x86_64-elf-redox - function recipe_version { echo "$VERSION" skip=1 diff --git a/recipes/nasm/recipe.sh b/recipes/nasm/recipe.sh index 0aedbd04b51d52e4f9948fa0646fbd9e81358ef4..66c5f9d7fba6b86b1ebf331ed027bbc0b1657e3b 100644 --- a/recipes/nasm/recipe.sh +++ b/recipes/nasm/recipe.sh @@ -1,8 +1,6 @@ VERSION=2.13.01 TAR=http://www.nasm.us/pub/nasm/releasebuilds/$VERSION/nasm-$VERSION.tar.gz -HOST=x86_64-elf-redox - function recipe_version { echo "$VERSION" skip=1 diff --git a/recipes/newlib/recipe.sh b/recipes/newlib/recipe.sh index 78950b9a62c310973ec3af409fd29e10f3cb56e6..58387f7302e99b158448861eef8ba07d5e6f9d46 100644 --- a/recipes/newlib/recipe.sh +++ b/recipes/newlib/recipe.sh @@ -1,8 +1,6 @@ GIT=https://github.com/redox-os/newlib.git BRANCH=redox -HOST=x86_64-elf-redox - function recipe_version { printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" skip=1 @@ -46,7 +44,7 @@ function recipe_stage { dest="$(realpath $1)" make DESTDIR="$dest" install cd "$dest" - mv x86_64-elf-redox/* ./ - rmdir x86_64-elf-redox + mv $HOST/* ./ + rmdir $HOST skip=1 } diff --git a/recipes/openssl/recipe.sh b/recipes/openssl/recipe.sh index 48559cac75479e8587133ab0a3c59deda42aa4a6..5aef73cb30e9dcd9bd2419af4da917f1a9e917df 100644 --- a/recipes/openssl/recipe.sh +++ b/recipes/openssl/recipe.sh @@ -1,8 +1,6 @@ GIT=https://github.com/ids1024/openssl.git BRANCH=redox -HOST=x86_64-elf-redox - function recipe_version { printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" skip=1 @@ -14,7 +12,7 @@ function recipe_update { } function recipe_build { - ./Configure no-shared no-dgram redox-x86_64 --prefix="/" + ./Configure no-shared no-dgram redox-$ARCH --prefix="/" make -j"$(nproc)" skip=1 } diff --git a/recipes/python/recipe.sh b/recipes/python/recipe.sh index c0d11da0a6494e572412853e504cd2f6b845e3a5..2a8783cfa76139e61055f20e4193e905551725d1 100644 --- a/recipes/python/recipe.sh +++ b/recipes/python/recipe.sh @@ -1,9 +1,6 @@ VERSION=3.6.1 TAR=https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz -ARCH=x86_64 -HOST=x86_64-elf-redox - export AR="${HOST}-ar" export AS="${HOST}-as" export CC="${HOST}-gcc" diff --git a/recipes/rust/recipe.sh b/recipes/rust/recipe.sh index c2e13f227763d4ad1e9c66579dfebcf1edf8eb09..e10d07499ba1e86cf8549953aacc27ec1e648763 100644 --- a/recipes/rust/recipe.sh +++ b/recipes/rust/recipe.sh @@ -1,13 +1,11 @@ GIT=https://github.com/ids1024/rust.git BRANCH=compile-redox -ARCH=x86_64 -HOST=x86_64-elf-redox -RUST_HOST=x86_64-unknown-redox LLVM_PREFIX=$PWD/build/llvm-root -SYSROOT=/usr/x86_64-elf-redox +SYSROOT=/usr/$HOST unset AR AS CC CXX LD NM OBJCOPY OBJDUMP RANLIB READELF STRIP + LLVM_CMAKE_ARGS=(-Wno-dev -DCMAKE_CROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX="$LLVM_PREFIX" -DLLVM_DEFAULT_TARGET_TRIPLE=$HOST -DLLVM_TARGET_ARCH=$ARCH -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_SYSTEM_NAME=Generic -DPYTHON_EXECUTABLE=/usr/bin/python2 -DUNIX=1 -DLLVM_ENABLE_THREADS=Off -DLLVM_INCLUDE_TESTS=OFF -target=$HOST -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen -I"$SYSROOT/include" -DCMAKE_CXX_FLAGS='--std=gnu++11' -DLLVM_TOOL_LTO_BUILD=Off -DLLVM_TOOL_LLVM_PROFDATA_BUILD=Off -DLLVM_TOOL_LLI_BUILD=Off -DLLVM_TOOL_RDOBJ_BUILD=Off -DLLVM_TOOL_LLVM_COV_BUILD=Off -DLLVM_TOOL_LLVM_XRAY_BUILD=Off -DLLVM_TOOL_LLVM_LTO2_BUILD=Off -DLLVM_TOOL_LLVM_LTO_BUILD=Off -DLLVM_TOOL_LLVM_RTDYLD_BUILD=Off) function recipe_version { diff --git a/recipes/sed/recipe.sh b/recipes/sed/recipe.sh index 7e09799d938316a883926d5e6ce232cbfcb14632..ca77b91021868de04890073e5bf2f3227ba90d70 100644 --- a/recipes/sed/recipe.sh +++ b/recipes/sed/recipe.sh @@ -1,8 +1,6 @@ VERSION=4.4 TAR=http://ftp.gnu.org/gnu/sed/sed-$VERSION.tar.xz -HOST=x86_64-elf-redox - function recipe_version { echo "$VERSION" skip=1