4 # Before making any changes to this file, contact portmgr to arrange
5 # for an experimental ports run.
6 # Untested commits will almost certainly break the tree, incur the
7 # wrath of countless folks, and be unceremoniously backed out by
8 # the maintainer and/or portmgr.
10 Autotools_Include_MAINTAINER= autotools@FreeBSD.org
12 #---------------------------------------------------------------------------
13 # USE_AUTOTOOLS= tool[:env] ...
15 # 'tool' can currently be one of the following:
16 # autoconf, autoheader
19 # ':env' is used to specify that the environmental variables are needed
20 # but the relevant tool should NOT be run as part of the
21 # 'run-autotools' target
23 # In addition, these variables can be set in the port Makefile to be
24 # passed to the relevant tools:
27 # - Extra arguments passed to automake during configure step
30 # - Arguments passed to aclocal during configure step
33 # - Extra arguments passed to autoconf during configure step
36 # - Extra arguments passed to autoheader during configure step
38 #---------------------------------------------------------------------------
40 #---------------------------------------------------------------------------
41 # NO USER-SERVICABLE PARTS BEYOND THIS POINT. REALLY. WE MEAN IT.
42 #---------------------------------------------------------------------------
44 # Known autotools components
45 _AUTOTOOLS_ALL= autoconf autoheader \
48 #---------------------------------------------------------------------------
49 # Primary magic to break out the USE_AUTOTOOLS stanza into something
50 # more useful, along with substantial error checking to prevent
52 #---------------------------------------------------------------------------
54 # Break out the stanza
57 .for stanza in ${USE_AUTOTOOLS}
58 _AUTOTOOLS_IMPL+= ${stanza:C/^([^:]+).*/\1/}
59 _AUTOTOOL_${stanza:C/^([^:]+).*/\1/}= ${stanza:C/^[^:]+:([^:]+)/\1/}
62 # Verify each component, normalize
65 .for component in ${_AUTOTOOLS_IMPL}
66 . if ${_AUTOTOOLS_ALL:M${component}}==""
67 _AUTOTOOLS_NOCOMP+= ${component}
69 . if ${_AUTOTOOL_${component}}==${component}
70 _AUTOTOOL_${component}= yes
71 . elsif ${_AUTOTOOL_${component}}!="env" && ${_AUTOTOOL_${component}}!="yes"
72 _AUTOTOOLS_BADCOMP+= ${component}:${_AUTOTOOL_${component}}
75 .if !empty(_AUTOTOOLS_NOCOMP)
76 IGNORE+= Unknown autotool: ${_AUTOTOOLS_NOCOMP:O:u}
79 # Check for anything other than 'yes' or 'env'
82 .for component in ${_AUTOTOOLS_IMPL}
83 . if ${_AUTOTOOL_${component}}!="env" && ${_AUTOTOOL_${component}}!="yes"
84 _AUTOTOOLS_BADCOMP+= ${component}:${_AUTOTOOL_${component}}
87 .if !empty(_AUTOTOOLS_BADCOMP)
88 IGNORE+= Bad autotool stanza: ${_AUTOTOOLS_BADCOMP:O:u}
91 #---------------------------------------------------------------------------
92 # automake and aclocal
93 #---------------------------------------------------------------------------
95 .if defined(_AUTOTOOL_aclocal) && ${_AUTOTOOL_aclocal} == "yes"
96 _AUTOTOOL_automake?= env
97 _AUTOTOOL_rule_aclocal= yes
101 .if defined(_AUTOTOOL_automake)
102 AUTOMAKE_VERSION= 1.15
103 AUTOMAKE_APIVER= 1.15
104 AUTOMAKE_PORT= devel/automake
106 . if ${_AUTOTOOL_automake} == "yes"
107 _AUTOTOOL_rule_automake= yes
112 .if defined(AUTOMAKE_VERSION)
113 AUTOMAKE= ${LOCALBASE}/bin/automake-${AUTOMAKE_VERSION}
114 AUTOMAKE_DIR= ${LOCALBASE}/share/automake-${AUTOMAKE_VERSION}
115 ACLOCAL= ${LOCALBASE}/bin/aclocal-${AUTOMAKE_VERSION}
116 ACLOCAL_DIR= ${LOCALBASE}/share/aclocal-${AUTOMAKE_VERSION}
118 . if defined(_AUTOTOOL_aclocal)
119 ACLOCAL_ARGS?= --automake-acdir=${ACLOCAL_DIR}
122 AUTOMAKE_VARS= AUTOMAKE=${AUTOMAKE} \
123 AUTOMAKE_DIR=${AUTOMAKE_DIR} \
124 AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
125 AUTOMAKE_APIVER=${AUTOMAKE_APIVER} \
127 ACLOCAL_DIR=${ACLOCAL_DIR}
129 AUTOMAKE_DEPENDS= ${AUTOMAKE}:${AUTOMAKE_PORT}
130 BUILD_DEPENDS+= ${AUTOMAKE_DEPENDS}
133 #---------------------------------------------------------------------------
134 # autoconf and autoheader
135 #---------------------------------------------------------------------------
137 .if defined(_AUTOTOOL_autoheader) && ${_AUTOTOOL_autoheader} == "yes"
138 _AUTOTOOL_autoconf= yes
139 _AUTOTOOL_rule_autoheader= yes
143 .if defined(_AUTOTOOL_autoconf)
144 AUTOCONF_VERSION= 2.69
145 AUTOCONF_PORT= devel/autoconf
147 . if ${_AUTOTOOL_autoconf} == "yes"
148 _AUTOTOOL_rule_autoconf= yes
153 .if defined(AUTOCONF_VERSION)
154 AUTOCONF= ${LOCALBASE}/bin/autoconf-${AUTOCONF_VERSION}
155 AUTOCONF_DIR= ${LOCALBASE}/share/autoconf-${AUTOCONF_VERSION}
156 AUTOHEADER= ${LOCALBASE}/bin/autoheader-${AUTOCONF_VERSION}
157 AUTOIFNAMES= ${LOCALBASE}/bin/ifnames-${AUTOCONF_VERSION}
158 AUTOM4TE?= ${LOCALBASE}/bin/autom4te-${AUTOCONF_VERSION}
159 AUTORECONF= ${LOCALBASE}/bin/autoreconf-${AUTOCONF_VERSION}
160 AUTOSCAN= ${LOCALBASE}/bin/autoscan-${AUTOCONF_VERSION}
161 AUTOUPDATE= ${LOCALBASE}/bin/autoupdate-${AUTOCONF_VERSION}
163 AUTOCONF_VARS= AUTOCONF=${AUTOCONF} \
164 AUTOCONF_DIR=${AUTOCONF_DIR} \
165 AUTOHEADER=${AUTOHEADER} \
166 AUTOIFNAMES=${AUTOIFNAMES} \
167 AUTOM4TE=${AUTOM4TE} \
168 AUTORECONF=${AUTORECONF} \
169 AUTOSCAN=${AUTOSCAN} \
170 AUTOUPDATE=${AUTOUPDATE} \
171 AUTOCONF_VERSION=${AUTOCONF_VERSION}
173 AUTOCONF_DEPENDS= ${AUTOCONF}:${AUTOCONF_PORT}
174 BUILD_DEPENDS+= ${AUTOCONF_DEPENDS}
177 #---------------------------------------------------------------------------
178 # Add to the environment
179 #---------------------------------------------------------------------------
181 AUTOTOOLS_VARS= ${AUTOMAKE_VARS} ${AUTOCONF_VARS}
183 .if defined(AUTOTOOLS_VARS) && !empty(AUTOTOOLS_VARS)
184 . for var in AUTOTOOLS CONFIGURE MAKE SCRIPTS
185 ${var:tu}_ENV+= ${AUTOTOOLS_VARS}
189 #---------------------------------------------------------------------------
191 #---------------------------------------------------------------------------
193 .if !target(run-autotools)
194 .ORDER: run-autotools run-autotools-aclocal \
195 run-autotools-autoconf run-autotools-autoheader \
196 run-autotools-automake
198 run-autotools:: run-autotools-aclocal \
199 run-autotools-autoconf run-autotools-autoheader \
200 run-autotools-automake
203 .if !target(run-autotools-aclocal)
204 run-autotools-aclocal:
205 . if defined(_AUTOTOOL_rule_aclocal)
206 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${ACLOCAL} \
213 .if !target(run-autotools-automake)
214 run-autotools-automake:
215 . if defined(_AUTOTOOL_rule_automake)
216 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOMAKE} \
223 .if !target(run-autotools-autoconf)
224 run-autotools-autoconf:
225 . if defined(_AUTOTOOL_rule_autoconf)
226 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOCONF} \
233 .if !target(run-autotools-autoheader)
234 run-autotools-autoheader:
235 . if defined(_AUTOTOOL_rule_autoheader)
236 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOHEADER} \