~drizzle-trunk/drizzle/development

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
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
6
dnl If the user is on a Mac and didn't ask for a specific compiler
7
dnl You're gonna get 4.2.
8
AC_DEFUN([PANDORA_MAC_GCC42],
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
9
  [AS_IF([test "$GCC" = "yes"],[
10
    AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[
1126.6.1 by Monty Taylor
pandora-build v0.58
11
      host_os_version=`echo ${host_os} | perl -ple 's/^\D+//g;s,\..*,,'`
12
      AS_IF([test "$host_os_version" -lt 10],[
13
        AS_IF([test -f /usr/bin/gcc-4.2],
1081.1.2 by Monty Taylor
Added file existence test for gcc-4.2 check on osx.
14
        [
15
          CPP="/usr/bin/gcc-4.2 -E"
16
          CC=/usr/bin/gcc-4.2
17
          CXX=/usr/bin/g++-4.2
18
        ])
1126.6.1 by Monty Taylor
pandora-build v0.58
19
      ])
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
20
    ])
21
  ])
22
])
23
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
24
dnl 
25
AC_DEFUN([PANDORA_ENSURE_GCC_VERSION],[
26
  AC_REQUIRE([PANDORA_MAC_GCC42])
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
27
  AC_CACHE_CHECK([if GCC is recent enough], [ac_cv_gcc_recent],
28
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
29
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
30
# error GCC is Too Old!
31
#endif
32
      ]])],
33
      [ac_cv_gcc_recent=yes],
34
      [ac_cv_gcc_recent=no])])
35
  AS_IF([test "$ac_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"],
36
    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]))
1085.1.4 by Monty Taylor
pandora-build v1
37
  AS_IF([test "$ac_cv_gcc_recent" = "no"],
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
38
    AC_MSG_ERROR([Your version of GCC is too old. At least version 4.1 is required]))
39
])