]> git.saurik.com Git - cycript.git/blame - m4/ax_prog_cxx_for_build.m4
Allow the size of array typedefs to be a variable.
[cycript.git] / m4 / ax_prog_cxx_for_build.m4
CommitLineData
8d20f0f1
JF
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_PROG_CXX_FOR_BUILD
8#
9# DESCRIPTION
10#
11# This macro searches for a C++ compiler that generates native
12# executables, that is a C++ compiler that surely is not a cross-compiler.
13# This can be useful if you have to generate source code at compile-time
14# like for example GCC does.
15#
16# The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything
17# needed to compile or link (CXX_FOR_BUILD) and preprocess
18# (CXXCPP_FOR_BUILD). The value of these variables can be overridden by
19# the user by specifying a compiler with an environment variable (like you
20# do for standard CXX).
21#
22# LICENSE
23#
24# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
25# Copyright (c) 2012 Avionic Design GmbH
26#
27# Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini.
28#
29# Copying and distribution of this file, with or without modification, are
30# permitted in any medium without royalty provided the copyright notice
31# and this notice are preserved. This file is offered as-is, without any
32# warranty.
33
34#serial 2
35
36AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD])
37AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl
38AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl
39AC_REQUIRE([AC_PROG_CXX])dnl
40AC_REQUIRE([AC_PROG_CXXCPP])dnl
41AC_REQUIRE([AC_CANONICAL_HOST])dnl
42
43dnl Use the standard macros, but make them use other variable names
44dnl
45pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl
46pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl
47pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl
48pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl
49pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl
50pushdef([CXX], CXX_FOR_BUILD)dnl
51pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl
52pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl
53pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
54pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl
55pushdef([host], build)dnl
56pushdef([host_alias], build_alias)dnl
57pushdef([host_cpu], build_cpu)dnl
58pushdef([host_vendor], build_vendor)dnl
59pushdef([host_os], build_os)dnl
60pushdef([ac_cv_host], ac_cv_build)dnl
61pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
62pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
63pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
64pushdef([ac_cv_host_os], ac_cv_build_os)dnl
65pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl
66pushdef([ac_compile], ac_build_compile)dnl
67pushdef([ac_link], ac_build_link)dnl
68
69save_cross_compiling=$cross_compiling
70save_ac_tool_prefix=$ac_tool_prefix
71cross_compiling=no
72ac_tool_prefix=
73
74AC_PROG_CXX
75AC_PROG_CXXCPP
76
77ac_tool_prefix=$save_ac_tool_prefix
78cross_compiling=$save_cross_compiling
79
80dnl Restore the old definitions
81dnl
82popdef([ac_link])dnl
83popdef([ac_compile])dnl
84popdef([ac_cxxcpp])dnl
85popdef([ac_cv_host_os])dnl
86popdef([ac_cv_host_vendor])dnl
87popdef([ac_cv_host_cpu])dnl
88popdef([ac_cv_host_alias])dnl
89popdef([ac_cv_host])dnl
90popdef([host_os])dnl
91popdef([host_vendor])dnl
92popdef([host_cpu])dnl
93popdef([host_alias])dnl
94popdef([host])dnl
95popdef([CXXCPPFLAGS])dnl
96popdef([CPPFLAGS])dnl
97popdef([CXXFLAGS])dnl
98popdef([CXXCPP])dnl
99popdef([CXX])dnl
100popdef([ac_cv_prog_cxx_g])dnl
101popdef([ac_cv_prog_cxx_cross])dnl
102popdef([ac_cv_prog_cxx_works])dnl
103popdef([ac_cv_prog_gxx])dnl
104popdef([ac_cv_prog_CXXCPP])dnl
105
106dnl Finally, set Makefile variables
107dnl
108AC_SUBST([CXXFLAGS_FOR_BUILD])dnl
109AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl
110])