From 6cddfc752e14a4e8084e62dc03872411ee7493df Mon Sep 17 00:00:00 2001
From: Maximilian Downey Twiss <creatorsmithmdt@gmail.com>
Date: Fri, 25 Nov 2022 16:35:31 +1100
Subject: [PATCH 53/56] classpath: Use modern autotools mkdir -p handling.

libjava/classpath/ChangeLog:

	* configure.ac: Add AC_PROG_MKDIR_P call, replace @mkdir_p@ with $(MKDIR_P).
	* configure: Reconfigure.
	* lib/Makefile.am: Replace @mkdir_p@ with $(MKDIR_P).
	* lib/Makefile.in: Reconfigure.
	* lib/copy-vmresources.sh.in: Replace @mkdir_p@ with $(MKDIR_P).
---
 libjava/classpath/configure                  | 10 ++++++----
 libjava/classpath/configure.ac               |  2 ++
 libjava/classpath/lib/Makefile.am            | 10 +++++-----
 libjava/classpath/lib/Makefile.in            | 10 +++++-----
 libjava/classpath/lib/copy-vmresources.sh.in |  4 ++--
 5 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/libjava/classpath/configure b/libjava/classpath/configure
index 8214e1ba7cd..dbde6463c94 100755
--- a/libjava/classpath/configure
+++ b/libjava/classpath/configure
@@ -24338,6 +24338,8 @@ fi
 
 
 
+
+
 # Extract the first word of "find", so it can be a program name with args.
 set dummy find; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -25559,7 +25561,7 @@ else
 JAVA_TEST=Object.java
 CLASS_TEST=Object.class
 cat << \EOF > $JAVA_TEST
-/* #line 25562 "configure" */
+/* #line 25564 "configure" */
 package java.lang;
 
 public class Object
@@ -25652,7 +25654,7 @@ EOF
 if uudecode$EXEEXT Test.uue; then
         ac_cv_prog_uudecode_base64=yes
 else
-        echo "configure: 25655: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
+        echo "configure: 25657: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
         echo "configure: failed file was:" >&5
         cat Test.uue >&5
         ac_cv_prog_uudecode_base64=no
@@ -25680,7 +25682,7 @@ JAVA_TEST=Test.java
 CLASS_TEST=Test.class
 TEST=Test
 cat << \EOF > $JAVA_TEST
-/* [#]line 25683 "configure" */
+/* [#]line 25685 "configure" */
 public class Test {
 public static void main (String args[]) {
         System.exit (0);
@@ -25888,7 +25890,7 @@ if test "x${use_glibj_zip}" = xfalse || \
   JAVA_TEST=Test.java
   CLASS_TEST=Test.class
   cat << \EOF > $JAVA_TEST
-  /* #line 25891 "configure" */
+  /* #line 25893 "configure" */
   public class Test
   {
     public static void main(String args)
diff --git a/libjava/classpath/configure.ac b/libjava/classpath/configure.ac
index 2079fd2121b..40439f594dc 100644
--- a/libjava/classpath/configure.ac
+++ b/libjava/classpath/configure.ac
@@ -1008,6 +1008,8 @@ AC_PATH_PROG(MKDIR, mkdir)
 AC_PATH_PROG(CP, cp)
 AC_PATH_PROG(DATE, date)
 
+AC_PROG_MKDIR_P
+
 dnl -----------------------------------------------------------
 dnl According to the GNU coding guide, we shouldn't require find, 
 dnl and zip, however GNU provides both so it should be okay 
diff --git a/libjava/classpath/lib/Makefile.am b/libjava/classpath/lib/Makefile.am
index 2d47009f459..2f9e32ae98c 100644
--- a/libjava/classpath/lib/Makefile.am
+++ b/libjava/classpath/lib/Makefile.am
@@ -86,18 +86,18 @@ endif # USE_PREBUILT_GLIBJ_ZIP
 resources: copy-vmresources.sh
 	@list=`cd $(top_srcdir)/resource && $(FIND) gnu java javax org -name \*\.properties -print -o -name \*\.css -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then $(MKDIR_P) "$$dirname"; fi; \
 	  cp $(top_srcdir)/resource/$$p $$p; \
 	done
 	@list=`cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -name .svn -prune -o -name \*\.in -prune -o -type f -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then $(MKDIR_P) "$$dirname"; fi; \
 	  cp $(top_srcdir)/resource/$$p $$p; \
 	done
 	@$(SHELL) ./copy-vmresources.sh
 	@list=`cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then $(MKDIR_P) "$$dirname"; fi; \
 	  cp $(top_srcdir)/$$p $$p; \
 	done
 	touch resources
@@ -105,7 +105,7 @@ resources: copy-vmresources.sh
 classes: genclasses
 
 $(top_builddir)/gnu/java/locale/LocaleData.java: $(top_srcdir)/scripts/generate-locale-list.sh 
-	@mkdir_p@ $(top_builddir)/gnu/java/locale
+	$(MKDIR_P) $(top_builddir)/gnu/java/locale
 	$(top_srcdir)/scripts/generate-locale-list.sh > $(top_builddir)/gnu/java/locale/LocaleData.java
 
 genclasses: gen-classlist.sh standard.omit $(top_builddir)/gnu/java/locale/LocaleData.java gen-xpath-parser
@@ -165,7 +165,7 @@ clean-local:
 	-rm -rf lists
 
 dist-hook:
-	@mkdir_p@ $(distdir)
+	$(MKDIR_P) $(distdir)
 	cp -pdfR $(top_srcdir)/gnu $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/org $(top_srcdir)/sun $(top_srcdir)/vm $(top_srcdir)/resource $(distdir)/..
 # Delete not wanted files.
 	$(FIND) $(distdir)/../gnu $(distdir)/../java $(distdir)/../javax $(distdir)/../org $(distdir)/../sun $(distdir)/../vm $(distdir)/../resource -name CVS -print | xargs rm -fr
diff --git a/libjava/classpath/lib/Makefile.in b/libjava/classpath/lib/Makefile.in
index 0a912f62cdb..125eff6a6d7 100644
--- a/libjava/classpath/lib/Makefile.in
+++ b/libjava/classpath/lib/Makefile.in
@@ -584,18 +584,18 @@ sinclude $(JAVA_DEPEND)
 resources: copy-vmresources.sh
 	@list=`cd $(top_srcdir)/resource && $(FIND) gnu java javax org -name \*\.properties -print -o -name \*\.css -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then $(MKDIR_P) "$$dirname"; fi; \
 	  cp $(top_srcdir)/resource/$$p $$p; \
 	done
 	@list=`cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -name .svn -prune -o -name \*\.in -prune -o -type f -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then $(MKDIR_P) "$$dirname"; fi; \
 	  cp $(top_srcdir)/resource/$$p $$p; \
 	done
 	@$(SHELL) ./copy-vmresources.sh
 	@list=`cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then $(MKDIR_P) "$$dirname"; fi; \
 	  cp $(top_srcdir)/$$p $$p; \
 	done
 	touch resources
@@ -603,7 +603,7 @@ resources: copy-vmresources.sh
 classes: genclasses
 
 $(top_builddir)/gnu/java/locale/LocaleData.java: $(top_srcdir)/scripts/generate-locale-list.sh 
-	@mkdir_p@ $(top_builddir)/gnu/java/locale
+	$(MKDIR_P) $(top_builddir)/gnu/java/locale
 	$(top_srcdir)/scripts/generate-locale-list.sh > $(top_builddir)/gnu/java/locale/LocaleData.java
 
 genclasses: gen-classlist.sh standard.omit $(top_builddir)/gnu/java/locale/LocaleData.java gen-xpath-parser
@@ -649,7 +649,7 @@ clean-local:
 	-rm -rf lists
 
 dist-hook:
-	@mkdir_p@ $(distdir)
+	$(MKDIR_P) $(distdir)
 	cp -pdfR $(top_srcdir)/gnu $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/org $(top_srcdir)/sun $(top_srcdir)/vm $(top_srcdir)/resource $(distdir)/..
 # Delete not wanted files.
 	$(FIND) $(distdir)/../gnu $(distdir)/../java $(distdir)/../javax $(distdir)/../org $(distdir)/../sun $(distdir)/../vm $(distdir)/../resource -name CVS -print | xargs rm -fr
diff --git a/libjava/classpath/lib/copy-vmresources.sh.in b/libjava/classpath/lib/copy-vmresources.sh.in
index 8dc8c0f5b4d..5296adddcd9 100644
--- a/libjava/classpath/lib/copy-vmresources.sh.in
+++ b/libjava/classpath/lib/copy-vmresources.sh.in
@@ -11,7 +11,7 @@ for p in ${vmdirs}; do
 		(cd $p/META-INF; 
 		 dirs=`find . -name "CVS" -prune -o -type d -print`;
 		 for u in ${dirs}; do
-			 @mkdir_p@ ${destMetaDir}/${u};
+			 $(MKDIR_P) ${destMetaDir}/${u};
 		 done;
 		 files=`find . -name "CVS" -prune -o -name "*.in" -prune -o -type f -print`;
 		 for u in ${files}; do
@@ -31,7 +31,7 @@ for p in ${vmdirs}; do
   	  resnewdirs=`echo ${resdirs} | uniq`;
 
   	  for u in ${resnewdirs}; do
-  		  @mkdir_p@ ${destResDir}/${u};
+		  $(MKDIR_P) ${destResDir}/${u};
   	  done
   
 	  for f in ${resfiles}; do
-- 
2.38.1

