mirror of
https://github.com/richfelker/musl-cross-make.git
synced 2025-04-19 07:24:59 +02:00
Feat: china mirror and lib32 lib64 switch
This commit is contained in:
parent
1aefb41dad
commit
eba4523bd5
40
Makefile
40
Makefile
@ -1,6 +1,6 @@
|
||||
SOURCES = sources
|
||||
|
||||
CONFIG_SUB_REV = 3d5db9ebe860
|
||||
CONFIG_SUB_REV = 28ea239c53a2
|
||||
GCC_VER = 11.4.0
|
||||
MUSL_VER = 1.2.4
|
||||
BINUTILS_VER = 2.41
|
||||
@ -11,29 +11,37 @@ ISL_VER =
|
||||
LINUX_VER =
|
||||
MINGW_VER = v11.0.1
|
||||
|
||||
ifeq ($(CHINA),)
|
||||
GNU_SITE = https://ftp.gnu.org/gnu
|
||||
|
||||
SOURCEFORGE_MIRROT = https://downloads.sourceforge.net
|
||||
|
||||
GCC_SNAP = https://sourceware.org/pub/gcc/snapshots
|
||||
|
||||
LINUX_SITE = https://cdn.kernel.org/pub/linux/kernel
|
||||
else
|
||||
GNU_SITE = https://mirrors.ustc.edu.cn/gnu
|
||||
|
||||
SOURCEFORGE_MIRROT = https://jaist.dl.sourceforge.net
|
||||
|
||||
GCC_SNAP = https://mirrors.tuna.tsinghua.edu.cn/sourceware/gcc/snapshots
|
||||
|
||||
LINUX_SITE = https://mirrors.ustc.edu.cn/kernel.org/linux/kernel
|
||||
endif
|
||||
|
||||
MUSL_SITE = https://musl.libc.org/releases
|
||||
MUSL_REPO = https://git.musl-libc.org/git/musl
|
||||
GCC_SITE = $(GNU_SITE)/gcc
|
||||
BINUTILS_SITE = $(GNU_SITE)/binutils
|
||||
GMP_SITE = $(GNU_SITE)/gmp
|
||||
MPC_SITE = $(GNU_SITE)/mpc
|
||||
MPFR_SITE = $(GNU_SITE)/mpfr
|
||||
|
||||
# SOURCEFORGE_MIRROT = https://downloads.sourceforge.net
|
||||
SOURCEFORGE_MIRROT = https://jaist.dl.sourceforge.net
|
||||
|
||||
ISL_SITE = $(SOURCEFORGE_MIRROT)/project/libisl
|
||||
GCC_SNAP = https://sourceware.org/pub/gcc/snapshots
|
||||
|
||||
MUSL_SITE = https://musl.libc.org/releases
|
||||
# MUSL_REPO = https://git.musl-libc.org/git/musl
|
||||
MUSL_REPO = git://git.musl-libc.org/musl
|
||||
|
||||
LINUX_SITE = https://cdn.kernel.org/pub/linux/kernel
|
||||
MINGW_SITE = $(SOURCEFORGE_MIRROT)/project/mingw-w64/mingw-w64/mingw-w64-release
|
||||
LINUX_HEADERS_SITE = https://ftp.barfooze.de/pub/sabotage/tarballs
|
||||
|
||||
MINGW_SITE = $(SOURCEFORGE_MIRROT)/project/mingw-w64/mingw-w64/mingw-w64-release
|
||||
|
||||
DL_CMD = curl -sLo
|
||||
# curl --progress-bar -Lo <file> <url>
|
||||
DL_CMD = curl --progress-bar -Lo
|
||||
SHA1_CMD = sha1sum -c
|
||||
|
||||
COWPATCH = $(CURDIR)/cowpatch.sh
|
||||
@ -68,6 +76,8 @@ check:
|
||||
@which bzip2
|
||||
@echo "check gcc"
|
||||
@which gcc
|
||||
@echo "check g++"
|
||||
@which g++
|
||||
@echo "check libtool"
|
||||
@which libtool
|
||||
|
||||
|
@ -26,8 +26,6 @@ ifeq ($(CPUS),)
|
||||
CPUS = $(shell if command -v nproc >/dev/null 2>&1; then nproc; else echo 1; fi)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
ifneq ($(findstring mingw,$(TARGET)),)
|
||||
MUSL_SRCDIR =
|
||||
LINUX_SRCDIR =
|
||||
@ -87,6 +85,23 @@ ifneq ($(filter %hf,$(TARGET)),)
|
||||
GCC_CONFIG_FOR_TARGET += --with-float=hard
|
||||
endif
|
||||
|
||||
ifneq ($(findstring mingw,$(TARGET)),)
|
||||
ifneq ($(findstring x86_64,$(TARGET)),)
|
||||
MINGW_CRT_CONFIG += --disable-lib32 --enable-lib64
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(findstring musl,$(TARGET)),)
|
||||
ifneq ($(findstring 64,$(TARGET)),)
|
||||
ifeq ($(findstring 32,$(TARGET)),)
|
||||
MINGW_CRT_CONFIG += --disable-lib32 --enable-lib64
|
||||
endif
|
||||
endif
|
||||
ifneq ($(findstring aarch,$(TARGET)),)
|
||||
MINGW_CRT_CONFIG += --disable-libarm32 --enable-libarm64
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(LIBTOOL),)
|
||||
LIBTOOL_ARG = LIBTOOL=$(LIBTOOL)
|
||||
endif
|
||||
@ -123,7 +138,6 @@ FULL_GCC_CONFIG = --enable-languages=c,c++,fortran \
|
||||
--disable-multilib \
|
||||
--with-dwarf2 \
|
||||
--enable-deterministic-archives \
|
||||
--enable-libstdcxx-time \
|
||||
--enable-libquadmath --enable-libquadmath-support \
|
||||
--disable-decimal-float \
|
||||
$(OVERRIDE)
|
||||
|
@ -22,10 +22,11 @@ function Help() {
|
||||
echo "-h: help"
|
||||
echo "-t: test build only"
|
||||
echo "-T: targets file path or targets string"
|
||||
echo "-C: use china mirror"
|
||||
}
|
||||
|
||||
function ParseArgs() {
|
||||
while getopts "htT:" arg; do
|
||||
while getopts "htT:C" arg; do
|
||||
case $arg in
|
||||
h)
|
||||
Help
|
||||
@ -37,6 +38,9 @@ function ParseArgs() {
|
||||
T)
|
||||
TARGETS_FILE="$OPTARG"
|
||||
;;
|
||||
C)
|
||||
USE_CHINA_MIRROR="1"
|
||||
;;
|
||||
?)
|
||||
echo "unkonw argument"
|
||||
exit 1
|
||||
@ -47,7 +51,8 @@ function ParseArgs() {
|
||||
|
||||
function Build() {
|
||||
TARGET="$1"
|
||||
make TARGET=${TARGET} \
|
||||
make TARGET="${TARGET}" \
|
||||
CONFIG_SUB_REV="28ea239c53a2" \
|
||||
GCC_VER="11.4.0" \
|
||||
MUSL_VER="1.2.4" \
|
||||
BINUTILS_VER="2.41" \
|
||||
@ -57,7 +62,10 @@ function Build() {
|
||||
ISL_VER="" \
|
||||
LINUX_VER="" \
|
||||
MINGW_VER="v11.0.1" \
|
||||
CHINA="${USE_CHINA_MIRROR}" \
|
||||
'COMMON_CONFIG+=CFLAGS="-g0 -Os" CXXFLAGS="-g0 -Os" LDFLAGS="-s"' \
|
||||
'COMMON_CONFIG+=CC="gcc -static --static" CXX="g++ -static --static"' \
|
||||
'GCC_CONFIG+=--enable-languages=c,c++' \
|
||||
'BINUTILS_CONFIG+=--enable-compressed-debug-sections=none' \
|
||||
install
|
||||
if [ $? -ne 0 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user