AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE])
This macro tries to guess the "native" arch corresponding to the target architecture for use with gcc’s -march=arch or -mtune=arch flags. If found, the cache variable $ax_cv_gcc_archflag is set to this flag and ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is set to "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is to add $ax_cv_gcc_archflag to the end of $CFLAGS.
PORTABLE? should be either [yes] (default) or [no]. In the former case, the flag is set to -mtune (or equivalent) so that the architecture is only used for tuning, but the instruction set used is still portable. In the latter case, the flag is set to -march (or equivalent) so that architecture-specific instructions are enabled.
The user can specify –with-gcc-arch=<arch> in order to override the macro’s choice of architecture, or –without-gcc-arch to disable this.
When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is called unless the user specified –with-gcc-arch manually.
Requires macros: AX_CHECK_COMPILE_FLAG, AX_GCC_X86_CPUID
(The main emphasis here is on recent CPUs, on the principle that doing high-performance computing on old hardware is uncommon.)
Download the latest version of ax_gcc_archflag.m4 or browse the macro’s revision history.
Copyright © 2008 Steven G. Johnson firstname.lastname@example.org
Copyright © 2008 Matteo Frigo
Copyright © 2012 Tsukasa Oi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
As a special exception, the respective Autoconf Macro’s copyright owner gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf when processing the Macro. You need not follow the terms of the GNU General Public License when using or distributing such scripts, even though portions of the text of the Macro appear in them. The GNU General Public License (GPL) does govern all other use of the material that constitutes the Autoconf Macro.
This special exception to the GPL applies to versions of the Autoconf Macro released by the Autoconf Archive. When you make and distribute a modified version of the Autoconf Macro, you may extend this special exception to the GPL to apply to your modified version as well.