acinclude: rename ax_gcc_x86_cpuid.m4.htm to ax_gcc_x86_cpuid.m4
authorOzkan Sezer <sezeroz@gmail.com>
Sat, 15 Sep 2018 09:24:04 +0300
changeset 1219004650c2fe44e
parent 12189 bd18236f41b5
child 12191 3c9c784e85bb
acinclude: rename ax_gcc_x86_cpuid.m4.htm to ax_gcc_x86_cpuid.m4
acinclude/ax_gcc_x86_cpuid.m4
acinclude/ax_gcc_x86_cpuid.m4.htm
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/acinclude/ax_gcc_x86_cpuid.m4	Sat Sep 15 09:24:04 2018 +0300
     1.3 @@ -0,0 +1,79 @@
     1.4 +# ===========================================================================
     1.5 +#     http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html
     1.6 +# ===========================================================================
     1.7 +#
     1.8 +# SYNOPSIS
     1.9 +#
    1.10 +#   AX_GCC_X86_CPUID(OP)
    1.11 +#
    1.12 +# DESCRIPTION
    1.13 +#
    1.14 +#   On Pentium and later x86 processors, with gcc or a compiler that has a
    1.15 +#   compatible syntax for inline assembly instructions, run a small program
    1.16 +#   that executes the cpuid instruction with input OP. This can be used to
    1.17 +#   detect the CPU type.
    1.18 +#
    1.19 +#   On output, the values of the eax, ebx, ecx, and edx registers are stored
    1.20 +#   as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable
    1.21 +#   ax_cv_gcc_x86_cpuid_OP.
    1.22 +#
    1.23 +#   If the cpuid instruction fails (because you are running a
    1.24 +#   cross-compiler, or because you are not using gcc, or because you are on
    1.25 +#   a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP
    1.26 +#   is set to the string "unknown".
    1.27 +#
    1.28 +#   This macro mainly exists to be used in AX_GCC_ARCHFLAG.
    1.29 +#
    1.30 +# LICENSE
    1.31 +#
    1.32 +#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
    1.33 +#   Copyright (c) 2008 Matteo Frigo
    1.34 +#
    1.35 +#   This program is free software: you can redistribute it and/or modify it
    1.36 +#   under the terms of the GNU General Public License as published by the
    1.37 +#   Free Software Foundation, either version 3 of the License, or (at your
    1.38 +#   option) any later version.
    1.39 +#
    1.40 +#   This program is distributed in the hope that it will be useful, but
    1.41 +#   WITHOUT ANY WARRANTY; without even the implied warranty of
    1.42 +#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    1.43 +#   Public License for more details.
    1.44 +#
    1.45 +#   You should have received a copy of the GNU General Public License along
    1.46 +#   with this program. If not, see <http://www.gnu.org/licenses/>.
    1.47 +#
    1.48 +#   As a special exception, the respective Autoconf Macro's copyright owner
    1.49 +#   gives unlimited permission to copy, distribute and modify the configure
    1.50 +#   scripts that are the output of Autoconf when processing the Macro. You
    1.51 +#   need not follow the terms of the GNU General Public License when using
    1.52 +#   or distributing such scripts, even though portions of the text of the
    1.53 +#   Macro appear in them. The GNU General Public License (GPL) does govern
    1.54 +#   all other use of the material that constitutes the Autoconf Macro.
    1.55 +#
    1.56 +#   This special exception to the GPL applies to versions of the Autoconf
    1.57 +#   Macro released by the Autoconf Archive. When you make and distribute a
    1.58 +#   modified version of the Autoconf Macro, you may extend this special
    1.59 +#   exception to the GPL to apply to your modified version as well.
    1.60 +
    1.61 +#serial 7
    1.62 +
    1.63 +AC_DEFUN([AX_GCC_X86_CPUID],
    1.64 +[AC_REQUIRE([AC_PROG_CC])
    1.65 +AC_LANG_PUSH([C])
    1.66 +AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
    1.67 + [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
    1.68 +     int op = $1, eax, ebx, ecx, edx;
    1.69 +     FILE *f;
    1.70 +      __asm__("cpuid"
    1.71 +        : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
    1.72 +        : "a" (op));
    1.73 +     f = fopen("conftest_cpuid", "w"); if (!f) return 1;
    1.74 +     fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
    1.75 +     fclose(f);
    1.76 +     return 0;
    1.77 +])],
    1.78 +     [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
    1.79 +     [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
    1.80 +     [ax_cv_gcc_x86_cpuid_$1=unknown])])
    1.81 +AC_LANG_POP([C])
    1.82 +])
     2.1 --- a/acinclude/ax_gcc_x86_cpuid.m4.htm	Sat Sep 15 08:11:50 2018 +0300
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,79 +0,0 @@
     2.4 -# ===========================================================================
     2.5 -#     http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html
     2.6 -# ===========================================================================
     2.7 -#
     2.8 -# SYNOPSIS
     2.9 -#
    2.10 -#   AX_GCC_X86_CPUID(OP)
    2.11 -#
    2.12 -# DESCRIPTION
    2.13 -#
    2.14 -#   On Pentium and later x86 processors, with gcc or a compiler that has a
    2.15 -#   compatible syntax for inline assembly instructions, run a small program
    2.16 -#   that executes the cpuid instruction with input OP. This can be used to
    2.17 -#   detect the CPU type.
    2.18 -#
    2.19 -#   On output, the values of the eax, ebx, ecx, and edx registers are stored
    2.20 -#   as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable
    2.21 -#   ax_cv_gcc_x86_cpuid_OP.
    2.22 -#
    2.23 -#   If the cpuid instruction fails (because you are running a
    2.24 -#   cross-compiler, or because you are not using gcc, or because you are on
    2.25 -#   a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP
    2.26 -#   is set to the string "unknown".
    2.27 -#
    2.28 -#   This macro mainly exists to be used in AX_GCC_ARCHFLAG.
    2.29 -#
    2.30 -# LICENSE
    2.31 -#
    2.32 -#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
    2.33 -#   Copyright (c) 2008 Matteo Frigo
    2.34 -#
    2.35 -#   This program is free software: you can redistribute it and/or modify it
    2.36 -#   under the terms of the GNU General Public License as published by the
    2.37 -#   Free Software Foundation, either version 3 of the License, or (at your
    2.38 -#   option) any later version.
    2.39 -#
    2.40 -#   This program is distributed in the hope that it will be useful, but
    2.41 -#   WITHOUT ANY WARRANTY; without even the implied warranty of
    2.42 -#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    2.43 -#   Public License for more details.
    2.44 -#
    2.45 -#   You should have received a copy of the GNU General Public License along
    2.46 -#   with this program. If not, see <http://www.gnu.org/licenses/>.
    2.47 -#
    2.48 -#   As a special exception, the respective Autoconf Macro's copyright owner
    2.49 -#   gives unlimited permission to copy, distribute and modify the configure
    2.50 -#   scripts that are the output of Autoconf when processing the Macro. You
    2.51 -#   need not follow the terms of the GNU General Public License when using
    2.52 -#   or distributing such scripts, even though portions of the text of the
    2.53 -#   Macro appear in them. The GNU General Public License (GPL) does govern
    2.54 -#   all other use of the material that constitutes the Autoconf Macro.
    2.55 -#
    2.56 -#   This special exception to the GPL applies to versions of the Autoconf
    2.57 -#   Macro released by the Autoconf Archive. When you make and distribute a
    2.58 -#   modified version of the Autoconf Macro, you may extend this special
    2.59 -#   exception to the GPL to apply to your modified version as well.
    2.60 -
    2.61 -#serial 7
    2.62 -
    2.63 -AC_DEFUN([AX_GCC_X86_CPUID],
    2.64 -[AC_REQUIRE([AC_PROG_CC])
    2.65 -AC_LANG_PUSH([C])
    2.66 -AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
    2.67 - [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
    2.68 -     int op = $1, eax, ebx, ecx, edx;
    2.69 -     FILE *f;
    2.70 -      __asm__("cpuid"
    2.71 -        : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
    2.72 -        : "a" (op));
    2.73 -     f = fopen("conftest_cpuid", "w"); if (!f) return 1;
    2.74 -     fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
    2.75 -     fclose(f);
    2.76 -     return 0;
    2.77 -])],
    2.78 -     [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
    2.79 -     [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
    2.80 -     [ax_cv_gcc_x86_cpuid_$1=unknown])])
    2.81 -AC_LANG_POP([C])
    2.82 -])