comparison common/autoconf/boot-jdk.m4 @ 890:13ddc5c3ebfc

Merge
author jlaskey
date Sat, 02 Mar 2013 10:28:16 -0400
parents 2ba6f4da4bf3
children 3ef3f4174c2b 174a54ce39c4
comparison
equal deleted inserted replaced
1:e344dc92d11d 2:54b9fd5070e2
60 AC_MSG_NOTICE([(Your Boot JDK must be version 7 or 8)]) 60 AC_MSG_NOTICE([(Your Boot JDK must be version 7 or 8)])
61 BOOT_JDK_FOUND=no 61 BOOT_JDK_FOUND=no
62 else 62 else
63 # We're done! :-) 63 # We're done! :-)
64 BOOT_JDK_FOUND=yes 64 BOOT_JDK_FOUND=yes
65 SPACESAFE(BOOT_JDK,[the path to the Boot JDK]) 65 BASIC_FIXUP_PATH(BOOT_JDK)
66 AC_MSG_CHECKING([for Boot JDK]) 66 AC_MSG_CHECKING([for Boot JDK])
67 AC_MSG_RESULT([$BOOT_JDK ($BOOT_JDK_VERSION)]) 67 AC_MSG_RESULT([$BOOT_JDK])
68 AC_MSG_CHECKING([Boot JDK version])
69 BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
70 AC_MSG_RESULT([$BOOT_JDK_VERSION])
68 fi # end check jdk version 71 fi # end check jdk version
69 fi # end check rt.jar 72 fi # end check rt.jar
70 fi # end check javac 73 fi # end check javac
71 fi # end check java 74 fi # end check java
72 fi # end check boot jdk found 75 fi # end check boot jdk found
91 94
92 # Test: Is $JAVA_HOME set? 95 # Test: Is $JAVA_HOME set?
93 AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME], 96 AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME],
94 [ 97 [
95 if test "x$JAVA_HOME" != x; then 98 if test "x$JAVA_HOME" != x; then
96 if test "x$OPENJDK_TARGET_OS" = xwindows; then 99 JAVA_HOME_PROCESSED="$JAVA_HOME"
97 # On Windows, JAVA_HOME is likely in DOS-style 100 BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED)
98 JAVA_HOME_PROCESSED="`$CYGPATH -u "$JAVA_HOME"`"
99 else
100 JAVA_HOME_PROCESSED="$JAVA_HOME"
101 fi
102 if test ! -d "$JAVA_HOME_PROCESSED"; then 101 if test ! -d "$JAVA_HOME_PROCESSED"; then
103 AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) 102 AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
104 else 103 else
105 # Aha, the user has set a JAVA_HOME 104 # Aha, the user has set a JAVA_HOME
106 # let us use that as the Boot JDK. 105 # let us use that as the Boot JDK.
123 if test "x$BINARY" != x; then 122 if test "x$BINARY" != x; then
124 # So there is a java(c) binary, it might be part of a JDK. 123 # So there is a java(c) binary, it might be part of a JDK.
125 # Lets find the JDK/JRE directory by following symbolic links. 124 # Lets find the JDK/JRE directory by following symbolic links.
126 # Linux/GNU systems often have links from /usr/bin/java to 125 # Linux/GNU systems often have links from /usr/bin/java to
127 # /etc/alternatives/java to the real JDK binary. 126 # /etc/alternatives/java to the real JDK binary.
128 SET_FULL_PATH_SPACESAFE(BINARY) 127 BASIC_REMOVE_SYMBOLIC_LINKS(BINARY)
129 REMOVE_SYMBOLIC_LINKS(BINARY)
130 BOOT_JDK=`dirname "$BINARY"` 128 BOOT_JDK=`dirname "$BINARY"`
131 BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` 129 BOOT_JDK=`cd "$BOOT_JDK/.."; pwd`
132 if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then 130 if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
133 # Looks like we found ourselves an JDK 131 # Looks like we found ourselves an JDK
134 BOOT_JDK_FOUND=maybe 132 BOOT_JDK_FOUND=maybe
153 # $2 = String to append to the found JDK directory to get the proper JDK home 151 # $2 = String to append to the found JDK directory to get the proper JDK home
154 AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY], 152 AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY],
155 [ 153 [
156 BOOT_JDK_PREFIX="$1" 154 BOOT_JDK_PREFIX="$1"
157 BOOT_JDK_SUFFIX="$2" 155 BOOT_JDK_SUFFIX="$2"
158 BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` 156 ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r`
159 if test "x$BEST_JDK_FOUND" != x; then 157 if test "x$ALL_JDKS_FOUND" != x; then
160 BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" 158 for JDK_TO_TRY in $ALL_JDKS_FOUND ; do
161 if test -d "$BOOT_JDK"; then 159 BOOTJDK_DO_CHECK([
162 BOOT_JDK_FOUND=maybe 160 BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
163 AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)]) 161 if test -d "$BOOT_JDK"; then
164 fi 162 BOOT_JDK_FOUND=maybe
163 AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)])
164 fi
165 ])
166 done
165 fi 167 fi
166 ]) 168 ])
167 169
168 # Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given 170 # Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given
169 # environmental variable as base for where to look. 171 # environmental variable as base for where to look.
170 # $1 Name of an environmal variable, assumed to point to the Program Files directory. 172 # $1 Name of an environmal variable, assumed to point to the Program Files directory.
171 AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY], 173 AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY],
172 [ 174 [
173 if test "x[$]$1" != x; then 175 if test "x[$]$1" != x; then
174 BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([`$CYGPATH -u "[$]$1"`/Java]) 176 VIRTUAL_DIR="[$]$1/Java"
177 BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VIRTUAL_DIR)
178 BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY($VIRTUAL_DIR)
175 fi 179 fi
176 ]) 180 ])
177 181
178 # Test: Is there a JDK installed in default, well-known locations? 182 # Test: Is there a JDK installed in default, well-known locations?
179 AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS], 183 AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS],
185 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramFiles])]) 189 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramFiles])])
186 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/cygdrive/c/Program Files/Java])]) 190 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/cygdrive/c/Program Files/Java])])
187 elif test "x$OPENJDK_TARGET_OS" = xmacosx; then 191 elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
188 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])]) 192 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])])
189 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])]) 193 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])])
194 elif test "x$OPENJDK_TARGET_OS" = xlinux; then
195 BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/lib/jvm])])
190 fi 196 fi
191 ]) 197 ])
192 198
193 # Check that a command-line tool in the Boot JDK is correct 199 # Check that a command-line tool in the Boot JDK is correct
194 # $1 = name of variable to assign 200 # $1 = name of variable to assign