This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: port contrib/download_prerequisites script to macOS
- From: Damian Rouson <damian at sourceryinstitute dot org>
- To: Jeff Law <law at redhat dot com>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jerry DeLisle <jvdelisle at charter dot net>
- Date: Thu, 13 Apr 2017 16:29:11 -0700
- Subject: Re: port contrib/download_prerequisites script to macOS
- Authentication-results: sourceware.org; auth=none
- References: <etPan.58e44420.2d1bb7c0.14e0e@sourceryinstitute.org> <c19fbc68-35cb-ddcc-f524-55229b96935a@redhat.com> <etPan.58f001c5.14409c5f.c453@sourceryinstitute.org>
Resending as plain text:
On April 12, 2017 at 3:03:19 PM, Jeff Law (law@redhat.com(mailto:law@redhat.com)) wrote:
> >
> > 2017-04-05 Damian Rouson
> >
> > * download_prerequisites (md5_check): New function emulates Linux
> > 'md5 --check' on macOS. Modified script for macOS compatibility.
> I wonder if we should just switch to curl from wget in general rather
> than conditionalizing the code at all.
Hi Jeff,
Thanks for your comments. The conditionals are more portable than hardwiring one choice. On macOS, curl is always present but not wget. On the Linux distribution that I use (Lubuntu), wget is always present but curl isn’t installed by default. My goal was to support as many users as possible without requiring them to install prerequisites just to download the prerequisites. :) As my first contribution of a patch to GCC, I took the baby step of allowing for the use of curl. If acceptable, my next step would be to allow for the use of ftp when neither curl nor wget is present. That’s what I do in the scripts from which I culled the code in the patch. In those scripts, I invoke ftp via the following function:
https://github.com/sourceryinstitute/OpenCoarrays/blob/master/prerequisites/build-functions/ftp_url.sh
>
>
> For the sums, rather than doing a check of the OS, just see if
> sha512/md5sum exists. If not, then fallback to the Darwin defaults.
I think I tried that first and ran into some difficulties. I’ll make another attempt. My recent shell programming experience is with the bash shell and I have some experience with the C-shell from years ago, but I had no experience with writing Bourne shell scripts before writing this patch and I think the problem I encountered was related to differences between Bourne and bash.
Damian