127 IFS="$IFS_save" |
127 IFS="$IFS_save" |
128 else |
128 else |
129 AC_MSG_NOTICE([Resolving $1 (as $path) failed, using $path directly.]) |
129 AC_MSG_NOTICE([Resolving $1 (as $path) failed, using $path directly.]) |
130 new_path="$path" |
130 new_path="$path" |
131 fi |
131 fi |
132 |
132 |
133 if test "x$new_path" = x; then |
133 if test "x$new_path" = x; then |
134 AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) |
134 AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) |
135 has_space=`$ECHO "$complete" | $GREP " "` |
135 has_space=`$ECHO "$complete" | $GREP " "` |
136 if test "x$has_space" != x; then |
136 if test "x$has_space" != x; then |
137 AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.]) |
137 AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.]) |
|
138 fi |
|
139 AC_MSG_ERROR([Cannot locate the the path of $1]) |
|
140 fi |
|
141 fi |
|
142 |
|
143 # Now join together the path and the arguments once again |
|
144 if test "x$arguments" != xEOL; then |
|
145 new_complete="$new_path ${arguments% *}" |
|
146 else |
|
147 new_complete="$new_path" |
|
148 fi |
|
149 |
|
150 if test "x$complete" != "x$new_complete"; then |
|
151 $1="$new_complete" |
|
152 AC_MSG_NOTICE([Rewriting $1 to "$new_complete"]) |
|
153 fi |
|
154 ]) |
|
155 |
|
156 AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS], |
|
157 [ |
|
158 if test "x$OPENJDK_BUILD_OS" != xwindows; then |
|
159 # Follow a chain of symbolic links. Use readlink |
|
160 # where it exists, else fall back to horribly |
|
161 # complicated shell code. |
|
162 if test "x$READLINK_TESTED" != yes; then |
|
163 # On MacOSX there is a readlink tool with a different |
|
164 # purpose than the GNU readlink tool. Check the found readlink. |
|
165 ISGNU=`$READLINK --version 2>&1 | $GREP GNU` |
|
166 if test "x$ISGNU" = x; then |
|
167 # A readlink that we do not know how to use. |
|
168 # Are there other non-GNU readlinks out there? |
|
169 READLINK_TESTED=yes |
|
170 READLINK= |
|
171 fi |
|
172 fi |
|
173 |
|
174 if test "x$READLINK" != x; then |
|
175 $1=`$READLINK -f [$]$1` |
|
176 else |
|
177 # Save the current directory for restoring afterwards |
|
178 STARTDIR=$PWD |
|
179 COUNTER=0 |
|
180 sym_link_dir=`$DIRNAME [$]$1` |
|
181 sym_link_file=`$BASENAME [$]$1` |
|
182 cd $sym_link_dir |
|
183 # Use -P flag to resolve symlinks in directories. |
|
184 cd `$THEPWDCMD -P` |
|
185 sym_link_dir=`$THEPWDCMD -P` |
|
186 # Resolve file symlinks |
|
187 while test $COUNTER -lt 20; do |
|
188 ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` |
|
189 if test "x$ISLINK" == x; then |
|
190 # This is not a symbolic link! We are done! |
|
191 break |
138 fi |
192 fi |
139 AC_MSG_ERROR([Cannot locate the the path of $1]) |
193 # Again resolve directory symlinks since the target of the just found |
140 fi |
194 # link could be in a different directory |
141 fi |
195 cd `$DIRNAME $ISLINK` |
142 |
196 sym_link_dir=`$THEPWDCMD -P` |
143 # Now join together the path and the arguments once again |
197 sym_link_file=`$BASENAME $ISLINK` |
144 if test "x$arguments" != xEOL; then |
198 let COUNTER=COUNTER+1 |
145 new_complete="$new_path ${arguments% *}" |
199 done |
146 else |
200 cd $STARTDIR |
147 new_complete="$new_path" |
201 $1=$sym_link_dir/$sym_link_file |
148 fi |
202 fi |
149 |
203 fi |
150 if test "x$complete" != "x$new_complete"; then |
204 ]) |
151 $1="$new_complete" |
205 |
152 AC_MSG_NOTICE([Rewriting $1 to "$new_complete"]) |
206 # Register a --with argument but mark it as deprecated |
153 fi |
207 # $1: The name of the with argument to deprecate, not including --with- |
154 ]) |
208 AC_DEFUN([BASIC_DEPRECATED_ARG_WITH], |
155 |
209 [ |
156 AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS], |
210 AC_ARG_WITH($1, [AS_HELP_STRING([--with-$1], |
157 [ |
211 [Deprecated. Option is kept for backwards compatibility and is ignored])], |
158 if test "x$OPENJDK_BUILD_OS" != xwindows; then |
212 [AC_MSG_WARN([Option --with-$1 is deprecated and will be ignored.])]) |
159 # Follow a chain of symbolic links. Use readlink |
213 ]) |
160 # where it exists, else fall back to horribly |
214 |
161 # complicated shell code. |
215 # Register a --enable argument but mark it as deprecated |
162 if test "x$READLINK_TESTED" != yes; then |
216 # $1: The name of the with argument to deprecate, not including --enable- |
163 # On MacOSX there is a readlink tool with a different |
217 # $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -) |
164 # purpose than the GNU readlink tool. Check the found readlink. |
218 AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE], |
165 ISGNU=`$READLINK --version 2>&1 | $GREP GNU` |
219 [ |
166 if test "x$ISGNU" = x; then |
220 AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1], |
167 # A readlink that we do not know how to use. |
221 [Deprecated. Option is kept for backwards compatibility and is ignored])]) |
168 # Are there other non-GNU readlinks out there? |
222 if test "x$enable_$2" != x; then |
169 READLINK_TESTED=yes |
223 AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.]) |
170 READLINK= |
224 fi |
171 fi |
|
172 fi |
|
173 |
|
174 if test "x$READLINK" != x; then |
|
175 $1=`$READLINK -f [$]$1` |
|
176 else |
|
177 # Save the current directory for restoring afterwards |
|
178 STARTDIR=$PWD |
|
179 COUNTER=0 |
|
180 sym_link_dir=`$DIRNAME [$]$1` |
|
181 sym_link_file=`$BASENAME [$]$1` |
|
182 cd $sym_link_dir |
|
183 # Use -P flag to resolve symlinks in directories. |
|
184 cd `$THEPWDCMD -P` |
|
185 sym_link_dir=`$THEPWDCMD -P` |
|
186 # Resolve file symlinks |
|
187 while test $COUNTER -lt 20; do |
|
188 ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` |
|
189 if test "x$ISLINK" == x; then |
|
190 # This is not a symbolic link! We are done! |
|
191 break |
|
192 fi |
|
193 # Again resolve directory symlinks since the target of the just found |
|
194 # link could be in a different directory |
|
195 cd `$DIRNAME $ISLINK` |
|
196 sym_link_dir=`$THEPWDCMD -P` |
|
197 sym_link_file=`$BASENAME $ISLINK` |
|
198 let COUNTER=COUNTER+1 |
|
199 done |
|
200 cd $STARTDIR |
|
201 $1=$sym_link_dir/$sym_link_file |
|
202 fi |
|
203 fi |
|
204 ]) |
225 ]) |
205 |
226 |
206 AC_DEFUN_ONCE([BASIC_INIT], |
227 AC_DEFUN_ONCE([BASIC_INIT], |
207 [ |
228 [ |
208 # Save the original command line. This is passed to us by the wrapper configure script. |
229 # Save the original command line. This is passed to us by the wrapper configure script. |
209 AC_SUBST(CONFIGURE_COMMAND_LINE) |
230 AC_SUBST(CONFIGURE_COMMAND_LINE) |
210 DATE_WHEN_CONFIGURED=`LANG=C date` |
231 DATE_WHEN_CONFIGURED=`LANG=C date` |
211 AC_SUBST(DATE_WHEN_CONFIGURED) |
232 AC_SUBST(DATE_WHEN_CONFIGURED) |
212 AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) |
233 AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) |
213 AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) |
234 AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) |
214 ]) |
235 ]) |
215 |
236 |
216 # Test that variable $1 denoting a program is not empty. If empty, exit with an error. |
237 # Test that variable $1 denoting a program is not empty. If empty, exit with an error. |
217 # $1: variable to check |
238 # $1: variable to check |
218 # $2: executable name to print in warning (optional) |
239 # $2: executable name to print in warning (optional) |
219 AC_DEFUN([BASIC_CHECK_NONEMPTY], |
240 AC_DEFUN([BASIC_CHECK_NONEMPTY], |
220 [ |
241 [ |
221 if test "x[$]$1" = x; then |
242 if test "x[$]$1" = x; then |
222 if test "x$2" = x; then |
243 if test "x$2" = x; then |
223 PROG_NAME=translit($1,A-Z,a-z) |
244 PROG_NAME=translit($1,A-Z,a-z) |
224 else |
245 else |
225 PROG_NAME=$2 |
246 PROG_NAME=$2 |
226 fi |
247 fi |
227 AC_MSG_NOTICE([Could not find $PROG_NAME!]) |
248 AC_MSG_NOTICE([Could not find $PROG_NAME!]) |
228 AC_MSG_ERROR([Cannot continue]) |
249 AC_MSG_ERROR([Cannot continue]) |
229 fi |
250 fi |
230 ]) |
251 ]) |
231 |
252 |
232 # Does AC_PATH_PROG followed by BASIC_CHECK_NONEMPTY. |
253 # Does AC_PATH_PROG followed by BASIC_CHECK_NONEMPTY. |
233 # Arguments as AC_PATH_PROG: |
254 # Arguments as AC_PATH_PROG: |
234 # $1: variable to set |
255 # $1: variable to set |
235 # $2: executable name to look for |
256 # $2: executable name to look for |
236 AC_DEFUN([BASIC_REQUIRE_PROG], |
257 AC_DEFUN([BASIC_REQUIRE_PROG], |
237 [ |
258 [ |
238 AC_PATH_PROGS($1, $2) |
259 AC_PATH_PROGS($1, $2) |
239 BASIC_CHECK_NONEMPTY($1, $2) |
260 BASIC_CHECK_NONEMPTY($1, $2) |
240 ]) |
261 ]) |
241 |
262 |
242 # Setup the most fundamental tools that relies on not much else to set up, |
263 # Setup the most fundamental tools that relies on not much else to set up, |
243 # but is used by much of the early bootstrap code. |
264 # but is used by much of the early bootstrap code. |
244 AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], |
265 AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], |
245 [ |
266 [ |
246 |
267 |
247 # Start with tools that do not need have cross compilation support |
268 # Start with tools that do not need have cross compilation support |
248 # and can be expected to be found in the default PATH. These tools are |
269 # and can be expected to be found in the default PATH. These tools are |
249 # used by configure. Nor are these tools expected to be found in the |
270 # used by configure. Nor are these tools expected to be found in the |
250 # devkit from the builddeps server either, since they are |
271 # devkit from the builddeps server either, since they are |
251 # needed to download the devkit. |
272 # needed to download the devkit. |
252 |
273 |
253 # First are all the simple required tools. |
274 # First are all the simple required tools. |
254 BASIC_REQUIRE_PROG(BASENAME, basename) |
275 BASIC_REQUIRE_PROG(BASENAME, basename) |
255 BASIC_REQUIRE_PROG(BASH, bash) |
276 BASIC_REQUIRE_PROG(BASH, bash) |
256 BASIC_REQUIRE_PROG(CAT, cat) |
277 BASIC_REQUIRE_PROG(CAT, cat) |
257 BASIC_REQUIRE_PROG(CHMOD, chmod) |
278 BASIC_REQUIRE_PROG(CHMOD, chmod) |
258 BASIC_REQUIRE_PROG(CMP, cmp) |
279 BASIC_REQUIRE_PROG(CMP, cmp) |
259 BASIC_REQUIRE_PROG(COMM, comm) |
280 BASIC_REQUIRE_PROG(COMM, comm) |
260 BASIC_REQUIRE_PROG(CP, cp) |
281 BASIC_REQUIRE_PROG(CP, cp) |
261 BASIC_REQUIRE_PROG(CPIO, cpio) |
282 BASIC_REQUIRE_PROG(CPIO, cpio) |
262 BASIC_REQUIRE_PROG(CUT, cut) |
283 BASIC_REQUIRE_PROG(CUT, cut) |
263 BASIC_REQUIRE_PROG(DATE, date) |
284 BASIC_REQUIRE_PROG(DATE, date) |
264 BASIC_REQUIRE_PROG(DIFF, [gdiff diff]) |
285 BASIC_REQUIRE_PROG(DIFF, [gdiff diff]) |
265 BASIC_REQUIRE_PROG(DIRNAME, dirname) |
286 BASIC_REQUIRE_PROG(DIRNAME, dirname) |
266 BASIC_REQUIRE_PROG(ECHO, echo) |
287 BASIC_REQUIRE_PROG(ECHO, echo) |
267 BASIC_REQUIRE_PROG(EXPR, expr) |
288 BASIC_REQUIRE_PROG(EXPR, expr) |
268 BASIC_REQUIRE_PROG(FILE, file) |
289 BASIC_REQUIRE_PROG(FILE, file) |
269 BASIC_REQUIRE_PROG(FIND, find) |
290 BASIC_REQUIRE_PROG(FIND, find) |
270 BASIC_REQUIRE_PROG(HEAD, head) |
291 BASIC_REQUIRE_PROG(HEAD, head) |
271 BASIC_REQUIRE_PROG(LN, ln) |
292 BASIC_REQUIRE_PROG(LN, ln) |
272 BASIC_REQUIRE_PROG(LS, ls) |
293 BASIC_REQUIRE_PROG(LS, ls) |
273 BASIC_REQUIRE_PROG(MKDIR, mkdir) |
294 BASIC_REQUIRE_PROG(MKDIR, mkdir) |
274 BASIC_REQUIRE_PROG(MKTEMP, mktemp) |
295 BASIC_REQUIRE_PROG(MKTEMP, mktemp) |
275 BASIC_REQUIRE_PROG(MV, mv) |
296 BASIC_REQUIRE_PROG(MV, mv) |
276 BASIC_REQUIRE_PROG(PRINTF, printf) |
297 BASIC_REQUIRE_PROG(PRINTF, printf) |
277 BASIC_REQUIRE_PROG(RM, rm) |
298 BASIC_REQUIRE_PROG(RM, rm) |
278 BASIC_REQUIRE_PROG(SH, sh) |
299 BASIC_REQUIRE_PROG(SH, sh) |
279 BASIC_REQUIRE_PROG(SORT, sort) |
300 BASIC_REQUIRE_PROG(SORT, sort) |
280 BASIC_REQUIRE_PROG(TAIL, tail) |
301 BASIC_REQUIRE_PROG(TAIL, tail) |
281 BASIC_REQUIRE_PROG(TAR, tar) |
302 BASIC_REQUIRE_PROG(TAR, tar) |
282 BASIC_REQUIRE_PROG(TEE, tee) |
303 BASIC_REQUIRE_PROG(TEE, tee) |
283 BASIC_REQUIRE_PROG(TOUCH, touch) |
304 BASIC_REQUIRE_PROG(TOUCH, touch) |
284 BASIC_REQUIRE_PROG(TR, tr) |
305 BASIC_REQUIRE_PROG(TR, tr) |
285 BASIC_REQUIRE_PROG(UNAME, uname) |
306 BASIC_REQUIRE_PROG(UNAME, uname) |
286 BASIC_REQUIRE_PROG(UNIQ, uniq) |
307 BASIC_REQUIRE_PROG(UNIQ, uniq) |
287 BASIC_REQUIRE_PROG(WC, wc) |
308 BASIC_REQUIRE_PROG(WC, wc) |
288 BASIC_REQUIRE_PROG(WHICH, which) |
309 BASIC_REQUIRE_PROG(WHICH, which) |
289 BASIC_REQUIRE_PROG(XARGS, xargs) |
310 BASIC_REQUIRE_PROG(XARGS, xargs) |
290 |
311 |
291 # Then required tools that require some special treatment. |
312 # Then required tools that require some special treatment. |
292 AC_PROG_AWK |
313 AC_PROG_AWK |
293 BASIC_CHECK_NONEMPTY(AWK) |
314 BASIC_CHECK_NONEMPTY(AWK) |
294 AC_PROG_GREP |
315 AC_PROG_GREP |
295 BASIC_CHECK_NONEMPTY(GREP) |
316 BASIC_CHECK_NONEMPTY(GREP) |
296 AC_PROG_EGREP |
317 AC_PROG_EGREP |
297 BASIC_CHECK_NONEMPTY(EGREP) |
318 BASIC_CHECK_NONEMPTY(EGREP) |
298 AC_PROG_FGREP |
319 AC_PROG_FGREP |
299 BASIC_CHECK_NONEMPTY(FGREP) |
320 BASIC_CHECK_NONEMPTY(FGREP) |
300 AC_PROG_SED |
321 AC_PROG_SED |
301 BASIC_CHECK_NONEMPTY(SED) |
322 BASIC_CHECK_NONEMPTY(SED) |
302 |
323 |
303 AC_PATH_PROGS(NAWK, [nawk gawk awk]) |
324 AC_PATH_PROGS(NAWK, [nawk gawk awk]) |
304 BASIC_CHECK_NONEMPTY(NAWK) |
325 BASIC_CHECK_NONEMPTY(NAWK) |
305 |
326 |
306 # Always force rm. |
327 # Always force rm. |
307 RM="$RM -f" |
328 RM="$RM -f" |
308 |
329 |
309 # pwd behaves differently on various platforms and some don't support the -L flag. |
330 # pwd behaves differently on various platforms and some don't support the -L flag. |
310 # Always use the bash builtin pwd to get uniform behavior. |
331 # Always use the bash builtin pwd to get uniform behavior. |
311 THEPWDCMD=pwd |
332 THEPWDCMD=pwd |
312 |
333 |
313 # These are not required on all platforms |
334 # These are not required on all platforms |
314 AC_PATH_PROG(CYGPATH, cygpath) |
335 AC_PATH_PROG(CYGPATH, cygpath) |
315 AC_PATH_PROG(READLINK, readlink) |
336 AC_PATH_PROG(READLINK, readlink) |
316 AC_PATH_PROG(DF, df) |
337 AC_PATH_PROG(DF, df) |
317 AC_PATH_PROG(SETFILE, SetFile) |
338 AC_PATH_PROG(SETFILE, SetFile) |
318 ]) |
339 ]) |
319 |
340 |
320 # Setup basic configuration paths, and platform-specific stuff related to PATHs. |
341 # Setup basic configuration paths, and platform-specific stuff related to PATHs. |
321 AC_DEFUN_ONCE([BASIC_SETUP_PATHS], |
342 AC_DEFUN_ONCE([BASIC_SETUP_PATHS], |
322 [ |
343 [ |
323 # Locate the directory of this script. |
344 # Locate the directory of this script. |
324 SCRIPT="[$]0" |
345 SCRIPT="[$]0" |
325 AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` |
346 AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` |
326 |
347 |
327 # Where is the source? It is located two levels above the configure script. |
348 # Where is the source? It is located two levels above the configure script. |
328 CURDIR="$PWD" |
349 CURDIR="$PWD" |
329 cd "$AUTOCONF_DIR/../.." |
350 cd "$AUTOCONF_DIR/../.." |
330 SRC_ROOT="`$THEPWDCMD -L`" |
351 SRC_ROOT="`$THEPWDCMD -L`" |
331 |
352 |
332 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
353 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
333 PATH_SEP=";" |
354 PATH_SEP=";" |
334 BASIC_CHECK_PATHS_WINDOWS |
355 BASIC_CHECK_PATHS_WINDOWS |
335 else |
356 else |
336 PATH_SEP=":" |
357 PATH_SEP=":" |
337 fi |
358 fi |
338 |
359 |
339 AC_SUBST(SRC_ROOT) |
360 AC_SUBST(SRC_ROOT) |
340 AC_SUBST(PATH_SEP) |
361 AC_SUBST(PATH_SEP) |
341 cd "$CURDIR" |
362 cd "$CURDIR" |
342 |
363 |
343 BASIC_FIXUP_PATH(SRC_ROOT) |
364 BASIC_FIXUP_PATH(SRC_ROOT) |
344 BASIC_FIXUP_PATH(CURDIR) |
365 BASIC_FIXUP_PATH(CURDIR) |
345 |
366 |
346 if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then |
367 if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then |
347 # Add extra search paths on solaris for utilities like ar and as etc... |
368 # Add extra search paths on solaris for utilities like ar and as etc... |
348 PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" |
369 PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" |
349 fi |
370 fi |
350 |
371 |
351 # You can force the sys-root if the sys-root encoded into the cross compiler tools |
372 # You can force the sys-root if the sys-root encoded into the cross compiler tools |
352 # is not correct. |
373 # is not correct. |
353 AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root], |
374 AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root], |
354 [pass this sys-root to the compilers and tools (for cross-compiling)])]) |
375 [pass this sys-root to the compilers and tools (for cross-compiling)])]) |
355 |
376 |
356 if test "x$with_sys_root" != x; then |
377 if test "x$with_sys_root" != x; then |
357 SYS_ROOT=$with_sys_root |
378 SYS_ROOT=$with_sys_root |
358 else |
379 else |
359 SYS_ROOT=/ |
380 SYS_ROOT=/ |
360 fi |
381 fi |
361 AC_SUBST(SYS_ROOT) |
382 AC_SUBST(SYS_ROOT) |
362 |
383 |
363 AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir], |
384 AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir], |
364 [search this directory for compilers and tools (for cross-compiling)])], |
385 [search this directory for compilers and tools (for cross-compiling)])], |
365 [TOOLS_DIR=$with_tools_dir] |
386 [TOOLS_DIR=$with_tools_dir] |
366 ) |
387 ) |
367 |
388 |
368 AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], |
389 AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], |
369 [use this directory as base for tools-dir and sys-root (for cross-compiling)])], |
390 [use this directory as base for tools-dir and sys-root (for cross-compiling)])], |
370 [ |
391 [ |
371 if test "x$with_sys_root" != x; then |
392 if test "x$with_sys_root" != x; then |
372 AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time]) |
393 AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time]) |
373 fi |
394 fi |
374 BASIC_FIXUP_PATH([with_devkit]) |
395 BASIC_FIXUP_PATH([with_devkit]) |
375 BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin) |
396 BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin) |
376 if test -d "$with_devkit/$host_alias/libc"; then |
397 if test -d "$with_devkit/$host_alias/libc"; then |
377 SYS_ROOT=$with_devkit/$host_alias/libc |
398 SYS_ROOT=$with_devkit/$host_alias/libc |
378 elif test -d "$with_devkit/$host/sys-root"; then |
399 elif test -d "$with_devkit/$host/sys-root"; then |
379 SYS_ROOT=$with_devkit/$host/sys-root |
400 SYS_ROOT=$with_devkit/$host/sys-root |
380 fi |
401 fi |
381 ]) |
402 ]) |
382 ]) |
403 ]) |
383 |
404 |
384 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR], |
405 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR], |
385 [ |
406 [ |
386 |
407 |
387 AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name], |
408 AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name], |
388 [use this as the name of the configuration @<:@generated from important configuration options@:>@])], |
409 [use this as the name of the configuration @<:@generated from important configuration options@:>@])], |
389 [ CONF_NAME=${with_conf_name} ]) |
410 [ CONF_NAME=${with_conf_name} ]) |
390 |
411 |
391 # Test from where we are running configure, in or outside of src root. |
412 # Test from where we are running configure, in or outside of src root. |
392 if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ |
413 if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ |
393 || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ |
414 || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ |
394 || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then |
415 || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then |
395 # We are running configure from the src root. |
416 # We are running configure from the src root. |
396 # Create a default ./build/target-variant-debuglevel output root. |
417 # Create a default ./build/target-variant-debuglevel output root. |
397 if test "x${CONF_NAME}" = x; then |
418 if test "x${CONF_NAME}" = x; then |
398 CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" |
419 CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" |
399 fi |
420 fi |
400 OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" |
421 OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" |
401 $MKDIR -p "$OUTPUT_ROOT" |
422 $MKDIR -p "$OUTPUT_ROOT" |
402 if test ! -d "$OUTPUT_ROOT"; then |
423 if test ! -d "$OUTPUT_ROOT"; then |
403 AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT]) |
424 AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT]) |
404 fi |
425 fi |
405 else |
426 else |
406 # We are running configure from outside of the src dir. |
427 # We are running configure from outside of the src dir. |
407 # Then use the current directory as output dir! |
428 # Then use the current directory as output dir! |
408 # If configuration is situated in normal build directory, just use the build |
429 # If configuration is situated in normal build directory, just use the build |
409 # directory name as configuration name, otherwise use the complete path. |
430 # directory name as configuration name, otherwise use the complete path. |
410 if test "x${CONF_NAME}" = x; then |
431 if test "x${CONF_NAME}" = x; then |
411 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` |
432 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` |
412 fi |
433 fi |
413 OUTPUT_ROOT="$CURDIR" |
434 OUTPUT_ROOT="$CURDIR" |
414 |
435 |
415 # WARNING: This might be a bad thing to do. You need to be sure you want to |
436 # WARNING: This might be a bad thing to do. You need to be sure you want to |
416 # have a configuration in this directory. Do some sanity checks! |
437 # have a configuration in this directory. Do some sanity checks! |
417 |
438 |
418 if test ! -e "$OUTPUT_ROOT/spec.gmk"; then |
439 if test ! -e "$OUTPUT_ROOT/spec.gmk"; then |
419 # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for |
440 # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for |
420 # other files |
441 # other files |
421 files_present=`$LS $OUTPUT_ROOT` |
442 files_present=`$LS $OUTPUT_ROOT` |
422 # Configure has already touched config.log and confdefs.h in the current dir when this check |
443 # Configure has already touched config.log and confdefs.h in the current dir when this check |
423 # is performed. |
444 # is performed. |
424 filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \ |
445 filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \ |
425 | $TR -d '\n'` |
446 | $TR -d '\n'` |
426 if test "x$filtered_files" != x; then |
447 if test "x$filtered_files" != x; then |
427 AC_MSG_NOTICE([Current directory is $CURDIR.]) |
448 AC_MSG_NOTICE([Current directory is $CURDIR.]) |
428 AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here]) |
449 AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here]) |
429 AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).]) |
450 AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).]) |
430 AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could]) |
451 AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could]) |
570 AC_MSG_NOTICE([Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)]) |
591 AC_MSG_NOTICE([Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)]) |
571 ]) |
592 ]) |
572 |
593 |
573 AC_DEFUN([BASIC_CHECK_FIND_DELETE], |
594 AC_DEFUN([BASIC_CHECK_FIND_DELETE], |
574 [ |
595 [ |
575 # Test if find supports -delete |
596 # Test if find supports -delete |
576 AC_MSG_CHECKING([if find supports -delete]) |
597 AC_MSG_CHECKING([if find supports -delete]) |
577 FIND_DELETE="-delete" |
598 FIND_DELETE="-delete" |
578 |
599 |
579 DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) |
600 DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) |
580 |
601 |
581 echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete |
602 echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete |
582 |
603 |
583 TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` |
604 TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` |
584 if test -f $DELETEDIR/TestIfFindSupportsDelete; then |
605 if test -f $DELETEDIR/TestIfFindSupportsDelete; then |
585 # No, it does not. |
606 # No, it does not. |
586 rm $DELETEDIR/TestIfFindSupportsDelete |
607 rm $DELETEDIR/TestIfFindSupportsDelete |
587 FIND_DELETE="-exec rm \{\} \+" |
608 FIND_DELETE="-exec rm \{\} \+" |
588 AC_MSG_RESULT([no]) |
609 AC_MSG_RESULT([no]) |
589 else |
610 else |
590 AC_MSG_RESULT([yes]) |
611 AC_MSG_RESULT([yes]) |
591 fi |
612 fi |
592 rmdir $DELETEDIR |
613 rmdir $DELETEDIR |
593 AC_SUBST(FIND_DELETE) |
614 AC_SUBST(FIND_DELETE) |
594 ]) |
615 ]) |
595 |
616 |
596 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], |
617 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], |
597 [ |
618 [ |
598 BASIC_CHECK_GNU_MAKE |
619 BASIC_CHECK_GNU_MAKE |
599 |
620 |
600 BASIC_CHECK_FIND_DELETE |
621 BASIC_CHECK_FIND_DELETE |
601 |
622 |
602 # These tools might not be installed by default, |
623 # These tools might not be installed by default, |
603 # need hint on how to install them. |
624 # need hint on how to install them. |
604 BASIC_REQUIRE_PROG(UNZIP, unzip) |
625 BASIC_REQUIRE_PROG(UNZIP, unzip) |
605 BASIC_REQUIRE_PROG(ZIP, zip) |
626 BASIC_REQUIRE_PROG(ZIP, zip) |
606 |
627 |
607 # Non-required basic tools |
628 # Non-required basic tools |
608 |
629 |
609 AC_PATH_PROG(LDD, ldd) |
630 AC_PATH_PROG(LDD, ldd) |
610 if test "x$LDD" = "x"; then |
631 if test "x$LDD" = "x"; then |
611 # List shared lib dependencies is used for |
632 # List shared lib dependencies is used for |
612 # debug output and checking for forbidden dependencies. |
633 # debug output and checking for forbidden dependencies. |
613 # We can build without it. |
634 # We can build without it. |
614 LDD="true" |
635 LDD="true" |
615 fi |
636 fi |
616 AC_PATH_PROG(OTOOL, otool) |
637 AC_PATH_PROG(OTOOL, otool) |
617 if test "x$OTOOL" = "x"; then |
638 if test "x$OTOOL" = "x"; then |
618 OTOOL="true" |
639 OTOOL="true" |
619 fi |
640 fi |
620 AC_PATH_PROGS(READELF, [readelf greadelf]) |
641 AC_PATH_PROGS(READELF, [readelf greadelf]) |
621 AC_PATH_PROG(HG, hg) |
642 AC_PATH_PROG(HG, hg) |
622 AC_PATH_PROG(STAT, stat) |
643 AC_PATH_PROG(STAT, stat) |
623 AC_PATH_PROG(TIME, time) |
644 AC_PATH_PROG(TIME, time) |
624 # Check if it's GNU time |
645 # Check if it's GNU time |
625 IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` |
646 IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` |
626 if test "x$IS_GNU_TIME" != x; then |
647 if test "x$IS_GNU_TIME" != x; then |
627 IS_GNU_TIME=yes |
648 IS_GNU_TIME=yes |
628 else |
649 else |
629 IS_GNU_TIME=no |
650 IS_GNU_TIME=no |
630 fi |
651 fi |
631 AC_SUBST(IS_GNU_TIME) |
652 AC_SUBST(IS_GNU_TIME) |
632 |
653 |
633 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
654 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
634 BASIC_REQUIRE_PROG(COMM, comm) |
655 BASIC_REQUIRE_PROG(COMM, comm) |
635 fi |
656 fi |
636 |
657 |
637 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
658 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
638 BASIC_REQUIRE_PROG(XATTR, xattr) |
659 BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil) |
639 AC_PATH_PROG(CODESIGN, codesign) |
660 BASIC_REQUIRE_PROG(XATTR, xattr) |
640 if test "x$CODESIGN" != "x"; then |
661 AC_PATH_PROG(CODESIGN, codesign) |
641 # Verify that the openjdk_codesign certificate is present |
662 if test "x$CODESIGN" != "x"; then |
642 AC_MSG_CHECKING([if openjdk_codesign certificate is present]) |
663 # Verify that the openjdk_codesign certificate is present |
643 rm -f codesign-testfile |
664 AC_MSG_CHECKING([if openjdk_codesign certificate is present]) |
644 touch codesign-testfile |
665 rm -f codesign-testfile |
645 codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= |
666 touch codesign-testfile |
646 rm -f codesign-testfile |
667 codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= |
647 if test "x$CODESIGN" = x; then |
668 rm -f codesign-testfile |
648 AC_MSG_RESULT([no]) |
669 if test "x$CODESIGN" = x; then |
649 else |
670 AC_MSG_RESULT([no]) |
650 AC_MSG_RESULT([yes]) |
671 else |
651 fi |
672 AC_MSG_RESULT([yes]) |
652 fi |
673 fi |
653 fi |
674 fi |
|
675 fi |
654 ]) |
676 ]) |
655 |
677 |
656 # Check if build directory is on local disk. If not possible to determine, |
678 # Check if build directory is on local disk. If not possible to determine, |
657 # we prefer to claim it's local. |
679 # we prefer to claim it's local. |
658 # Argument 1: directory to test |
680 # Argument 1: directory to test |
659 # Argument 2: what to do if it is on local disk |
681 # Argument 2: what to do if it is on local disk |
660 # Argument 3: what to do otherwise (remote disk or failure) |
682 # Argument 3: what to do otherwise (remote disk or failure) |
661 AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK], |
683 AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK], |
662 [ |
684 [ |
663 # df -l lists only local disks; if the given directory is not found then |
685 # df -l lists only local disks; if the given directory is not found then |
664 # a non-zero exit code is given |
686 # a non-zero exit code is given |
665 if test "x$DF" = x; then |
687 if test "x$DF" = x; then |
666 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
688 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
667 # msys does not have df; use Windows "net use" instead. |
689 # msys does not have df; use Windows "net use" instead. |
668 IS_NETWORK_DISK=`net use | grep \`pwd -W | cut -d ":" -f 1 | tr a-z A-Z\`:` |
690 IS_NETWORK_DISK=`net use | grep \`pwd -W | cut -d ":" -f 1 | tr a-z A-Z\`:` |
669 if test "x$IS_NETWORK_DISK" = x; then |
691 if test "x$IS_NETWORK_DISK" = x; then |