1#---------------------------------------------------------------------------
2#
3# xc-am-iface.m4
4#
5# Copyright (c) 2013 Daniel Stenberg <daniel@haxx.se>
6#
7# Permission to use, copy, modify, and distribute this software for any
8# purpose with or without fee is hereby granted, provided that the above
9# copyright notice and this permission notice appear in all copies.
10#
11# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18#
19#---------------------------------------------------------------------------
20
21# serial 1
22
23
24dnl _XC_AUTOMAKE_BODY
25dnl -------------------------------------------------
26dnl Private macro.
27dnl
28dnl This macro performs embedding of automake initialization
29dnl code into configure script. When automake version 1.14 or
30dnl newer is used at configure script generation time, this
31dnl results in 'subdir-objects' automake option being used.
32dnl When using automake versions older than 1.14 this option
33dnl is not used when generating configure script.
34
35m4_define([_XC_AUTOMAKE_BODY],
36[dnl
37## --------------------------------------- ##
38##  Start of automake initialization code  ##
39## --------------------------------------- ##
40m4_ifdef([_AM_PROG_CC_C_O],
41[
42AM_INIT_AUTOMAKE([subdir-objects])
43],[
44AM_INIT_AUTOMAKE
45])dnl
46## ------------------------------------- ##
47##  End of automake initialization code  ##
48## ------------------------------------- ##
49dnl
50m4_define([$0], [])[]dnl
51])
52
53
54dnl XC_AUTOMAKE
55dnl -------------------------------------------------
56dnl Public macro.
57dnl
58dnl This macro embeds automake machinery into configure
59dnl script with initialization option 'subdir-objects'
60dnl when using automake version 1.14 or newer.
61
62AC_DEFUN([XC_AUTOMAKE],
63[dnl
64AC_PREREQ([2.50])dnl
65dnl
66AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
67dnl
68_XC_AUTOMAKE_BODY
69dnl
70m4_ifdef([AM_INIT_AUTOMAKE],
71  [m4_undefine([AM_INIT_AUTOMAKE])])dnl
72dnl
73m4_define([$0], [])[]dnl
74])
75
76