|
From: Matt B. <wal...@ma...> - 2024-07-10 20:21:21
|
> On Jul 10, 2024, at 12:54 PM, Greg Troxel <gd...@le...> wrote:
>
> Matt Broughton <wal...@ma...> writes:
>
>> FWIW, on macos 12.7.5, I do have to edit the `configure` line 19887
>> and delete '-D_POSIX_C_SOURCE=200809L -std=c99' to get v5.3.5-pre1 to
>> build. If left in, the build will fail with errors of the type:
>
> That's very interesting you see the same error on macOS as what I am
> seeing on NetBSD (but I hear that apple adopted NetBSD's networking
> stack and this is pbobably very longstanding code).
>
> That is great progress to get it to build. Did you, or could you, try
> with removing the -DPOSIX_C_SOURCE=200809L, and leaving --std=c99? I
> am guessing that will be ok.
>
> Visibility defines are tricky. While they appear to say "make
> everything required by this standard visible", they really are "make
> *only* what this standard requires visible". Many things in an OS are
> removed from visibility by them.
>
> I wonder why that define exists in the first place. Normally programs
> expect the posix+local-os environment, and that's almost always ok.
>
> I believe that there are some systems that make an older standard
> available by default, and you have to ask for something more modern.
> Then, one would have to have defines to not only have the modern posix,
> but also turn back on the OS extensions that are expected, all ifdef'd
> on the OS that needs it.
>
It does build fine on macos 12.7.5 with -std=c99. I was going on what the previous macos maintainer indicated needed to be changed. I am wondering if the macos builds ever used -std=c99. Comparing the default v5.2.15 and v5.3.5-pre1 `configure` and the resulting Configuration Summary, I get:
v5.2.15
configure line 18503 ---
'for stp_ac_arg in -D_POSIX_C_SOURCE=200809L -std=c99 -pedantic -Waggregate-return -Wcast-qual -Wshadow -Wredundant-decls ; do'
Configuration Summary---
General configuration:
Compiler options: -Disfinite=finite -O6 -mmacosx-version-min=10.7 -Os -arch x86_64 -D_PPD_DEPRECATED="" -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wwrite-strings -Werror-implicit-function-declaration -Winline -Wformat=2 -finline-limit=131072
Build static libraries: yes
Build shared libraries: yes
Maintainer mode: no
Use i18n: no
Generate profiling information: no
Generate debugging symbols: no
Use modules: static
Use readline libraries: yes, extra arguments: -lncurses
uname -a output: Darwin Borodin.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Apr 24 06:02:02 PDT 2024; root:xnu-8020.240.18.708.4~1/RELEASE_X86_64 x86_64
================================================================
v5.3.5-pre1
configure line19887---
for stp_ac_arg in -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wwrite-strings -Werror-implicit-function-declaration -Winline -Wformat=2 -finline-limit=131072 -Wformat -Werror=format-security -D_POSIX_C_SOURCE=200809L -std=c99 ; do
Configuration Summary---
General configuration:
Configure arguments: --prefix=/Library/Printers/Gutenprint.printerDriver/Contents/MacOS --datadir=/Library/Printers/Gutenprint.printerDriver/Contents/Resources --datarootdir=/Library/Printers/Gutenprint.printerDriver/Contents/Resources --localedir=/Library/Printers/Gutenprint.printerDriver/Contents/Resources --docdir=/Library/Printers/Gutenprint.printerDriver/Contents/Resources/doc --mandir=/Library/Printers/Gutenprint.printerDriver/Contents/Resources --disable-samples --disable-test --enable-nls-macosx '--with-archflags=-mmacosx-version-min=10.7 -Os -arch x86_64 -D_PPD_DEPRECATED=""'
Compiler: gcc
Compiler Version: Apple clang version 14.0.0 (clang-1400.0.29.202)
Compiler options: -Disfinite=finite -O3 -mmacosx-version-min=10.7 -Os -arch x86_64 -D_PPD_DEPRECATED="" -Wformat -Werror=format-security -D_POSIX_C_SOURCE=200809L -std=c99
Build static libraries: yes
Build shared libraries: yes
Maintainer mode: no
Use i18n: no
Generate profiling information: no
Generate debugging symbols: no
Use modules: static
Use readline libraries: yes, extra arguments: -lncurses
uname -a output: Darwin Borodin.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Apr 24 06:02:02 PDT 2024; root:xnu-8020.240.18.708.4~1/RELEASE_X86_64 x86_64
================================================================
Both results are using macos 12.7.5 and the same XCode. For some reason, the past 'configure' drops the compiler options '-D_POSIX_C_SOURCE=200809L -std=c99'. The 'configure' keeps them as options. There must be some differences in 'configure' between the two Gutenprint releases -- something that removes these options as not useable. I wish I knew what I was doing.
Matt
|