2015-05-30 2:24 GMT+02:00 Daniel Mack <dan...@zonque.org>:
>
> Fine for me, just go ahead if you have an implementation in mind :)

I was lazy and just copied
ftp://ftp.tu-clausthal.de/pub/mirror/gnu/www/software/ac-archive/normpath.html
The resulting diff would look something like

diff --git a/configure.ac b/configure.ac
index 92654a6..815c8af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1397,11 +1397,13 @@ AC_ARG_WITH([zshcompletiondir],
 AC_ARG_WITH([rootprefix],
         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory
prefix for config files and kernel modules]),
         [], [with_rootprefix=${ac_default_prefix}])
+adl_NORMALIZE_PATH([with_rootprefix])

 AC_ARG_WITH([rootlibdir],
         AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for
libraries necessary for boot]),
         [],
         [with_rootlibdir=${libdir}])
+adl_NORMALIZE_PATH([with_rootlibdir])

 AC_ARG_WITH([pamlibdir],
         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
diff --git a/m4/normpath.m4 b/m4/normpath.m4
new file mode 100644
index 0000000..5b29488
--- /dev/null
+++ b/m4/normpath.m4
@@ -0,0 +1,15 @@
+AC_DEFUN([adl_NORMALIZE_PATH],
+[case ":[$]$1:" in
+# change empty paths to '.'
+  ::) $1='.' ;;
+# strip trailing slashes
+  :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case ifelse($2,,"[$]$1",$2) in
+# if the path contains any backslashes, turn slashes into backslashes
+ *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+# if the path contains slashes, also turn backslashes into slashes
+ *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
+esac])


This would need to be extended all remaining dirs.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to