SQLite User Forum

Mac platform identification in proj-looks-like-mac and proj-dll-extension in autosetup/proj.tcl
Login

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 [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 [link] [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.