~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/check_gcc_verion.m4

  • Committer: Monty Taylor
  • Date: 2009-06-30 18:09:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1083.
  • Revision ID: mordred@inaugust.com-20090630180907-r24363hlhgxg4cbw
Whole boat-load of build fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_DEFUN([FORCE_MAC_GCC42],
 
2
  [AS_IF([test "$GCC" = "yes"],[
 
3
    dnl If you're on a Mac, and you didn't ask for a specific compiler
 
4
    dnl You're gonna get 4.2.
 
5
    AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[
 
6
      CPP="/usr/bin/gcc-4.2 -E"
 
7
      CC=/usr/bin/gcc-4.2
 
8
      CXX=/usr/bin/g++-4.2
 
9
    ])
 
10
  ])
 
11
])
 
12
 
 
13
AC_DEFUN([CHECK_GCC_VERSION],[
 
14
  AC_REQUIRE([FORCE_MAC_GCC42])
 
15
  AC_CACHE_CHECK([if GCC is recent enough], [ac_cv_gcc_recent],
 
16
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
17
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
 
18
# error GCC is Too Old!
 
19
#endif
 
20
      ]])],
 
21
      [ac_cv_gcc_recent=yes],
 
22
      [ac_cv_gcc_recent=no])])
 
23
  AS_IF([test "$ac_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"],
 
24
    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]))
 
25
  AS_IF([test "$drizzle_cv_gcc_recent" = "no"],
 
26
    AC_MSG_ERROR([Your version of GCC is too old. At least version 4.1 is required]))
 
27
])