Check-in Number:
|
5986 | |
Date: |
2008-Jan-30 17:23:07 (local)
2008-Jan-30 16:23:07 (UTC) |
User: | rse |
Branch: | |
Comment: |
Detect Windows/Cygwin |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/shtool/ChangeLog 1.236 -> 1.237
--- ChangeLog 2007/07/25 16:40:06 1.236
+++ ChangeLog 2008/01/30 16:23:07 1.237
@@ -11,6 +11,9 @@
Changes between 2.0.7 and 2.0.8 (19-May-2007 to xx-XXX-2007):
+ *) Detect Windows/Cygwin
+ [Ralf S. Engelschall]
+
*) Detect DragonFly BSD
[Ralf S. Engelschall]
|
|
ossp-pkg/shtool/sh.platform 1.27 -> 1.28
--- sh.platform 2007/12/05 09:07:43 1.27
+++ sh.platform 2008/01/30 16:23:07 1.28
@@ -489,6 +489,36 @@
SC="4.4BSD/Mach3.0"
;;
+ # Windows/Cygwin
+ *:CYGWIN*:* )
+ # determine architecture
+ AT="`uname -m`"
+ AP="${AT}"
+ case "${AP}" in
+ i?86 ) AP="iX86" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ unset v1; unset v2; unset v3
+ eval `echo "${UNAME_RELEASE}" |\
+ sed -e 's/^/#/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \
+ -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \
+ -e 's/^#.*$/v1="0"/'`
+ ST="Cygwin ${v1}${v2+.$v2}${v3+[.$v3]}"
+ SP="$ST"
+ SC="Windows"
+ v=`echo "${UNAME_SYSTEM}" | sed -e 's/^CYGWIN_NT-//' |\
+ sed -e 's/^/#/' -e 's/^#\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' -e 's/^#.*$//'`
+ case "$v" in
+ 4.0 ) SC="$SC[ NT]" ;;
+ 5.0 ) SC="$SC[ 2000]" ;;
+ 5.1 ) SC="$SC[ XP]" ;;
+ 6.0 ) SC="$SC[ Vista]" ;;
+ esac
+ ;;
+
# TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
# *:XXX:* )
# ...
|
|