author | erikj |
Tue, 03 Jul 2012 16:11:12 -0700 | |
changeset 13132 | bd88bb8dd3af |
parent 12801 | 948f8ad66ee7 |
child 13697 | 5262b00bc10c |
permissions | -rw-r--r-- |
13132 | 1 |
#!/bin/sh |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
2 |
|
13132 | 3 |
CONFIGURE_COMMAND_LINE="$@" |
4 |
conf_script_dir=`dirname $0` |
|
5 |
conf_closed_script_dir="$conf_script_dir/../../jdk/make/closed/autoconf" |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
|
13132 | 7 |
### |
8 |
### Test that the generated configure is up-to-date |
|
9 |
### |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
|
13132 | 11 |
# On Solaris /bin/sh doesn't support test -nt but /usr/bin/test does. |
12 |
TEST=`which test` |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
|
13132 | 14 |
print_error_not_up_to_date() { |
15 |
echo "Error: The configure source files is newer than the generated files." |
|
16 |
echo "Please run 'sh autogen.sh' to update the generated files." |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
} |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
|
13132 | 19 |
for file in configure.ac *.m4 ; do |
20 |
if $TEST $file -nt generated-configure.sh; then |
|
21 |
print_error_not_up_to_date |
|
22 |
exit 1 |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
done |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
13132 | 26 |
if $TEST -e $conf_closed_script_dir/generated-configure.sh; then |
27 |
# If closed source configure is available, make sure it is up-to-date as well. |
|
28 |
for file in configure.ac *.m4 $conf_closed_script_dir/*.m4; do |
|
29 |
if $TEST $file -nt $conf_closed_script_dir/generated-configure.sh; then |
|
30 |
print_error_not_up_to_date |
|
31 |
exit 1 |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
32 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
33 |
done |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
34 |
|
13132 | 35 |
# Test if open configure is newer than closed configure, if so, closed needs to |
36 |
# be regenerated. |
|
37 |
conf_open_configure_timestamp=`grep DATE_WHEN_GENERATED: $conf_script_dir/generated-configure.sh | cut -d" " -f 3` |
|
38 |
conf_closed_configure_timestamp=`grep DATE_WHEN_GENERATED: $conf_closed_script_dir/generated-configure.sh | cut -d" " -f 3` |
|
39 |
if $TEST $conf_open_configure_timestamp -gt $conf_closed_configure_timestamp; then |
|
40 |
print_error_not_up_to_date |
|
41 |
exit 1 |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
42 |
fi |
13132 | 43 |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
44 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
45 |
|
13132 | 46 |
### |
47 |
### Process command-line arguments |
|
48 |
### |
|
49 |
conf_processed_arguments= |
|
50 |
conf_openjdk_target= |
|
51 |
conf_extra_cflags= |
|
52 |
conf_extra_cxxflags= |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
53 |
|
13132 | 54 |
for conf_option |
55 |
do |
|
56 |
case $conf_option in |
|
57 |
--openjdk-target=*) |
|
58 |
conf_openjdk_target=`expr "X$conf_option" : '[^=]*=\(.*\)'` |
|
59 |
continue ;; |
|
60 |
--with-extra-cflags=*) |
|
61 |
conf_extra_cflags=`expr "X$conf_option" : '[^=]*=\(.*\)'` |
|
62 |
continue ;; |
|
63 |
--with-extra-cxxflags=*) |
|
64 |
conf_extra_cxxflags=`expr "X$conf_option" : '[^=]*=\(.*\)'` |
|
65 |
continue ;; |
|
66 |
*) |
|
67 |
conf_processed_arguments="$conf_processed_arguments $conf_option" ;; |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
68 |
esac |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
69 |
|
13132 | 70 |
case $conf_option in |
71 |
-build | --build | --buil | --bui | --bu |-build=* | --build=* | --buil=* | --bui=* | --bu=*) |
|
72 |
conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; |
|
73 |
-target | --target | --targe | --targ | --tar | --ta | --t | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) |
|
74 |
conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; |
|
75 |
-host | --host | --hos | --ho | -host=* | --host=* | --hos=* | --ho=*) |
|
76 |
conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; |
|
77 |
esac |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
78 |
done |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
79 |
|
13132 | 80 |
if $TEST "x$conf_legacy_crosscompile" != "x"; then |
81 |
if $TEST "x$conf_openjdk_target" != "x"; then |
|
82 |
echo "Error: Specifying --openjdk-target together with autoconf" |
|
83 |
echo "legacy cross-compilation flags is not supported." |
|
84 |
echo "You specified: --openjdk-target=$conf_openjdk_target and $conf_legacy_crosscompile." |
|
85 |
echo "The recommended use is just --openjdk-target." |
|
86 |
exit 1 |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
87 |
else |
13132 | 88 |
echo "Warning: You are using legacy autoconf cross-compilation flags." |
89 |
echo "It is recommended that you use --openjdk-target instead." |
|
90 |
echo "" |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
91 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
92 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
93 |
|
13132 | 94 |
if $TEST "x$conf_openjdk_target" != "x"; then |
95 |
conf_build_platform=`sh $conf_script_dir/build-aux/config.guess` |
|
96 |
conf_processed_arguments="--build=$conf_build_platform --host=$conf_openjdk_target --target=$conf_openjdk_target $conf_processed_arguments" |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
97 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
98 |
|
13132 | 99 |
# Make configure exit with error on invalid options as default. |
100 |
# Can be overridden by --disable-option-checking, since we prepend our argument |
|
101 |
# and later options override earlier. |
|
102 |
conf_processed_arguments="--enable-option-checking=fatal $conf_processed_arguments" |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
103 |
|
13132 | 104 |
### |
105 |
### Call the configure script |
|
106 |
### |
|
107 |
if $TEST -e $conf_closed_script_dir/generated-configure.sh; then |
|
108 |
# Closed source configure available; run that instead |
|
109 |
. $conf_closed_script_dir/generated-configure.sh $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags" |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
110 |
else |
13132 | 111 |
. $conf_script_dir/generated-configure.sh $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags" |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
112 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
113 |
|
13132 | 114 |
### |
115 |
### Post-processing |
|
116 |
### |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
117 |
|
13132 | 118 |
# Move the log file to the output root, if this was successfully created |
119 |
if $TEST -d "$OUTPUT_ROOT"; then |
|
120 |
mv -f config.log "$OUTPUT_ROOT" 2> /dev/null |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
121 |
fi |