libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] macOS, gnu gcc, -no-cpp-precomp


From: Evgeny Grin
Subject: Re: [libmicrohttpd] macOS, gnu gcc, -no-cpp-precomp
Date: Wed, 22 Jun 2022 09:46:56 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

Hi Chris,

Thanks for the report.
Actually is not needed for a long time, but as MHD is tested by OS-supplied tool, it hasn't been noticed (clang still works with this flag).

You can just delete the offending line in configure.ac and run './bootstrap'. This should rebuild 'configure', if you have required tools installed.

The next MHD version will be released with fix for this problem.

--
Evgeny


On 21.06.2022 8:06, Chris Guiney wrote:
I've been being vexed by the configure script using -no-cpp-precomp as a CFLAG if the host is found to be macOS

https://git.gnunet.org/libmicrohttpd.git/tree/configure.ac#n765 <https://git.gnunet.org/libmicrohttpd.git/tree/configure.ac#n765>

This flag has been removed from gcc, and according to the maintainers, hasn't been needed for many years

https://gcc.gnu.org/legacy-ml/gcc/2005-12/msg00368.html <https://gcc.gnu.org/legacy-ml/gcc/2005-12/msg00368.html>

I'm hoping that I can either persuade a maintainer to remove it, or provide instruction on how I might remove it -- I've never had to contribute to a GNU project, or contribute to a autoconf/automake build.

I find that if I do remove it, and run autoreconf, it's able to configure and compile cleanly.


It manifests as an error indicating that it can't find a suitable threading library:

CC=/opt/homebrew/bin/gcc-11 ./configure --prefix=/usr/local
... many lines of configure output ...
checking for pthread-config... no
checking for threading lib to use with libmicrohttpd (auto)... configure: error: No threading lib is available. Consider installing pthreads


but after viewing the config.log, one can find:
configure:21066: checking for target host OS
configure:21075: result: Darwin
configure:22010: checking whether /opt/homebrew/bin/gcc-11 is Clang
configure:22037: result: no
configure:22102: checking whether pthreads work with "-pthread" and "-lpthread" configure:22213: /opt/homebrew/bin/gcc-11 -o conftest -no-cpp-precomp -fno-common -g -O2 -pthread   conftest.c -lpthread  >&5
gcc-11: error: unrecognized command-line option '-no-cpp-precomp'


For posterity, the output of gcc --version:
/opt/homebrew/bin/gcc-11 --version
gcc-11 (Homebrew GCC 11.3.0_2) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I should also note that it does build with clang -- I'm intentionally trying to use gcc

Any help is appreciated,
Chris

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]