]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/bmake/mk/autoconf.mk
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / bmake / mk / autoconf.mk
1 # $Id: autoconf.mk,v 1.8 2012/11/19 05:37:48 sjg Exp $
2 #
3 #       @(#) Copyright (c) 1996-2009, Simon J. Gerraty
4 #
5 #       This file is provided in the hope that it will
6 #       be of use.  There is absolutely NO WARRANTY.
7 #       Permission to copy, redistribute or otherwise
8 #       use this file is hereby granted provided that 
9 #       the above copyright notice and this notice are
10 #       left intact. 
11 #      
12 #       Please send copies of changes and bug-fixes to:
13 #       sjg@crufty.net
14 #
15
16 .NOPATH:        config.h config.status
17
18 .if !target(config.h)
19 config.h:       ${.CURDIR}/config.h.in config.status
20         ./config.status
21 .endif
22
23 .if !target(config.status)
24 # avoid the targets behaving differently
25 .if exists(${.OBJDIR}/config.status)
26 config.status:  config.recheck
27 .else
28 config.status:  config.gen
29 .endif
30
31 config.recheck: config.h.in ${.CURDIR}/configure
32         ./config.status --recheck
33         @touch $@
34
35 config.gen: config.h.in ${.CURDIR}/configure
36         CC="${CC} ${CCMODE}" ${.CURDIR}/configure --no-create ${CONFIGURE_ARGS}
37         @touch $@ config.recheck
38
39 CLEANFILES+= config.recheck config.gen config.status *.meta
40 .endif
41
42 # avoid things blowing up if these are not here...
43 # this is not quite per the autoconf manual,
44 # and is extremely convoluted - but all utterly necessary!
45
46 .if make(autoconf-in) || make(configure) || make(config.h.in) || ${AUTO_AUTOCONF:Uno:tl} == "yes"
47 AUTOCONF ?= autoconf
48 AUTOHEADER ?= autoheader
49
50 # expand it to a full path 
51 AUTOCONF := ${AUTOCONF:${M_whence}}
52
53 .if exists(${AUTOCONF})
54
55 .PRECIOUS: configure config.h.in config.status
56
57 ACLOCAL =
58 ACCONFIG =
59
60 .if exists(${.CURDIR}/aclocal.m4)
61 ACLOCAL += aclocal.m4
62 .endif
63 # use of acconfig.h is deprecated!
64 .if exists(${.CURDIR}/acconfig.h)
65 ACCONFIG += acconfig.h
66 .endif
67
68 config.h.in:    ${.CURDIR}/configure.in ${ACCONFIG}
69         (cd ${.CURDIR} && ${AUTOHEADER})
70
71 configure:      ${.CURDIR}/configure.in ${ACLOCAL}
72         (cd ${.CURDIR} && ${AUTOCONF})
73
74 AUTOCONF_INPUTS += configure
75 autoconf-input: ${AUTOCONF_INPUTS}
76
77 .endif
78 .endif