Skip to content

Commit

Permalink
Merge pull request #556 from Prince213/update-scripts
Browse files Browse the repository at this point in the history
Update scripts
  • Loading branch information
niXman authored Aug 11, 2021
2 parents a276d59 + 4b15c31 commit 90a6683
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 71 deletions.
6 changes: 2 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ while [[ $# > 0 ]]; do
--no-strip) STRIP_ON_INSTALL=no ;;
--static-gcc)
BOOTSTRAPING=yes
LINK_TYPE_GCC=$LINK_TYPE_STATIC
LINK_TYPE_GCC=$LINK_TYPE_GCC_STATIC
GCC_DEPS_LINK_TYPE=$LINK_TYPE_STATIC
BUILD_SHARED_GCC=no
LINK_TYPE_SUFFIX=static
Expand Down Expand Up @@ -879,10 +879,8 @@ for rule in ${SUBTARGETS[@]}; do
_reverse_arch=$(func_get_reverse_arch $BUILD_ARCHITECTURE)
_reverse_bits=$(func_get_reverse_arch_bit $BUILD_ARCHITECTURE)
mkdir -p $TESTS_ROOT_DIR/${_reverse_arch}
[[ $BUILD_SHARED_GCC == yes ]] && {
cp -f $( find $PREFIX/$TARGET/lib${_reverse_bits} -type f \( -iname *.dll \) ) \
cp -f $( find $PREFIX/$TARGET/lib${_reverse_bits} -type f \( -iname *.dll \) ) \
$TESTS_ROOT_DIR/${_reverse_arch}/
}
}
for test in "${!PKG_TESTS[@]}"; do
func_test $test ${PKG_TESTS[$test]} $TESTS_ROOT_DIR
Expand Down
6 changes: 3 additions & 3 deletions library/config-win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

# **************************************************************************

readonly HOST_MINGW_VERSION=7.2.0
readonly HOST_MINGW_RT_VERSION=5
readonly HOST_MINGW_BUILD_REV=1
readonly HOST_MINGW_VERSION=8.1.0
readonly HOST_MINGW_RT_VERSION=6
readonly HOST_MINGW_BUILD_REV=0
readonly i686_HOST_MINGW_PATH_URL="https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/$HOST_MINGW_VERSION/threads-posix/{exceptions}/i686-$HOST_MINGW_VERSION-release-posix-{exceptions}-rt_v$HOST_MINGW_RT_VERSION-rev$HOST_MINGW_BUILD_REV.7z"
readonly x86_64_HOST_MINGW_PATH_URL="https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/$HOST_MINGW_VERSION/threads-posix/{exceptions}/x86_64-$HOST_MINGW_VERSION-release-posix-{exceptions}-rt_v$HOST_MINGW_RT_VERSION-rev$HOST_MINGW_BUILD_REV.7z"

Expand Down
7 changes: 4 additions & 3 deletions library/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ PROCESSOR_OPTIMIZATION_ARCH_64='nocona'

# **************************************************************************

LINK_TYPE_BOTH="--enable-shared --enable-static"
LINK_TYPE_SHARED="--enable-shared --disable-static"
LINK_TYPE_STATIC="--enable-static --disable-shared"
LINK_TYPE_GCC=$LINK_TYPE_BOTH
LINK_TYPE_GCC_SHARED="--enable-host-shared"
LINK_TYPE_GCC_STATIC="--disable-host-shared"
LINK_TYPE_GCC=$LINK_TYPE_GCC_SHARED
GCC_DEPS_LINK_TYPE=$LINK_TYPE_STATIC

ENABLE_LANGUAGES='c,c++,fortran'
Expand All @@ -99,7 +100,7 @@ SHOW_LOG_ON_ERROR=yes

JOBS=4

RUNTIME_VERSION=v7
RUNTIME_VERSION=v9
RUNTIME_BRANCH="master"

CLANG_GCC_VERSION=gcc-4.9.3
Expand Down
19 changes: 19 additions & 0 deletions licenses/isl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 4 additions & 1 deletion scripts/binutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ PKG_CONFIGURE_FLAGS=(
--disable-nls
--disable-shared
#
$LINK_TYPE_GCC
$( [[ $BUILD_SHARED_GCC == yes ]] \
&& echo "$LINK_TYPE_SHARED" \
|| echo "$LINK_TYPE_STATIC"
)
#
CFLAGS="\"$COMMON_CFLAGS\""
CXXFLAGS="\"$COMMON_CXXFLAGS\""
Expand Down
1 change: 1 addition & 0 deletions scripts/gcc-11.2.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ PKG_CONFIGURE_FLAGS=(
--with-sysroot=$PREFIX
#--with-gxx-include-dir=$MINGWPREFIX/$TARGET/include/c++
#
--enable-shared
$LINK_TYPE_GCC
#
$( [[ $USE_MULTILIB == yes ]] \
Expand Down
72 changes: 30 additions & 42 deletions scripts/gcc-post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,70 +61,58 @@ function gcc_post_install {

local _gcc_version=$(func_map_gcc_name_to_gcc_version $_GCC_NAME)
local _reverse_bits=$(func_get_reverse_arch_bit $BUILD_ARCHITECTURE)
[[ $BUILD_SHARED_GCC == yes ]] && {
# libgcc_s.a
cp -f $PREFIX/lib/gcc/$TARGET/lib/libgcc_s.a $PREFIX/$TARGET/lib/ \
|| die "Cannot copy libgcc_s.a to $PREFIX/$TARGET/lib"
}
# libgcc_s.a
cp -f $PREFIX/lib/gcc/$TARGET/lib/libgcc_s.a $PREFIX/$TARGET/lib/ \
|| die "Cannot copy libgcc_s.a to $PREFIX/$TARGET/lib"

func_has_lang objc
local is_objc=$?
[[ $is_objc == 1 ]] && {
# libobjc
cp -f $BUILDS_DIR/$_GCC_NAME/$TARGET/libobjc/.libs/libobjc.a $PREFIX/lib/gcc/$TARGET/$_gcc_version/ \
|| die "Cannot copy libobjc.a to $PREFIX/lib/gcc/$TARGET/$_gcc_version"
[[ $BUILD_SHARED_GCC == yes ]] && {
cp -f $BUILDS_DIR/$_GCC_NAME/$TARGET/libobjc/.libs/libobjc.dll.a $PREFIX/lib/gcc/$TARGET/$_gcc_version/ \
|| die "Cannot copy libobjc.dll.a to $PREFIX/lib/gcc/$TARGET/$_gcc_version"
}
cp -f $BUILDS_DIR/$_GCC_NAME/$TARGET/libobjc/.libs/libobjc.dll.a $PREFIX/lib/gcc/$TARGET/$_gcc_version/ \
|| die "Cannot copy libobjc.dll.a to $PREFIX/lib/gcc/$TARGET/$_gcc_version"
# objc headers
cp -rf ${SRCS_DIR}/$_GCC_NAME/libobjc/objc $PREFIX/lib/gcc/$TARGET/$_gcc_version/include \
|| die "Cannot copy objc headers to $PREFIX/lib/gcc/$TARGET/$_gcc_version/include"
}

[[ $BUILD_SHARED_GCC == yes ]] && {
# builded architecture dlls
local _dlls=( $(find $BUILDS_DIR/$_GCC_NAME/$TARGET \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/32 -prune \) \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/64 -prune \) \
-not \( -path $BUILDS_DIR/$_GCC_NAME/gcc/ada -prune \) \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/libada/adainclude -prune \) \
-type f -name *.dll) )
cp -f ${_dlls[@]} $PREFIX/bin/ > /dev/null 2>&1 || die "Cannot copy architecture dlls to $PREFIX/bin/"
cp -f ${_dlls[@]} $PREFIX/$TARGET/lib/ > /dev/null 2>&1 || die "Cannot copy architecture dlls to $PREFIX/lib/"

[[ $STRIP_ON_INSTALL == yes ]] && {
strip $PREFIX/bin/*.dll || die "Error stripping dlls from $PREFIX/bin"
strip $PREFIX/$TARGET/lib/*.dll || die "Error stripping dlls from $PREFIX/$TARGET/lib"
}
# builded architecture dlls
local _dlls=( $(find $BUILDS_DIR/$_GCC_NAME/$TARGET \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/32 -prune \) \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/64 -prune \) \
-not \( -path $BUILDS_DIR/$_GCC_NAME/gcc/ada -prune \) \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/libada/adainclude -prune \) \
-type f -name *.dll) )
cp -f ${_dlls[@]} $PREFIX/bin/ > /dev/null 2>&1 || die "Cannot copy architecture dlls to $PREFIX/bin/"
cp -f ${_dlls[@]} $PREFIX/$TARGET/lib/ > /dev/null 2>&1 || die "Cannot copy architecture dlls to $PREFIX/lib/"

[[ $STRIP_ON_INSTALL == yes ]] && {
strip $PREFIX/bin/*.dll || die "Error stripping dlls from $PREFIX/bin"
strip $PREFIX/$TARGET/lib/*.dll || die "Error stripping dlls from $PREFIX/$TARGET/lib"
}
[[ $USE_MULTILIB == yes ]] && {
[[ $BUILD_SHARED_GCC == yes ]] && {
# libgcc_s.a
cp -f $PREFIX/lib/gcc/$TARGET/lib$_reverse_bits/libgcc_s.a $PREFIX/$TARGET/lib$_reverse_bits/ \
|| die "Cannot copy libgcc_s.a to $PREFIX/$TARGET/lib${_reverse_bits}/"
}
# libgcc_s.a
cp -f $PREFIX/lib/gcc/$TARGET/lib$_reverse_bits/libgcc_s.a $PREFIX/$TARGET/lib$_reverse_bits/ \
|| die "Cannot copy libgcc_s.a to $PREFIX/$TARGET/lib${_reverse_bits}/"

[[ $is_objc == 1 ]] && {
# libobjc libraries
cp -f $BUILDS_DIR/$_GCC_NAME/$TARGET/$_reverse_bits/libobjc/.libs/libobjc.a $PREFIX/lib/gcc/$TARGET/$_gcc_version/$_reverse_bits/ \
|| die "Cannot copy libobjc.a to $PREFIX/lib/gcc/$TARGET/$_gcc_version/${_reverse_bits}"
[[ $BUILD_SHARED_GCC == yes ]] && {
cp -f $BUILDS_DIR/$_GCC_NAME/$TARGET/$_reverse_bits/libobjc/.libs/libobjc.dll.a $PREFIX/lib/gcc/$TARGET/$_gcc_version/$_reverse_bits/ \
|| die "Cannot copy libobjc.dll.a to $PREFIX/lib/gcc/$TARGET/$_gcc_version/${_reverse_bits}"
}
cp -f $BUILDS_DIR/$_GCC_NAME/$TARGET/$_reverse_bits/libobjc/.libs/libobjc.dll.a $PREFIX/lib/gcc/$TARGET/$_gcc_version/$_reverse_bits/ \
|| die "Cannot copy libobjc.dll.a to $PREFIX/lib/gcc/$TARGET/$_gcc_version/${_reverse_bits}"
}

[[ $BUILD_SHARED_GCC == yes ]] && {
# Second architecture bit dlls
find $BUILDS_DIR/$_GCC_NAME/$TARGET/$_reverse_bits \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/$_reverse_bits/libada/adainclude -prune \) \
-type f -name *.dll ! -name *winpthread* -print0 \
| xargs -0 -I{} cp -f {} $PREFIX/$TARGET/lib$_reverse_bits/ || die "Error copying ${_reverse_bits}-bit dlls"
# Second architecture bit dlls
find $BUILDS_DIR/$_GCC_NAME/$TARGET/$_reverse_bits \
-not \( -path $BUILDS_DIR/$_GCC_NAME/$TARGET/$_reverse_bits/libada/adainclude -prune \) \
-type f -name *.dll ! -name *winpthread* -print0 \
| xargs -0 -I{} cp -f {} $PREFIX/$TARGET/lib$_reverse_bits/ || die "Error copying ${_reverse_bits}-bit dlls"

[[ $STRIP_ON_INSTALL == yes ]] && {
strip $PREFIX/$TARGET/lib$_reverse_bits/*.dll || die "Error stripping ${_reverse_bits}-bit dlls"
}
[[ $STRIP_ON_INSTALL == yes ]] && {
strip $PREFIX/$TARGET/lib$_reverse_bits/*.dll || die "Error stripping ${_reverse_bits}-bit dlls"
}
}

Expand Down
1 change: 1 addition & 0 deletions scripts/licenses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function func_get_licenses {
mpfr
mpc
ppl
isl
cloog
libiconv
zlib
Expand Down
24 changes: 9 additions & 15 deletions scripts/mingw-w64-runtime-post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ function runtime_post_install {
}

# winpthreads
[[ $BUILD_SHARED_GCC == yes ]] && {
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/bin/libwinpthread-1.dll $PREFIX/bin/ || { echo "13"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/bin/libwinpthread-1.dll $PREFIX/$TARGET/lib/ || { echo "14"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/lib/libwinpthread.dll.a $PREFIX/$TARGET/lib/ || { echo "15"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/lib/libpthread.dll.a $PREFIX/$TARGET/lib/ || { echo "16"; return 1; }
}
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/bin/libwinpthread-1.dll $PREFIX/bin/ || { echo "13"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/bin/libwinpthread-1.dll $PREFIX/$TARGET/lib/ || { echo "14"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/lib/libwinpthread.dll.a $PREFIX/$TARGET/lib/ || { echo "15"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/lib/libpthread.dll.a $PREFIX/$TARGET/lib/ || { echo "16"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/lib/libwinpthread.a $PREFIX/$TARGET/lib/ || { echo "17"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/lib/libpthread.a $PREFIX/$TARGET/lib/ || { echo "18"; return 1; }
cp -fv $RUNTIME_DIR/$BUILD_ARCHITECTURE-winpthreads-$RUNTIME_VERSION/include/*.h $PREFIX/$TARGET/include/ || { echo "19"; return 1; }
Expand Down Expand Up @@ -120,19 +118,15 @@ function runtime_post_install {
}

# winpthreads
[[ $BUILD_SHARED_GCC == yes ]] && {
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/bin/libwinpthread-1.dll $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "26"; return 1; }
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/lib/libwinpthread.dll.a $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "27"; return 1; }
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/lib/libpthread.dll.a $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "28"; return 1; }
}
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/bin/libwinpthread-1.dll $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "26"; return 1; }
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/lib/libwinpthread.dll.a $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "27"; return 1; }
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/lib/libpthread.dll.a $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "28"; return 1; }
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/lib/libwinpthread.a $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "29"; return 1; }
cp -fv $RUNTIME_DIR/$_reverse_arch-winpthreads-$RUNTIME_VERSION/lib/libpthread.a $PREFIX/$TARGET/lib$_reverse_bits/ || { echo "30"; return 1; }

mkdir -pv $BUILDS_DIR/$GCC_NAME/$TARGET/$_reverse_bits/{libgcc,libgfortran,libgomp,libitm,libquadmath,libssp,libstdc++-v3}
[[ $BUILD_SHARED_GCC == yes ]] && {
echo $BUILDS_DIR/$GCC_NAME/$TARGET/$_reverse_bits/{libgcc,libgfortran,libgomp,libitm,libquadmath,libssp,libstdc++-v3} \
| xargs -n 1 cp $PREFIX/$TARGET/lib$_reverse_bits/libwinpthread-1.dll || { echo "31"; return 1; }
}
echo $BUILDS_DIR/$GCC_NAME/$TARGET/$_reverse_bits/{libgcc,libgfortran,libgomp,libitm,libquadmath,libssp,libstdc++-v3} \
| xargs -n 1 cp $PREFIX/$TARGET/lib$_reverse_bits/libwinpthread-1.dll || { echo "31"; return 1; }
}

cp -rfv $PREFIX/$TARGET/* $PREFIX/mingw/ || { echo "32"; return 1; }
Expand Down
4 changes: 2 additions & 2 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ filesystem_list=(
# **************************************************************************

declare -A PKG_TESTS
[[ $BUILD_SHARED_GCC == yes ]] && { PKG_TESTS["dll_test1"]=dll_test1_list[@]; }
[[ $BUILD_SHARED_GCC == yes ]] && { PKG_TESTS["dll_test2"]=dll_test2_list[@]; }
PKG_TESTS["dll_test1"]=dll_test1_list[@]
PKG_TESTS["dll_test2"]=dll_test2_list[@]
PKG_TESTS["lto_test"]=lto_test_list[@]
PKG_TESTS["omp_test"]=omp_test_list[@]
PKG_TESTS["pthread_test"]=pthread_test_list[@]
Expand Down
3 changes: 2 additions & 1 deletion scripts/winpthreads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ PKG_CONFIGURE_FLAGS=(
#
--prefix=$RUNTIME_DIR/$PKG_NAME
#
$LINK_TYPE_GCC
--enable-shared
--enable-static
#
CFLAGS="\"$COMMON_CFLAGS\""
CXXFLAGS="\"$COMMON_CXXFLAGS\""
Expand Down

0 comments on commit 90a6683

Please sign in to comment.