autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

path separator (was: target triplet)


From: Ralf Wildenhues
Subject: path separator (was: target triplet)
Date: Mon, 22 Jan 2007 20:25:17 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Keith MARSHALL wrote on Mon, Jan 22, 2007 at 12:12:02PM CET:
> Ralf Wildenhues wrote:
> >
> > So there's no need to roll your own.
> 
> With respect, I disagree, for the reasons I discuss here:
> [this is the same reference I cited in an earlier reply to Bob Rossi]:
> http://article.gmane.org/gmane.comp.gnu.mingw.msys/3822

Thanks for the pointer, I was not fully aware of the limitation that
$PATH_SEPARATOR is useful for $build only, not for $host.  OK to apply
the patch at the end to document this?

Looking around though, for example Libtool uses the stuff posted below
in ltmain.sh.  Also I do think that if you're going to use essentially a
non feature-based test, you might as well do away with some header
preprocessing goo, and skip any Autoconf-like test.  Saves you extra
compiler invocation and has the advantage that if you ever have to
adjust it (say, because somebody forked Cygwin and renamed the fork),
the uninitiated user will be more comfortable changing some header.

Maybe we can agree on some suitable header snippet and put that in the
Autoconf documentation?  Maybe simplify as most applications don't need
the notion of two possible path separators.

Cheers,
Ralf

#ifndef DIR_SEPARATOR
# define DIR_SEPARATOR '/'
# define PATH_SEPARATOR ':'
#endif

#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  defined (__OS2__)
# define HAVE_DOS_BASED_FILE_SYSTEM
# ifndef DIR_SEPARATOR_2
#  define DIR_SEPARATOR_2 '\\'
# endif
# ifndef PATH_SEPARATOR_2
#  define PATH_SEPARATOR_2 ';'
# endif
#endif

#ifndef DIR_SEPARATOR_2
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */
# define IS_DIR_SEPARATOR(ch) \
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */

#ifndef PATH_SEPARATOR_2
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
#else /* PATH_SEPARATOR_2 */
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
#endif /* PATH_SEPARATOR_2 */



2007-01-22  Ralf Wildenhues  <address@hidden>

        * doc/autoconf.texi (File System Conventions): Mention that
        $PATH_SEPARATOR is for the build system only.
        Report by Keith Marshall.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1127
diff -u -r1.1127 autoconf.texi
--- doc/autoconf.texi   19 Jan 2007 06:54:34 -0000      1.1127
+++ doc/autoconf.texi   22 Jan 2007 19:07:49 -0000
@@ -11399,7 +11400,8 @@
 Also, because the colon is used as part of a drivespec, these systems don't
 use it as path separator.  When creating or accessing paths, you can use the
 @code{PATH_SEPARATOR} output variable instead.  @command{configure} sets this
-to the appropriate value (@samp{:} or @samp{;}) when it starts up.
+to the appropriate value for the build system (@samp{:} or @samp{;}) when it
+starts up.
 
 File names need extra care as well.  While @acronym{DOS} variants
 that are Posixy enough to run @command{autoconf} (such as @acronym{DJGPP})




reply via email to

[Prev in Thread] Current Thread [Next in Thread]