force=0
OS=$(uname)
-case $OS in
- "Darwin"|"FreeBSD"|"DragonFly"|"AIX")
- chksum='shasum -a 512 --check'
- ;;
- "OpenBSD")
- chksum='sha512 -c'
- ;;
- *)
- chksum='sha512sum -c'
- ;;
-esac
-
if type wget > /dev/null ; then
fetch='wget'
else
done
unset arg
-# Emulate Linux's 'md5 --check' on macOS
+# Emulate Linux's 'md5sum --check' on macOS
md5_check() {
# Store the standard input: a line from contrib/prerequisites.md5:
md5_checksum_line=$(cat -)
verify=0
;;
--sha512)
- case $OS in
- "Darwin")
- chksum='shasum -a 512 --check'
- ;;
- *)
- chksum='sha512sum --check'
- ;;
- esac
chksum_extension='sha512'
verify=1
;;
--md5)
- case $OS in
- "Darwin")
- chksum='md5_check'
- ;;
- *)
- chksum='md5 --check'
- ;;
- esac
chksum_extension='md5'
verify=1
;;
[ "x${argnext}" = x ] || die "Missing argument for option --${argnext}"
unset arg argnext
+case $chksum_extension in
+ sha512)
+ case $OS in
+ "Darwin"|"FreeBSD"|"DragonFly"|"AIX")
+ chksum='shasum -a 512 --check'
+ ;;
+ "OpenBSD")
+ chksum='sha512 -c'
+ ;;
+ *)
+ chksum='sha512sum -c'
+ ;;
+ esac
+ ;;
+ md5)
+ case $OS in
+ "Darwin")
+ chksum='md5_check'
+ ;;
+ *)
+ chksum='md5sum -c'
+ ;;
+ esac
+ ;;
+ *)
+ die "Unkown checksum $chksum_extension"
+ ;;
+esac
+
[ -e ./gcc/BASE-VER ] \
|| die "You must run this script in the top-level GCC source directory"