1085.1.4
by Monty Taylor
pandora-build v1 |
1 |
dnl Copyright (C) 2009 Sun Microsystems |
2 |
dnl This file is free software; Sun Microsystems |
|
3 |
dnl gives unlimited permission to copy and/or distribute it, |
|
4 |
dnl with or without modifications, as long as this notice is preserved. |
|
5 |
||
1530.5.3
by Monty Taylor
Added macro to force use of gcc44 on centos. |
6 |
AC_DEFUN([_PANDORA_TRY_GCC],[ |
1530.5.4
by Monty Taylor
Made a macro out of repeated text. |
7 |
pushdef([Name],[translit([$1],[./-], [___])]) |
8 |
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
|
9 |
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
|
1530.5.5
by Monty Taylor
Made sure we order tests in the right way - we want to make sure that we upgrade the gcc version before we test for C++0x support. |
10 |
AC_CHECK_PROGS([CC]NAME,[gcc$1]) |
11 |
AC_CHECK_PROGS([CXX]NAME,[g++$1]) |
|
1530.5.11
by Monty Taylor
Don't let's overwrite values the user has provided. |
12 |
AS_IF([test "x${CC]NAME[}" != "x" -a "x${ac_cv_env_CC_set}" = "x"], |
13 |
[CC="${CC]NAME[}"]) |
|
14 |
AS_IF([test "x${CXX]NAME[}" != "x" -a "x${ac_cv_env_CCX_set}" = "x"], |
|
15 |
[CXX="${CXX]NAME[}"]) |
|
16 |
AS_IF([test "x${CC]NAME[}" != "x" -a "x${ac_cv_env_CPP_set}" = "x"], |
|
17 |
[CPP="${CC]NAME[} -E"]) |
|
1530.5.3
by Monty Taylor
Added macro to force use of gcc44 on centos. |
18 |
]) |
19 |
||
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
20 |
dnl If the user is on a Mac and didn't ask for a specific compiler |
21 |
dnl You're gonna get 4.2. |
|
22 |
AC_DEFUN([PANDORA_MAC_GCC42], |
|
1081.1.1
by Monty Taylor
Whole boat-load of build fixes. |
23 |
[AS_IF([test "$GCC" = "yes"],[ |
24 |
AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[ |
|
1126.6.1
by Monty Taylor
pandora-build v0.58 |
25 |
host_os_version=`echo ${host_os} | perl -ple 's/^\D+//g;s,\..*,,'`
|
26 |
AS_IF([test "$host_os_version" -lt 10],[ |
|
1530.5.3
by Monty Taylor
Added macro to force use of gcc44 on centos. |
27 |
_PANDORA_TRY_GCC([-4.2]) |
1126.6.1
by Monty Taylor
pandora-build v0.58 |
28 |
]) |
1081.1.1
by Monty Taylor
Whole boat-load of build fixes. |
29 |
]) |
30 |
]) |
|
31 |
]) |
|
32 |
||
1530.5.3
by Monty Taylor
Added macro to force use of gcc44 on centos. |
33 |
dnl If the user is on CentOS or RHEL and didn't ask for a specific compiler |
34 |
dnl You're gonna get 4.4 (forward compatible with 4.5) |
|
35 |
AC_DEFUN([PANDORA_RH_GCC44], |
|
36 |
[AS_IF([test "$GCC" = "yes"],[ |
|
37 |
AS_IF([test "x${ac_cv_env_CC_set}" = "x"],[ |
|
38 |
_PANDORA_TRY_GCC([44]) |
|
39 |
_PANDORA_TRY_GCC([45]) |
|
40 |
]) |
|
41 |
]) |
|
42 |
]) |
|
43 |
||
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
44 |
dnl |
45 |
AC_DEFUN([PANDORA_ENSURE_GCC_VERSION],[ |
|
46 |
AC_REQUIRE([PANDORA_MAC_GCC42]) |
|
1530.5.3
by Monty Taylor
Added macro to force use of gcc44 on centos. |
47 |
AC_REQUIRE([PANDORA_RH_GCC44]) |
1530.5.5
by Monty Taylor
Made sure we order tests in the right way - we want to make sure that we upgrade the gcc version before we test for C++0x support. |
48 |
AS_IF([test "$GCC" = "yes"],[ |
49 |
AC_CACHE_CHECK([if GCC is recent enough], [ac_cv_gcc_recent], |
|
50 |
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
|
1530.5.3
by Monty Taylor
Added macro to force use of gcc44 on centos. |
51 |
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 2))
|
1081.1.1
by Monty Taylor
Whole boat-load of build fixes. |
52 |
# error GCC is Too Old!
|
53 |
#endif
|
|
1530.5.5
by Monty Taylor
Made sure we order tests in the right way - we want to make sure that we upgrade the gcc version before we test for C++0x support. |
54 |
]])], |
55 |
[ac_cv_gcc_recent=yes], |
|
56 |
[ac_cv_gcc_recent=no])]) |
|
57 |
AS_IF([test "$ac_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"], |
|
58 |
AC_MSG_ERROR([Your version of GCC is too old. At least version 4.2 is required on OSX. You may need to install a version of XCode >= 3.1.2])) |
|
59 |
AS_IF([test "$ac_cv_gcc_recent" = "no"], |
|
60 |
AC_MSG_ERROR([Your version of GCC is too old. At least version 4.2 is required. On RHEL/CentOS systems this is found in the gcc44 and gcc44-c++ packages.])) |
|
61 |
]) |
|
1081.1.1
by Monty Taylor
Whole boat-load of build fixes. |
62 |
]) |