Error running configure on Mac

From: samay sharma <smilingsamay(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Error running configure on Mac
Date: 2022-01-24 07:07:55
Message-ID: CAJxrbywrgbxz2yb=augW4x+UHUFWdcdURN7zNybUchMUmU1ZRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-01-24 07:14:50 Re: Error running configure on Mac
Previous Message Justin Pryzby 2022-01-24 07:07:54 Re: typos