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.
6
dnl Which version of the canonical setup we're using
7
AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.1])
9
AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
10
dnl Force dependency tracking on for Sun Studio builds
11
AS_IF([test "x${enable_dependency_tracking}" = "x"],[
12
enable_dependency_tracking=yes
1
16
dnl The standard setup for how we build Pandora projects
3
17
AC_DEFUN([PANDORA_CANONICAL_TARGET],[
6
PCT_IGNORE_SHARED_PTR=no
17
PCT_IGNORE_SHARED_PTR=yes
18
AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING])
19
m4_define([PCT_ALL_ARGS],[$@])
20
m4_define([PCT_USE_GNULIB],[no])
21
m4_define([PCT_REQUIRE_CXX],[no])
22
m4_define([PCT_IGNORE_SHARED_PTR],[no])
23
m4_foreach_w([pct_arg],$@,[
26
m4_undefine([PCT_USE_GNULIB])
27
m4_define([PCT_USE_GNULIB],[yes])
30
m4_undefine([PCT_REQUIRE_CXX])
31
m4_define([PCT_REQUIRE_CXX],[yes])
33
[ignore-shared-ptr], [
34
m4_undefine([PCT_IGNORE_SHARED_PTR])
35
m4_define([PCT_IGNORE_SHARED_PTR],[yes])
22
39
# We need to prevent canonical target
23
40
# from injecting -O2 into CFLAGS - but we won't modify anything if we have
30
47
AC_CANONICAL_TARGET
32
49
AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects)
33
AS_IF([test "x${PCT_USE_GNULIB}" = "xyes"], [
51
m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ])
38
53
AC_REQUIRE([AC_PROG_CC])
40
dnl Force dependency tracking on for Sun Studio builds
41
AS_IF([test "x${enable_dependency_tracking}" = "x"],[
42
enable_dependency_tracking=yes
46
55
dnl Once we can use a modern autoconf, we can use this
66
dnl autoconf doesn't automatically provide a fail-if-no-C++ macro
67
dnl so we check c++98 features and fail if we don't have them, mainly
57
69
PANDORA_CHECK_CXX_STANDARD
58
AS_IF([test "$PCT_REQUIRE_CXX" = "yes"],[
70
m4_if(PCT_REQUIRE_CXX, [yes], [
59
71
AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[
60
72
AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98])
65
AS_IF([test "$PCT_IGNORE_SHARED_PTR" = no],[
77
m4_if(PCT_IGNORE_SHARED_PTR, [no], [
66
78
AS_IF([test "$ac_cv_shared_ptr_namespace" = "missing"],[
67
79
AC_MSG_WARN([a usable shared_ptr implementation was not found. Let someone know what your platform is.])
71
AS_IF([test "x${PCT_USE_GNULIB}" = "xyes"], [
72
dnl TODO: replace this run-time test with an m4 compile-time test
83
m4_if(PCT_USE_GNULIB, [yes], [gl_INIT])
88
96
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
100
AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)
89
102
PANDORA_CHECK_C_VERSION
90
103
PANDORA_CHECK_CXX_VERSION
98
PANDORA_WARNINGS($PCT_ALL_ARGS)
107
PANDORA_WARNINGS(PCT_ALL_ARGS)