Mac platform identification in proj-looks-like-mac and proj-dll-extension in autosetup/proj.tcl
(1) By anonymous on 2025-06-17 10:07:05 [link] [source]
Hello, I'm trying to compile the latest SQLite for an old system that for some reason includes the word "apple" in the build target, despite being a Linux/GNU system. This causes the build to create .dylib files instead of .so files.
I tracked this down to the autosetup/proj.tcl that in the proj-looks-like-mac and proj-dll-extension functions identifies the host based on just *apple*, instead of what I think should be replaced with *-*-darwin, as it does with cygwin etc.
As a side note, the proj-dll-extension does the identification on its own instead of just using the proj-looks-like-windows and proj-looks-like-mac functions, which seems a bit unnecessary to do when the specific functions exist.
(2) By Stephan Beal (stephan) on 2025-06-17 14:26:58 in reply to 1 [link] [source]
I'm trying to compile the latest SQLite for an old system that for some reason includes the word "apple" in the build target, despite being a Linux/GNU system. This causes the build to create .dylib files instead of .so files.
Certainly that's not surprising?
I tracked this down to the autosetup/proj.tcl that in the proj-looks-like-mac and proj-dll-extension functions identifies the host based on just apple, instead of what I think should be replaced with --darwin, as it does with cygwin etc.
That sounds reasonable. i will make that change but can't test it, so please be on the lookout for a checkin soon which does that and try it out. That there is an OS which uses "apple" in its name, which isn't from that particular company, comes as a complete surprise to me.
As a side note, the proj-dll-extension does the identification on its own instead of just using the proj-looks-like-windows and proj-looks-like-mac functions, which seems a bit unnecessary to do when the specific functions exist.
i'll look into that.
Thank you for the feedback!
(3.1) By Stephan Beal (stephan) on 2025-06-17 16:36:54 edited from 3.0 in reply to 2 [link] [source]
i will make that change but can't test it, so please be on the lookout for a checkin soon which does that and try it out.
That's now in the trunk, along with your other suggested cleanup. If you're able, please build from there and verify that it's not hosed something unrelated.
Thanks again!
(4) By anonymous on 2025-06-17 17:05:56 in reply to 3.0 [source]
Thank you. That does work, both when compiling for that target and for another target without "apple" inside. I also tested doing one with -darwin at the end and that created .dylib files as expected.
However, I also tried under macOS, but it turns out that there was a version number added after darwin in that case, so the detection should probaby be replaced with *-*-darwin* which I tested to replace it with and it worked as expected.
(5) By Stephan Beal (stephan) on 2025-06-17 17:12:13 in reply to 4 [link] [source]
However, I also tried under macOS, but it turns out that there was a version number added after darwin in that case, so the detection should probaby be replaced with --darwin* which I tested to replace it with and it worked as expected.
Great, thank you! i contemplated adding that trailing asterisk initially and left it, but will do so momentarily.
(6) By Rowan Worth (sqweek) on 2025-06-18 03:03:20 in reply to 1 [link] [source]
I tracked this down to the autosetup/proj.tcl that in the proj-looks-like-mac and proj-dll-extension functions identifies the host based on just apple, instead of what I think should be replaced with --darwin, as it does with cygwin etc.
I was curious about what happens here for Apple machines pre-OSX -- for most projects this would be utterly irrelevant but SQLite has a long enough history that there may still be someone running it on an antique somewhere :)
It turns out that autoconf's config.sub has similar logic where a wildcard on "*-apple" defaults the OS to "macos", however this is only invoked if the OS has not already been identified.
In your case I'm guessing "apple" is part of the vendor, possibly because of the machine's hardware? It would be nice to have a record of what gcc -dumpmachine
outputs for you if you're happy to share.
(props to http://wiki.osdev.org/Target_Triplet for pointing me in the direction of config.sub)
(7) By anonymous on 2025-06-18 08:44:28 in reply to 6 [link] [source]
Awaiting Moderator Approval
(8) By anonymous on 2025-06-18 10:45:31 in reply to 6 [link] [source]
Awaiting Moderator Approval