|
|
Message-ID: <20161025091324.GB5749@port70.net>
Date: Tue, 25 Oct 2016 11:13:24 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] configure: check whether linker works too
* Laine Gholson <laine.gholson@...il.com> [2016-10-24 19:00:55 -0500]:
> +if test x"$shared" != xno ; then
> + printf "checking whether linker works... "
> + echo "int main(void) { return 0; }" > "$tmpc"
> + if output=$($CC -nostdlib -shared -o /dev/null "$tmpc" 2>&1) ; then
a shared lib does not need main (it does not hurt though).
> + printf "yes\n"
> + else
> + if test x"$shared" = xyes ; then
> + printf "no; compiler output follows:\n%s\n" "$output"
> + exit 1
> + else
> + printf "no; shared library disabled\n"
> + shared=no
> + fi
this silently succeeds with default options when the
linker is broken (does not match documented behaviour).
> + fi
> +fi
> +
> +printf "checking whether CFLAGS and CPPFLAGS are sane... "
> +echo "typedef int x;" > "$tmpc"
> +if output=$($CC $CFLAGS $CPPFLAGS -c -o /dev/null "$tmpc" 2>&1) ; then
there is some copy-paste repetition in these checks,
i think it could be refactored in a cleaner way.
(like tryflag etc)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.