5 # Script for converting between windows and unix-style paths.
7 # Copyright (C) 2001,2002 Free Software Foundation, Inc.
9 # Author: Stephen Brandon <stephen@brandonitconsulting.co.uk>
10 # Modified by: Richard Frith-Macdonald <rfm@gnu.org>
12 # This file is part of the GNUstep Makefile Package.
14 # This library is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License
16 # as published by the Free Software Foundation; either version 2
17 # of the License, or (at your option) any later version.
19 # You should have received a copy of the GNU General Public
20 # License along with this library; see the file COPYING.LIB.
21 # If not, write to the Free Software Foundation,
22 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 # Define CYGWIN to "yes" to force cygwin style path handling, or
27 # to anything else for MINGW32/MSYS style path handling.
31 if [ ! $# -eq 2 ]; then
35 test "$1" = '-u' || test "$1" = '-w' || quit="yes"
38 if [ "$quit" = "yes" ]; then
39 echo "Usage: $0 (-u)|(-w) filename"
41 echo " -u print Unix form of filename"
42 echo " -w print Windows form of filename"
49 if [ "$operation" = "-u" ]; then
51 # convert to Unix style file name
53 if [ "$CYGWIN" = "yes" ]; then
55 # drive:directory --> /cygdrive/drive/directory
59 sed 's/^\([a-zA-Z]\):\(.*\)$/\/cygdrive\/\1\2/'
62 # drive:directory --> /drive/directory
66 sed 's/^\([a-zA-Z]\):\(.*\)$/\/\1\2/' | \
71 # convert to Windows style file name
73 if [ "$CYGWIN" = "yes" ]; then
75 # /cygdrive/drive/directory --> drive:directory
78 sed 's/^\(\/cygdrive\)\?\/\([a-zA-Z]\)\(\/.*\)$/\2:\3/' | \
82 # /drive/directory --> drive:directory
85 sed 's/^\/\([a-zA-Z]\)\(\/.*\)$/\1:\2/' | \