From c864603bb4344a0623c8cedb2a68a77392cac161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Mon, 28 Nov 2011 15:32:32 -0500 Subject: [PATCH] Bug 705466 - Use MOZ_CHECK_HEADERS to check for cpuid.h. r=ted. --HG-- extra : rebase_source : ecd108d166017cbd64c5be459a76cb2522723dfb --- aclocal.m4 | 1 + build/autoconf/mozcommonheader.m4 | 41 ++++++++++++++++++++++++ configure.in | 7 +--- js/src/aclocal.m4 | 1 + js/src/build/autoconf/mozcommonheader.m4 | 41 ++++++++++++++++++++++++ js/src/configure.in | 7 +--- xpcom/glue/SSE.cpp | 2 +- xpcom/glue/SSE.h | 2 +- 8 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 build/autoconf/mozcommonheader.m4 create mode 100644 js/src/build/autoconf/mozcommonheader.m4 diff --git a/aclocal.m4 b/aclocal.m4 index fc1d46a1086..fc58446c9dc 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,6 +12,7 @@ builtin(include, build/autoconf/codeset.m4)dnl builtin(include, build/autoconf/altoptions.m4)dnl builtin(include, build/autoconf/mozprog.m4)dnl builtin(include, build/autoconf/mozheader.m4)dnl +builtin(include, build/autoconf/mozcommonheader.m4)dnl builtin(include, build/autoconf/acwinpaths.m4)dnl builtin(include, build/autoconf/lto.m4)dnl builtin(include, build/autoconf/gcc-pr49911.m4)dnl diff --git a/build/autoconf/mozcommonheader.m4 b/build/autoconf/mozcommonheader.m4 new file mode 100644 index 00000000000..cc910377858 --- /dev/null +++ b/build/autoconf/mozcommonheader.m4 @@ -0,0 +1,41 @@ +dnl ***** BEGIN LICENSE BLOCK ***** +dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1 +dnl +dnl The contents of this file are subject to the Mozilla Public License Version +dnl 1.1 (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at +dnl http://www.mozilla.org/MPL/ +dnl +dnl Software distributed under the License is distributed on an "AS IS" basis, +dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +dnl for the specific language governing rights and limitations under the +dnl License. +dnl +dnl The Original Code is mozilla.org code. +dnl +dnl The Initial Developer of the Original Code is the +dnl Mozilla Foundation +dnl +dnl Portions created by the Initial Developer are Copyright (C) 2009 +dnl the Initial Developer. All Rights Reserved. +dnl +dnl +dnl Alternatively, the contents of this file may be used under the terms of +dnl either of the GNU General Public License Version 2 or later (the "GPL"), +dnl or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +dnl in which case the provisions of the GPL or the LGPL are applicable instead +dnl of those above. If you wish to allow use of your version of this file only +dnl under the terms of either the GPL or the LGPL, and not to allow others to +dnl use your version of this file under the terms of the MPL, indicate your +dnl decision by deleting the provisions above and replace them with the notice +dnl and other provisions required by the GPL or the LGPL. If you do not delete +dnl the provisions above, a recipient may use your version of this file under +dnl the terms of any one of the MPL, the GPL or the LGPL. +dnl +dnl ***** END LICENSE BLOCK ***** + +AC_DEFUN(MOZ_CHECK_COMMON_HEADERS, + MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h sys/bitypes.h \ + memory.h unistd.h gnu/libc-version.h nl_types.h malloc.h \ + X11/XKBlib.h io.h cpuid.h) +) diff --git a/configure.in b/configure.in index 3c6c7a81b1d..134015fc0c6 100644 --- a/configure.in +++ b/configure.in @@ -3409,12 +3409,7 @@ freebsd*|openbsd*) CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}" ;; esac -MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h) -MOZ_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h) -MOZ_CHECK_HEADERS(gnu/libc-version.h nl_types.h) -MOZ_CHECK_HEADERS(malloc.h) -MOZ_CHECK_HEADERS(X11/XKBlib.h) -MOZ_CHECK_HEADERS(io.h) +MOZ_CHECK_COMMON_HEADERS dnl These are all the places some variant of statfs can be hiding. MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h) diff --git a/js/src/aclocal.m4 b/js/src/aclocal.m4 index e3ac8aa0d2e..b826fcbe471 100644 --- a/js/src/aclocal.m4 +++ b/js/src/aclocal.m4 @@ -9,6 +9,7 @@ builtin(include, build/autoconf/altoptions.m4)dnl builtin(include, build/autoconf/moznbytetype.m4)dnl builtin(include, build/autoconf/mozprog.m4)dnl builtin(include, build/autoconf/mozheader.m4)dnl +builtin(include, build/autoconf/mozcommonheader.m4)dnl builtin(include, build/autoconf/acwinpaths.m4)dnl builtin(include, build/autoconf/lto.m4)dnl builtin(include, build/autoconf/gcc-pr49911.m4)dnl diff --git a/js/src/build/autoconf/mozcommonheader.m4 b/js/src/build/autoconf/mozcommonheader.m4 new file mode 100644 index 00000000000..cc910377858 --- /dev/null +++ b/js/src/build/autoconf/mozcommonheader.m4 @@ -0,0 +1,41 @@ +dnl ***** BEGIN LICENSE BLOCK ***** +dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1 +dnl +dnl The contents of this file are subject to the Mozilla Public License Version +dnl 1.1 (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at +dnl http://www.mozilla.org/MPL/ +dnl +dnl Software distributed under the License is distributed on an "AS IS" basis, +dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +dnl for the specific language governing rights and limitations under the +dnl License. +dnl +dnl The Original Code is mozilla.org code. +dnl +dnl The Initial Developer of the Original Code is the +dnl Mozilla Foundation +dnl +dnl Portions created by the Initial Developer are Copyright (C) 2009 +dnl the Initial Developer. All Rights Reserved. +dnl +dnl +dnl Alternatively, the contents of this file may be used under the terms of +dnl either of the GNU General Public License Version 2 or later (the "GPL"), +dnl or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +dnl in which case the provisions of the GPL or the LGPL are applicable instead +dnl of those above. If you wish to allow use of your version of this file only +dnl under the terms of either the GPL or the LGPL, and not to allow others to +dnl use your version of this file under the terms of the MPL, indicate your +dnl decision by deleting the provisions above and replace them with the notice +dnl and other provisions required by the GPL or the LGPL. If you do not delete +dnl the provisions above, a recipient may use your version of this file under +dnl the terms of any one of the MPL, the GPL or the LGPL. +dnl +dnl ***** END LICENSE BLOCK ***** + +AC_DEFUN(MOZ_CHECK_COMMON_HEADERS, + MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h sys/bitypes.h \ + memory.h unistd.h gnu/libc-version.h nl_types.h malloc.h \ + X11/XKBlib.h io.h cpuid.h) +) diff --git a/js/src/configure.in b/js/src/configure.in index 35ef358c55a..a652025bdd4 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -3248,12 +3248,7 @@ freebsd*) CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}" ;; esac -MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h) -MOZ_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h) -MOZ_CHECK_HEADERS(gnu/libc-version.h nl_types.h) -MOZ_CHECK_HEADERS(malloc.h) -MOZ_CHECK_HEADERS(X11/XKBlib.h) -MOZ_CHECK_HEADERS(io.h) +MOZ_CHECK_COMMON_HEADERS dnl These are all the places some variant of statfs can be hiding. MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h) diff --git a/xpcom/glue/SSE.cpp b/xpcom/glue/SSE.cpp index 0c5f4fba6c1..a37e3d15fdf 100644 --- a/xpcom/glue/SSE.cpp +++ b/xpcom/glue/SSE.cpp @@ -46,7 +46,7 @@ namespace { // conflicts with on MSVC 2005, and some files want to // include both SSE.h and . -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && (defined(__i386__) || defined(__x86_64__)) +#ifdef HAVE_CPUID_H // cpuid.h is available on gcc 4.3 and higher on i386 and x86_64 #include diff --git a/xpcom/glue/SSE.h b/xpcom/glue/SSE.h index b0cc33c6db6..20ae182eef3 100644 --- a/xpcom/glue/SSE.h +++ b/xpcom/glue/SSE.h @@ -160,7 +160,7 @@ #define MOZILLA_PRESUME_SSE4_2 1 #endif -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#ifdef HAVE_CPUID_H #define MOZILLA_SSE_HAVE_CPUID_DETECTION #endif