Error running configure on Mac - Mailing list pgsql-hackers

From samay sharma
Subject Error running configure on Mac
Date
Msg-id CAJxrbywrgbxz2yb=augW4x+UHUFWdcdURN7zNybUchMUmU1ZRg@mail.gmail.com
Whole thread Raw
Responses Re: Error running configure on Mac
List pgsql-hackers
Hi,

I was trying to build Postgres from source on my Mac (MacOS Monterey 12.1) and ran into an error when running configure.

./configure


...

checking for gcc option to accept ISO C99... unsupported

configure: error: C compiler "gcc" does not support C99


When I do gcc --version I see:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/4.2.1

Apple clang version 13.0.0 (clang-1300.0.27.3)

Target: x86_64-apple-darwin21.2.0

Thread model: posix

InstalledDir: /Library/Developer/CommandLineTools/usr/bin


So, it looks like it is using clang to compile and not gcc.


configure runs successfully if I do: ./configure CC=gcc-11 or soft link gcc to gcc-11 and then run configure. However, I didn't find these tips in Platform specific notes in docs: https://www.postgresql.org/docs/9.6/installation-platform-notes.html#INSTALLATION-NOTES-MACOS.


So, I wanted to ask if this behavior is expected and if so, should we update docs to make a note of this?


Regards,

Samay

pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: typos
Next
From: Tom Lane
Date:
Subject: Re: Error running configure on Mac