Commits

Anonymous committed 504384f

solaris11: #i117567#: configure: argh, Darwin readlink(1) has no -f:
use old JAVA_HOME check as a fallback.

Comments (0)

Files changed (1)

     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
       # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
       if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
-         if test "$JAVACOMPILER" != `readlink -f "$JAVACOMPILER" 2>/dev/null`; then
+         javac_link_f=`readlink -f "$JAVACOMPILER" 2>/dev/null`
+         if test $? == 0 && test "$JAVACOMPILER" != "$javac_link_f"; then
           # try to recover first by looking whether we have a alternatives 
           # system as in Debian or newer SuSEs where following /usr/bin/javac
           # over /etc/alternatives/javac leads to the right bindir where we
           # just need to strip a bit away to get a valid JAVA_HOME
+          # Solaris 11 is even worse, because target is relative, so use -f
+            JAVA_HOME="$javac_link_f"
+         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
+          # Darwin readlink(1) is so primitive it doesn't even support -f
           # maybe only one level of symlink (e.g. on Mac)
-          # Solaris 11 is even worse, because target is relative, so use -f
-            JAVA_HOME=`readlink -f $JAVACOMPILER`
+            JAVA_HOME=`readlink $JAVACOMPILER`
          else
           # else warn
           AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.