Blame vars/gcc.vars

Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz e1d469
# set +o errexit -o noglob -o nounset is assumed.
308fa7
# Order: stage1_cross, runtime_cross, libstdcpp_v3_cross, full_cross
308fa7
# Order: stage1_host, runtime_host, libstdcpp_v3_host, full_host
308fa7
# Order: stage1, runtime, libstdcpp_v3, full
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
# Order: stage1_mingw32, native_mingw32
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz b6a9a1
#
Lucio Andrés Illanes Albornoz b6a9a1
# Private subroutines
Lucio Andrés Illanes Albornoz b6a9a1
#
e9fa07
e9fa07
pkgp_gcc_build_dir() { PKG_BUILD_DIR="${1}-${2}-${PKG_TARGET}"; return 0; };
Lucio Andrés Illanes Albornoz b6a9a1
pkgp_gcc_state_set() {
0aca86
	ex_pkg_dispatch_send "step" "unknown" "${PKG_NAME}" "${1}";
Lucio Andrés Illanes Albornoz f3f7e8
	ex_pkg_state_set "${PKG_NAME}" "${1}" ${2:+"${2}"};
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
Lucio Andrés Illanes Albornoz b6a9a1
pkgp_gcc_configure() {
Lucio Andrés Illanes Albornoz b6a9a1
	if ! rtl_fileop rm "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"		\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop mkdir "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"	\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"		\
ef5ed9
	|| ! CC="${PKG_CC}" CXX="${PKG_CXX}"				\
ef5ed9
	     "../cbb-gcc-${PKG_VERSION}/configure" "${@}"		\
Lucio Andrés Illanes Albornoz b6a9a1
			--disable-bootstrap				\
Lucio Andrés Illanes Albornoz b6a9a1
			--disable-libmudflap				\
Lucio Andrés Illanes Albornoz b6a9a1
			--disable-multilib				\
Lucio Andrés Illanes Albornoz b6a9a1
			--disable-nls					\
Lucio Andrés Illanes Albornoz b6a9a1
			--disable-obsolete				\
Lucio Andrés Illanes Albornoz b6a9a1
			--disable-symvers				\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-canonical-system-headers		\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-__cxa_atexit				\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-debug					\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-gnu-indirect-function			\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-gnu-unique-object			\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-initfini-array				\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-languages=c,c++,fortran,objc,lto	\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-libstdcxx-debug			\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-lto					\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-multiarch				\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-secureplt				\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-shared					\
Lucio Andrés Illanes Albornoz b6a9a1
			--enable-threads=posix				\
Lucio Andrés Illanes Albornoz b6a9a1
			--target="${PKG_TARGET}"			\
Lucio Andrés Illanes Albornoz b6a9a1
			--with-fpmath=sse; then
Lucio Andrés Illanes Albornoz b6a9a1
		return 1;
Lucio Andrés Illanes Albornoz b6a9a1
	else
Lucio Andrés Illanes Albornoz 370e98
		pkgp_gcc_state_set "configure" "build";
Lucio Andrés Illanes Albornoz b6a9a1
	fi;
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
Lucio Andrés Illanes Albornoz (arab, vxp) d4754c
pkgp_gcc_setup_env() {
Lucio Andrés Illanes Albornoz b6a9a1
	local _vname="";
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
	for _vname in	CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD			\
Lucio Andrés Illanes Albornoz b6a9a1
			CXXFLAGS CXXFLAGS_FOR_BUILD; do
Lucio Andrés Illanes Albornoz b6a9a1
		export "${_vname}=${GCCFLAGS}";
Lucio Andrés Illanes Albornoz b6a9a1
	done;
Lucio Andrés Illanes Albornoz b6a9a1
	for _vname in	CFLAGS_FOR_TARGET CPPFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET	\
Lucio Andrés Illanes Albornoz b6a9a1
			LIBCFLAGS_FOR_TARGET XGCC_FLAGS_FOR_TARGET; do
Lucio Andrés Illanes Albornoz b6a9a1
		export "${_vname}=${GCCTARGET_FLAGS}";
Lucio Andrés Illanes Albornoz b6a9a1
	done;
Lucio Andrés Illanes Albornoz b6a9a1
	for _vname in	cbb_cflags_for_stage1 cbb_cflags_for_stage2			\
Lucio Andrés Illanes Albornoz b6a9a1
			cbb_cflags_for_stage3 cbb_cflags_for_stage4; do
Lucio Andrés Illanes Albornoz b6a9a1
		export "${_vname}=${CFLAGS_FOR_BUILD}" ;
Lucio Andrés Illanes Albornoz b6a9a1
	done;
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
Lucio Andrés Illanes Albornoz b6a9a1
pkgp_gcc_setup_vars() {
Lucio Andrés Illanes Albornoz b6a9a1
	local _unwind_midipix_h="";
Lucio Andrés Illanes Albornoz b6a9a1
	export cbb_target="${PKG_TARGET}" MAKE="make LIBTOOL=slibtool";
Lucio Andrés Illanes Albornoz b6a9a1
	_unwind_midipix_h="$(readlink -f "${PKG_BASE_DIR}/cbb-gcc-${PKG_VERSION}/gcc/unwind-midipix.h")";
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
	case "${PKG_NAME}" in
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
	gcc_full)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "--include=${_unwind_midipix_h}";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION_MIDIPIX";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "${DEFAULT_CFLAGS_DEBUG_RUNTIME}";
308fa7
		export	cbb_ldflags_for_target="--sysroot=${PREFIX_NATIVE}"		\
308fa7
			cbb_neutral_libiberty="no"					\
308fa7
			cbb_sysroot_for_libgcc="${PREFIX_NATIVE}"			\
308fa7
			cbb_xgcc_for_specs=${PREFIX}/bin/${PKG_TARGET}-gcc;
e9fa07
		;;
e9fa07
308fa7
	gcc_full_host)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "--include=${_unwind_midipix_h}";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION_MIDIPIX";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "${DEFAULT_CFLAGS_DEBUG_RUNTIME}";
308fa7
		export	cbb_ldflags_for_target=						\
308fa7
			cbb_neutral_libiberty="no"					\
308fa7
			cbb_sysroot_for_libgcc="${PREFIX_NATIVE}"			\
e9fa07
			cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc";
e9fa07
		;;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	gcc_stage1_host)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "--include=${_unwind_midipix_h}";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION_MIDIPIX";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "${DEFAULT_CFLAGS_DEBUG_RUNTIME}";
308fa7
		export	cbb_ldflags_for_target=						\
308fa7
			cbb_neutral_libiberty="no"					\
308fa7
			cbb_sysroot_for_libgcc="${PREFIX_NATIVE}"			\
308fa7
			cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc"	\
308fa7
			LDFLAGS="${PKG_LDFLAGS_CONFIGURE}";
308fa7
		;;
308fa7
308fa7
	gcc_full_cross)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "--include=${_unwind_midipix_h}";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION_MIDIPIX";
e9fa07
		rtl_lconcat \$GCCTARGET_FLAGS "${DEFAULT_CFLAGS_DEBUG_RUNTIME}";
308fa7
		export	cbb_ldflags_for_target=						\
308fa7
			cbb_neutral_libiberty="no"					\
308fa7
			cbb_sysroot_for_libgcc="${PREFIX_CROSS}"			\
308fa7
			cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc";
308fa7
		;;
308fa7
308fa7
	gcc_stage1_cross)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "--include=${_unwind_midipix_h}";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "-DTARGET_PERSONALITY_FUNCTION_MIDIPIX";
308fa7
		rtl_lconcat \$GCCTARGET_FLAGS "${DEFAULT_CFLAGS_DEBUG_RUNTIME}";
308fa7
		export	cbb_ldflags_for_target=						\
e9fa07
			cbb_neutral_libiberty="no"					\
e9fa07
			cbb_sysroot_for_libgcc="${PREFIX_CROSS}"			\
e9fa07
			cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc"	\
e9fa07
			LDFLAGS="${PKG_LDFLAGS_CONFIGURE}";
e9fa07
		;;
e9fa07
308fa7
	# FIXME: shouldn't we have PREFIX_NATIVE_MINGW32
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	gcc_stage1_native_mingw32)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD -midata";
308fa7
		export	cbb_ldflags_for_target=						\
e9fa07
			cbb_neutral_libiberty=no					\
308fa7
			cbb_sysroot_for_libgcc="${PREFIX_MINGW32}"			\
e9fa07
			cbb_xgcc_for_specs="${PKG_TARGET}-gcc";
e9fa07
		;;
e9fa07
308fa7
	gcc_stage1_host_mingw32)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD -midata";
308fa7
		export	cbb_ldflags_for_target=						\
308fa7
			cbb_neutral_libiberty="no"					\
308fa7
			cbb_sysroot_for_libgcc="${PREFIX_MINGW32}"			\
308fa7
			cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc"	\
308fa7
			LDFLAGS="${PKG_LDFLAGS_CONFIGURE}";
308fa7
		;;
308fa7
308fa7
	gcc_stage1_cross_mingw32)
308fa7
		GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD -midata";
308fa7
		export	cbb_ldflags_for_target=						\
308fa7
			cbb_neutral_libiberty="no"					\
308fa7
			cbb_sysroot_for_libgcc="${PREFIX_LOCAL_CROSS_MINGW32}"		\
308fa7
			cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc"	\
308fa7
			LDFLAGS="${PKG_LDFLAGS_CONFIGURE}";
308fa7
		;;
308fa7
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
	esac;
e9fa07
e9fa07
	rtl_lconcat2			\
e9fa07
		\$GCCFLAGS		\
308fa7
		\$PKG_CFLAGS_CONFIGURE	\
e9fa07
		"--include $(readlink -f "${PKG_BASE_DIR}/cbb-gcc-${PKG_VERSION}/libc/cbb-musl-pe.h")";
Lucio Andrés Illanes Albornoz (arab, vxp) d4754c
};
Lucio Andrés Illanes Albornoz (arab, vxp) d4754c
Lucio Andrés Illanes Albornoz b6a9a1
pkgp_gcc_stage1_all() {
e9fa07
	local	_group_name="${1}" _pkg_name="${2}" _restart_at="${3}"	\
e9fa07
		_rc=0;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
	case "${PKG_NAME}" in
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	gcc_stage1_cross_mingw32)
308fa7
		pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" cross;
308fa7
		;;
308fa7
308fa7
	gcc_stage1_host_mingw32)
308fa7
		pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" host;
308fa7
		;;
308fa7
308fa7
	gcc_stage1_cross)
eb7c32
		if ! rtl_fileop mkdir . "${PREFIX_LOCAL_CROSS}"\
eb7c32
		|| ! rtl_fileop ln_symbolic . "${PREFIX_LOCAL_CROSS}/usr"\
308fa7
		|| ! rtl_fileop mkdir "${PREFIX_LOCAL_CROSS}/usr/include"\
eb7c32
		|| ! rtl_fileop mkdir "${PREFIX_CROSS}"\
308fa7
		|| ! rtl_fileop ln_symbolic . "${PREFIX_CROSS}/usr"\
308fa7
		|| ! rtl_fileop mkdir "${PREFIX_CROSS}/usr/include"\
308fa7
		|| ! pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" cross; then
308fa7
			_rc=1;
308fa7
		fi;
e9fa07
		;;
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
	gcc_stage1_host)
eb7c32
		if ! rtl_fileop mkdir . "${PREFIX_CROSS}"\
eb7c32
		|| ! rtl_fileop ln_symbolic . "${PREFIX_CROSS}/usr"\
Lucio Andrés Illanes Albornoz b6a9a1
		|| ! rtl_fileop mkdir "${PREFIX_CROSS}/usr/include"\
eb7c32
		|| ! rtl_fileop mkdir . "${PREFIX_NATIVE}"\
308fa7
		|| ! rtl_fileop ln_symbolic . "${PREFIX_NATIVE}/usr"\
308fa7
		|| ! rtl_fileop mkdir "${PREFIX_NATIVE}/usr/include"\
308fa7
		|| ! pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" host; then
Lucio Andrés Illanes Albornoz b6a9a1
			_rc=1;
e9fa07
		fi;
e9fa07
		;;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	gcc_stage1_native_mingw32)
e9fa07
		pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" native;
e9fa07
		;;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
	esac;
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
	if [ "${_rc}" -ne 0 ]; then
Lucio Andrés Illanes Albornoz b6a9a1
		return 1;
Lucio Andrés Illanes Albornoz b6a9a1
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,fetch_clean,fetch_download,fetch_extract" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" fetch "${_restart_at}" );
eb7c32
	then
e9fa07
		if ! rtl_fetch_dlcache_subdir				\
e9fa07
				"${BUILD_DLCACHEDIR}" "${PKG_NAME}"	\
e9fa07
				"${PKG_INHERIT_FROM:-}";
e9fa07
		then
Lucio Andrés Illanes Albornoz 10ff54
			return 1;
Lucio Andrés Illanes Albornoz 10ff54
		elif ! rtl_fetch_urls_git									\
Lucio Andrés Illanes Albornoz 10ff54
				"${BUILD_DLCACHEDIR}/${PKG_NAME}" "${DEFAULT_GIT_ARGS}" "${PKG_BASE_DIR}"	\
Lucio Andrés Illanes Albornoz 10ff54
				"${PKG_NAME}" "${PKG_MIRRORS_GIT:-}"						\
Lucio Andrés Illanes Albornoz 10ff54
				"cbb-gcc-${PKG_VERSION}=${PKG_GITROOT}/cbb/cbb-gcc-${PKG_VERSION}"; then
Lucio Andrés Illanes Albornoz 10ff54
			return 1;
Lucio Andrés Illanes Albornoz 10ff54
		else
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "fetch" "patch";
Lucio Andrés Illanes Albornoz 10ff54
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 17e78c
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,configure_patch" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" patch "${_restart_at}" );
eb7c32
	then
Lucio Andrés Illanes Albornoz (arab, vxp) 0f5aa2
		if [ -e "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch" ]; then
Lucio Andrés Illanes Albornoz b6a9a1
			patch -b -d "${PKG_BASE_DIR}" -p0 < "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch" || return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) 0f5aa2
		fi;
Lucio Andrés Illanes Albornoz 370e98
		pkgp_gcc_state_set "patch" "configure";
Lucio Andrés Illanes Albornoz (arab, vxp) d4754c
	fi;
e9fa07
e9fa07
	pkgp_gcc_setup_vars;
e9fa07
	pkgp_gcc_setup_env;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,configure" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}" );
eb7c32
	then
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
		case "${PKG_NAME}" in
e9fa07
308fa7
		gcc_stage1_host_mingw32)
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
			pkgp_gcc_configure				\
Lucio Andrés Illanes Albornoz b6a9a1
				--enable-sjlj-exceptions		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
				--prefix="${PREFIX}"			\
Lucio Andrés Illanes Albornoz 292783
				--with-gmp="${PREFIX}"			\
Lucio Andrés Illanes Albornoz 292783
				--with-mpc="${PREFIX}"			\
Lucio Andrés Illanes Albornoz 292783
				--with-mpfr="${PREFIX}"			\
Lucio Andrés Illanes Albornoz b6a9a1
				--with-sysroot="${PREFIX_MINGW32}"	\
e9fa07
				--without-headers;
e9fa07
			;;
e9fa07
308fa7
		gcc_stage1_cross_mingw32)
308fa7
			pkgp_gcc_configure					\
308fa7
				--enable-sjlj-exceptions			\
308fa7
				--prefix="${PREFIX}"				\
308fa7
				--with-gmp="${PREFIX}"				\
308fa7
				--with-mpc="${PREFIX}"				\
308fa7
				--with-mpfr="${PREFIX}"				\
308fa7
				--with-sysroot="${PREFIX_LOCAL_CROSS_MINGW32}"	\
308fa7
				--without-headers;
308fa7
			;;
308fa7
Lucio Andrés Illanes Albornoz b6a9a1
		gcc_stage1_host)
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
			pkgp_gcc_configure				\
Lucio Andrés Illanes Albornoz b6a9a1
				--disable-sjlj-exceptions		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
				--prefix="${PREFIX}"			\
Lucio Andrés Illanes Albornoz 292783
				--with-gmp="${PREFIX}"			\
Lucio Andrés Illanes Albornoz 292783
				--with-mpc="${PREFIX}"			\
Lucio Andrés Illanes Albornoz 292783
				--with-mpfr="${PREFIX}"			\
308fa7
				--with-sysroot="${PREFIX_NATIVE}";
308fa7
			;;
308fa7
308fa7
		gcc_stage1_cross)
308fa7
			pkgp_gcc_configure				\
308fa7
				--disable-sjlj-exceptions		\
308fa7
				--prefix="${PREFIX}"			\
308fa7
				--with-gmp="${PREFIX}"			\
308fa7
				--with-mpc="${PREFIX}"			\
308fa7
				--with-mpfr="${PREFIX}"			\
e9fa07
				--with-sysroot="${PREFIX_CROSS}";
e9fa07
			;;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		gcc_stage1_native_mingw32)
Lucio Andrés Illanes Albornoz (arab, vxp) d4754c
			pkgp_gcc_configure				\
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
				--build=x86_64-unknown-linux-gnu	\
Lucio Andrés Illanes Albornoz (arab, vxp) d4754c
				--enable-sjlj-exceptions		\
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
				--host=x86_64-nt64-midipix		\
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
				--prefix=/				\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
				--with-elf="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
				--with-gmp="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
				--with-mpc="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
				--with-mpfr="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
				--with-sysroot=				\
e9fa07
				--without-headers;
e9fa07
			;;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
		esac;
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
		if [ "${?}" -ne 0 ]; then
Lucio Andrés Illanes Albornoz b6a9a1
			return 1;
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
eb7c32
	elif [ "${_restart_at:+1}" != 1 ]\
eb7c32
	||   rtl_lmatch \$_restart_at "ALL,build,install_subdirs,install_make,install" ","; then
e9fa07
		rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}" || return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,build" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}" );
eb7c32
	then
a9f452
		make ${PKG_MAKEFLAGS_BUILD:-} "all-gcc" || return 1;
Lucio Andrés Illanes Albornoz 370e98
		pkgp_gcc_state_set "build" "install_subdirs";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,install_subdirs" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}" );
eb7c32
	then
e9fa07
		pkg_install_subdirs "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz 370e98
		pkgp_gcc_state_set "install_subdirs" "install_make";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,install_make" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}" );
eb7c32
	then
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
		case "${PKG_NAME}" in
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		gcc_stage1_cross_mingw32)
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install-gcc"; ;;
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
		gcc_stage1_host)
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install-gcc"; ;;
e9fa07
308fa7
		gcc_stage1_cross)
308fa7
			make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install-gcc"; ;;
308fa7
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		gcc_stage1_native_mingw32)
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install-gcc"; ;;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
		esac;
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
		if [ "${?}" -ne 0 ]; then
Lucio Andrés Illanes Albornoz b6a9a1
			return 1;
e9fa07
		else
e9fa07
			case "$(uname -s)" in
Lucio Andrés Illanes Albornoz b6a9a1
			CYGWIN_*)
Lucio Andrés Illanes Albornoz b6a9a1
				if ! rtl_fileop ln_symbolic "${PKG_DESTDIR}/libexec/gcc/${PKG_TARGET}/${PKG_VERSION}/liblto_plugin.dll.a"\
Lucio Andrés Illanes Albornoz b6a9a1
				|| ! rtl_fileop ln_symbolic "${PKG_DESTDIR}/libexec/gcc/${PKG_TARGET}/${PKG_VERSION}/liblto_plugin.so"; then
Lucio Andrés Illanes Albornoz b6a9a1
					return 1;
Lucio Andrés Illanes Albornoz b6a9a1
				fi; ;;
Lucio Andrés Illanes Albornoz b6a9a1
			esac;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "install_make" "install";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,install" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}" );
eb7c32
	then
e9fa07
		pkg_install "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz f3f7e8
		pkgp_gcc_state_set "install";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
e9fa07
Lucio Andrés Illanes Albornoz f3f7e8
	pkgp_gcc_state_set "finish";
e9fa07
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
pkg_gcc_full_all() {
e9fa07
	local	_group_name="${1}" _pkg_name="${2}" _restart_at="${3}"	\
e9fa07
		_configure_host="" _vis_hide="vis_hide=-fvisibility=hidden";
Lucio Andrés Illanes Albornoz 3c2739
	export MAKE="make LIBTOOL=slibtool ${_vis_hide}";
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" native;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,fetch_clean,fetch_download,fetch_extract" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" fetch "${_restart_at}" );
eb7c32
	then
e9fa07
		if ! rtl_fetch_dlcache_subdir				\
e9fa07
				"${BUILD_DLCACHEDIR}" "${PKG_NAME}"	\
e9fa07
				"${PKG_INHERIT_FROM:-}";
e9fa07
		then
Lucio Andrés Illanes Albornoz 10ff54
			return 1;
Lucio Andrés Illanes Albornoz 10ff54
		elif ! rtl_fetch_urls_git						\
Lucio Andrés Illanes Albornoz 10ff54
				"${BUILD_DLCACHEDIR}/${PKG_NAME}" "${DEFAULT_GIT_ARGS}"	\
Lucio Andrés Illanes Albornoz 10ff54
				"${PKG_BASE_DIR}" "${PKG_NAME}"				\
Lucio Andrés Illanes Albornoz 10ff54
				"${PKG_MIRRORS_GIT:-}"					\
Lucio Andrés Illanes Albornoz 10ff54
				"cbb-gcc-${PKG_VERSION}=${PKG_GITROOT}/cbb/cbb-gcc-${PKG_VERSION}"; then
Lucio Andrés Illanes Albornoz 10ff54
			return 1;
Lucio Andrés Illanes Albornoz 10ff54
		else
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "fetch" "patch";
Lucio Andrés Illanes Albornoz 10ff54
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 0580af
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,configure_patch" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" patch "${_restart_at}" );
eb7c32
	then
Lucio Andrés Illanes Albornoz (arab, vxp) 0580af
		if [ -e "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch" ]; then
Lucio Andrés Illanes Albornoz b6a9a1
			patch -b -d "${PKG_BASE_DIR}" -p0 < "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch" || return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) 0580af
		fi;
Lucio Andrés Illanes Albornoz 370e98
		pkgp_gcc_state_set "patch" "configure";
Lucio Andrés Illanes Albornoz (arab, vxp) 0580af
	fi;
e9fa07
e9fa07
	pkgp_gcc_setup_vars;
e9fa07
	pkgp_gcc_setup_env;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,configure" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}" );
eb7c32
	then
Lucio Andrés Illanes Albornoz b6a9a1
		rtl_fileop mkdir "${PKG_PREFIX}/${PKG_TARGET}" || return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
		if [ \! -d "${PKG_PREFIX}/${PKG_TARGET}/usr" ]; then
Lucio Andrés Illanes Albornoz b6a9a1
			rtl_fileop ln_symbolic . "${PKG_PREFIX}/${PKG_TARGET}/usr" || return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) d4754c
		fi;
e9fa07
Lucio Andrés Illanes Albornoz b6a9a1
		case "${ARCH}" in
Lucio Andrés Illanes Albornoz b6a9a1
		nt32)	_configure_host="i686-nt32-midipix"; ;;
Lucio Andrés Illanes Albornoz b6a9a1
		nt64)	_configure_host="x86_64-nt64-midipix"; ;;
Lucio Andrés Illanes Albornoz b6a9a1
		esac;
e9fa07
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
		pkgp_gcc_configure				\
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
			--disable-sjlj-exceptions		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
			--host="${_configure_host}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) f93712
			--prefix=/				\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
			--with-elf="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
			--with-gmp="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
			--with-mpc="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) 36ab93
			--with-mpfr="${PKG_PREFIX}"		\
Lucio Andrés Illanes Albornoz b6a9a1
			--with-sysroot="" || return 1;
bc9115
	elif [ "${_restart_at:+1}" != 1 ]\
bc9115
	||   rtl_lmatch \$_restart_at "ALL,build,install_subdirs,install_make,install" ","; then
e9fa07
		rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}" || return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,build" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}" );
eb7c32
	then
a9f452
		if ! make ${PKG_MAKEFLAGS_BUILD:-} "all-gcc"\
a9f452
		|| ! make ${PKG_MAKEFLAGS_BUILD:-} "all-target-libgcc" ${_vis_hide}\
a9f452
		|| ! make ${PKG_MAKEFLAGS_BUILD:-} "all-target-libstdc++-v3"\
a9f452
		|| ! make ${PKG_MAKEFLAGS_BUILD:-} "all-target-libgfortran"\
a9f452
		|| ! make ${PKG_MAKEFLAGS_BUILD:-} "all"; then
Lucio Andrés Illanes Albornoz b6a9a1
			return 1;
Lucio Andrés Illanes Albornoz 370e98
		else	pkgp_gcc_state_set "build" "install_subdirs";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,install_subdirs" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}" );
eb7c32
	then
e9fa07
		pkg_install_subdirs "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz 370e98
		pkgp_gcc_state_set "install_subdirs" "install_make";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,install_make" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}" );
eb7c32
	then
a9f452
		make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install" || return 1;
Lucio Andrés Illanes Albornoz 370e98
		pkgp_gcc_state_set "install_make" "install";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
e9fa07
eb7c32
	if rtl_lmatch \$_restart_at "ALL,install" ","\
eb7c32
	|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
	&&   ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}" );
eb7c32
	then
e9fa07
		pkg_install "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz f3f7e8
		pkgp_gcc_state_set "install";
Lucio Andrés Illanes Albornoz b6a9a1
	fi;
e9fa07
Lucio Andrés Illanes Albornoz f3f7e8
	pkgp_gcc_state_set "finish";
e9fa07
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
Lucio Andrés Illanes Albornoz b6a9a1
pkg_gcc_full_host_all() {
308fa7
	local _group_name="${1}" _pkg_name="${2}" _restart_at="${3}" \
308fa7
		_toolchain_type="${4:-host}"
Lucio Andrés Illanes Albornoz b6a9a1
	export MAKE="make LIBTOOL=slibtool";
e9fa07
eb7c32
	if [ "${_restart_at:+1}" = 1 ]\
eb7c32
	&& ! rtl_lmatch \$_restart_at "ALL,build,install_subdirs,install_make,install" ","; then
eb7c32
		if rtl_lmatch \$_restart_at "finish" ","; then
eb7c32
			pkgp_gcc_state_set "finish";
eb7c32
		fi;
eb7c32
		return 0;
eb7c32
	fi;
eb7c32
308fa7
	if ! pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" ${_toolchain_type} \
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; then
Lucio Andrés Illanes Albornoz b6a9a1
		return 1;
e9fa07
	else
eb7c32
		if rtl_lmatch \$_restart_at "ALL,build" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}" );
eb7c32
		then
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "build" "install_subdirs";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install_subdirs" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}" );
eb7c32
		then
e9fa07
			pkg_install_subdirs "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "install_subdirs" "install_make";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install_make" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}" );
eb7c32
		then
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install" || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "install_make" "install";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}" );
eb7c32
		then
e9fa07
			pkg_install "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz f3f7e8
			pkgp_gcc_state_set "install";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
Lucio Andrés Illanes Albornoz f3f7e8
		pkgp_gcc_state_set "finish";
Lucio Andrés Illanes Albornoz b6a9a1
	fi;
e9fa07
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
308fa7
pkg_gcc_full_cross_all() {
308fa7
	pkg_gcc_full_host_all "${@}" cross
308fa7
};
308fa7
Lucio Andrés Illanes Albornoz b6a9a1
pkg_gcc_libstdcpp_v3_host_all() {
308fa7
	local _group_name="${1}" _pkg_name="${2}" _restart_at="${3}" \
308fa7
		_toolchain_type="${4:-host}"
Lucio Andrés Illanes Albornoz b6a9a1
	export MAKE="make LIBTOOL=slibtool";
e9fa07
eb7c32
	if [ "${_restart_at:+1}" = 1 ]\
eb7c32
	&& ! rtl_lmatch \$_restart_at "ALL,build,install_subdirs,install_make,install" ","; then
eb7c32
		if rtl_lmatch \$_restart_at "finish" ","; then
eb7c32
			pkgp_gcc_state_set "finish";
eb7c32
		fi;
eb7c32
		return 0;
eb7c32
	fi;
eb7c32
308fa7
	if ! pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" ${_toolchain_type} \
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; then
Lucio Andrés Illanes Albornoz b6a9a1
		return 1;
e9fa07
	else
eb7c32
		if rtl_lmatch \$_restart_at "ALL,build" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}" );
eb7c32
		then
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "all-target-libstdc++-v3" || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "build" "install_subdirs";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install_subdirs" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}" );
eb7c32
		then
e9fa07
			pkg_install_subdirs "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "install_subdirs" "install_make";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install_make" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}" );
eb7c32
		then
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install-target-libstdc++-v3" || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "install_make" "install";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}" );
eb7c32
		then
e9fa07
			pkg_install "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz f3f7e8
			pkgp_gcc_state_set "install";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
Lucio Andrés Illanes Albornoz f3f7e8
		pkgp_gcc_state_set "finish";
Lucio Andrés Illanes Albornoz b6a9a1
	fi;
e9fa07
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
308fa7
pkg_gcc_libstdcpp_v3_cross_all() {
308fa7
	pkg_gcc_libstdcpp_v3_host_all "${@}" cross
308fa7
};
308fa7
Lucio Andrés Illanes Albornoz b6a9a1
pkg_gcc_runtime_host_all() {
e9fa07
	local	_group_name="${1}" _pkg_name="${2}" _restart_at="${3}"	\
308fa7
		_toolchain_type="${4:-host}"				\
e9fa07
		_vis_hide="vis_hide=-fvisibility=hidden";
Lucio Andrés Illanes Albornoz b6a9a1
	export MAKE="make LIBTOOL=slibtool ${_vis_hide}";
e9fa07
eb7c32
	if [ "${_restart_at:+1}" = 1 ]\
eb7c32
	&& ! rtl_lmatch \$_restart_at "ALL,build,install_subdirs,install_make,install" ","; then
eb7c32
		if rtl_lmatch \$_restart_at "finish" ","; then
eb7c32
			pkgp_gcc_state_set "finish";
eb7c32
		fi;
eb7c32
		return 0;
eb7c32
	fi;
eb7c32
308fa7
	if ! pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" ${_toolchain_type} \
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; then
Lucio Andrés Illanes Albornoz b6a9a1
		return 1;
e9fa07
	else
eb7c32
		if rtl_lmatch \$_restart_at "ALL,build" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}" );
eb7c32
		then
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "all-target-libgcc" ${_vis_hide} || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "build" "install_subdirs";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install_subdirs" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}" );
eb7c32
		then
e9fa07
			pkg_install_subdirs "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "install_subdirs" "install_make";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install_make" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}" );
eb7c32
		then
a9f452
			make ${PKG_MAKEFLAGS_BUILD:-} "prefix=${PKG_DESTDIR}" "install-target-libgcc" || return 1;
Lucio Andrés Illanes Albornoz 370e98
			pkgp_gcc_state_set "install_make" "install";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
eb7c32
		if rtl_lmatch \$_restart_at "ALL,install" ","\
eb7c32
		|| ( [ "${_restart_at:+1}" != 1 ]\
eb7c32
		&&   ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}" );
eb7c32
		then
e9fa07
			pkg_install "${_group_name}" "${_pkg_name}" "${_restart_at}" || return 1;
Lucio Andrés Illanes Albornoz f3f7e8
			pkgp_gcc_state_set "install";
Lucio Andrés Illanes Albornoz b6a9a1
		fi;
e9fa07
Lucio Andrés Illanes Albornoz f3f7e8
		pkgp_gcc_state_set "finish";
Lucio Andrés Illanes Albornoz b6a9a1
	fi;
e9fa07
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
308fa7
pkg_gcc_runtime_cross_all() {
308fa7
	pkg_gcc_runtime_host_all "${@}" cross
308fa7
};
308fa7
Lucio Andrés Illanes Albornoz b6a9a1
pkg_gcc_stage1_all() {
Lucio Andrés Illanes Albornoz b6a9a1
	pkgp_gcc_stage1_all "${@}";
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
308fa7
pkg_gcc_stage1_host_mingw32_all() {
eb7c32
	if ! rtl_fileop mkdir . "${PKG_PREFIX}/x86_64-w64-mingw32"\
eb7c32
	|| ! rtl_fileop ln_symbolic . "${PKG_PREFIX}/x86_64-w64-mingw32/mingw"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop mkdir "${PKG_DESTDIR}/x86_64-w64-mingw32"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop ln_symbolic . "${PKG_DESTDIR}/x86_64-w64-mingw32/mingw"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop mkdir "${PKG_PREFIX}/x86_64-w64-mingw32/include"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! pkgp_gcc_stage1_all "${@}"; then
Lucio Andrés Illanes Albornoz b6a9a1
		return 1;
Lucio Andrés Illanes Albornoz b6a9a1
	fi;
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
308fa7
pkg_gcc_stage1_cross_mingw32_all() {
308fa7
	pkg_gcc_stage1_host_mingw32_all "${@}"
308fa7
};
308fa7
Lucio Andrés Illanes Albornoz b6a9a1
pkg_gcc_stage1_host_all() {
Lucio Andrés Illanes Albornoz b6a9a1
	pkgp_gcc_stage1_all "${@}";
Lucio Andrés Illanes Albornoz b6a9a1
};
Lucio Andrés Illanes Albornoz b6a9a1
308fa7
pkg_gcc_stage1_cross_all() {
308fa7
	pkgp_gcc_stage1_all "${@}";
308fa7
};
308fa7
Lucio Andrés Illanes Albornoz b6a9a1
pkg_gcc_stage1_native_mingw32_all() {
eb7c32
	if ! rtl_fileop mkdir . "${PKG_PREFIX}/x86_64-w64-mingw32"\
eb7c32
	|| ! rtl_fileop ln_symbolic . "${PKG_PREFIX}/x86_64-w64-mingw32/mingw"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop mkdir "${PKG_DESTDIR}/x86_64-w64-mingw32"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop ln_symbolic . "${PKG_DESTDIR}/x86_64-w64-mingw32/mingw"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! rtl_fileop mkdir "${PKG_PREFIX}/x86_64-w64-mingw32/include"\
Lucio Andrés Illanes Albornoz b6a9a1
	|| ! pkgp_gcc_stage1_all "${@}"; then
Lucio Andrés Illanes Albornoz b6a9a1
		return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz bf9edf
# vim:filetype=sh textwidth=0