@@ -79,25 +79,30 @@ build_and_install()
7979 # Warn about header prerequisite on macOS Mojave or subsequent versions
8080 if [[ $( uname) == " Darwin" ]]; then
8181 export kernel=$( uname -r)
82- export Mojave=" 18.7.0"
82+ export Mojave=" 18.0.0"
83+ export Catalina=" 19.0.0"
8384 if [ $( version $kernel ) -ge $( version $Mojave ) ]; then
84- info " "
85- info " ______________________________________________________________________________"
86- info " Detected Darwin $kernel >= $Mojave (Mojave). If $package_to_build build fails"
87- info " due to a missing header (*.h) file, please try something like the following bash command:"
88- info " open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg"
89- info " Follow the prompts to install the missing headers. Then restart this $this_script ."
90- info " See https://bit.ly/build-gcc-on-mojave for more details."
91- if [[ " ${arg_y} " == " ${__flag_present} " ]]; then
92- info " -y or --yes-to-all flag present. Proceeding with non-interactive build."
85+ if [ $( version $kernel ) -ge $( version $Catalina ) ]; then
86+ export with_sysroot=" --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
9387 else
94- info " Would you like to proceed anyway? (Y/n)"
95- read -r proceed
96- if [[ " ${proceed} " == " n" || " ${proceed} " == " N" || " ${proceed} " == " no" ]]; then
97- info " n"
98- emergency " Aborting. [exit 80]"
88+ info " "
89+ info " ______________________________________________________________________________"
90+ info " Detected Darwin $kernel (Mojave). If $package_to_build build fails due to a"
91+ info " missing header (*.h) file, please try something like the following bash command:"
92+ info " open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg"
93+ info " Follow the prompts to install the missing headers. Then restart this $this_script ."
94+ info " See https://bit.ly/build-gcc-on-mojave for more details."
95+ if [[ " ${arg_y} " == " ${__flag_present} " ]]; then
96+ info " -y or --yes-to-all flag present. Proceeding with non-interactive build."
9997 else
100- info " y"
98+ info " Would you like to proceed anyway? (Y/n)"
99+ read -r proceed
100+ if [[ " ${proceed} " == " n" || " ${proceed} " == " N" || " ${proceed} " == " no" ]]; then
101+ info " n"
102+ emergency " Aborting. [exit 80]"
103+ else
104+ info " y"
105+ fi
101106 fi
102107 fi
103108 fi
@@ -127,8 +132,8 @@ build_and_install()
127132 info " popd"
128133 popd || emergency " build_and_install.sh: popd failed"
129134 info " Configuring gcc/g++/gfortran builds with the following command:"
130- info " ${download_path} /${package_source_directory} /configure --prefix=${install_path} --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror ${bootstrap_configure} "
131- " ${download_path} /${package_source_directory} /configure" --prefix=" ${install_path} " --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror " ${bootstrap_configure} "
135+ info " ${download_path} /${package_source_directory} /configure --prefix=${install_path} --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror ${bootstrap_configure} ${with_sysroot :- } "
136+ " ${download_path} /${package_source_directory} /configure" --prefix=" ${install_path} " --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror " ${bootstrap_configure} " " ${with_sysroot :- } "
132137 info " Building with the following command: make -j ${num_threads} ${bootstrap_build} "
133138 make -j ${num_threads} ${bootstrap_build:- }
134139 if [[ -n " ${SUDO:- } " ]]; then
0 commit comments