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 |
||
6 |
dnl Which version of the canonical setup we're using |
|
1090.1.2
by Monty Taylor
pandora-build v0.11 |
7 |
AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.11])
|
1085.1.4
by Monty Taylor
pandora-build v1 |
8 |
|
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
|
|
13 |
])
|
|
14 |
])
|
|
15 |
||
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
16 |
dnl The standard setup for how we build Pandora projects
|
17 |
AC_DEFUN([PANDORA_CANONICAL_TARGET],[
|
|
1085.1.4
by Monty Taylor
pandora-build v1 |
18 |
AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING])
|
1085.1.7
by Monty Taylor
pandora-build r0.7 |
19 |
ifdef([m4_define],,[define([m4_define], defn([define]))])
|
20 |
ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
|
|
21 |
m4_define([PCT_ALL_ARGS],[$*])
|
|
1085.1.4
by Monty Taylor
pandora-build v1 |
22 |
m4_define([PCT_USE_GNULIB],[no])
|
23 |
m4_define([PCT_REQUIRE_CXX],[no])
|
|
24 |
m4_define([PCT_IGNORE_SHARED_PTR],[no])
|
|
1085.1.7
by Monty Taylor
pandora-build r0.7 |
25 |
m4_define([PCT_FORCE_GCC42],[no])
|
1085.3.4
by Monty Taylor
pandora-build v0.8 |
26 |
m4_foreach([pct_arg],[$*],[
|
1085.1.4
by Monty Taylor
pandora-build v1 |
27 |
m4_case(pct_arg,
|
28 |
[use-gnulib], [
|
|
29 |
m4_undefine([PCT_USE_GNULIB])
|
|
30 |
m4_define([PCT_USE_GNULIB],[yes])
|
|
31 |
],
|
|
32 |
[require-cxx], [
|
|
33 |
m4_undefine([PCT_REQUIRE_CXX])
|
|
34 |
m4_define([PCT_REQUIRE_CXX],[yes])
|
|
35 |
],
|
|
36 |
[ignore-shared-ptr], [
|
|
37 |
m4_undefine([PCT_IGNORE_SHARED_PTR])
|
|
38 |
m4_define([PCT_IGNORE_SHARED_PTR],[yes])
|
|
1085.1.7
by Monty Taylor
pandora-build r0.7 |
39 |
],
|
40 |
[force-gcc42], [
|
|
41 |
m4_undefine([PCT_FORCE_GCC42])
|
|
42 |
m4_define([PCT_FORCE_GCC42],[yes])
|
|
1085.1.4
by Monty Taylor
pandora-build v1 |
43 |
])
|
44 |
])
|
|
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
45 |
|
46 |
# We need to prevent canonical target
|
|
47 |
# from injecting -O2 into CFLAGS - but we won't modify anything if we have |
|
48 |
# set CFLAGS on the command line, since that should take ultimate precedence |
|
49 |
AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], |
|
50 |
[CFLAGS=""]) |
|
51 |
AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"], |
|
52 |
[CXXFLAGS=""]) |
|
53 |
|
|
54 |
AC_CANONICAL_TARGET |
|
55 |
|
|
56 |
AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects) |
|
1085.1.4
by Monty Taylor
pandora-build v1 |
57 |
|
58 |
m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ]) |
|
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
59 |
|
60 |
AC_REQUIRE([AC_PROG_CC]) |
|
1085.1.7
by Monty Taylor
pandora-build r0.7 |
61 |
AC_REQUIRE([PANDORA_MAC_GCC42]) |
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
62 |
|
63 |
dnl Once we can use a modern autoconf, we can use this |
|
64 |
dnl AC_PROG_CC_C99 |
|
65 |
AC_PROG_CXX |
|
66 |
AC_PROG_CPP |
|
67 |
AM_PROG_CC_C_O |
|
68 |
||
69 |
gl_USE_SYSTEM_EXTENSIONS |
|
1085.1.7
by Monty Taylor
pandora-build r0.7 |
70 |
m4_if(PCT_FORCE_GCC42, [yes], [ |
71 |
AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION) |
|
72 |
]) |
|
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
73 |
|
74 |
||
75 |
PANDORA_LIBTOOL |
|
76 |
||
1085.1.4
by Monty Taylor
pandora-build v1 |
77 |
dnl autoconf doesn't automatically provide a fail-if-no-C++ macro |
78 |
dnl so we check c++98 features and fail if we don't have them, mainly |
|
79 |
dnl for that reason |
|
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
80 |
PANDORA_CHECK_CXX_STANDARD |
1085.1.4
by Monty Taylor
pandora-build v1 |
81 |
m4_if(PCT_REQUIRE_CXX, [yes], [ |
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
82 |
AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[ |
83 |
AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98]) |
|
84 |
]) |
|
85 |
]) |
|
86 |
|
|
87 |
PANDORA_SHARED_PTR |
|
1085.1.4
by Monty Taylor
pandora-build v1 |
88 |
m4_if(PCT_IGNORE_SHARED_PTR, [no], [ |
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
89 |
AS_IF([test "$ac_cv_shared_ptr_namespace" = "missing"],[ |
90 |
AC_MSG_WARN([a usable shared_ptr implementation was not found. Let someone know what your platform is.]) |
|
91 |
]) |
|
92 |
]) |
|
93 |
|
|
1085.1.4
by Monty Taylor
pandora-build v1 |
94 |
m4_if(PCT_USE_GNULIB, [yes], [gl_INIT]) |
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
95 |
|
96 |
AC_C_BIGENDIAN |
|
97 |
AC_C_CONST |
|
98 |
AC_C_INLINE |
|
99 |
AC_C_VOLATILE |
|
100 |
||
101 |
AC_HEADER_TIME |
|
102 |
AC_TYPE_SIZE_T |
|
103 |
AC_FUNC_MALLOC |
|
104 |
AC_FUNC_REALLOC |
|
105 |
|
|
106 |
||
107 |
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) |
|
1085.1.4
by Monty Taylor
pandora-build v1 |
108 |
|
109 |
AC_SYS_LARGEFILE |
|
110 |
||
111 |
||
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
112 |
PANDORA_CHECK_C_VERSION |
113 |
PANDORA_CHECK_CXX_VERSION |
|
114 |
||
115 |
PANDORA_OPTIMIZE |
|
116 |
PANDORA_64BIT |
|
1085.1.7
by Monty Taylor
pandora-build r0.7 |
117 |
|
118 |
gl_VISIBILITY |
|
119 |
||
1090.1.2
by Monty Taylor
pandora-build v0.11 |
120 |
PANDORA_HEADER_ASSERT |
121 |
||
1085.1.4
by Monty Taylor
pandora-build v1 |
122 |
PANDORA_WARNINGS(PCT_ALL_ARGS) |
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
123 |
|
124 |
PANDORA_ENABLE_DTRACE |
|
125 |
||
126 |
AC_CHECK_PROGS([DOXYGEN], [doxygen]) |
|
127 |
AC_CHECK_PROGS([PERL], [perl]) |
|
128 |
||
129 |
AS_IF([test "x${gl_LIBOBJS}" != "x"],[ |
|
130 |
AS_IF([test "$GCC" = "yes"],[ |
|
131 |
AM_CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${AM_CPPFLAGS}"
|
|
132 |
],[ |
|
133 |
AM_CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${AM_CPPFLAGS}"
|
|
134 |
]) |
|
135 |
]) |
|
136 |
||
137 |
AM_CPPFLAGS="-I\${top_srcdir} -I\${top_builddir} ${AM_CPPFLAGS}" |
|
138 |
AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}" |
|
139 |
AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}" |
|
140 |
||
141 |
AC_SUBST([AM_CFLAGS]) |
|
142 |
AC_SUBST([AM_CXXFLAGS]) |
|
143 |
AC_SUBST([AM_CPPFLAGS]) |
|
144 |
||
145 |
]) |