8176467: --with-cacerts-file should fail during configure if file does not exist
authorihse
Mon, 25 Sep 2017 10:47:28 +0200
changeset 47255 181dc03e0be7
parent 47254 ff97a658de30
child 47256 7c2d1e90a9e4
8176467: --with-cacerts-file should fail during configure if file does not exist Reviewed-by: erikj
make/autoconf/generated-configure.sh
make/autoconf/jdk-options.m4
--- a/make/autoconf/generated-configure.sh	Mon Sep 25 10:45:34 2017 +0200
+++ b/make/autoconf/generated-configure.sh	Mon Sep 25 10:47:28 2017 +0200
@@ -5115,7 +5115,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1506329089
+DATE_WHEN_GENERATED=1506329225
 
 ###############################################################################
 #
@@ -25080,8 +25080,20 @@
   withval=$with_cacerts_file;
 fi
 
-  if test "x$with_cacerts_file" != x; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacerts file" >&5
+$as_echo_n "checking for cacerts file... " >&6; }
+  if test "x$with_cacerts_file" == x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5
+$as_echo "default" >&6; }
+  else
     CACERTS_FILE=$with_cacerts_file
+    if test ! -f "$CACERTS_FILE"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: fail" >&5
+$as_echo "fail" >&6; }
+      as_fn_error $? "Specified cacerts file \"$CACERTS_FILE\" does not exist" "$LINENO" 5
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CACERTS_FILE" >&5
+$as_echo "$CACERTS_FILE" >&6; }
   fi
 
 
--- a/make/autoconf/jdk-options.m4	Mon Sep 25 10:45:34 2017 +0200
+++ b/make/autoconf/jdk-options.m4	Mon Sep 25 10:47:28 2017 +0200
@@ -206,8 +206,16 @@
   # Choose cacerts source file
   AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
       [specify alternative cacerts file])])
-  if test "x$with_cacerts_file" != x; then
+  AC_MSG_CHECKING([for cacerts file])
+  if test "x$with_cacerts_file" == x; then
+    AC_MSG_RESULT([default])
+  else
     CACERTS_FILE=$with_cacerts_file
+    if test ! -f "$CACERTS_FILE"; then
+      AC_MSG_RESULT([fail])
+      AC_MSG_ERROR([Specified cacerts file "$CACERTS_FILE" does not exist])
+    fi
+    AC_MSG_RESULT([$CACERTS_FILE])
   fi
   AC_SUBST(CACERTS_FILE)