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
20 # ':env' is used to specify that the environmental variables are needed
21 # but the relevant tool should NOT be run as part of the
22 # 'run-autotools' target
24 # In addition, these variables can be set in the port Makefile to be
25 # passed to the relevant tools:
28 # - Extra arguments passed to automake during configure step
31 # - Arguments passed to aclocal during configure step
34 # - Extra arguments passed to autoconf during configure step
37 # - Extra arguments passed to autoheader during configure step
40 # - Extra arguments passed to libtoolize during configure step
42 #---------------------------------------------------------------------------
44 #---------------------------------------------------------------------------
45 # NO USER-SERVICABLE PARTS BEYOND THIS POINT. REALLY. WE MEAN IT.
46 #---------------------------------------------------------------------------
48 # Known autotools components
49 _AUTOTOOLS_ALL= autoconf autoheader \
53 #---------------------------------------------------------------------------
54 # Primary magic to break out the USE_AUTOTOOLS stanza into something
55 # more useful, along with substantial error checking to prevent
57 #---------------------------------------------------------------------------
59 # Break out the stanza
62 .for stanza in ${USE_AUTOTOOLS}
63 _AUTOTOOLS_IMPL+= ${stanza:C/^([^:]+).*/\1/}
64 _AUTOTOOL_${stanza:C/^([^:]+).*/\1/}= ${stanza:C/^[^:]+:([^:]+)/\1/}
67 # Verify each component, normalize
70 .for component in ${_AUTOTOOLS_IMPL}
71 . if ${_AUTOTOOLS_ALL:M${component}}==""
72 _AUTOTOOLS_NOCOMP+= ${component}
74 . if ${_AUTOTOOL_${component}}==${component}
75 _AUTOTOOL_${component}= yes
76 . elsif ${_AUTOTOOL_${component}}!="env" && ${_AUTOTOOL_${component}}!="yes"
77 _AUTOTOOLS_BADCOMP+= ${component}:${_AUTOTOOL_${component}}
80 .if !empty(_AUTOTOOLS_NOCOMP)
81 IGNORE+= Unknown autotool: ${_AUTOTOOLS_NOCOMP:O:u}
84 # Check for anything other than 'yes' or 'env'
87 .for component in ${_AUTOTOOLS_IMPL}
88 . if ${_AUTOTOOL_${component}}!="env" && ${_AUTOTOOL_${component}}!="yes"
89 _AUTOTOOLS_BADCOMP+= ${component}:${_AUTOTOOL_${component}}
92 .if !empty(_AUTOTOOLS_BADCOMP)
93 IGNORE+= Bad autotool stanza: ${_AUTOTOOLS_BADCOMP:O:u}
96 #---------------------------------------------------------------------------
97 # automake and aclocal
98 #---------------------------------------------------------------------------
100 .if defined(_AUTOTOOL_aclocal) && ${_AUTOTOOL_aclocal} == "yes"
101 _AUTOTOOL_automake?= env
102 _AUTOTOOL_rule_aclocal= yes
106 .if defined(_AUTOTOOL_automake)
107 AUTOMAKE_VERSION= 1.14
108 AUTOMAKE_APIVER= 1.14
109 AUTOMAKE_PORT= devel/automake
111 . if ${_AUTOTOOL_automake} == "yes"
112 _AUTOTOOL_rule_automake= yes
117 .if defined(AUTOMAKE_VERSION)
118 AUTOMAKE= ${LOCALBASE}/bin/automake-${AUTOMAKE_VERSION}
119 AUTOMAKE_DIR= ${LOCALBASE}/share/automake-${AUTOMAKE_VERSION}
120 ACLOCAL= ${LOCALBASE}/bin/aclocal-${AUTOMAKE_VERSION}
121 ACLOCAL_DIR= ${LOCALBASE}/share/aclocal-${AUTOMAKE_VERSION}
123 . if defined(_AUTOTOOL_aclocal)
124 ACLOCAL_ARGS?= --automake-acdir=${ACLOCAL_DIR}
127 AUTOMAKE_VARS= AUTOMAKE=${AUTOMAKE} \
128 AUTOMAKE_DIR=${AUTOMAKE_DIR} \
129 AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
130 AUTOMAKE_APIVER=${AUTOMAKE_APIVER} \
132 ACLOCAL_DIR=${ACLOCAL_DIR}
134 AUTOMAKE_DEPENDS= ${AUTOMAKE}:${PORTSDIR}/${AUTOMAKE_PORT}
135 BUILD_DEPENDS+= ${AUTOMAKE_DEPENDS}
138 #---------------------------------------------------------------------------
139 # autoconf and autoheader
140 #---------------------------------------------------------------------------
142 .if defined(_AUTOTOOL_autoheader) && ${_AUTOTOOL_autoheader} == "yes"
143 _AUTOTOOL_autoconf= yes
144 _AUTOTOOL_rule_autoheader= yes
148 .if defined(_AUTOTOOL_autoconf)
149 AUTOCONF_VERSION= 2.69
150 AUTOCONF_PORT= devel/autoconf
152 . if ${_AUTOTOOL_autoconf} == "yes"
153 _AUTOTOOL_rule_autoconf= yes
158 .if defined(AUTOCONF_VERSION)
159 AUTOCONF= ${LOCALBASE}/bin/autoconf-${AUTOCONF_VERSION}
160 AUTOCONF_DIR= ${LOCALBASE}/share/autoconf-${AUTOCONF_VERSION}
161 AUTOHEADER= ${LOCALBASE}/bin/autoheader-${AUTOCONF_VERSION}
162 AUTOIFNAMES= ${LOCALBASE}/bin/ifnames-${AUTOCONF_VERSION}
163 AUTOM4TE?= ${LOCALBASE}/bin/autom4te-${AUTOCONF_VERSION}
164 AUTORECONF= ${LOCALBASE}/bin/autoreconf-${AUTOCONF_VERSION}
165 AUTOSCAN= ${LOCALBASE}/bin/autoscan-${AUTOCONF_VERSION}
166 AUTOUPDATE= ${LOCALBASE}/bin/autoupdate-${AUTOCONF_VERSION}
168 AUTOCONF_VARS= AUTOCONF=${AUTOCONF} \
169 AUTOCONF_DIR=${AUTOCONF_DIR} \
170 AUTOHEADER=${AUTOHEADER} \
171 AUTOIFNAMES=${AUTOIFNAMES} \
172 AUTOM4TE=${AUTOM4TE} \
173 AUTORECONF=${AUTORECONF} \
174 AUTOSCAN=${AUTOSCAN} \
175 AUTOUPDATE=${AUTOUPDATE} \
176 AUTOCONF_VERSION=${AUTOCONF_VERSION}
178 AUTOCONF_DEPENDS= ${AUTOCONF}:${PORTSDIR}/${AUTOCONF_PORT}
179 BUILD_DEPENDS+= ${AUTOCONF_DEPENDS}
182 #---------------------------------------------------------------------------
184 #---------------------------------------------------------------------------
186 .if defined(_AUTOTOOL_libtoolize)
188 LIBTOOL_PORT= devel/libtool
190 . if defined(_AUTOTOOL_libtoolize) && ${_AUTOTOOL_libtoolize} == "yes"
191 _AUTOTOOL_rule_libtoolize= yes
197 .if defined(LIBTOOL_VERSION)
198 LIBTOOLIZE= ${LOCALBASE}/bin/libtoolize
199 LIBTOOL_LIBEXECDIR= ${LOCALBASE}/libexec/libtool
200 LIBTOOL_SHAREDIR= ${LOCALBASE}/share/libtool
201 LIBTOOL_M4= ${LOCALBASE}/share/aclocal/libtool.m4
202 LTMAIN= ${LOCALBASE}/share/libtool/config/ltmain.sh
204 LIBTOOL_VARS= LIBTOOLIZE=${LIBTOOLIZE} \
205 LIBTOOL_LIBEXECDIR=${LIBTOOL_LIBEXECDIR} \
206 LIBTOOL_SHAREDIR=${LIBTOOL_SHAREDIR} \
207 LIBTOOL_M4=${LIBTOOL_M4} \
210 LIBTOOLIZE_ARGS?= -i -c -f
212 LIBTOOL_DEPENDS= libtool>=2.4:${PORTSDIR}/${LIBTOOL_PORT}
213 BUILD_DEPENDS+= ${LIBTOOL_DEPENDS}
216 #---------------------------------------------------------------------------
217 # Add to the environment
218 #---------------------------------------------------------------------------
220 AUTOTOOLS_VARS= ${AUTOMAKE_VARS} ${AUTOCONF_VARS} ${LIBTOOL_VARS}
222 .if defined(AUTOTOOLS_VARS) && !empty(AUTOTOOLS_VARS)
223 . for var in AUTOTOOLS CONFIGURE MAKE SCRIPTS
224 ${var:tu}_ENV+= ${AUTOTOOLS_VARS}
228 #---------------------------------------------------------------------------
230 #---------------------------------------------------------------------------
232 .if !target(run-autotools)
233 .ORDER: run-autotools run-autotools-libtoolize run-autotools-aclocal \
234 run-autotools-autoconf run-autotools-autoheader \
235 run-autotools-automake
237 run-autotools:: run-autotools-libtoolize run-autotools-aclocal \
238 run-autotools-autoconf run-autotools-autoheader \
239 run-autotools-automake
242 .if !target(run-autotools-aclocal)
243 run-autotools-aclocal:
244 . if defined(_AUTOTOOL_rule_aclocal)
245 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${ACLOCAL} \
252 .if !target(run-autotools-automake)
253 run-autotools-automake:
254 . if defined(_AUTOTOOL_rule_automake)
255 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOMAKE} \
262 .if !target(run-autotools-autoconf)
263 run-autotools-autoconf:
264 . if defined(_AUTOTOOL_rule_autoconf)
265 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOCONF} \
272 .if !target(run-autotools-autoheader)
273 run-autotools-autoheader:
274 . if defined(_AUTOTOOL_rule_autoheader)
275 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOHEADER} \
282 .if !target(run-autotools-libtoolize)
283 run-autotools-libtoolize:
284 . if defined(_AUTOTOOL_rule_libtoolize)
285 @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${LIBTOOLIZE} \