[Asterisk-code-review] Update configure.ac/Makefile for clang (asterisk[13])

Corey Farrell asteriskteam at digium.com
Fri Apr 24 20:16:10 CDT 2015


Corey Farrell has posted comments on this change.

Change subject: Update configure.ac/Makefile for clang
......................................................................


Patch Set 6: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/157/6/autoconf/ast_check_raii.m4
File autoconf/ast_check_raii.m4:

Line 8: 	AS_CASE(["$(${BASENAME} ${CC})"],
I configure asterisk with the following:
CC="ccache gcc-4.8" ./configure

Quick tests on the command-line:
$ basename ccache gcc-4.8
ccache
$ basename "ccache gcc-4.8"
ccache gcc-4.8

So for this to work at all it would need to check for [*gcc*] or [*clang*|*ccc-analyzer], and use the quoted version of basename execution.

I'm not a fan of using $CC to decide what compiler is being used.  How could we handle CC=cc or CC="ccache cc"?  What if CC=my-analyzer?

I feel that a better way to handle this check is to try building programs using the different RAII methods until one works.  The following seems like the correct order to try the different methods:

1. gcc style without the need for -fnested-functions
2. gcc style with the need for -fnested-functions
3. clang style without the need for -lBlocksRuntime
4. clang style with the need for -lBlocksRuntime

Once one of these options works, we found our compiler.  If none work, fail configure.


-- 
To view, visit https://gerrit.asterisk.org/157
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I12ea29d3bda2254ad3908e279b7effbbac6a97cb
Gerrit-PatchSet: 6
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Diederik de Groot <dkgroot at talon.nl>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list