[PATCH] gsed.cfg: Add check for gsed

Chris Johns chrisj at rtems.org
Wed Oct 5 21:51:19 UTC 2022


On 6/10/2022 5:29 am, Ryan Long wrote:
> On 10/4/2022 4:31 PM, Chris Johns wrote:
>> On 5/10/2022 12:52 am, Ryan Long wrote:
>>> It looks like gcc checks for gsed if sed is not the GNU version.
>> Thanks for checking this.
>>
>>> I've installed it on FreeBSD and MacOS. I had to install it via Homebrew on
>>> MacOS, but that's because it fails to build gsed.
>> Homebrew complicates your work. I make sure my test Macs have never had Homebrew
>> or Macports installed. When I played with this a long time ago the install
>> prefix was /usr/local and after a while I found I had no idea what was installed
>> and what was provided by the OS and if the base OS versions were overwritten. I
>> believe Macports is not doing this these days (if it ever did) but I have not
>> looked.
> 
> On the m1 macs, Homebrew installs under /opt/homebrew/bin. The prefix for Intel
> macs is /usr/local, so I assume anything installed would be under
> /usr/local/homebrew/bin.

That helps but I am not sure my point has been made that RTEMS as a project
depending on homebrew or macports complicates our builds and how we maintain
them long term. If either are rolling releases it is hard. There has been no
need for homebrew or macports up to now and I still do not see a need.

And I think they are great and useful projects so this is about how we maintain
our tools and not a reflection on them.

> I don't know when the packages in Homebrew may overwrite the programs used by
> the systems, but at least in the case of gsed, it didn't overwrite the system's
> sed.>
>>
>>> The error is "machine `arm64-apple' not recognized".
>> Does the GNU sed upstream project have a fix?
> 
> I looked into how Homebrew builds it. All that they do is
> 
>   def install
>     args = %W[
>       --prefix=#{prefix}
>       --disable-dependency-tracking
>     ]
> 
>     args << if OS.mac?
>       "--program-prefix=g"
>     else
>       "--without-selinux"
>     end
>     system "./configure", *args
>     system "make", "install"
> 
> I experimented with the building of gsed with the RSB. I just removed the --host
> flag, and I was able to get around the error. However, it then reports

What was `--host` set to?

Without the option what does sed'w configure detect the host to be?

> sizes: gsed-4.8-arm64-apple-darwin21.6.0-1: 16.874MB (installed: 0.000B)

Is this the latest RSB?

If it is I suggest you put the RSB aside and manually untar the source,
configure it and run make. Once you know how to build the package run the RSB
with --dry-run to get the options you need then remove the --dry-run option.
Always use --trace when adding a new build and look at the log file for the details.

Chris


More information about the devel mailing list