| Hello all,

Hi Mark,

| Instead of offering a new revision of my previous patches on DOS-style 
| absolute paths and trying to get everything right, perhaps it would better to 
| just offer suggestions on how to treat DOS-style absolute paths as absolute 
| and leave the fixes to the Autoconf experts.

Actually, we do have a problem with time: we lack it.  We do need
help.  I'm sorry I gave the impression it's hard to get a patch get
in, it should not.

| DOS style paths can have drive letters and they can have slashes or 
| backslashes. I use the term "DOS-style" to refer to DOS, Windows, and OS/2 
| because they all use this style.  So the typical pattern that detects 
| absolute paths should be changed from:
| /*)
| 
| to
| 
| [/\\*] | [A-z]:[/\\*]

You probably mean

[/\\]* | [A-z]:[/\\]* )

| This covers:
| /bin
| \bin
| c:/bin
| c:\bin
| 
| The range [A-z] is used and not ? as in my patches because it is enough to 
| cover the usual drive letters [A-Za-z] and certain unusual cases with DOS 
| network drives. Plus it's a little clearer that DOS style drive letters are 
| being matched.

That's bizarre.  If you really need other chars than [a-zA-Z], if
there are a few, listing them is fine, otherwise I don't think ? would
be that wrong.  It's even correct for Unix here.


Attached is the state we had reached at the end of the previous
thread, though it does not contain the cd x: weird things.  Personally
I think it is fine to do that in two steps: the regular stuff first,
then the various atrocities needed to cope with relative paths.

| DOS style relative paths are another matter. These take the form:
| x:foo/bar
| or of course x:foo\bar. These should be turned into absolute paths because 
| it's possible the cwd of the drive could change while Autoconf is running. To 
| do this, you need the cooperation of shell that knows each drive has it's own 
| cwd:
| cd x:foo/bar
| absolute_path=$PWD/file

Please, help us Mark.  We need it.

        Akim

Index: ChangeLog
===================================================================
RCS file: /cvs/autoconf/ChangeLog,v
retrieving revision 1.408
diff -u -r1.408 ChangeLog
--- ChangeLog	2000/02/21 09:18:01	1.408
+++ ChangeLog	2000/02/21 09:28:23
@@ -1,3 +1,18 @@
+2000-02-21 Mark Elbrecht <[EMAIL PROTECTED]>
+
+	Support absolute DOS-style paths.
+
+	Any character before the colon is accepted because network drives
+	can be assigned characters outside the [a-zA-Z] range. DOS-style
+	relative paths (?:foo/bar) are also considered absolute for
+	Autoconf's purposes since the path '../?:foo/bar' is invalid.
+
+	* acgeneral.m4 (AC_OUTPUT_FILES): Treat DOS-style paths (?:*') as
+	absolute.
+	(AC_OUTPUT_SUBDIRS): Likewise.
+	(AC_PATH_PROG): Make pattern for matching DOS-style paths the same
+	as that used in AC_OUTPUT_FILES and AC_OUTPUT_SUBDIRS.
+
 2000-02-21  Akim Demaille  <[EMAIL PROTECTED]>
 
 	* tests/tools.m4 (syntax.sh): Exit 1 if you managed to kill the
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.362
diff -u -r1.362 acgeneral.m4
--- acgeneral.m4	2000/02/15 09:33:59	1.362
+++ acgeneral.m4	2000/02/21 09:28:23
@@ -2093,8 +2093,7 @@
 AC_MSG_CHECKING([for $ac_word])
 AC_CACHE_VAL(ac_cv_path_$1,
 [case "[$]$1" in
-dnl Second pattern matches DOS absolute paths.
-  /* | ?:/*)
+  /* | ?:[\\/]*)
   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
   ;;
   *)
@@ -3738,7 +3737,8 @@
   .)  srcdir=.
       if test -z "$ac_dots"; then top_srcdir=.
       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
-  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  /* | ?:*) srcdir="$ac_given_srcdir$ac_dir_suffix";
+            top_srcdir="$ac_given_srcdir" ;;
   *) # Relative path.
     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
     top_srcdir="$ac_dots$ac_given_srcdir" ;;
@@ -3746,7 +3746,7 @@
 
 ifdef([AC_PROVIDE_AC_PROG_INSTALL],
 [[  case "$ac_given_INSTALL" in
-  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  [/$]* | ?:* ) INSTALL="$ac_given_INSTALL" ;;
   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
   esac
 ]])dnl
@@ -4074,7 +4074,7 @@
   fi
 
   case "$srcdir" in
-  [[/$]]*) ac_rel_source="$srcdir/$ac_source" ;;
+  [[/$]]* | ?:*) ac_rel_source="$srcdir/$ac_source" ;;
       *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
   esac
 
@@ -4193,7 +4193,7 @@
     case "$srcdir" in
     .) # No --srcdir option.  We are building in place.
       ac_sub_srcdir=$srcdir ;;
-    /*) # Absolute path.
+    /* | ?:*) # Absolute path.
       ac_sub_srcdir=$srcdir/$ac_config_dir ;;
     *) # Relative path.
       ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
@@ -4214,13 +4214,13 @@
 
       # Make the cache file name correct relative to the subdirectory.
       case "$cache_file" in
-      /*) ac_sub_cache_file=$cache_file ;;
+      /* | ?:*) ac_sub_cache_file=$cache_file ;;
       *) # Relative path.
         ac_sub_cache_file="$ac_dots$cache_file" ;;
       esac
 ifdef([AC_PROVIDE_AC_PROG_INSTALL],
 [[      case "$ac_given_INSTALL" in
-        [/$]*) INSTALL="$ac_given_INSTALL" ;;
+        [/$]* | ?:*) INSTALL="$ac_given_INSTALL" ;;
         *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
       esac
 ]])dnl

Reply via email to