You can subscribe to this list here.
| 2006 | Jan | Feb | Mar | Apr | May | Jun | Jul (16) | Aug (203) | Sep (142) | Oct (113) | Nov (73) | Dec (27) | 
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 | Jan (7) | Feb (38) | Mar (6) | Apr (1) | May (9) | Jun (104) | Jul (6) | Aug (11) | Sep (13) | Oct (6) | Nov (15) | Dec (37) | 
| 2008 | Jan (17) | Feb (4) | Mar (6) | Apr (4) | May (2) | Jun (5) | Jul (1) | Aug (3) | Sep (21) | Oct (7) | Nov | Dec (3) | 
| 2009 | Jan (4) | Feb (15) | Mar | Apr (34) | May (44) | Jun (12) | Jul (6) | Aug (15) | Sep (20) | Oct (10) | Nov (1) | Dec (20) | 
| 2010 | Jan (19) | Feb (5) | Mar (4) | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | 
| 
      
      
      From: <ped...@us...> - 2008-09-24 11:52:36
      
     | 
| Revision: 1189
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1189&view=rev
Author:   pedroalves
Date:     2008-09-24 11:52:20 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
Didn't mean to push this bit, at least without a user option...
	* build-cegcc.sh (build_gcc): Remove -j4.
	* build-mingw32ce.sh (build_gcc): Likewise.
Modified Paths:
--------------
    trunk/cegcc/src/ChangeLog
    trunk/cegcc/src/build-cegcc.sh
    trunk/cegcc/src/build-mingw32ce.sh
Modified: trunk/cegcc/src/ChangeLog
===================================================================
--- trunk/cegcc/src/ChangeLog	2008-09-24 01:30:18 UTC (rev 1188)
+++ trunk/cegcc/src/ChangeLog	2008-09-24 11:52:20 UTC (rev 1189)
@@ -1,5 +1,10 @@
 2008-09-24  Pedro Alves  <ped...@us...>
 
+	* build-cegcc.sh (build_gcc): Remove -j4.
+	* build-mingw32ce.sh (build_gcc): Likewise.
+
+2008-09-24  Pedro Alves  <ped...@us...>
+
 	* build-cegcc.sh: Rewrite based on build-mingw32ce.sh.
 
 2008-09-24  Pedro Alves  <ped...@us...>
Modified: trunk/cegcc/src/build-cegcc.sh
===================================================================
--- trunk/cegcc/src/build-cegcc.sh	2008-09-24 01:30:18 UTC (rev 1188)
+++ trunk/cegcc/src/build-cegcc.sh	2008-09-24 11:52:20 UTC (rev 1189)
@@ -265,7 +265,7 @@
 
 #  --disable-clocale              \
 
-    make -j4
+    make
     make install
 
     cd ${BUILD_DIR}
Modified: trunk/cegcc/src/build-mingw32ce.sh
===================================================================
--- trunk/cegcc/src/build-mingw32ce.sh	2008-09-24 01:30:18 UTC (rev 1188)
+++ trunk/cegcc/src/build-mingw32ce.sh	2008-09-24 11:52:20 UTC (rev 1189)
@@ -260,7 +260,7 @@
 
 #  --disable-clocale              \
 
-    make -j4
+    make
     make install
 
     cd ${BUILD_DIR}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-24 01:30:25
      
     | 
| Revision: 1188
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1188&view=rev
Author:   pedroalves
Date:     2008-09-24 01:30:18 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
	* build-cegcc.sh: Rewrite based on build-mingw32ce.sh.
Modified Paths:
--------------
    trunk/cegcc/src/ChangeLog
    trunk/cegcc/src/build-cegcc.sh
Modified: trunk/cegcc/src/ChangeLog
===================================================================
--- trunk/cegcc/src/ChangeLog	2008-09-24 01:22:47 UTC (rev 1187)
+++ trunk/cegcc/src/ChangeLog	2008-09-24 01:30:18 UTC (rev 1188)
@@ -1,5 +1,9 @@
 2008-09-24  Pedro Alves  <ped...@us...>
 
+	* build-cegcc.sh: Rewrite based on build-mingw32ce.sh.
+
+2008-09-24  Pedro Alves  <ped...@us...>
+
 	* build-mingw32ce.sh: Require bash.  Use a central a module list
 	instead of hardcoding it in several places.  Use set -e, instead
 	of a `|| exit 1' construct throughout.
Modified: trunk/cegcc/src/build-cegcc.sh
===================================================================
--- trunk/cegcc/src/build-cegcc.sh	2008-09-24 01:22:47 UTC (rev 1187)
+++ trunk/cegcc/src/build-cegcc.sh	2008-09-24 01:30:18 UTC (rev 1188)
@@ -1,87 +1,179 @@
-#!/bin/sh
+#! /usr/bin/env bash
 
-if [ $# -lt 2 ] ; then
-  echo "Using defaults:"
-  export BASE_DIRECTORY=`readlink -f .`
-  export BUILD_DIR=${BASE_DIRECTORY}/build-cegcc
-  export PREFIX=/opt/cegcc
+BASE_DIRECTORY=`dirname $0`
+BASE_DIRECTORY=`(cd ${BASE_DIRECTORY}; pwd)`
+ME=`basename $0`
 
-  if [ $# -lt 1 ] ; then
-    BUILD_OPT="all"
-  else
-    BUILD_OPT="$1"
-    shift
+#
+# Initializations.
+#
+export BUILD_DIR=`pwd`
+
+ac_default_prefix="/opt/cegcc"
+ac_default_destdir="${BUILD_DIR}/install"
+
+gcc_src=gcc
+
+# The list of components, in build order.  There's a build_FOO
+# function for each of these components
+COMPONENTS=( binutils bootstrapgcc w32api newlib dummy_cegccdll gcc cegccdll cegccthrddll libstdcppdll profile docs )
+COMPONENTS_NUM=${#COMPONENTS}
+
+# Build comma separated list of components, for user display.
+for ((i=0;i<$COMPONENTS_NUM;i++)); do
+    if [ $i = 0 ]; then
+	COMPONENTS_COMMA_LIST=${COMPONENTS[${i}]}
+    else
+	COMPONENTS_COMMA_LIST="${COMPONENTS_COMMA_LIST}, ${COMPONENTS[${i}]}"
+    fi
+done
+
+usage()
+{
+    cat << _ACEOF
+
+$ME builds the mingw32ce toolchain.
+
+Usage: $0 [OPTIONS] ...
+
+  -h, --help              print this help, then exit
+  --prefix=PREFIX         install toolchain in PREFIX
+			  [$ac_default_prefix]
+  --components=LIST       specify which components to build
+                          valid components are: ${COMPONENTS_COMMA_LIST}
+			  [all]
+
+Report bugs to <ceg...@li...>.
+_ACEOF
+
+}
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
   fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  case $ac_option in
+
+  -help | --help | --hel | --he | -h)
+    usage; exit 0 ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -components | --components | --component | --componen | \
+      --compone | --compon | --compo | --comp | --com \
+      | --co | --c)
+    ac_prev=components ;;
+  -components=* | --components=* | --component=* | --componen=* \
+      | --compone=* | --compon=* | --compo=* | --comp=* | --com=* \
+      | --co=* | --c=*)
+    components=$ac_optarg ;;
+
+  -destdir | --destdir | --destdi | --destd | --dest | --des | --de | --d)
+    ac_prev=destdir ;;
+  -destdir=* | --destdir=* | --destdi=* | --destd=* | --dest=* | --des=* | --de=* | --d=*)
+    destdir=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    ;;
+  esac
+done
+
+# We don't want no errors from here on.
+set -e
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+if [ "x${prefix}" != "x" ]; then
+    export PREFIX="${prefix}"
 else
-  export BASE_DIRECTORY=`readlink -f $1`
-  export BUILD_DIR=`readlink -f $2`
-  export PREFIX=`readlink -f $3`
-  BUILD_OPT="$4"
-  shift 4
+    export PREFIX=${ac_default_prefix}
 fi
 
-export TARGET="arm-wince-cegcc"
-export PATH=${PREFIX}/bin:${PATH}
-#export CFLAGS="-g3 -O0"
+# Figure out what components where requested to be built.
+if test x"${components+set}" != xset; then
+    components=all
+else
+    if test x"${components}" = x ||
+	test x"${components}" = xyes;
+	then
+	echo --components needs at least one argument 1>&2
+	exit 1
+    fi
+fi
 
-echo "Building cegcc:"
-echo "source: ${BASE_DIRECTORY}"
-echo "build: ${BUILD_DIR}"
-echo "prefix: ${PREFIX}"
+# embedded tabs in the sed below -- do not untabify
+components=`echo "${components}" | sed -e 's/[ 	,][ 	,]*/,/g' -e 's/,$//'`
 
-mkdir -p ${BUILD_DIR} || exit 1
-mkdir -p ${PREFIX} || exit 1
+# Don't build in source directory, it will clobber things and cleanup is hard.
+if [ -d ${BUILD_DIR}/.svn ]; then
+	echo "Don't build in a source directory, please create an empty directory and build there."
+	echo "Example :"
+	echo "  mkdir build-mingw32ce"
+	echo "  cd build-mingw32ce"
+	echo "  sh ../build-mingw32ce.sh $@"
+	exit 1
+fi
 
 build_binutils()
 {
     echo ""
     echo "BUILDING BINUTILS --------------------------"
     echo ""
-
-    mkdir -p ${BUILD_DIR}/binutils || exit 1
-    cd ${BUILD_DIR}/binutils || exit 1
+    echo ""
+    mkdir -p binutils
+    cd binutils
     ${BASE_DIRECTORY}/binutils/configure \
 	--prefix=${PREFIX}      \
-	--exec-prefix=${PREFIX} \
-	--bindir=${PREFIX}/bin  \
 	--target=${TARGET}      \
-	--disable-nls           \
-	--includedir=${PREFIX}/include || exit 1
-    make         || exit 1
-    make install || exit 1
-    
-    cd ${BASE_DIRECTORY} || exit 1
-}
+	--disable-nls
 
-build_import_libs()
-{
-    echo ""
-    echo "Building import libs. --------------------------"
-    echo ""
-    echo ""
+    make
+    make install
 
-    mkdir -p ${PREFIX}/${TARGET}/lib || exit 1
-    cd ${BASE_DIRECTORY}/cegcc/importlibs || exit 1
-    ./build.sh ./defs ${PREFIX}/${TARGET}/lib || exit 1
-    
-    cd ${BASE_DIRECTORY} || exit 1
-}
+    cd ${BUILD_DIR}
+}    
 
-
-copy_w32api_headers()
-{
-    echo ""
-    echo "Copying w32api headers. ----------------------"
-    echo ""
-    echo ""
-
-    mkdir -p ${PREFIX}/${TARGET}/include/w32api/{GL,directx,ddk}
-    cp -fp ${BASE_DIRECTORY}/w32api/include/*.h ${PREFIX}/${TARGET}/include/w32api || exit 1
-    cp -fp ${BASE_DIRECTORY}/w32api/include/GL/*.h ${PREFIX}/${TARGET}/include/w32api/GL || exit 1
-    cp -fp ${BASE_DIRECTORY}/w32api/include/directx/*.h ${PREFIX}/${TARGET}/include/w32api/directx || exit 1
-    cp -fp ${BASE_DIRECTORY}/w32api/include/ddk/*.h ${PREFIX}/${TARGET}/include/w32api/ddk || exit 1
-}
-
 build_dummy_cegccdll()
 {
     echo ""
@@ -89,21 +181,19 @@
     echo ""
     echo ""
     
-    pushd ${BASE_DIRECTORY}/cegcc/fakecegccdll || exit 1
-    ./install.sh ${PREFIX} || exit 1
-    popd || exit 1
+    cd ${BASE_DIRECTORY}/cegcc/fakecegccdll
+
+    sh ./install.sh ${PREFIX}
+
+    cd ${BUILD_DIR}
 }
 
 build_bootstrap_gcc()
 {
-    echo ""
-    echo "Building bootstrap gcc. ----------------------"
-    echo ""
+    mkdir -p gcc-bootstrap
+    cd gcc-bootstrap
 
-    mkdir -p ${BUILD_DIR}/gcc-bootstrap || exit 1
-    cd ${BUILD_DIR}/gcc-bootstrap || exit 1
-
-    ${BASE_DIRECTORY}/gcc/configure		 \
+    ${BASE_DIRECTORY}/${gcc_src}/configure	       \
 	--with-gcc                     \
 	--with-gnu-ld                  \
 	--with-gnu-as                  \
@@ -114,47 +204,47 @@
 	--enable-languages=c           \
 	--disable-win32-registry       \
 	--disable-multilib             \
+	--disable-shared               \
 	--disable-interwork            \
-	--without-headers              \
-	--enable-checking              \
-	|| exit 1
+	--without-newlib               \
+	--enable-checking
     
-    make all-gcc        || exit 1
-    make install-gcc || exit 1
-    cd ${BASE_DIRECTORY} || exit 1
+    make all-gcc
+
+    if [ ${gcc_src} != "gcc" ];
+    then
+	make all-target-libgcc
+    fi
+    make install-gcc
+    if [ ${gcc_src} != "gcc" ];
+    then
+	make install-target-libgcc
+    fi
+
+    cd ${BUILD_DIR}
 }
 
-build_newlib()
+build_w32api()
 {
-    echo ""
-    echo "Building newlib. --------------------------"
-    echo ""
-    echo ""
+    mkdir -p w32api
+    cd w32api
 
-    mkdir -p ${BUILD_DIR}/newlib || exit 1
-    cd ${BUILD_DIR}/newlib || exit 1
+    ${BASE_DIRECTORY}/w32api/configure \
+	--host=${TARGET}               \
+	--prefix=${PREFIX}
 
-    ${BASE_DIRECTORY}/newlib/configure   \
-	--target=${TARGET}                 \
-	--prefix=${PREFIX}                 \
-	|| exit 1
+    make
+    make install
 
-    make || exit 1
-    make install || exit 1
-    cd ${BASE_DIRECTORY} || exit 1
+    cd ${BUILD_DIR}
 }
 
 build_gcc()
 {
-    echo ""
-    echo "Building full gcc. --------------------------"
-    echo ""
-    echo ""
-    
-    mkdir -p ${BUILD_DIR}/gcc || exit 1
-    pushd ${BUILD_DIR}/gcc || exit 1
-    
-    ${BASE_DIRECTORY}/gcc/configure    \
+    mkdir -p gcc
+    cd gcc
+
+    ${BASE_DIRECTORY}/${gcc_src}/configure	\
 	--with-gcc                     \
 	--with-gnu-ld                  \
 	--with-gnu-as                  \
@@ -168,117 +258,72 @@
 	--disable-interwork            \
 	--without-newlib               \
 	--enable-checking              \
-	--with-headers                 \
-	|| exit 1
+	--with-headers
 
+# we build libstdc++ as dll, so we don't need this.    
+#  --enable-fully-dynamic-string  \
 
-    #
-    # Below, the first "make" followed by a file removal, are a workaround
-    # for a gcc build bug. The existence of the script causes the first
-    # make to fail, the second one should succeed. Therefore, not checking
-    # the error code of the first make is intentional.
-    #
-    make
-    rm -f gcc/as
-    make || exit 1
-    #
-    # End workaround
-    #
-    make install || exit 1
+#  --disable-clocale              \
 
-    popd || exit 1
+    make -j4
+    make install
+
+    cd ${BUILD_DIR}
 }
 
-build_cegccdll()
+build_newlib()
 {
     echo ""
-    echo "Building cegcc.dll --------------------------"
+    echo "Building newlib. --------------------------"
     echo ""
     echo ""
 
-    cd ${BASE_DIRECTORY}/cegcc/cegccdll || exit 1
-    make || exit 1
-    make install || exit 1
-}
+    mkdir -p newlib
+    cd newlib
 
-build_cegccthrddll()
-{
-    echo ""
-    echo "Building cegccthrd.dll --------------------------"
-    echo ""
-    echo ""
+    ${BASE_DIRECTORY}/newlib/configure   \
+	--target=${TARGET}               \
+	--prefix=${PREFIX}
 
-    cd ${BASE_DIRECTORY}/cegcc/cegccthrd || exit 1
-    make  || exit 1
-    make install || exit 1
+    make
+    make install
+    cd ${BASE_DIRECTORY}
 }
 
-build_libstdcppdll()
+build_cegccdll()
 {
     echo ""
-    echo "Building libstdc++.dll --------------------------"
+    echo "Building cegcc.dll --------------------------"
     echo ""
     echo ""
 
-    cd ${BASE_DIRECTORY}/cegcc/libstdc++ || exit 1
-    make || exit 1
-    make install || exit 1
+    cd ${BASE_DIRECTORY}/cegcc/cegccdll
+    make
+    make install
 }
 
-build_gdb()
+build_cegccthrddll()
 {
     echo ""
-    echo "BUILDING GDB --------------------------"
+    echo "Building cegccthrd.dll --------------------------"
     echo ""
     echo ""
 
-    mkdir -p ${BUILD_DIR}/gdb || exit 1
-    cd ${BUILD_DIR}/gdb || exit 1
-
-    PREV_CFLAGS=${CFLAGS}
-    export CFLAGS="-I${BASE_DIRECTORY}/w32api/include"
-
-    ${BASE_DIRECTORY}/gdb/configure  \
-	--with-gcc                     \
-	--with-gnu-ld                  \
-	--with-gnu-as                  \
-	--target=${TARGET}             \
-	--prefix=${PREFIX}             \
-	--disable-nls                  \
-	--disable-win32-registry       \
-	--disable-multilib             \
-	--disable-interwork            \
-	--enable-checking              \
-	|| exit
-
-    export CFLAGS=${PREV_CFLAGS}
-
-    make         || exit 1
-    make install || exit 1
+    cd ${BASE_DIRECTORY}/cegcc/cegccthrd
+    make
+    make install
 }
 
-build_gdbstub()
+build_libstdcppdll()
 {
     echo ""
-    echo "BUILDING GDB stub --------------------------"
+    echo "Building libstdc++.dll --------------------------"
     echo ""
     echo ""
 
-    STUB_EXE=${PREFIX}/bin/${TARGET}-stub.exe
-    STUB_SRC=${BASE_DIRECTORY}/gdb/gdb/wince-stub.c
-
-    #pass -static so the stub doesn't depend on cegcc.dll. 
-    #Useful for debugging cegcc.dll itself.
-    #Actually, the stub would better be built with -mno-cegcc/arm-wince-mingw32
-    #To remove the newlib/cegcc.dll dependency, since it mostly uses win32 api.
-    #Removed for now, as it is giving problems.
-    ${TARGET}-gcc -O2 -mwin32  \
-           ${STUB_SRC}         \
-           -o ${STUB_EXE}      \
-           -lwinsock || exit 1
-    ${TARGET}-strip ${STUB_EXE} || exit 1
-
-    cd ${BASE_DIRECTORY} || exit 1
+    cd ${BASE_DIRECTORY}/cegcc/libstdc++
+    make
+    make install
 }
 
 build_profile()
@@ -288,18 +333,17 @@
     echo ""
     echo ""
 
-    mkdir -p ${BUILD_DIR}/profile || exit 1
-    cd ${BUILD_DIR}/profile || exit 1
+    mkdir -p ${BUILD_DIR}/profile
+    cd ${BUILD_DIR}/profile
 
     ${BASE_DIRECTORY}/profile/configure  \
 	--build=${BUILD}              \
 	--host=${TARGET}              \
 	--target=${TARGET}            \
-	--prefix=${PREFIX}            \
-	|| exit
+	--prefix=${PREFIX}
 
-    make         || exit 1
-    make install || exit 1
+    make
+    make install
 }
 
 build_docs()
@@ -309,67 +353,71 @@
     echo ""
     echo ""
 
-    mkdir -p ${PREFIX}/share/docs || exit 1
-    mkdir -p ${PREFIX}/share/images || exit 1
+    mkdir -p ${PREFIX}/share/docs
+    mkdir -p ${PREFIX}/share/images
 
-    cd ${BASE_DIRECTORY}/../docs || exit 1
-    tar cf - . | (cd ${PREFIX}/share/docs; tar xf -) || exit 1
-    cd ${BASE_DIRECTORY}/../website || exit 1
-    tar cf - images | (cd ${PREFIX}/share; tar xf -) || exit 1
+    cd ${BASE_DIRECTORY}/../docs
+    tar cf - . | (cd ${PREFIX}/share/docs; tar xf -)
+    cd ${BASE_DIRECTORY}/../website
+    tar cf - images | (cd ${PREFIX}/share; tar xf -)
 
-    cd ${BASE_DIRECTORY}/.. || exit 1
-    cp NEWS README ${PREFIX} || exit 1
-    cp src/binutils/COPYING ${PREFIX} || exit 1
-    cp src/binutils/COPYING.LIB ${PREFIX} || exit 1
-    cp src/binutils/COPYING.NEWLIB ${PREFIX} || exit 1
+    cd ${BASE_DIRECTORY}/..
+    cp NEWS README ${PREFIX}
+    cp src/binutils/COPYING ${PREFIX}
+    cp src/binutils/COPYING.LIB ${PREFIX}
+    cp src/binutils/COPYING.NEWLIB ${PREFIX}
 }
 
 build_all()
 {
-    build_binutils
-    build_import_libs
-    copy_w32api_headers
-    build_dummy_cegccdll
-    build_bootstrap_gcc
-    build_newlib
-    build_gcc
-    build_cegccdll
-    build_cegccthrddll
-    build_libstdcppdll
-    build_profile
-    build_docs
-    build_gdb
-    build_gdbstub
+    for ((i=0;i<$COMPONENTS_NUM;i++)); do
+	comp=${COMPONENTS[${i}]}
+	build_$comp
+    done
 }
 
-case $BUILD_OPT in
- --help)
-        echo "usage:"
-        echo "$0 [source dir] [build directory] [prefix dir] [build_opt]"
-	echo " "
-	echo "Valid build options : binutils importlibs w32api dummy_cegccdll"
-	echo "  bootstrapgcc newlib gcc cegccdll cegccthrd libstdc++ gdb"
-	echo "  gdbstub docs profile all"
-		;;
- binutils) build_binutils ;;
- importlibs) build_import_libs ;;
- w32api) copy_w32api_headers ;;
- dummy_cegccdll) build_dummy_cegccdll ;;
- bootstrapgcc) build_bootstrap_gcc ;;
- newlib) build_newlib ;;
- gcc) build_gcc ;;
- cegccdll) build_cegccdll ;;
- cegccthrd) build_cegccthrddll ;;
- libstdc++) build_libstdcppdll ;; 
- gdb) build_gdb ;;
- gdbstub) build_gdbstub ;;
- docs) build_docs ;;
- profile) build_profile ;;
- all) build_all ;;
- *) echo "Please enter a valid build option." ;;
-esac
+split_components=`echo "${components}" | sed -e 's/,/ /g'`
 
+# check for valid options before trying to build them all.
+eval "set -- $split_components"
+while [ -n "$1" ]; do
+    if [ "$1" != "all" ]; then
+	found=false
+	for ((i=0;i<$COMPONENTS_NUM;i++)); do
+	    if [ "${COMPONENTS[${i}]}" = "$1" ]; then
+		found=true
+	    fi
+	done
+	if [ $found = false ] ; then
+	    echo "Please enter a valid build option."
+	    exit 1
+	fi
+    fi
+
+    shift
+done
+
+export TARGET="arm-cegcc"
+export BUILD=`sh ${BASE_DIRECTORY}/gcc/config.guess`
+export PATH=${PREFIX}/bin:${PATH}
+
+echo "Building cegcc:"
+echo "source: ${BASE_DIRECTORY}"
+echo "building in: ${BUILD_DIR}"
+echo "prefix: ${PREFIX}"
+echo "components: ${components}"
+
+mkdir -p ${BUILD_DIR}
+mkdir -p ${PREFIX}
+
+# Now actually build them.
+eval "set -- $split_components"
+while [ -n "$1" ]; do
+    build_${1}
+    shift
+done
+
 echo ""
-echo "Done. --------------------------"
+echo "DONE --------------------------"
 echo ""
 echo ""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-24 01:22:54
      
     | 
| Revision: 1187
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1187&view=rev
Author:   pedroalves
Date:     2008-09-24 01:22:47 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
2008-09-24  Pedro Alves  <ped...@us...>
	* config.sub: Add cegcc support.
	* configure.in: Adjust to allow arm-cegcc.
	* configure: Regenerate.
	newlib/
	* configure.host: Adjust to allow arm-cegcc.
Modified Paths:
--------------
    trunk/cegcc/src/newlib/ChangeLog.cegcc
    trunk/cegcc/src/newlib/config.sub
    trunk/cegcc/src/newlib/configure
    trunk/cegcc/src/newlib/configure.in
    trunk/cegcc/src/newlib/newlib/configure.host
Modified: trunk/cegcc/src/newlib/ChangeLog.cegcc
===================================================================
--- trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-09-24 01:15:16 UTC (rev 1186)
+++ trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-09-24 01:22:47 UTC (rev 1187)
@@ -1,3 +1,12 @@
+2008-09-24  Pedro Alves  <ped...@us...>
+
+	* config.sub: Add cegcc support.
+	* configure.in: Adjust to allow arm-cegcc.
+	* configure: Regenerate.
+
+	newlib/
+	* configure.host: Adjust to allow arm-cegcc.
+
 2008-09-12  Pawel Veselov <paw...@gm...>
         * newlib/newlib/libc/include/stdlib.h : added realpath() declaration
         * newlib/libc/sys/wince/Makefile.in newlib/libc/sys/wince/Makefile.am :
Modified: trunk/cegcc/src/newlib/config.sub
===================================================================
--- trunk/cegcc/src/newlib/config.sub	2008-09-24 01:15:16 UTC (rev 1186)
+++ trunk/cegcc/src/newlib/config.sub	2008-09-24 01:22:47 UTC (rev 1187)
@@ -446,6 +446,10 @@
 		basic_machine=c90-cray
 		os=-unicos
 		;;
+	cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
Modified: trunk/cegcc/src/newlib/configure
===================================================================
--- trunk/cegcc/src/newlib/configure	2008-09-24 01:15:16 UTC (rev 1186)
+++ trunk/cegcc/src/newlib/configure	2008-09-24 01:22:47 UTC (rev 1187)
@@ -1241,7 +1241,7 @@
   sh-*-linux*)
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
     ;;    
-  sh*-*-pe|mips*-*-pe|*arm-wince-pe|*arm-wince-cegcc)
+  sh*-*-pe | mips*-*-pe | arm*-wince-pe | arm*-*-cegcc)
     noconfigdirs="$noconfigdirs target-libgloss"
     noconfigdirs="$noconfigdirs ${libgcj}"
     noconfigdirs="$noconfigdirs target-examples"
Modified: trunk/cegcc/src/newlib/configure.in
===================================================================
--- trunk/cegcc/src/newlib/configure.in	2008-09-24 01:15:16 UTC (rev 1186)
+++ trunk/cegcc/src/newlib/configure.in	2008-09-24 01:22:47 UTC (rev 1187)
@@ -449,7 +449,7 @@
   sh-*-linux*)
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
     ;;    
-  sh*-*-pe|mips*-*-pe|*arm-wince-pe|*arm-wince-cegcc)
+  sh*-*-pe | mips*-*-pe | arm*-wince-pe | arm*-*-cegcc)
     noconfigdirs="$noconfigdirs target-libgloss"
     noconfigdirs="$noconfigdirs ${libgcj}"
     noconfigdirs="$noconfigdirs target-examples"
Modified: trunk/cegcc/src/newlib/newlib/configure.host
===================================================================
--- trunk/cegcc/src/newlib/newlib/configure.host	2008-09-24 01:15:16 UTC (rev 1186)
+++ trunk/cegcc/src/newlib/newlib/configure.host	2008-09-24 01:22:47 UTC (rev 1187)
@@ -320,7 +320,7 @@
   arc-*-*)
 	sys_dir=arc
 	;;
-  arm-wince-pe | arm-wince-cegcc)
+  arm-wince-pe | arm*-*-cegcc)
 	sys_dir=wince
 	unix_dir=unix
 	;;
@@ -507,17 +507,17 @@
   arm-wince-pe)
 	syscall_dir=syscalls
 	#no really srcdir yet, but will be. for now it makes my life easier to point into ${prefix}
-	test -z "$cegcc_srcdir" && cegcc_srcdir=`cd ${prefix}/arm-wince-pe/include; pwd`
+	test -z "$cegcc_srcdir" && cegcc_srcdir=`cd ${prefix}/${host}/include; pwd`
 	export cegcc_srcdir
 	newlib_cflags="${newlib_cflags} -mwin32 -idirafter ${cegcc_srcdir}/w32api -march=armv4 -DGNUWINCE -DSARM -DABORT_PROVIDED -DMALLOC_PROVIDED -DWANT_PRINTF_LONG_LONG -D_COMPILING_NEWLIB -DREENTRANT_SYSCALLS_PROVIDED -DNO_FORK"
 	default_newlib_io_long_long="yes"
 	default_newlib_io_long_double="yes"
 	default_newlib_io_pos_args="yes"
 	;;	
-  arm-wince-cegcc)
+  arm*-*-cegcc*)
 	syscall_dir=syscalls
 	#no really srcdir yet, but will be. for now it makes my life easier to point into ${prefix}
-	test -z "$cegcc_srcdir" && cegcc_srcdir=`cd ${prefix}/arm-wince-cegcc/include; pwd`
+	test -z "$cegcc_srcdir" && cegcc_srcdir=`cd ${prefix}/${host}/include; pwd`
 	export cegcc_srcdir
 	newlib_cflags="${newlib_cflags} -mwin32 -idirafter ${cegcc_srcdir}/w32api -march=armv4 -DGNUWINCE -DSARM -DABORT_PROVIDED -DMALLOC_PROVIDED -DWANT_PRINTF_LONG_LONG -D_COMPILING_NEWLIB -DREENTRANT_SYSCALLS_PROVIDED -DNO_FORK"
 	default_newlib_io_long_long="yes"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-24 01:15:23
      
     | 
| Revision: 1186
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1186&view=rev
Author:   pedroalves
Date:     2008-09-24 01:15:16 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
2008-09-24  Pedro Alves  <ped...@us...>
	gcc/libstdc++/
	* configure: Regenerate.
Modified Paths:
--------------
    trunk/cegcc/src/gcc/ChangeLog.ce
    trunk/cegcc/src/gcc/libstdc++-v3/configure
Modified: trunk/cegcc/src/gcc/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/gcc/ChangeLog.ce	2008-09-24 01:08:30 UTC (rev 1185)
+++ trunk/cegcc/src/gcc/ChangeLog.ce	2008-09-24 01:15:16 UTC (rev 1186)
@@ -1,3 +1,8 @@
+2008-09-24  Pedro Alves  <ped...@us...>
+
+	gcc/libstdc++/
+	* configure: Regenerate.
+
 2007-12-25  Pedro Alves  <ped...@po...>
 
 	* configure.in: Use $target_alias instead of $target.
Modified: trunk/cegcc/src/gcc/libstdc++-v3/configure
===================================================================
--- trunk/cegcc/src/gcc/libstdc++-v3/configure	2008-09-24 01:08:30 UTC (rev 1185)
+++ trunk/cegcc/src/gcc/libstdc++-v3/configure	2008-09-24 01:15:16 UTC (rev 1186)
@@ -80522,7 +80522,7 @@
 
     fi
     ;;
-  *-mingw32*)
+  arm-wince-pe | arm*-*-cegcc* | arm*-*-mingw32ce*)
 
 
 
@@ -80530,7 +80530,7 @@
 
 
 
-for ac_header in sys/types.h errno.h unistd.h signal.h locale.h float.h fcntl.h
+for ac_header in sys/types.h locale.h float.h errno.h signal.h unistd.h fcntl.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -80679,6 +80679,8 @@
 
 done
 
+#    AC_DEFINE(_GLIBCXX_HAVE_SYS_IOCTL_H)
+#   AC_DEFINE(HAVE_SYS_IOCTL_H)
 
   # If we're not using GNU ld, then there's no point in even trying these
   # tests.  Check for that first.  We should have already tested for gld
@@ -81330,513 +81332,6 @@
 
 
 
-
-  enable_iconv=no
-  # Only continue checking if the ISO C99 headers exist and support is on.
-  if test x"$enable_wchar_t" = xyes; then
-
-    # Use iconv for wchar_t to char conversions. As such, check for
-    # X/Open Portability Guide, version 2 features (XPG2).
-    if test "${ac_cv_header_iconv_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for iconv.h" >&5
-echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
-if test "${ac_cv_header_iconv_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
-echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking iconv.h usability" >&5
-echo $ECHO_N "checking iconv.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <iconv.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking iconv.h presence" >&5
-echo $ECHO_N "checking iconv.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <iconv.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: iconv.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: iconv.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: iconv.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: iconv.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: iconv.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: iconv.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: iconv.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: iconv.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: iconv.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: iconv.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: iconv.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists.  ##
-## ----------------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for iconv.h" >&5
-echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
-if test "${ac_cv_header_iconv_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_iconv_h=$ac_header_preproc
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
-echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
-
-fi
-if test $ac_cv_header_iconv_h = yes; then
-  ac_has_iconv_h=yes
-else
-  ac_has_iconv_h=no
-fi
-
-
-    if test "${ac_cv_header_langinfo_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for langinfo.h" >&5
-echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
-if test "${ac_cv_header_langinfo_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
-echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking langinfo.h usability" >&5
-echo $ECHO_N "checking langinfo.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <langinfo.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking langinfo.h presence" >&5
-echo $ECHO_N "checking langinfo.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <langinfo.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: langinfo.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: langinfo.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: langinfo.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: langinfo.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: langinfo.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: langinfo.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: langinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: langinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: langinfo.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: langinfo.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: langinfo.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists.  ##
-## ----------------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for langinfo.h" >&5
-echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
-if test "${ac_cv_header_langinfo_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_langinfo_h=$ac_header_preproc
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
-echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
-
-fi
-if test $ac_cv_header_langinfo_h = yes; then
-  ac_has_langinfo_h=yes
-else
-  ac_has_langinfo_h=no
-fi
-
-
-
-    # Check for existence of libiconv.a providing XPG2 wchar_t support.
-    echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
-echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
-if test "${ac_cv_lib_iconv_iconv+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-liconv  $LIBS"
-if test x$gcc_no_link = xyes; then
-  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char iconv ();
-int
-main ()
-{
-iconv ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_iconv_iconv=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_iconv_iconv=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5
-echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
-if test $ac_cv_lib_iconv_iconv = yes; then
-  LIBICONV="-liconv"
-fi
-
-    ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LIBICONV"
-
-
-
-
-
-
-for ac_func in iconv_open iconv_close iconv nl_langinfo
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test x$gcc_no_link = xyes; then
-  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ac_XPG2funcs=yes
-else
-  ac_XPG2funcs=no
-fi
-done
-
-
-    LIBS="$ac_save_LIBS"
-
-    if test x"$ac_has_iconv_h" = xyes &&
-       test x"$ac_has_langinfo_h" = xyes &&
-       test x"$ac_XPG2funcs" = xyes;
-    then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_ICONV 1
-_ACEOF
-
-      enable_iconv=yes
-    fi
-  fi
-  echo "$as_me:$LINENO: checking for enabled iconv specializations" >&5
-echo $ECHO_N "checking for enabled iconv specializations... $ECHO_C" >&6
-  echo "$as_me:$LINENO: result: $enable_iconv" >&5
-echo "${ECHO_T}$enable_iconv" >&6
-
-
   ac_test_CXXFLAGS="${CXXFLAGS+set}"
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
@@ -82585,8 +82080,9 @@
 
   CXXFLAGS="$ac_save_CXXFLAGS"
 
+    #GLIBCXX_CHECK_WCHAR_T_SUPPORT
     ;;
-  *arm-unknown-* | *arm-wince-pe | *-cegcc*)
+  *-mingw32*)
 
 
 
@@ -82594,7 +82090,7 @@
 
 
 
-for ac_header in sys/types.h locale.h float.h errno.h signal.h unistd.h fcntl.h
+for ac_header in sys/types.h errno.h unistd.h signal.h locale.h float.h fcntl.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -82743,8 +82239,6 @@
 
 done
 
-#    AC_DEFINE(_GLIBCXX_HAVE_SYS_IOCTL_H)
-#   AC_DEFINE(HAVE_SYS_IOCTL_H)
 
   # If we're not using GNU ld, then there's no point in even trying these
   # tests.  Check for that first.  We should have already tested for gld
@@ -83396,6 +82890,513 @@
 
 
 
+
+  enable_iconv=no
+  # Only continue checking if the ISO C99 headers exist and support is on.
+  if test x"$enable_wchar_t" = xyes; then
+
+    # Use iconv for wchar_t to char conversions. As such, check for
+    # X/Open Portability Guide, version 2 features (XPG2).
+    if test "${ac_cv_header_iconv_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <iconv.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <iconv.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: iconv.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: iconv.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: iconv.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: iconv.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: iconv.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: iconv.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: iconv.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: iconv.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists.  ##
+## ----------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_iconv_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
+fi
+if test $ac_cv_header_iconv_h = yes; then
+  ac_has_iconv_h=yes
+else
+  ac_has_iconv_h=no
+fi
+
+
+    if test "${ac_cv_header_langinfo_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <langinfo.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <langinfo.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: langinfo.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: langinfo.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: langinfo.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: langinfo.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: langinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: langinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: langinfo.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: langinfo.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists.  ##
+## ----------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_langinfo_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+  ac_has_langinfo_h=yes
+else
+  ac_has_langinfo_h=no
+fi
+
+
+
+    # Check for existence of libiconv.a providing XPG2 wchar_t support.
+    echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv  $LIBS"
+if test x$gcc_no_link = xyes; then
+  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char iconv ();
+int
+main ()
+{
+iconv ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_iconv_iconv=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+  LIBICONV="-liconv"
+fi
+
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIBICONV"
+
+
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test x$gcc_no_link = xyes; then
+  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ac_XPG2funcs=yes
+else
+  ac_XPG2funcs=no
+fi
+done
+
+
+    LIBS="$ac_save_LIBS"
+
+    if test x"$ac_has_iconv_h" = xyes &&
+       test x"$ac_has_langinfo_h" = xyes &&
+       test x"$ac_XPG2funcs" = xyes;
+    then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_ICONV 1
+_ACEOF
+
+      enable_iconv=yes
+    fi
+  fi
+  echo "$as_me:$LINENO: checking for enabled iconv specializations" >&5
+echo $ECHO_N "checking for enabled iconv specializations... $ECHO_C" >&6
+  echo "$as_me:$LINENO: result: $enable_iconv" >&5
+echo "${ECHO_T}$enable_iconv" >&6
+
+
   ac_test_CXXFLAGS="${CXXFLAGS+set}"
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
@@ -84144,7 +84145,6 @@
 
   CXXFLAGS="$ac_save_CXXFLAGS"
 
-    #GLIBCXX_CHECK_WCHAR_T_SUPPORT
     ;;
   *-netbsd*)
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-24 01:08:34
      
     | 
| Revision: 1185
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1185&view=rev
Author:   pedroalves
Date:     2008-09-24 01:08:30 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
2008-09-24  Pedro Alves  <ped...@us...>
	ld/
	* configure.tgt (arm*-*-cegcc*): Set LIB_PATH to
	${tooldir}/lib/w32api.
Modified Paths:
--------------
    trunk/cegcc/src/binutils/ChangeLog.ce
    trunk/cegcc/src/binutils/ld/configure.tgt
Modified: trunk/cegcc/src/binutils/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/binutils/ChangeLog.ce	2008-09-24 01:04:22 UTC (rev 1184)
+++ trunk/cegcc/src/binutils/ChangeLog.ce	2008-09-24 01:08:30 UTC (rev 1185)
@@ -1,3 +1,9 @@
+2008-09-24  Pedro Alves  <ped...@us...>
+
+	ld/
+	* configure.tgt (arm*-*-cegcc*): Set LIB_PATH to
+	${tooldir}/lib/w32api.
+
 2008-03-29  Danny Backx  <dan...@us...>
 
 	* pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
Modified: trunk/cegcc/src/binutils/ld/configure.tgt
===================================================================
--- trunk/cegcc/src/binutils/ld/configure.tgt	2008-09-24 01:04:22 UTC (rev 1184)
+++ trunk/cegcc/src/binutils/ld/configure.tgt	2008-09-24 01:08:30 UTC (rev 1185)
@@ -44,7 +44,10 @@
 arc-*-elf*)		targ_emul=arcelf
 			;;
 arm-epoc-pe)		targ_emul=arm_epoc_pe ;	targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-arm-wince-* | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*)
+arm*-*-cegcc*)
+			targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o"
+			LIB_PATH='${tooldir}/lib/w32api' ;;
+arm-wince-* | arm-*-wince | arm*-*-mingw32ce*)
 			targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
 arm-*-pe)		targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
 arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-24 01:04:28
      
     | 
| Revision: 1184
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1184&view=rev
Author:   pedroalves
Date:     2008-09-24 01:04:22 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
2008-09-24  Pedro Alves  <ped...@us...>
	* config.sub: Add support for cegcc.
	* libce/Makefile.in (inst_includedir, inst_libdir) [cegcc]: Set to
	a w32api subdir.
	(EXTRA_INCLUDES) [cegcc]: Point at newlib headers.
Modified Paths:
--------------
    trunk/cegcc/src/w32api/ChangeLog.ce
    trunk/cegcc/src/w32api/config.sub
    trunk/cegcc/src/w32api/libce/Makefile.in
Modified: trunk/cegcc/src/w32api/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/w32api/ChangeLog.ce	2008-09-24 00:57:24 UTC (rev 1183)
+++ trunk/cegcc/src/w32api/ChangeLog.ce	2008-09-24 01:04:22 UTC (rev 1184)
@@ -1,3 +1,10 @@
+2008-09-24  Pedro Alves  <ped...@us...>
+
+	* config.sub: Add support for cegcc.
+	* libce/Makefile.in (inst_includedir, inst_libdir) [cegcc]: Set to
+	a w32api subdir.
+	(EXTRA_INCLUDES) [cegcc]: Point at newlib headers.
+
 2008-09-04  Danny Backx  <dan...@us...>
 
 	* include/winbase.h: Fix SetSystemPowerState as indicated by Klaus
Modified: trunk/cegcc/src/w32api/config.sub
===================================================================
--- trunk/cegcc/src/w32api/config.sub	2008-09-24 00:57:24 UTC (rev 1183)
+++ trunk/cegcc/src/w32api/config.sub	2008-09-24 01:04:22 UTC (rev 1184)
@@ -411,6 +411,10 @@
 		basic_machine=c90-cray
 		os=-unicos
 		;;
+	cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -1133,7 +1137,7 @@
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* | -cegcc* \
 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
Modified: trunk/cegcc/src/w32api/libce/Makefile.in
===================================================================
--- trunk/cegcc/src/w32api/libce/Makefile.in	2008-09-24 00:57:24 UTC (rev 1183)
+++ trunk/cegcc/src/w32api/libce/Makefile.in	2008-09-24 01:04:22 UTC (rev 1184)
@@ -43,8 +43,19 @@
 endif
 datadir = @datadir@
 infodir = @infodir@
-inst_includedir:=$(tooldir)/include
+
+ifneq (,$(findstring cegcc,$(host_alias)))
+inst_includedir:=$(tooldir)/include/w32api
+inst_libdir:=$(tooldir)/lib/w32api
+else
+ifneq (,$(with_cross_host))
+inst_includedir:=$(tooldir)/include/w32api
 inst_libdir:=$(tooldir)/lib
+else
+inst_includedir:=$(includedir)
+inst_libdir:=$(libdir)
+endif
+endif
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -75,6 +86,12 @@
 EXTRA_INCLUDES = -I$(srcdir)/../../mingw/include
 endif
 
+# This would be better passed from configure.  Not so important to do
+# until winsup is cleaned up too.
+ifneq (,$(findstring cegcc, $(host_alias)))
+EXTRA_INCLUDES = -I$(srcdir)/../../include -I$(srcdir)/../../newlib/newlib/libc/include
+endif
+
 INCLUDES = -I$(srcdir)/../include $(EXTRA_INCLUDES)
 
 CFLAGS = @CFLAGS@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-24 00:57:30
      
     | 
| Revision: 1183
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1183&view=rev
Author:   pedroalves
Date:     2008-09-24 00:57:24 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
2008-09-24  Pedro Alves  <ped...@us...>
	* build-mingw32ce.sh: Require bash.  Use a central a module list
	instead of hardcoding it in several places.  Use set -e, instead
	of a `|| exit 1' construct throughout.
Modified Paths:
--------------
    trunk/cegcc/src/ChangeLog
    trunk/cegcc/src/build-mingw32ce.sh
Modified: trunk/cegcc/src/ChangeLog
===================================================================
--- trunk/cegcc/src/ChangeLog	2008-09-18 21:25:14 UTC (rev 1182)
+++ trunk/cegcc/src/ChangeLog	2008-09-24 00:57:24 UTC (rev 1183)
@@ -1,6 +1,12 @@
+2008-09-24  Pedro Alves  <ped...@us...>
+
+	* build-mingw32ce.sh: Require bash.  Use a central a module list
+	instead of hardcoding it in several places.  Use set -e, instead
+	of a `|| exit 1' construct throughout.
+
 2008-06-22  Danny Backx  <dan...@so...>
 
-	* build-cegcc.sh : Remove all instances of the function keyword for
+	* build-cegcc.sh: Remove all instances of the function keyword for
 	POSIX compliance. Based on info by Mosfet, see the mailing list.
 
 2008-06-20  Danny Backx  <dan...@us...>
Modified: trunk/cegcc/src/build-mingw32ce.sh
===================================================================
--- trunk/cegcc/src/build-mingw32ce.sh	2008-09-18 21:25:14 UTC (rev 1182)
+++ trunk/cegcc/src/build-mingw32ce.sh	2008-09-24 00:57:24 UTC (rev 1183)
@@ -1,15 +1,35 @@
-#!/bin/sh
+#! /usr/bin/env bash
 
-export BASE_DIRECTORY=`dirname $0`
-export BASE_DIRECTORY=`(cd ${BASE_DIRECTORY}; pwd)`
+BASE_DIRECTORY=`dirname $0`
+BASE_DIRECTORY=`(cd ${BASE_DIRECTORY}; pwd)`
 ME=`basename $0`
 
+# FIXME: some components need this (mingwdll), but they shouldn't.
+export BASE_DIRECTORY
+
 #
 # Initializations.
 #
-ac_default_prefix="/opt/mingw32ce"
 export BUILD_DIR=`pwd`
 
+ac_default_prefix="/opt/mingw32ce"
+
+gcc_src=gcc
+
+# The list of components, in build order.  There's a build_FOO
+# function for each of these components
+COMPONENTS=( binutils bootstrap_gcc mingw w32api gcc profile dlls docs )
+COMPONENTS_NUM=${#COMPONENTS}
+
+# Build comma separated list of components, for user display.
+for ((i=0;i<$COMPONENTS_NUM;i++)); do
+    if [ $i = 0 ]; then
+	COMPONENTS_COMMA_LIST=${COMPONENTS[${i}]}
+    else
+	COMPONENTS_COMMA_LIST="${COMPONENTS_COMMA_LIST}, ${COMPONENTS[${i}]}"
+    fi
+done
+
 usage()
 {
     cat << _ACEOF
@@ -22,8 +42,7 @@
   --prefix=PREFIX         install toolchain in PREFIX
 			  [$ac_default_prefix]
   --components=LIST       specify which components to build
-                          valid components are: all,binutils,bootstrapgcc,
-                          mingw,w32api,gcc,docs,profile,gdb,gdbstub,dlls
+                          valid components are: ${COMPONENTS_COMMA_LIST}
 			  [all]
 
 Report bugs to <ceg...@li...>.
@@ -82,6 +101,9 @@
   esac
 done
 
+# We don't want no errors from here on.
+set -e
+
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
   { echo "$as_me: error: missing argument to $ac_option" >&2
@@ -136,25 +158,25 @@
     echo "BUILDING BINUTILS --------------------------"
     echo ""
     echo ""
-    mkdir -p binutils || exit 1
+    mkdir -p binutils
     cd binutils
     ${BASE_DIRECTORY}/binutils/configure \
 	--prefix=${PREFIX}      \
 	--target=${TARGET}      \
-	--disable-nls || exit 1
+	--disable-nls
 
-    make         || exit 1
-    make install || exit 1
-    
+    make
+    make install
+
     cd ${BUILD_DIR}
 }    
 
 build_bootstrap_gcc()
 {
-    mkdir -p gcc-bootstrap || exit 1
+    mkdir -p gcc-bootstrap
     cd gcc-bootstrap
 
-    ${BASE_DIRECTORY}/gcc/configure	       \
+    ${BASE_DIRECTORY}/${gcc_src}/configure	       \
 	--with-gcc                     \
 	--with-gnu-ld                  \
 	--with-gnu-as                  \
@@ -165,70 +187,59 @@
 	--enable-languages=c           \
 	--disable-win32-registry       \
 	--disable-multilib             \
+	--disable-shared               \
 	--disable-interwork            \
 	--without-newlib               \
-	--enable-checking              \
-	|| exit 1
+	--enable-checking
     
-    make all-gcc || exit 1
-    make install-gcc || exit 1
+    make all-gcc
 
+    if [ ${gcc_src} != "gcc" ];
+    then
+	make all-target-libgcc
+    fi
+    make install-gcc
+    if [ ${gcc_src} != "gcc" ];
+    then
+	make install-target-libgcc
+    fi
+
     cd ${BUILD_DIR}
 }
 
 build_w32api()
 {
-#I have this normally set by ccache.
-#Must unset them, because mingw being a lib,
-#uses $host==$target, and CC instead of CC_FOR_TARGET.
-    PREV_CC=${CC}
-    unset CC
-
-    mkdir -p w32api || exit 1
+    mkdir -p w32api
     cd w32api
 
     ${BASE_DIRECTORY}/w32api/configure \
 	--host=${TARGET}               \
-	--prefix=${PREFIX}             \
-	|| exit 1
+	--prefix=${PREFIX}
 
-    make || exit 1
-    make install || exit 1
-
-    export CC=${PREV_CC}
-    cd ${BUILD_DIR}
+    make
+    make install
 }
 
-build_mingw_runtime()
+build_mingw()
 {
-#I have this normally set by ccache.
-#Must unset them, because mingw being a lib,
-#uses $host==$target, and CC instead of CC_FOR_TARGET.
-    PREV_CC=${CC}
-    unset CC
-
-    mkdir -p mingw || exit 1
+    mkdir -p mingw
     cd mingw
     ${BASE_DIRECTORY}/mingw/configure \
 	--build=${BUILD}              \
 	--host=${TARGET}              \
 	--target=${TARGET}            \
-	--prefix=${PREFIX}            \
-	|| exit 1
+	--prefix=${PREFIX}
 
-    make || exit 1
-    make install || exit 1
-
-    export CC=${PREV_CC}
-    cd ${BUILD_DIR}
+    make
+    make install
 }
 
 build_gcc()
 {
-    mkdir -p gcc || exit 1
+    mkdir -p gcc
     cd gcc
 
-    ${BASE_DIRECTORY}/gcc/configure	\
+    ${BASE_DIRECTORY}/${gcc_src}/configure	\
 	--with-gcc                     \
 	--with-gnu-ld                  \
 	--with-gnu-as                  \
@@ -242,27 +253,15 @@
 	--disable-interwork            \
 	--without-newlib               \
 	--enable-checking              \
-	--with-headers                 \
-	|| exit
+	--with-headers
 
 # we build libstdc++ as dll, so we don't need this.    
 #  --enable-fully-dynamic-string  \
 
 #  --disable-clocale              \
 
-    #
-    # Below, the first "make" followed by a file removal, are a workaround
-    # for a gcc build bug. The existence of the script causes the first
-    # make to fail, the second one should succeed. Therefore, not checking
-    # the error code of the first make is intentional.
-    #
-    make
-    rm -f gcc/as
-    make || exit 1
-    #
-    # End workaround
-    #
-    make install || exit 1
+    make -j4
+    make install
 
     cd ${BUILD_DIR}
 }
@@ -274,12 +273,9 @@
     echo ""
     echo ""
 
-    mkdir -p gdb || exit 1
-    cd gdb || exit 1
+    mkdir -p gdb
+    cd gdb
 
-    PREV_CFLAGS=${CFLAGS}
-    export CFLAGS="-I${BASE_DIRECTORY}/w32api/include"
-
     ${BASE_DIRECTORY}/gdb/configure  \
 	--with-gcc                     \
 	--with-gnu-ld                  \
@@ -290,33 +286,34 @@
 	--disable-win32-registry       \
 	--disable-multilib             \
 	--disable-interwork            \
-	--enable-checking              \
-	|| exit 1
+	--enable-checking
 
     export CFLAGS=${PREV_CFLAGS}
 
-    make         || exit 1
-    make install || exit 1
+    make
+    make install
 
     cd ${BUILD_DIR}
 }
 
-build_gdbstub()
+build_gdbserver()
 {
     echo ""
-    echo "BUILDING GDB stub --------------------------"
+    echo "BUILDING gdbserver --------------------------"
     echo ""
     echo ""
 
-    STUB_EXE=${PREFIX}/bin/${TARGET}-stub.exe
-    STUB_SRC=${BASE_DIRECTORY}/gdb/gdb/wince-stub.c
+    mkdir -p gdbserver
+    cd gdbserver
 
-    ${TARGET}-gcc -O2  \
-           ${STUB_SRC}         \
-           -o ${STUB_EXE}      \
-           -lwinsock || exit 1
-    ${TARGET}-strip ${STUB_EXE} || exit 1
+    ${BASE_DIRECTORY}/gdb/gdbserver/configure  \
+	--target=${TARGET}             \
+	--host=${TARGET}               \
+	--prefix=${PREFIX}             \
 
+    make
+    make install
+
     cd ${BUILD_DIR}
 }
 
@@ -327,19 +324,19 @@
     echo ""
     echo ""
 
-    mkdir -p ${PREFIX}/share/docs || exit 1
-    mkdir -p ${PREFIX}/share/images || exit 1
+    mkdir -p ${PREFIX}/share/docs
+    mkdir -p ${PREFIX}/share/images
 
-    cd ${BASE_DIRECTORY}/../docs || exit 1
-    tar cf - . | (cd ${PREFIX}/share/docs; tar xf -) || exit 1
-    cd ${BASE_DIRECTORY}/../website || exit 1
-    tar cf - images | (cd ${PREFIX}/share; tar xf -) || exit 1
+    cd ${BASE_DIRECTORY}/../docs
+    tar cf - . | (cd ${PREFIX}/share/docs; tar xf -)
+    cd ${BASE_DIRECTORY}/../website
+    tar cf - images | (cd ${PREFIX}/share; tar xf -)
 
-    cd ${BASE_DIRECTORY}/.. || exit 1
-    cp NEWS README ${PREFIX} || exit 1
-    cp src/binutils/COPYING ${PREFIX} || exit 1
-    cp src/binutils/COPYING.LIB ${PREFIX} || exit 1
-    cp src/newlib/COPYING.NEWLIB ${PREFIX} || exit 1
+    cd ${BASE_DIRECTORY}/..
+    cp NEWS README ${PREFIX}
+    cp src/binutils/COPYING ${PREFIX}
+    cp src/binutils/COPYING.LIB ${PREFIX}
+    cp src/newlib/COPYING.NEWLIB ${PREFIX}
 
     cd ${BUILD_DIR}
 }
@@ -351,7 +348,7 @@
     echo ""
     echo ""
 
-    mkdir -p profile || exit 1
+    mkdir -p profile
     cd profile
 
     ${BASE_DIRECTORY}/profile/configure  \
@@ -361,8 +358,8 @@
 	--prefix=${PREFIX}            \
 	|| exit
 
-    make         || exit 1
-    make install || exit 1
+    make
+    make install
 
     cd ${BUILD_DIR}
 }
@@ -376,11 +373,11 @@
 
     cd ${BUILD_DIR}
 
-    mkdir -p dll || exit 1
+    mkdir -p dll
     cd dll
 
-    cd ${BASE_DIRECTORY} || exit 1
-    ${BASE_DIRECTORY}/build-mingw32ce-dlls.sh || exit 1
+    cd ${BASE_DIRECTORY}
+    ${BASE_DIRECTORY}/build-mingw32ce-dlls.sh
 
     cd ${BUILD_DIR}
 }
@@ -394,25 +391,19 @@
 
     cd ${BUILD_DIR}
 
-    cd ${BASE_DIRECTORY}/mingwdll || exit 1
-    make         || exit 1
-    make install || exit 1
+    cd ${BASE_DIRECTORY}/mingwdll
+    make
+    make install
 
     cd ${BUILD_DIR}
 }
 
 build_all()
 {
-    build_binutils
-    build_bootstrap_gcc
-    build_mingw_runtime
-    build_w32api
-    build_gcc
-    build_docs
-    build_profile
-    build_gdb
-    build_gdbstub
-    build_dlls
+    for ((i=0;i<$COMPONENTS_NUM;i++)); do
+	comp=${COMPONENTS[${i}]}
+	build_$comp
+    done
 }
 
 split_components=`echo "${components}" | sed -e 's/,/ /g'`
@@ -420,16 +411,19 @@
 # check for valid options before trying to build them all.
 eval "set -- $split_components"
 while [ -n "$1" ]; do
-    case $1 in
-	binutils | bootstrapgcc | w32api | \
-	    mingw | gcc | gdb | gdbstub | \
-	    docs | profile | dlls | all) 
-	    ;;
-	*)
+    if [ "$1" != "all" ]; then
+	found=false
+	for ((i=0;i<$COMPONENTS_NUM;i++)); do
+	    if [ "${COMPONENTS[${i}]}" = "$1" ]; then
+		found=true
+	    fi
+	done
+	if [ $found = false ] ; then
 	    echo "Please enter a valid build option."
 	    exit 1
-	    ;;
-    esac
+	fi
+    fi
+
     shift
 done
 
@@ -444,25 +438,13 @@
 echo "prefix: ${PREFIX}"
 echo "components: ${components}"
 
-mkdir -p ${BUILD_DIR} || exit 1
-mkdir -p ${PREFIX} || exit 1
+mkdir -p ${BUILD_DIR}
+mkdir -p ${PREFIX}
 
-# now actually try to build them.
+# Now actually build them.
 eval "set -- $split_components"
 while [ -n "$1" ]; do
-    case $1 in
-	binutils) build_binutils ;;
-	bootstrapgcc) build_bootstrap_gcc ;;
-	w32api) build_w32api ;;
-	mingw) build_mingw_runtime ;;
-	gcc) build_gcc ;;
-	gdb) build_gdb ;;
-	gdbstub) build_gdbstub ;;
-	docs) build_docs ;;
-	profile) build_profile ;;
-	dlls) build_dlls ;;
-	all) build_all ;;
-    esac
+    build_${1}
     shift
 done
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-09-18 14:25:16
      
     | 
| Revision: 1182
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1182&view=rev
Author:   dannybackx
Date:     2008-09-18 21:25:14 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Roll back last change
Modified Paths:
--------------
    trunk/cegcc/src/mingw/ChangeLog.mingw32ce
    trunk/cegcc/src/mingw/include/stdlib.h
Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce
===================================================================
--- trunk/cegcc/src/mingw/ChangeLog.mingw32ce	2008-09-18 21:16:02 UTC (rev 1181)
+++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce	2008-09-18 21:25:14 UTC (rev 1182)
@@ -1,7 +1,3 @@
-2008-09-04  Danny Backx  <dan...@us...>
-
-	* include/stdlib.h : Don't define getenv and system on CE.
-
 2007-12-25  Pedro Alves  <ped...@po...>
 
 	* Makefile.in, mingwex/Makefile.in, profile/Makefile.in: Use
Modified: trunk/cegcc/src/mingw/include/stdlib.h
===================================================================
--- trunk/cegcc/src/mingw/include/stdlib.h	2008-09-18 21:16:02 UTC (rev 1181)
+++ trunk/cegcc/src/mingw/include/stdlib.h	2008-09-18 21:25:14 UTC (rev 1182)
@@ -380,12 +380,10 @@
 /* Note: This is in startup code, not imported directly from dll */
 int __cdecl	atexit	(void (*)(void));
 
-#ifndef _WIN32_WCE
 #ifndef __COREDLL__
 _CRTIMP int __cdecl	system	(const char*);
 _CRTIMP char* __cdecl	getenv	(const char*);
 #endif
-#endif
 
 /* bsearch and qsort are also in non-ANSI header search.h  */
 _CRTIMP void* __cdecl	bsearch	(const void*, const void*, size_t, size_t, 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-09-16 15:57:05
      
     | 
| Revision: 1177
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1177&view=rev
Author:   dannybackx
Date:     2008-09-16 22:57:02 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
2008-09-12  Pawel Veselov <paw...@gm...>
        * newlib/newlib/libc/include/stdlib.h : added realpath() declaration
        * newlib/libc/sys/wince/Makefile.in newlib/libc/sys/wince/Makefile.am :
          compile realpath.c
        * newlib/libc/sys/wince/sys/unistd.h : declare fdatasync()
        * newlib/libc/sys/wince/realpath.c : defines realpath(), Linux compliant
        * newlib/libc/sys/wince/getcwd.c : buffer is now allocated if NULL.
          ENOENT is returned if current directory doesn't exist
Modified Paths:
--------------
    trunk/cegcc/src/newlib/ChangeLog.cegcc
    trunk/cegcc/src/newlib/newlib/libc/include/stdlib.h
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.am
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.in
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/getcwd.c
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/unistd.h
Added Paths:
-----------
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/realpath.c
Modified: trunk/cegcc/src/newlib/ChangeLog.cegcc
===================================================================
--- trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-09-16 22:44:29 UTC (rev 1176)
+++ trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-09-16 22:57:02 UTC (rev 1177)
@@ -1,3 +1,12 @@
+2008-09-12  Pawel Veselov <paw...@gm...>
+        * newlib/newlib/libc/include/stdlib.h : added realpath() declaration
+        * newlib/libc/sys/wince/Makefile.in newlib/libc/sys/wince/Makefile.am :
+          compile realpath.c
+        * newlib/libc/sys/wince/sys/unistd.h : declare fdatasync()
+        * newlib/libc/sys/wince/realpath.c : defines realpath(), Linux compliant
+        * newlib/libc/sys/wince/getcwd.c : buffer is now allocated if NULL.
+          ENOENT is returned if current directory doesn't exist
+
 2008-08-29  Pawel Veselov <paw...@gm...>
 	* newlib/libc/sys/wince/io.c (fsync, fdatasync) : Implement.
 	* newlib/libc/sys/wince/sys/io.h newlib/libc/sys/wince/io.c
Modified: trunk/cegcc/src/newlib/newlib/libc/include/stdlib.h
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/include/stdlib.h	2008-09-16 22:44:29 UTC (rev 1176)
+++ trunk/cegcc/src/newlib/newlib/libc/include/stdlib.h	2008-09-16 22:57:02 UTC (rev 1177)
@@ -122,6 +122,7 @@
 int	_EXFUN(system,(const char *__string));
 
 #ifndef __STRICT_ANSI__
+char *  _EXFUN(realpath,(const char *__path, char *__resolved_path)); 
 long    _EXFUN(a64l,(const char *__input));
 char *  _EXFUN(l64a,(long __input));
 char *  _EXFUN(_l64a_r,(struct _reent *,long __input));
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.am
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.am	2008-09-16 22:44:29 UTC (rev 1176)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.am	2008-09-16 22:57:02 UTC (rev 1177)
@@ -8,7 +8,7 @@
 
 net_SOURCES = ascii2addr.c htons.c htonl.c inet_aton.c inet_lnaof.c inet_mkadr.c \
 			  inet_net.c inet_netof.c inet_ntoa.c msnet.c wsdb.c rexec.c wsstrerror.c
-unix_SOURCES = getcwd.c getlogin.c sleep.c usleep.c vfork.c
+unix_SOURCES = getcwd.c getlogin.c sleep.c usleep.c vfork.c realpath.c
 celib_SOURCES = cecopyfile.c cefileattr.c cefindfile.c cefixpath.c ceirda.c ceutil.c cethread.c cemakeunixpath.c \
 				cemovefile.c cecreatefile.c cecreatefilemap.c ceregistry.c cecurrentdir.c ceprofile.c \
 				ceshared2.c ceremovedir.c cemisc.c
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.in
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.in	2008-09-16 22:44:29 UTC (rev 1176)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/Makefile.in	2008-09-16 22:57:02 UTC (rev 1177)
@@ -86,7 +86,7 @@
 
 net_SOURCES = ascii2addr.c htons.c htonl.c inet_aton.c inet_lnaof.c inet_mkadr.c 			  inet_net.c inet_netof.c inet_ntoa.c msnet.c wsdb.c rexec.c wsstrerror.c
 
-unix_SOURCES = getcwd.c getlogin.c sleep.c usleep.c vfork.c
+unix_SOURCES = getcwd.c getlogin.c sleep.c usleep.c vfork.c realpath.c
 celib_SOURCES = cecopyfile.c cefileattr.c cefindfile.c cefixpath.c ceirda.c ceutil.c cethread.c cemakeunixpath.c 				cemovefile.c cecreatefile.c cecreatefilemap.c ceregistry.c cecurrentdir.c ceprofile.c 				ceshared2.c ceremovedir.c cemisc.c
 
 
@@ -116,7 +116,7 @@
 trace.o tzset_hook_r.o uid.o unistd.o utime.o main.o ascii2addr.o \
 htons.o htonl.o inet_aton.o inet_lnaof.o inet_mkadr.o inet_net.o \
 inet_netof.o inet_ntoa.o msnet.o wsdb.o rexec.o wsstrerror.o getcwd.o \
-getlogin.o sleep.o usleep.o vfork.o cecopyfile.o cefileattr.o \
+getlogin.o realpath.o sleep.o usleep.o vfork.o cecopyfile.o cefileattr.o \
 cefindfile.o cefixpath.o ceirda.o ceutil.o cethread.o cemakeunixpath.o \
 cemovefile.o cecreatefile.o cecreatefilemap.o ceregistry.o \
 cecurrentdir.o ceprofile.o ceshared2.o ceremovedir.o cemisc.o _crt_mt.o \
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/getcwd.c
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/getcwd.c	2008-09-16 22:44:29 UTC (rev 1176)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/getcwd.c	2008-09-16 22:57:02 UTC (rev 1177)
@@ -68,9 +68,33 @@
 char *
 getcwd(char *buf, size_t size)
 {
-  /* This is NOT compliant with what Linux does.. */
-  if (buf == NULL || size == 0) {
-	/* ### TODO malloc a buffer here. Be careful with size-1 below */
+
+    int alloced = 0;
+
+  // realize glibc behavior to allocate buffer if the buf is 0.
+  // This is also a POSIX.1-2001 extension
+
+  if (!buf) {
+    if (!size) {
+        size = XCEGetCurrentDirectoryW(0, 0); // fastest way to get size
+        if (!size) {
+            WCETRACE(WCE_IO, "getcwd WARNING: curr dir is unset");
+            // ENOENT The current working directory has been unlinked.
+            errno = ENOENT;
+            return NULL;
+        }
+    }
+
+    buf = malloc(size);
+    if (!buf) {
+        errno = ENOMEM;
+        return NULL;
+    }
+    alloced = 1;
+
+  } else if (!size) {
+    // EINVAL The size argument is zero and buf is not a null pointer.
+    errno = EINVAL;
     return(NULL);
   }
 
@@ -78,18 +102,32 @@
 
   if (len > size)
   {
-	  XCEToUnixPath(buf, size-1);
-	  errno = ERANGE;
-	  return(NULL);
+    // XCEToUnixPath(buf, size-1);
+    // ^^ commented out, why do we care? the spec says:
+    // the contents of the array pointed to by buf is undefined on error.
+    errno = ERANGE;
+    return(NULL);
   }
   else if (!len)
   {
-	  WCETRACE(WCE_IO, "getcwd WARNING: curr dir is unset");
-	  return NULL;
+    WCETRACE(WCE_IO, "getcwd WARNING: curr dir is unset");
+    // ENOENT The current working directory has been unlinked.
+    // well, that's the next best thing
+    errno = ENOENT;
+    return NULL;
   }
   else
   {
-	  XCEToUnixPath(buf, -1);
+    struct stat st;
+    XCEToUnixPath(buf, -1);
+    if (lstat(buf, &st)) {
+        // ENOENT The current working directory has been unlinked.
+        if (alloced) {
+            free(buf);
+        }
+        errno = ENOENT;
+        return NULL;
+    }
   }
   return buf;
 }
Added: trunk/cegcc/src/newlib/newlib/libc/sys/wince/realpath.c
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/realpath.c	                        (rev 0)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/realpath.c	2008-09-16 22:57:02 UTC (rev 1177)
@@ -0,0 +1,165 @@
+/* realpath.c - Return the canonicalized absolute pathname */
+
+/* Written 2000 by Werner Almesberger */
+/* Adapted for WINCE */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <limits.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+char *realpath(const char *path, char *resolved_path) {
+
+    char *path_copy;
+    char *aptr;
+    int res;
+    int alloced = 0;
+
+    if (!path) {
+	errno = EINVAL;
+	return NULL;
+    } else if (!*path) {
+        errno = ENOENT;
+        return NULL;
+    }
+
+    path_copy = strdup(path);
+    if (!path_copy) {
+        errno = ENOMEM;
+        return NULL;
+    }
+    
+    // Since this is wince, there is no way we can have '\' characters
+    // in file/dir names. So we might as well replace them with '/', won't
+    // change nothing.
+
+    aptr = path_copy;
+    while (aptr = strchr(aptr, '\\')) { *(aptr++) = '/'; }
+
+    if (*path_copy != '/') {
+
+        // then we need current directory
+        char * cwd = getcwd(0,0);
+        if (!cwd) {
+            // this should only be ENOENT, or ENOMEM
+            free(path_copy);
+            return NULL;
+        }
+
+        aptr = malloc(strlen(cwd) + strlen(path_copy) + 2);
+
+        if (aptr) {
+            strcpy(aptr, cwd);
+            strcat(aptr, "/");
+            strcpy(aptr, path_copy);
+        }
+
+        free(path_copy);
+        free(cwd);
+        if (!aptr) {
+            errno = ENOMEM;
+            return NULL;
+        }
+        path_copy = aptr;
+    }
+
+    // remove any trailing slashes
+    aptr = path_copy + strlen(path_copy) - 1;
+    while (aptr > path_copy && *aptr == '/') { *(aptr--) = 0; }
+
+    if (!resolved_path) {
+        // since there are no symlinks on WinCE, we are lucky,
+        // the resolved path will never exceed this path
+        resolved_path = malloc(strlen(path_copy)+1);
+        alloced = 1;
+    }
+
+    *resolved_path = '/';
+    resolved_path[1] = 0; // ought to be faster than strcpy
+
+    aptr = path_copy;
+    struct stat st;
+
+    while (1) {
+
+        while (*aptr == '/') { aptr++; }
+
+        // are we done?
+        if (!*aptr) { break; }
+
+        // find next slash
+        char * slash = strchr(aptr, '/');
+        if (slash) {
+            *slash = 0;
+        }
+
+        if (*aptr == '.') {
+            if (!aptr[1]) {
+                // encountered "."
+                // nothing to do
+                if (!slash) { break; }
+                aptr = slash + 1;
+                continue;
+            } 
+            if (aptr[1] == '.' && !aptr[2]) {
+                // encountered ".."
+                // so rewind the path one element back
+                char * prev_slash = strrchr(resolved_path, '/');
+                if (prev_slash == resolved_path) {
+                    // if the only thing in the path now is the 
+                    // root, then the root just remains there
+                    prev_slash++;
+                }
+                *prev_slash = 0;
+
+                if (!slash) { break; }
+                aptr = slash + 1;
+                continue;
+            }
+        }
+
+        if (resolved_path[1]) {
+            strcat(resolved_path, "/");
+        }
+
+        strcat(resolved_path, aptr);
+
+        if (slash) {
+
+            if (lstat(resolved_path, &st)) {
+                
+                if (alloced) {
+                    free(resolved_path);
+                }
+                free(path_copy);
+
+                errno = EACCES;
+                return NULL;
+
+            }
+
+            if (!(st.st_mode & S_IFDIR)) {
+                // there are more entries ahead, but this one is
+                // not a directory. tsk-tsk
+                if (alloced) { free(resolved_path); }
+                free(path_copy);
+                errno = ENOTDIR;
+                return NULL;
+            }
+
+        } else {
+            break;
+        }
+
+        aptr = slash + 1;
+        continue;
+
+    }
+
+    free(path_copy);
+    return resolved_path;
+    
+}
+
Property changes on: trunk/cegcc/src/newlib/newlib/libc/sys/wince/realpath.c
___________________________________________________________________
Added: svn:eol-style
   + native
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/unistd.h
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/unistd.h	2008-09-16 22:44:29 UTC (rev 1176)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/unistd.h	2008-09-16 22:57:02 UTC (rev 1177)
@@ -21,6 +21,7 @@
 int     _EXFUN(chdir, (const char *__path ));
 int     _EXFUN(chmod, (const char *__path, mode_t __mode ));
 int     _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group ));
+int     _EXFUN(fdatasync, (int __fd));
 #if defined(__CYGWIN__) || defined(__rtems__)
 int     _EXFUN(chroot, (const char *__path ));
 #endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-09-16 15:44:31
      
     | 
| Revision: 1176
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1176&view=rev
Author:   dannybackx
Date:     2008-09-16 22:44:29 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
Remove gcc-4.3.0, will probably replace this with 4.3.2 shortly.
Removed Paths:
-------------
    trunk/cegcc/src/gcc-4.3.0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-09-16 15:23:20
      
     | 
| Revision: 1175
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1175&view=rev
Author:   dannybackx
Date:     2008-09-16 22:23:17 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
Remove gdb, we can use gdb 6.8 unmodified.
Removed Paths:
-------------
    trunk/cegcc/src/gdb/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-14 19:47:24
      
     | 
| Revision: 1174
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1174&view=rev
Author:   pedroalves
Date:     2008-09-14 19:47:22 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
Point to the archives and how to subscribe, not directly to the
mailing list address.
Modified Paths:
--------------
    trunk/cegcc/website/index.html
Modified: trunk/cegcc/website/index.html
===================================================================
--- trunk/cegcc/website/index.html	2008-09-14 19:14:41 UTC (rev 1173)
+++ trunk/cegcc/website/index.html	2008-09-14 19:47:22 UTC (rev 1174)
@@ -99,9 +99,9 @@
 		<h2 align=center>Support</h2>
 		<ul>
 			<li> <a href="docs/faq.html">Frequently asked questions ? Read the FAQ</a>.
-			<li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>.
+			<li> <a href="https://sourceforge.net/mail/?group_id=173455">Questions? Use the cegcc-devel mailing list</a>.
 			<li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a>
-			<LI><A HREF="docs/reporting.html">Information to including when asking help or when reporting problems</A></LI>
+			<li><a href="docs/reporting.html">Information to including when asking help or when reporting problems</a></li>
 		</ul>
 	</td>
 </tr></table>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ped...@us...> - 2008-09-14 19:14:43
      
     | 
| Revision: 1173
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1173&view=rev
Author:   pedroalves
Date:     2008-09-14 19:14:41 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
Put things in their right place.
Modified Paths:
--------------
    trunk/cegcc/src/ChangeLog
    trunk/cegcc/src/w32api/ChangeLog.ce
Added Paths:
-----------
    trunk/cegcc/src/cegcc/ChangeLog
Modified: trunk/cegcc/src/ChangeLog
===================================================================
--- trunk/cegcc/src/ChangeLog	2008-09-04 18:45:10 UTC (rev 1172)
+++ trunk/cegcc/src/ChangeLog	2008-09-14 19:14:41 UTC (rev 1173)
@@ -3,12 +3,6 @@
 	* build-cegcc.sh : Remove all instances of the function keyword for
 	POSIX compliance. Based on info by Mosfet, see the mailing list.
 
-2008-06-20  Eric House <ee...@ee...>
-
-	* cegcc/importlibs/defs/aygshell.def, w32api/include/aygshell.h,
-	w32api/libce/aygshell.def (SHSendBackToFocusWindow, SHMBOF_NODEFAULT,
-	SHMBOF_NOTIFY, SHCMBM_OVERRIDEKEY, VK_TBACK) : Define.
-
 2008-06-20  Danny Backx  <dan...@us...>
 
 	* build-mingw32ce.sh: Export BASE_DIRECTORY, the mingwdll build stuff
Added: trunk/cegcc/src/cegcc/ChangeLog
===================================================================
--- trunk/cegcc/src/cegcc/ChangeLog	                        (rev 0)
+++ trunk/cegcc/src/cegcc/ChangeLog	2008-09-14 19:14:41 UTC (rev 1173)
@@ -0,0 +1,3 @@
+2008-06-20  Eric House <ee...@ee...>
+
+	* importlibs/defs/aygshell.def (SHSendBackToFocusWindow): Define.
Property changes on: trunk/cegcc/src/cegcc/ChangeLog
___________________________________________________________________
Added: svn:eol-style
   + native
Modified: trunk/cegcc/src/w32api/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/w32api/ChangeLog.ce	2008-09-04 18:45:10 UTC (rev 1172)
+++ trunk/cegcc/src/w32api/ChangeLog.ce	2008-09-14 19:14:41 UTC (rev 1173)
@@ -3,6 +3,13 @@
 	* include/winbase.h: Fix SetSystemPowerState as indicated by Klaus
 	Rechert.
 
+2008-06-20  Eric House  <ee...@ee...>
+
+	* libce/aygshell.def (SHSendBackToFocusWindow): Define.
+	* include/aygshell.h (SHSendBackToFocusWindow): Declare.
+	(SHMBOF_NODEFAULT, SHMBOF_NOTIFY, SHCMBM_OVERRIDEKEY, VK_TBACK):
+	Define.
+
 2008-06-20  Danny Backx  <dan...@us...>
 
 	* include/aygshell.h: Include prsht.h.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-09-04 18:45:12
      
     | 
| Revision: 1172
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1172&view=rev
Author:   dannybackx
Date:     2008-09-04 18:45:10 +0000 (Thu, 04 Sep 2008)
Log Message:
-----------
Don't define getenv and system.
Modified Paths:
--------------
    trunk/cegcc/src/mingw/ChangeLog.mingw32ce
    trunk/cegcc/src/mingw/include/stdlib.h
Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce
===================================================================
--- trunk/cegcc/src/mingw/ChangeLog.mingw32ce	2008-09-04 18:28:26 UTC (rev 1171)
+++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce	2008-09-04 18:45:10 UTC (rev 1172)
@@ -1,3 +1,7 @@
+2008-09-04  Danny Backx  <dan...@us...>
+
+	* include/stdlib.h : Don't define getenv and system on CE.
+
 2007-12-25  Pedro Alves  <ped...@po...>
 
 	* Makefile.in, mingwex/Makefile.in, profile/Makefile.in: Use
Modified: trunk/cegcc/src/mingw/include/stdlib.h
===================================================================
--- trunk/cegcc/src/mingw/include/stdlib.h	2008-09-04 18:28:26 UTC (rev 1171)
+++ trunk/cegcc/src/mingw/include/stdlib.h	2008-09-04 18:45:10 UTC (rev 1172)
@@ -380,10 +380,12 @@
 /* Note: This is in startup code, not imported directly from dll */
 int __cdecl	atexit	(void (*)(void));
 
+#ifndef _WIN32_WCE
 #ifndef __COREDLL__
 _CRTIMP int __cdecl	system	(const char*);
 _CRTIMP char* __cdecl	getenv	(const char*);
 #endif
+#endif
 
 /* bsearch and qsort are also in non-ANSI header search.h  */
 _CRTIMP void* __cdecl	bsearch	(const void*, const void*, size_t, size_t, 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-09-04 18:28:29
      
     | 
| Revision: 1171
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1171&view=rev
Author:   dannybackx
Date:     2008-09-04 18:28:26 +0000 (Thu, 04 Sep 2008)
Log Message:
-----------
Fix SetSystemPowerState as indicated by Klaus Rechert
Modified Paths:
--------------
    trunk/cegcc/src/w32api/ChangeLog.ce
    trunk/cegcc/src/w32api/include/winbase.h
Modified: trunk/cegcc/src/w32api/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/w32api/ChangeLog.ce	2008-08-30 07:52:10 UTC (rev 1170)
+++ trunk/cegcc/src/w32api/ChangeLog.ce	2008-09-04 18:28:26 UTC (rev 1171)
@@ -1,3 +1,8 @@
+2008-09-04  Danny Backx  <dan...@us...>
+
+	* include/winbase.h: Fix SetSystemPowerState as indicated by Klaus
+	Rechert.
+
 2008-06-20  Danny Backx  <dan...@us...>
 
 	* include/aygshell.h: Include prsht.h.
Modified: trunk/cegcc/src/w32api/include/winbase.h
===================================================================
--- trunk/cegcc/src/w32api/include/winbase.h	2008-08-30 07:52:10 UTC (rev 1170)
+++ trunk/cegcc/src/w32api/include/winbase.h	2008-09-04 18:28:26 UTC (rev 1171)
@@ -2027,7 +2027,12 @@
 WINBASEAPI BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);
 WINBASEAPI BOOL WINAPI SetStdHandle(DWORD,HANDLE);
 #define SetSwapAreaSize(w) (w)
+#if (_WIN32_WCE >= 0x0400)
+WINBASEAPI DWORD WINAPI SetSystemPowerState(LPCWSTR, DWORD, DWORD);
+#else
+/* Only on Windows Server 2008, Windows Server 2003, or Windows 2000 Server. */
 WINBASEAPI BOOL WINAPI SetSystemPowerState(BOOL,BOOL);
+#endif
 WINBASEAPI BOOL WINAPI SetSystemTime(const SYSTEMTIME*);
 WINBASEAPI BOOL WINAPI SetSystemTimeAdjustment(DWORD,BOOL);
 WINBASEAPI DWORD WINAPI SetTapeParameters(HANDLE,DWORD,PVOID);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-08-30 07:52:12
      
     | 
| Revision: 1170
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1170&view=rev
Author:   dannybackx
Date:     2008-08-30 07:52:10 +0000 (Sat, 30 Aug 2008)
Log Message:
-----------
Implement fsync and fdatasync
Modified Paths:
--------------
    trunk/cegcc/src/newlib/ChangeLog.cegcc
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c
Modified: trunk/cegcc/src/newlib/ChangeLog.cegcc
===================================================================
--- trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-08-30 07:46:02 UTC (rev 1169)
+++ trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-08-30 07:52:10 UTC (rev 1170)
@@ -1,6 +1,7 @@
 2008-08-29  Pawel Veselov <paw...@gm...>
+	* newlib/libc/sys/wince/io.c (fsync, fdatasync) : Implement.
 	* newlib/libc/sys/wince/sys/io.h newlib/libc/sys/wince/io.c
-	newlib/libc/sys/wince/stat.c : add critical section parameter
+	newlib/libc/sys/wince/stat.c : Add critical section parameter
 	to FDCHECK to prevent deadlock when FDCHECK returns.
 
 2008-06-10  Danny Backx  <dan...@us...>
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c	2008-08-30 07:46:02 UTC (rev 1169)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c	2008-08-30 07:52:10 UTC (rev 1170)
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <string.h>
+#include <sys/unistd.h>
 #include <fcntl.h>
 #include <reent.h>
 #include <errno.h>
@@ -99,6 +100,21 @@
   LeaveCriticalSection(&critsect);
 }
 
+int fsync(int fd) {
+  WCETRACE(WCE_IO, "syncing descriptor %d", fd);
+  FDCHECK(fd, 0);
+  if (FlushFileBuffers(_fdtab[fd].hnd)) {
+      errno = _winerr2errno(GetLastError());
+      WCETRACE(WCE_IO, "FlushFileBuffers(%d): errno=%d oserr=%d\n", fd, errno, GetLastError());
+      return -1;
+  }
+  return 0;
+}
+
+int fdatasync(int fd) {
+    return fsync(fd);
+}
+
 void
 _initfds()
 {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-08-30 07:46:06
      
     | 
| Revision: 1169
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1169&view=rev
Author:   dannybackx
Date:     2008-08-30 07:46:02 +0000 (Sat, 30 Aug 2008)
Log Message:
-----------
Prevent abandoning critical section lock when calling close() on an
invalid file descriptor.
Modified Paths:
--------------
    trunk/cegcc/src/newlib/ChangeLog.cegcc
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/stat.c
    trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/io.h
Modified: trunk/cegcc/src/newlib/ChangeLog.cegcc
===================================================================
--- trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-08-01 20:35:28 UTC (rev 1168)
+++ trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-08-30 07:46:02 UTC (rev 1169)
@@ -1,3 +1,8 @@
+2008-08-29  Pawel Veselov <paw...@gm...>
+	* newlib/libc/sys/wince/sys/io.h newlib/libc/sys/wince/io.c
+	newlib/libc/sys/wince/stat.c : add critical section parameter
+	to FDCHECK to prevent deadlock when FDCHECK returns.
+
 2008-06-10  Danny Backx  <dan...@us...>
 
 	* newlib/libc/include/stdio.h (P_tmpdir) : Point to a directory that
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c	2008-08-01 20:35:28 UTC (rev 1168)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/io.c	2008-08-30 07:46:02 UTC (rev 1169)
@@ -1,919 +1,919 @@
-#define __USE_W32_SOCKETS
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <fcntl.h>
-#include <reent.h>
-#include <errno.h>
-
-#include <sys/ioctl.h>
-#include <sys/sysconf.h>
-#include <sys/io.h>
-#include <sys/fifo.h>
-
-#include "sys/wcetrace.h"
-
-#include <winsock2.h>
-
-void* _fifo_alloc();
-
-static int fdsinitialized = 0;
-static CRITICAL_SECTION critsect;
-
-/* mamaich: Used in hooking CreateFile/ReadFile/etc for transparent reading of RAR archives */
-typedef HANDLE pCreateFileW(LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
-typedef BOOL   pCloseHandle(HANDLE);
-typedef DWORD  pSetFilePointer(HANDLE, LONG, PLONG, DWORD);
-typedef BOOL   pReadFile(HANDLE, LPVOID, DWORD, LPDWORD, LPOVERLAPPED);
-typedef BOOL   pWriteFile(HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED);
-
-extern pCreateFileW XCECreateFileW;
-extern pCloseHandle XCECloseHandle;
-
-static pCreateFileW *_CreateFileW=XCECreateFileW;
-static pCloseHandle *_CloseHandle=XCECloseHandle;
-static pSetFilePointer *_SetFilePointer=SetFilePointer;
-static pReadFile *_ReadFile=ReadFile;
-static pWriteFile *_WriteFile=WriteFile;
-
-#if 1
-typedef int (* CONSOLE_READ_FUNC)(int, unsigned char *, int);
-typedef int (* CONSOLE_WRITE_FUNC)(int, const unsigned char *, int);
-typedef int (* CONSOLE_IOCTL_FUNC)(int, int, void *);
-
-HWND console_hwnd;
-CONSOLE_READ_FUNC  console_read_func;
-CONSOLE_WRITE_FUNC console_write_func;
-CONSOLE_IOCTL_FUNC console_ioctl_func;
-#endif
-
-void SetFileFuncs(void* CF, void *SFP, void *RF, void* WF, void *CH)
-{
-	_CreateFileW=(pCreateFileW*)CF;
-	_SetFilePointer=(pSetFilePointer*)SFP;
-	_ReadFile=(pReadFile*)RF;
-	_WriteFile=(pWriteFile*)WF;
-	_CloseHandle=(pCloseHandle*)CH;
-}
-
-_fdent_t _fdtab[MAXFDS];
-
-/* Prototypes from local.h that probably shouldn't be here.. */
-extern int __sclose(void *);
-extern _READ_WRITE_RETURN_TYPE __sread(void *, char *, int);
-extern _READ_WRITE_RETURN_TYPE __swrite(void *, char const *, int);
-extern fpos_t __sseek(void *, fpos_t, int);
-
-/* Public devops for devices we support */
-extern _DEVOPS _fifo_devops;
-
-int getfiletype(int fd)
-{
-	FDCHECK(fd);
-	return _fdtab[fd].type;
-}
-
-HANDLE get_osfhandle(int fd)
-{
-	if(fd < 0 || fd > MAXFDS || _fdtab[fd].fd == -1)
-		return INVALID_HANDLE_VALUE;
-	return _fdtab[fd].hFile;
-}
-
-static void 
-_initfds_p(int end)
-{
-  int i;
-
-  InitializeCriticalSection(&critsect);
-
-  EnterCriticalSection(&critsect);
-  for (i = 0; i < end; i++)
-  {
-    memset(&_fdtab[i], 0, sizeof(_fdtab[0]));
-    _fdtab[i].fd = -1;
-  }
-  LeaveCriticalSection(&critsect);
-}
-
-void
-_initfds()
-{
-  int i;
-
-  if (fdsinitialized)
-    return;
-  fdsinitialized = 1;
-
-  _initfds_p(MAXFDS);
-}
-
-void
-_initfds_std()
-{
-	/* stdin, stdio, stderr */
-  _initfds_p(3);
-}
-
-//void
-//_cleanupstdio()
-//{
-//	fclose(stderr);
-//	fclose(stdout);
-//	fclose(stdin);
-//}
-
-int __StdioInited = 0;
-
-void
-_initstdio()
-{
-  if(!__StdioInited)
-  {
-	  __StdioInited = 1;
-	  _initstdfd(stdin,  0, (HANDLE)_fileno(_getstdfilex(0)), __SRD);
-	  _initstdfd(stdout, 1, (HANDLE)_fileno(_getstdfilex(1)), __SWR);
-	  _initstdfd(stderr, 2, (HANDLE)_fileno(_getstdfilex(2)), __SWR);
-//	  atexit(_cleanupstdio);
-  }
-}
-
-int
-_getnewfd()
-{
-  int i;
-
-  EnterCriticalSection(&critsect);
-  for (i = 0; i < MAXFDS; i++) {
-    if (_fdtab[i].fd == -1)	{
-   	  _fdtab[i].flags = 0;
-      LeaveCriticalSection(&critsect);
-   	  return i;
-   	}
-  }
-  LeaveCriticalSection(&critsect);
-
-  WCETRACE(WCE_IO, "Out of file descriptors!");
-
-  return(-1);
-}
-
-void
-_setfd(int fd, int type, HANDLE hnd, int flags)
-{
-  _fdtab[fd].fd = fd;
-  _fdtab[fd].type = type;
-  _fdtab[fd].hnd = hnd;
-  _fdtab[fd].flags = flags;
-}
-
-int
-_assignfd(int type, HANDLE hnd, int flags)
-{
-  int fd;
-
-  WCETRACE(WCE_IO, "_assignfd(%x)", hnd);
-
-  if ((fd = _getnewfd()) >= 0)
-    _setfd(fd, type, hnd, flags);
-
-  WCETRACE(WCE_IO, "_assignfd returns %d", fd);
-  return(fd);
-}
-
-void
-_initstdfd(FILE *fp, int fd, HANDLE hnd, int flags)
-{
-  if (fd < 0 || fd > 2 || fp == NULL)
-    return;
-
-  _setfd(fd, IO_FILE_TYPE_CONSOLE, hnd, 0);
-
-  WCETRACE(WCE_IO, "_initstdfd: fd %d hnd %x", fd, hnd);
-
-  fp->_file = fd;
-  fp->_flags = flags;
-  fp->_cookie = (_PTR) fp;
-  fp->_read = __sread;
-  fp->_write = __swrite;
-  fp->_seek = __sseek;
-  fp->_close = __sclose;
-
-#ifdef __SCLE
-  if (__stextmode(fp->_file))
-    fp->_flags |= __SCLE;
-#endif
-}
-
-void
-_initstdfifofd(FILE *fp, int fd, int flags)
-{
-  if (fd < 0 || fd > 2 || fp == NULL)
-    return;
-
-  _fdtab[fd].type = IO_FILE_TYPE_FIFO;
-  _fdtab[fd].hnd = NULL;
-  _fdtab[fd].flags = 0;
-
-  WCETRACE(WCE_IO, "_initstdfifofd: fd %d fifofd %d", fd, _fdtab[fd].fd);
-
-  fp->_file = fd;
-  fp->_flags = flags;
-  fp->_cookie = (_PTR) fp;
-  fp->_read = __sread;
-  fp->_write = __swrite;
-  fp->_seek = __sseek;
-  fp->_close = __sclose;
-
-#ifdef __SCLE
-  if (__stextmode(fp->_file))
-    fp->_flags |= __SCLE;
-#endif
-}
-
-void
-_initecho(int stdinfd, int stdoutfd)
-{
-  _FIFOIOCXT fcxt = NULL;
-
-  WCETRACE(WCE_IO, "_initecho: stdinfd %d stdoutfd %d", stdinfd, stdoutfd);
-
-  if (stdinfd < 0 || stdoutfd < 0) {
-    WCETRACE(WCE_IO, "_initecho: ERROR invalid fds (%d,%d) giving up", stdinfd, stdoutfd);
-  }
-
-  fcxt = (_FIFOIOCXT) _fdtab[stdinfd].cxt;
-  WCETRACE(WCE_IO, "_initecho: fcxt %p", fcxt);
-  fflush(stdout);
-
-  if (fcxt == NULL) {
-    WCETRACE(WCE_IO, "_initecho: ERROR fcxt is NULL");
-    return;
-  }
-
-  if (_fdtab[stdoutfd].cxt == NULL) {
-    WCETRACE(WCE_IO, "_initecho: ERROR stdout cxt is NULL");
-    return;
-  }
-
-  fcxt->echofd = stdoutfd;
-  fcxt->echocxt = _fdtab[stdoutfd].cxt;
-}
-
-void *
-_getiocxt(int fd)
-{
-  if (fd < 0 || fd > MAXFDS - 1)
-    return(NULL);
-  return(_fdtab[fd].cxt);
-}
-
-void
-_ioatexit(void)
-{
-  int i;
-
-  WCETRACE(WCE_IO, "_ioatexit: STARTED");
-  for (i = 0; i < MAXFDS; i++) {
-    if (_fdtab[i].fd != -1)	{
-      if (_fdtab[i].type == IO_FILE_TYPE_FIFO) {
-        _close_r(NULL, i);
-   	  }
-    }
-  }
-}
-  
-int
-_open_r(struct _reent *reent, const char *path, int flags, int mode)
-{
-  wchar_t wpath[MAX_PATH];
-  char pathbuf[MAX_PATH];
-  HANDLE hnd = NULL;
-  DWORD fileaccess;
-  DWORD fileshare; 
-  DWORD filecreate;
-  DWORD fileattrib;
-  void *cxt;
-  int fd;
-
-  WCETRACE(WCE_IO, "open(%s, %x, %o)", path, flags, mode);
-
-  _initfds();
-
-  if (!strncmp("fifo", path, 4)) {
-	  fd = _assignfd(IO_FILE_TYPE_FIFO, NULL, 0);
-
-	  if (fd < 0) {
-		  errno = ENMFILE;
-		  return(-1);
-	  }
-
-	  _fdtab[fd].devops = _fifo_devops;
-	  _fdtab[fd].cxt = cxt = _fifo_alloc();
-	  if ((_fdtab[fd].fd = _fdtab[fd].devops->open_r(reent, path, flags, mode, cxt)) == -1) {
-		  WCETRACE(WCE_IO, "FIFO open fails, errno %d", errno);
-		  _fdtab[fd].fd = -1;
-		  return(-1);
-	  }
-  }
-  else if(!strncmp(path, "nul", 3) ||
-		  !strncmp(path, "nul:", 4) ||
-		  !strncmp(path, "null:", 5) ||
-		  !strncmp(path, "/dev/nul", 8) ||
-		  !strncmp(path, "/dev/null", 9))
-  {
-	  fd = _assignfd(IO_FILE_TYPE_NULL, (HANDLE) -1, 0);
-	  if (fd < 0) {
-		  errno = ENMFILE;
-		  return(-1);
-	  }
-	  _fdtab[fd].devops = NULL;
-	  _fdtab[fd].cxt = NULL;
-  } else {
-    if (strlen(path) >= MAX_PATH) {
-      WCETRACE(WCE_IO, "open fails, invalid path\n");
-      return(-1);
-    }
-
-    fixpath(path, pathbuf);
-    mbstowcs(wpath, pathbuf, strlen(pathbuf) + 1);
-
-    fileshare = FILE_SHARE_READ|FILE_SHARE_WRITE;
-    fileattrib = FILE_ATTRIBUTE_NORMAL;
-
-    switch (flags & (O_RDONLY | O_WRONLY | O_RDWR)) {
-    case O_RDONLY:              /* read access */
-      fileaccess = GENERIC_READ;
-      break;
-    case O_WRONLY:              /* write access */
-      fileaccess = GENERIC_WRITE;
-      break;
-    case O_RDWR:                /* read and write access */
-      fileaccess = GENERIC_READ | GENERIC_WRITE;
-      break;
-    default:                    /* error, bad flags */
-      errno = EINVAL;
-      return -1;
-    }
-
-    switch (flags & (O_CREAT | O_EXCL | O_TRUNC)) {
-    case 0:
-    case O_EXCL:                /* ignore EXCL w/o CREAT */
-      filecreate = OPEN_EXISTING;
-      break;
-    case O_CREAT:
-      filecreate = OPEN_ALWAYS;
-      break;
-    case O_CREAT | O_EXCL:
-    case O_CREAT | O_TRUNC | O_EXCL:
-      filecreate = CREATE_NEW;
-      break;
-
-    case O_TRUNC:
-    case O_TRUNC | O_EXCL:      /* ignore EXCL w/o CREAT */
-      filecreate = TRUNCATE_EXISTING;
-      break;
-    case O_CREAT | O_TRUNC:
-      filecreate = CREATE_ALWAYS;
-      break;
-    default:
-      /* this can't happen ... all cases are covered */
-      errno = EINVAL;
-      return(-1);
-    }
-
-    if ((hnd = _CreateFileW(wpath, fileaccess, fileshare, NULL, filecreate,
-                           fileattrib, NULL)) == INVALID_HANDLE_VALUE) {
-      errno = _winerr2errno(GetLastError());
-      WCETRACE(WCE_IO, "_CreateFile(%s): errno=%d oserr=%d\n", pathbuf, errno, GetLastError());
-      return(-1);
-    }
-
-    fd = _assignfd(IO_FILE_TYPE_FILE, hnd, 0);
-
-    if (fd < 0) {
-      errno = ENMFILE;
-      return(-1);
-    }
-    _fdtab[fd].devops = NULL;
-    _fdtab[fd].cxt = NULL;
-
-    if (flags & O_APPEND) {
-      _SetFilePointer(hnd, 0, NULL, FILE_END);
-    }
-  }
-
-  WCETRACE(WCE_IO, "open returns %d fd %d cxt %p (hnd %x)", fd, _fdtab[fd].fd, cxt, hnd);
-  return fd;
-}
-
-int
-_close_r(struct _reent *reent, int fd)
-{
-  WCETRACE(WCE_IO, "close(%d)", fd);
-  WCETRACE(WCE_IO, "close: fd %d type %d flags %x hnd %p cxt %p", _fdtab[fd].fd,
-           _fdtab[fd].type, _fdtab[fd].flags, _fdtab[fd].hnd, _fdtab[fd].cxt);
-
-  EnterCriticalSection(&critsect);
-  FDCHECK(fd);
-
-  if (_fdtab[fd].devops == NULL) {
-    if (_fdtab[fd].type == IO_FILE_TYPE_FILE) {
-      _CloseHandle(_fdtab[fd].hnd);
-    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
-      closesocket(fd);
-    } else if(_fdtab[fd].type == IO_FILE_TYPE_NULL) {
-    }
-  } else {
-    WCETRACE(WCE_IO, "close: doing device-specific close for fd %d", _fdtab[fd].fd);
-    _fdtab[fd].devops->close_r(reent, _fdtab[fd].fd, _fdtab[fd].cxt);
-    if (_fdtab[fd].cxt != NULL) {
-      free(_fdtab[fd].cxt);
-      _fdtab[fd].cxt = NULL;
-    }
-  }
-
-  /* IMPORTANT - reset fd fields here */
-  memset(&_fdtab[fd], 0, sizeof(_fdent_t));
-  _fdtab[fd].fd = -1;
-  LeaveCriticalSection(&critsect);
-
-  return(0);
-}
-
-_ssize_t
-_read_r(struct _reent *reent, int fd, void *buf, size_t count)
-{
-  int nread;
-  int error;
-
-  WCETRACE(WCE_IO, "read(fd = %d, count = %d, hnd %x)", fd, count, _fdtab[fd].hnd);
-
-  if ((!__StdioInited) && (fd >= 0) && (fd <= 2))
-  {
-    WCETRACE(WCE_IO, "read from fd = %d with stdio uninitialized", fd);
-	return count;
-  }
-
-  FDCHECK(fd);
-
-  if (_fdtab[fd].devops == NULL) {
-    if (_fdtab[fd].type == IO_FILE_TYPE_FILE || _fdtab[fd].type == IO_FILE_TYPE_CONSOLE) {
-      if (_ReadFile(_fdtab[fd].hnd, buf, count, (DWORD *)&nread, NULL) == FALSE) {
-        WCETRACE(WCE_IO, "_ReadFile: %d", GetLastError());
-        errno = EIO;
-        return(-1);
-      }
-    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
-      if ((nread = recv(fd, buf, count, 0)) == SOCKET_ERROR) {
-        /* error = WSAGetLastError(); */ 
-		error = 1;
-        WCETRACE(WCE_IO, "read: recv failed %d\n", error);
-        if (error == WSAEWOULDBLOCK) {
-          errno = EAGAIN;
-          return(-1);
-        }
-
-        errno = _winerr2errno(error);
-        return(-1);
-      }
-    } else if (_fdtab[fd].type == IO_FILE_TYPE_NULL) {
-      WCETRACE(WCE_IO, "warning - read called w/IO_FILE_TYPE_NULL");
-      nread = 0;
-    }
-  } else {
-    nread = _fdtab[fd].devops->read_r(reent, _fdtab[fd].fd, buf, count, _fdtab[fd].cxt);
-  }
-
-  return(nread);
-}
-
-_ssize_t
-_write_r(struct _reent *reent, int fd, const void *buf, size_t count){
-  int nwritten = 0;
-  int werr;
-
-  WCETRACE(WCE_IO, "write(%d, %d, %x)", fd, count, _fdtab[fd].hnd);
-  EnterCriticalSection(&critsect);
-
-#if 1
-  if (fd == 2 || fd == 1)
-  {
-	  const char* out = fd == 2?"stderr: ":"stdout: ";
-    WCETRACE(WCE_IO, "%s : %s", out, buf);
-  }
-#endif
-
-  /* until we can call console stuff inside the PE loader */
-  if ((!__StdioInited) && (fd >= 0) && (fd <= 2))
-  {
-    WCETRACE(WCE_IO, "write to fd = %d with stdio uninitialized", fd);
-	LeaveCriticalSection(&critsect);    
-	return count;
-  }
-
-  if (_fdtab[fd].devops == NULL) {
-    if (_fdtab[fd].type == IO_FILE_TYPE_FILE || _fdtab[fd].type == IO_FILE_TYPE_CONSOLE) {
-      if (_WriteFile(_fdtab[fd].hnd, buf, count, (DWORD *)&nwritten, NULL) == FALSE) {
-		if ((fd == 1 || fd == 2) && (_fdtab[fd].hnd == (HANDLE)-1))
-		{
-			/* ignore writting errors to stdout and stderr. happens when we don't have a console installed */ 
-			/* ### TODO replace this with something better */
-			nwritten = count;
-		}
-		else
-		{
-			WCETRACE(WCE_IO, "_WriteFile: hnd %x error %d\n", _fdtab[fd].hnd, GetLastError());
-			errno = EIO;
-        LeaveCriticalSection(&critsect);
-	        return(-1);
-		}
-      }
-    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
-      if ((nwritten = (int)send(fd, buf, count, 0)) == SOCKET_ERROR) {
-        /* werr = WSAGetLastError(); */ 
-        werr = 1;
-        WCETRACE(WCE_IO, "send: sock %d error %d",  _fdtab[fd].hnd, werr);
-        errno = _winerr2errno(werr);
-        LeaveCriticalSection(&critsect);
-        return(-1);
-      }
-    } else if (_fdtab[fd].type == IO_FILE_TYPE_NULL) {
-		// pretty normal, no?
-//      WCETRACE(WCE_IO, "warning - write called w/IO_FILE_TYPE_NULL");
-      nwritten = count;
-    }
-  } else {
-    nwritten = _fdtab[fd].devops->write_r(reent, _fdtab[fd].fd, buf, count, _fdtab[fd].cxt);
-  }
-
-  LeaveCriticalSection(&critsect);
-  return nwritten;
-}
-
-off_t
-_lseek_r(struct _reent *reent, int fd, off_t offset, int whence) {
-  off_t newpos;
-  int method;
-  WCETRACE(WCE_IO, "lseek(%d, %d, %d)", fd, offset, whence);
-
-  FDCHECK(fd);
-
-  if (_fdtab[fd].devops == NULL) {
-    switch (whence) {
-    case SEEK_SET:
-      method = FILE_BEGIN;
-      break;
-    case SEEK_CUR:
-      method = FILE_CURRENT;
-      break;
-    case SEEK_END:
-      method = FILE_END;
-      break;
-    default:
-      method = FILE_BEGIN;
-    }
-
-    if (_fdtab[fd].type == IO_FILE_TYPE_FILE) {
-      if ((newpos = _SetFilePointer(_fdtab[fd].hnd, (LONG)offset, NULL, (DWORD)method)) == -1) {
-        WCETRACE(WCE_IO, "_SetFilePointer(%x): error %d", _fdtab[fd].hnd, GetLastError());
-        errno = EIO;
-        newpos = -1;
-      } 
-    } else {
-      errno = EINVAL;
-      newpos = -1;
-    }
-  } else {
-    newpos = _fdtab[fd].devops->lseek_r(reent, _fdtab[fd].fd, offset, whence, _fdtab[fd].cxt);
-  }
-
-  WCETRACE(WCE_IO, "lseek returns %d", newpos);
-  return(newpos);
-}
-
-BOOL XCECopyFileW(
-  LPCWSTR lpExistingFileName, 
-  LPCWSTR lpNewFileName, 
-  BOOL bFailIfExists 
-); 
-
-int
-_link_r(struct _reent *reent, const char *old, const char *new)
-{
-  wchar_t wpathOld[MAX_PATH];
-  wchar_t wpathNew[MAX_PATH];
-  char pathOld[MAX_PATH];
-  char pathNew[MAX_PATH];
-  fixpath(old, pathOld);
-  fixpath(new, pathNew);
-  mbstowcs(wpathOld, pathOld, MAX_PATH);
-  mbstowcs(wpathNew, pathNew, MAX_PATH);
-  if(0==XCECopyFileW(wpathOld,wpathNew,FALSE))
-  {
-//    printf("failed rename '%s' to '%s'\n",pathOld,pathNew);
-  	errno = _winerr2errno(GetLastError());
-  	return(-1);
-  }
-  return 0;
-}
-
-int
-_unlink_r(struct _reent *reent, const char *path)
-{
-  wchar_t pathw[MAX_PATH];
-  char pathbuf[MAX_PATH];
-  BOOL res;
-
-  if (path == NULL)
-    return(-1);
-
-  fixpath(path, pathbuf);
-  mbstowcs(pathw, pathbuf, MAX_PATH);
-  res = DeleteFileW(pathw);
-
-  if (res == FALSE) {
-    errno = _winerr2errno(GetLastError());
-    return(-1);
-  }
-
-  return(0);
-}
-
-static int
-_fd_to_socket(struct fd_set *set, int *hndmap)
-{
-  int i;
-
-  if (set == NULL)
-    return(0);
-
-  for (i = 0; i < set->fd_count; i++) {
-    int fd = (int)set->fd_array[i];
-    FDCHECK(fd);
-
-    /* On WINCE, only IO_FILE_TYPE_SOCKET is handled */
-    if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
-      SOCKET s = _fdtab[fd].sock;
-      hndmap[fd] = s;
-      WCETRACE(WCE_IO, "_fd_to_socket: fd = %d, handle = %d", fd, s);
-      set->fd_array[i] = s;
-    } else {
-      WCETRACE(WCE_IO, "_fd_to_socket: fd = %d is not a socket", fd);
-    }
-  }
-  return(0);
-}
-
-static void
-_socket_to_fd(fd_set *set, int *hndmap)
-{
-  int i, j, fd;
-
-  if (set == NULL)
-    return;
-
-  if (set->fd_count > MAXFDS) {
-    WCETRACE(WCE_IO, "select (_socket_to_fd) ERROR fd_count > MAXFDS (%d > %d)",
-             set->fd_count, MAXFDS);
-  }
-
-  for (i = 0; i < set->fd_count; i++) {
-    fd = -1;
-    /* Hunt for matching hnd in the hndmap */    
-    for (j = 0; j < MAXFDS; j++) {
-      if (hndmap[j] == set->fd_array[i]) {
-        fd = j;
-        break;
-      }
-    }
-
-    if (fd < 0 || fd > MAXFDS) {
-      WCETRACE(WCE_IO, "_socket_to_fd: ERROR weird fd %d", fd);
-    } else {
-      set->fd_array[i] = fd;
-    }
-  }
-}
-
-#if 0
-int
-select(int n, fd_set *rfds, fd_set* wfds, fd_set* xfds, struct timeval *timeout)
-{
-  int i;
-  int status;
-  fd_set r, w, x;
-  int werr, hndmap[MAXFDS];
-  SOCKET s;
-
-  WCETRACE(WCE_IO, "select(%d, %p, %p, %p, %p)", n, rfds, wfds, xfds, timeout);
-  if (timeout != NULL) {
-    WCETRACE(WCE_IO, "select: timeout {%d,%d}", timeout->tv_sec, timeout->tv_usec);
-  }
-
-  /* Initialze hndmap - this is the SOCKET->fd mapping for use later */
-  for (i = 0; i < MAXFDS; i++)
-    hndmap[i] = -1;
-
-  if (rfds != NULL) {
-    if (_fd_to_socket(rfds, hndmap) < 0) {
-      WCETRACE(WCE_IO, "select: bad rfds");
-      return(-1);
-    }
-  }
-
-  if (wfds != NULL) {
-    if (_fd_to_socket(wfds, hndmap) < 0) {
-      WCETRACE(WCE_IO, "select: bad wfds");
-      return(-1);
-    }
-  }
-
-  if (xfds != NULL) {
-    if (_fd_to_socket(xfds, hndmap) < 0) {
-      WCETRACE(WCE_IO, "select: bad xfds");
-      return(-1);
-    }
-  }
-
-  status = __MS_select(n, rfds, wfds, xfds, timeout);
-  WCETRACE(WCE_IO, "select: returns %d errno %d", status, errno);
-
-  /* Give up here if there is an select error */
-  if (status == SOCKET_ERROR) {
-    int werr = XCEWSAGetLastError();
-    errno = _winerr2errno(werr);
-    return(-1);
-  }
-
-  /* Finally we must translate socket descriptors back to fds */
-  if (rfds != NULL)
-    _socket_to_fd(rfds, hndmap);
-
-  if (wfds != NULL) 
-    _socket_to_fd(wfds, hndmap);
-
-  if (xfds != NULL) 
-    _socket_to_fd(xfds, hndmap);
-
-  return(status);
-}
-#endif
-
-int
-ioctl(int fd, unsigned int request, void *arg)
-{
-  DWORD high, low;
-  int length, pos, avail, *iptr;
-  int werr;
-  SOCKET s;
-
-  WCETRACE(WCE_IO, "ioctl(%d, %p %p)", fd, request, arg);
-
-  FDCHECK(fd);
-
-  if (_fdtab[fd].devops == NULL) {
-    if (_fdtab[fd].type == IO_FILE_TYPE_FILE) {
-      switch (request) {
-      case FIONREAD:
-        if (arg == NULL) {
-          errno = EINVAL;
-          return(-1);
-        }
-        low = GetFileSize(_fdtab[fd].hnd, &high);
-
-        /* FIXME: Error checking */
-        length = (int)(((long long)high) << 32L) | (long long)low;
-        WCETRACE(WCE_IO, "ioctl(%d (FIONREAD) length %d", fd, length);
-
-        low = _SetFilePointer(_fdtab[fd].hnd, 0, (PLONG)&high, FILE_CURRENT);
-        if ((low == 0xffffffff) && (GetLastError() != NO_ERROR)) {
-          errno = EBADF;
-          return(-1);
-        }
-
-        pos = (int)(((long long)high) << 32L) | (long long)low;
-        avail = length - pos;
-        WCETRACE(WCE_IO, "ioctl(%d (FIONREAD) pos %d avail %d", fd, pos, avail);
-        iptr = (int *)arg;
-       *iptr = (avail > 0) ? avail : 0;
-        return(0);
-      default:
-        errno = ENOSYS;
-        return(-1);
-      }
-    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
-      s = _fdtab[fd].sock;
-      WCETRACE(WCE_IO, "ioctl: doing ioctlsocket w/0x%x (fd %d hnd %x)", request, fd, s);
-      if (ioctlsocket(fd, request, arg) == SOCKET_ERROR) {
-        /* werr = WSAGetLastError(); */ 
-		werr = 1;
-        errno =  _winerr2errno(werr);
-        return(-1);
-      }
-    } else if(_fdtab[fd].type == IO_FILE_TYPE_NULL) {
-      errno = ENOSYS;
-      return(-1);
-    }
-  } else {
-    return(_fdtab[fd].devops->ioctl_r(NULL, _fdtab[fd].fd, request, _fdtab[fd].cxt, arg));
-  }
-
-  return(0);
-}
-
-int
-_getpid_r(struct _reent *reent)
-{
-  int pid;
-
-  pid = GetCurrentProcessId();
-//  return pid & 0x7FFFFFFF; // pedro: Reiner, what is the rationale for this in celib?
-  return pid;
-}
-
-int
-isatty(int fd)
-{
-  WCETRACE(WCE_IO, "isatty(%d)", fd);
-
-  if (!fdsinitialized)
-    return(FALSE);
-
-  if (_fdtab[fd].type == IO_FILE_TYPE_CONSOLE ||
-      _fdtab[fd].type == IO_FILE_TYPE_FIFO) {
-    WCETRACE(WCE_IO, "isatty(%d): yes", fd);
-    return(TRUE);
-  }
-
-  WCETRACE(WCE_IO, "isatty(%d): no", fd);
-  return(FALSE);
-}
-
-int
-ftruncate(int fd, off_t size)
-{
-  DWORD newpos;
-
-  FDCHECK(fd);
-
-  if (_fdtab[fd].type != IO_FILE_TYPE_FILE) {
-    errno = EBADF;
-    return -1;
-  }
-
-  if ((newpos = _SetFilePointer(_fdtab[fd].hnd, size, NULL, 
-			       FILE_BEGIN)) == -1)
-    {
-      errno = _winerr2errno(GetLastError());
-      return -1;
-    }
-
-  if(!SetEndOfFile(_fdtab[fd].hnd))
-    {
-      errno = _winerr2errno(GetLastError());
-      return -1;
-    }
-
-  return 0;
-}
-
-// TODO: The fd entry is simply copied. When one of the files
-// is closed, the handle is also closed! There should be a 
-// refcount on the handles! That would require another table.
-
-// TODO: Consider using DuplicateHandle here.
-
-int
-dup(int fd)
-{
-  int newfd;
-
-
-  newfd = _getnewfd();
-
-  if(newfd >= 0)
-    memcpy(&_fdtab[newfd], &_fdtab[fd], sizeof(_fdent_t));
-
-  return newfd;
-}
-
-int
-dup2(int fd1, int fd2)
-{
-  if(fd2 < 0 || fd2 >= MAXFDS);
-    {
-      errno = EBADF;
-      return -1;
-    }
-
-  if(_fdtab[fd2].fd != -1)
-    close(fd2);
-
-  memcpy(&_fdtab[fd2], &_fdtab[fd1], sizeof(_fdent_t));
-
-  return fd2;
-}
+#define __USE_W32_SOCKETS
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <fcntl.h>
+#include <reent.h>
+#include <errno.h>
+
+#include <sys/ioctl.h>
+#include <sys/sysconf.h>
+#include <sys/io.h>
+#include <sys/fifo.h>
+
+#include "sys/wcetrace.h"
+
+#include <winsock2.h>
+
+void* _fifo_alloc();
+
+static int fdsinitialized = 0;
+static CRITICAL_SECTION critsect;
+
+/* mamaich: Used in hooking CreateFile/ReadFile/etc for transparent reading of RAR archives */
+typedef HANDLE pCreateFileW(LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
+typedef BOOL   pCloseHandle(HANDLE);
+typedef DWORD  pSetFilePointer(HANDLE, LONG, PLONG, DWORD);
+typedef BOOL   pReadFile(HANDLE, LPVOID, DWORD, LPDWORD, LPOVERLAPPED);
+typedef BOOL   pWriteFile(HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED);
+
+extern pCreateFileW XCECreateFileW;
+extern pCloseHandle XCECloseHandle;
+
+static pCreateFileW *_CreateFileW=XCECreateFileW;
+static pCloseHandle *_CloseHandle=XCECloseHandle;
+static pSetFilePointer *_SetFilePointer=SetFilePointer;
+static pReadFile *_ReadFile=ReadFile;
+static pWriteFile *_WriteFile=WriteFile;
+
+#if 1
+typedef int (* CONSOLE_READ_FUNC)(int, unsigned char *, int);
+typedef int (* CONSOLE_WRITE_FUNC)(int, const unsigned char *, int);
+typedef int (* CONSOLE_IOCTL_FUNC)(int, int, void *);
+
+HWND console_hwnd;
+CONSOLE_READ_FUNC  console_read_func;
+CONSOLE_WRITE_FUNC console_write_func;
+CONSOLE_IOCTL_FUNC console_ioctl_func;
+#endif
+
+void SetFileFuncs(void* CF, void *SFP, void *RF, void* WF, void *CH)
+{
+	_CreateFileW=(pCreateFileW*)CF;
+	_SetFilePointer=(pSetFilePointer*)SFP;
+	_ReadFile=(pReadFile*)RF;
+	_WriteFile=(pWriteFile*)WF;
+	_CloseHandle=(pCloseHandle*)CH;
+}
+
+_fdent_t _fdtab[MAXFDS];
+
+/* Prototypes from local.h that probably shouldn't be here.. */
+extern int __sclose(void *);
+extern _READ_WRITE_RETURN_TYPE __sread(void *, char *, int);
+extern _READ_WRITE_RETURN_TYPE __swrite(void *, char const *, int);
+extern fpos_t __sseek(void *, fpos_t, int);
+
+/* Public devops for devices we support */
+extern _DEVOPS _fifo_devops;
+
+int getfiletype(int fd)
+{
+	FDCHECK(fd, 0);
+	return _fdtab[fd].type;
+}
+
+HANDLE get_osfhandle(int fd)
+{
+	if(fd < 0 || fd > MAXFDS || _fdtab[fd].fd == -1)
+		return INVALID_HANDLE_VALUE;
+	return _fdtab[fd].hFile;
+}
+
+static void 
+_initfds_p(int end)
+{
+  int i;
+
+  InitializeCriticalSection(&critsect);
+
+  EnterCriticalSection(&critsect);
+  for (i = 0; i < end; i++)
+  {
+    memset(&_fdtab[i], 0, sizeof(_fdtab[0]));
+    _fdtab[i].fd = -1;
+  }
+  LeaveCriticalSection(&critsect);
+}
+
+void
+_initfds()
+{
+  int i;
+
+  if (fdsinitialized)
+    return;
+  fdsinitialized = 1;
+
+  _initfds_p(MAXFDS);
+}
+
+void
+_initfds_std()
+{
+	/* stdin, stdio, stderr */
+  _initfds_p(3);
+}
+
+//void
+//_cleanupstdio()
+//{
+//	fclose(stderr);
+//	fclose(stdout);
+//	fclose(stdin);
+//}
+
+int __StdioInited = 0;
+
+void
+_initstdio()
+{
+  if(!__StdioInited)
+  {
+	  __StdioInited = 1;
+	  _initstdfd(stdin,  0, (HANDLE)_fileno(_getstdfilex(0)), __SRD);
+	  _initstdfd(stdout, 1, (HANDLE)_fileno(_getstdfilex(1)), __SWR);
+	  _initstdfd(stderr, 2, (HANDLE)_fileno(_getstdfilex(2)), __SWR);
+//	  atexit(_cleanupstdio);
+  }
+}
+
+int
+_getnewfd()
+{
+  int i;
+
+  EnterCriticalSection(&critsect);
+  for (i = 0; i < MAXFDS; i++) {
+    if (_fdtab[i].fd == -1)	{
+   	  _fdtab[i].flags = 0;
+      LeaveCriticalSection(&critsect);
+   	  return i;
+   	}
+  }
+  LeaveCriticalSection(&critsect);
+
+  WCETRACE(WCE_IO, "Out of file descriptors!");
+
+  return(-1);
+}
+
+void
+_setfd(int fd, int type, HANDLE hnd, int flags)
+{
+  _fdtab[fd].fd = fd;
+  _fdtab[fd].type = type;
+  _fdtab[fd].hnd = hnd;
+  _fdtab[fd].flags = flags;
+}
+
+int
+_assignfd(int type, HANDLE hnd, int flags)
+{
+  int fd;
+
+  WCETRACE(WCE_IO, "_assignfd(%x)", hnd);
+
+  if ((fd = _getnewfd()) >= 0)
+    _setfd(fd, type, hnd, flags);
+
+  WCETRACE(WCE_IO, "_assignfd returns %d", fd);
+  return(fd);
+}
+
+void
+_initstdfd(FILE *fp, int fd, HANDLE hnd, int flags)
+{
+  if (fd < 0 || fd > 2 || fp == NULL)
+    return;
+
+  _setfd(fd, IO_FILE_TYPE_CONSOLE, hnd, 0);
+
+  WCETRACE(WCE_IO, "_initstdfd: fd %d hnd %x", fd, hnd);
+
+  fp->_file = fd;
+  fp->_flags = flags;
+  fp->_cookie = (_PTR) fp;
+  fp->_read = __sread;
+  fp->_write = __swrite;
+  fp->_seek = __sseek;
+  fp->_close = __sclose;
+
+#ifdef __SCLE
+  if (__stextmode(fp->_file))
+    fp->_flags |= __SCLE;
+#endif
+}
+
+void
+_initstdfifofd(FILE *fp, int fd, int flags)
+{
+  if (fd < 0 || fd > 2 || fp == NULL)
+    return;
+
+  _fdtab[fd].type = IO_FILE_TYPE_FIFO;
+  _fdtab[fd].hnd = NULL;
+  _fdtab[fd].flags = 0;
+
+  WCETRACE(WCE_IO, "_initstdfifofd: fd %d fifofd %d", fd, _fdtab[fd].fd);
+
+  fp->_file = fd;
+  fp->_flags = flags;
+  fp->_cookie = (_PTR) fp;
+  fp->_read = __sread;
+  fp->_write = __swrite;
+  fp->_seek = __sseek;
+  fp->_close = __sclose;
+
+#ifdef __SCLE
+  if (__stextmode(fp->_file))
+    fp->_flags |= __SCLE;
+#endif
+}
+
+void
+_initecho(int stdinfd, int stdoutfd)
+{
+  _FIFOIOCXT fcxt = NULL;
+
+  WCETRACE(WCE_IO, "_initecho: stdinfd %d stdoutfd %d", stdinfd, stdoutfd);
+
+  if (stdinfd < 0 || stdoutfd < 0) {
+    WCETRACE(WCE_IO, "_initecho: ERROR invalid fds (%d,%d) giving up", stdinfd, stdoutfd);
+  }
+
+  fcxt = (_FIFOIOCXT) _fdtab[stdinfd].cxt;
+  WCETRACE(WCE_IO, "_initecho: fcxt %p", fcxt);
+  fflush(stdout);
+
+  if (fcxt == NULL) {
+    WCETRACE(WCE_IO, "_initecho: ERROR fcxt is NULL");
+    return;
+  }
+
+  if (_fdtab[stdoutfd].cxt == NULL) {
+    WCETRACE(WCE_IO, "_initecho: ERROR stdout cxt is NULL");
+    return;
+  }
+
+  fcxt->echofd = stdoutfd;
+  fcxt->echocxt = _fdtab[stdoutfd].cxt;
+}
+
+void *
+_getiocxt(int fd)
+{
+  if (fd < 0 || fd > MAXFDS - 1)
+    return(NULL);
+  return(_fdtab[fd].cxt);
+}
+
+void
+_ioatexit(void)
+{
+  int i;
+
+  WCETRACE(WCE_IO, "_ioatexit: STARTED");
+  for (i = 0; i < MAXFDS; i++) {
+    if (_fdtab[i].fd != -1)	{
+      if (_fdtab[i].type == IO_FILE_TYPE_FIFO) {
+        _close_r(NULL, i);
+   	  }
+    }
+  }
+}
+  
+int
+_open_r(struct _reent *reent, const char *path, int flags, int mode)
+{
+  wchar_t wpath[MAX_PATH];
+  char pathbuf[MAX_PATH];
+  HANDLE hnd = NULL;
+  DWORD fileaccess;
+  DWORD fileshare; 
+  DWORD filecreate;
+  DWORD fileattrib;
+  void *cxt;
+  int fd;
+
+  WCETRACE(WCE_IO, "open(%s, %x, %o)", path, flags, mode);
+
+  _initfds();
+
+  if (!strncmp("fifo", path, 4)) {
+	  fd = _assignfd(IO_FILE_TYPE_FIFO, NULL, 0);
+
+	  if (fd < 0) {
+		  errno = ENMFILE;
+		  return(-1);
+	  }
+
+	  _fdtab[fd].devops = _fifo_devops;
+	  _fdtab[fd].cxt = cxt = _fifo_alloc();
+	  if ((_fdtab[fd].fd = _fdtab[fd].devops->open_r(reent, path, flags, mode, cxt)) == -1) {
+		  WCETRACE(WCE_IO, "FIFO open fails, errno %d", errno);
+		  _fdtab[fd].fd = -1;
+		  return(-1);
+	  }
+  }
+  else if(!strncmp(path, "nul", 3) ||
+		  !strncmp(path, "nul:", 4) ||
+		  !strncmp(path, "null:", 5) ||
+		  !strncmp(path, "/dev/nul", 8) ||
+		  !strncmp(path, "/dev/null", 9))
+  {
+	  fd = _assignfd(IO_FILE_TYPE_NULL, (HANDLE) -1, 0);
+	  if (fd < 0) {
+		  errno = ENMFILE;
+		  return(-1);
+	  }
+	  _fdtab[fd].devops = NULL;
+	  _fdtab[fd].cxt = NULL;
+  } else {
+    if (strlen(path) >= MAX_PATH) {
+      WCETRACE(WCE_IO, "open fails, invalid path\n");
+      return(-1);
+    }
+
+    fixpath(path, pathbuf);
+    mbstowcs(wpath, pathbuf, strlen(pathbuf) + 1);
+
+    fileshare = FILE_SHARE_READ|FILE_SHARE_WRITE;
+    fileattrib = FILE_ATTRIBUTE_NORMAL;
+
+    switch (flags & (O_RDONLY | O_WRONLY | O_RDWR)) {
+    case O_RDONLY:              /* read access */
+      fileaccess = GENERIC_READ;
+      break;
+    case O_WRONLY:              /* write access */
+      fileaccess = GENERIC_WRITE;
+      break;
+    case O_RDWR:                /* read and write access */
+      fileaccess = GENERIC_READ | GENERIC_WRITE;
+      break;
+    default:                    /* error, bad flags */
+      errno = EINVAL;
+      return -1;
+    }
+
+    switch (flags & (O_CREAT | O_EXCL | O_TRUNC)) {
+    case 0:
+    case O_EXCL:                /* ignore EXCL w/o CREAT */
+      filecreate = OPEN_EXISTING;
+      break;
+    case O_CREAT:
+      filecreate = OPEN_ALWAYS;
+      break;
+    case O_CREAT | O_EXCL:
+    case O_CREAT | O_TRUNC | O_EXCL:
+      filecreate = CREATE_NEW;
+      break;
+
+    case O_TRUNC:
+    case O_TRUNC | O_EXCL:      /* ignore EXCL w/o CREAT */
+      filecreate = TRUNCATE_EXISTING;
+      break;
+    case O_CREAT | O_TRUNC:
+      filecreate = CREATE_ALWAYS;
+      break;
+    default:
+      /* this can't happen ... all cases are covered */
+      errno = EINVAL;
+      return(-1);
+    }
+
+    if ((hnd = _CreateFileW(wpath, fileaccess, fileshare, NULL, filecreate,
+                           fileattrib, NULL)) == INVALID_HANDLE_VALUE) {
+      errno = _winerr2errno(GetLastError());
+      WCETRACE(WCE_IO, "_CreateFile(%s): errno=%d oserr=%d\n", pathbuf, errno, GetLastError());
+      return(-1);
+    }
+
+    fd = _assignfd(IO_FILE_TYPE_FILE, hnd, 0);
+
+    if (fd < 0) {
+      errno = ENMFILE;
+      return(-1);
+    }
+    _fdtab[fd].devops = NULL;
+    _fdtab[fd].cxt = NULL;
+
+    if (flags & O_APPEND) {
+      _SetFilePointer(hnd, 0, NULL, FILE_END);
+    }
+  }
+
+  WCETRACE(WCE_IO, "open returns %d fd %d cxt %p (hnd %x)", fd, _fdtab[fd].fd, cxt, hnd);
+  return fd;
+}
+
+int
+_close_r(struct _reent *reent, int fd)
+{
+  WCETRACE(WCE_IO, "close(%d)", fd);
+  WCETRACE(WCE_IO, "close: fd %d type %d flags %x hnd %p cxt %p", _fdtab[fd].fd,
+           _fdtab[fd].type, _fdtab[fd].flags, _fdtab[fd].hnd, _fdtab[fd].cxt);
+
+  EnterCriticalSection(&critsect);
+  FDCHECK(fd, &critsect);
+
+  if (_fdtab[fd].devops == NULL) {
+    if (_fdtab[fd].type == IO_FILE_TYPE_FILE) {
+      _CloseHandle(_fdtab[fd].hnd);
+    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
+      closesocket(fd);
+    } else if(_fdtab[fd].type == IO_FILE_TYPE_NULL) {
+    }
+  } else {
+    WCETRACE(WCE_IO, "close: doing device-specific close for fd %d", _fdtab[fd].fd);
+    _fdtab[fd].devops->close_r(reent, _fdtab[fd].fd, _fdtab[fd].cxt);
+    if (_fdtab[fd].cxt != NULL) {
+      free(_fdtab[fd].cxt);
+      _fdtab[fd].cxt = NULL;
+    }
+  }
+
+  /* IMPORTANT - reset fd fields here */
+  memset(&_fdtab[fd], 0, sizeof(_fdent_t));
+  _fdtab[fd].fd = -1;
+  LeaveCriticalSection(&critsect);
+
+  return(0);
+}
+
+_ssize_t
+_read_r(struct _reent *reent, int fd, void *buf, size_t count)
+{
+  int nread;
+  int error;
+
+  WCETRACE(WCE_IO, "read(fd = %d, count = %d, hnd %x)", fd, count, _fdtab[fd].hnd);
+
+  if ((!__StdioInited) && (fd >= 0) && (fd <= 2))
+  {
+    WCETRACE(WCE_IO, "read from fd = %d with stdio uninitialized", fd);
+	return count;
+  }
+
+  FDCHECK(fd, 0);
+
+  if (_fdtab[fd].devops == NULL) {
+    if (_fdtab[fd].type == IO_FILE_TYPE_FILE || _fdtab[fd].type == IO_FILE_TYPE_CONSOLE) {
+      if (_ReadFile(_fdtab[fd].hnd, buf, count, (DWORD *)&nread, NULL) == FALSE) {
+        WCETRACE(WCE_IO, "_ReadFile: %d", GetLastError());
+        errno = EIO;
+        return(-1);
+      }
+    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
+      if ((nread = recv(fd, buf, count, 0)) == SOCKET_ERROR) {
+        /* error = WSAGetLastError(); */ 
+		error = 1;
+        WCETRACE(WCE_IO, "read: recv failed %d\n", error);
+        if (error == WSAEWOULDBLOCK) {
+          errno = EAGAIN;
+          return(-1);
+        }
+
+        errno = _winerr2errno(error);
+        return(-1);
+      }
+    } else if (_fdtab[fd].type == IO_FILE_TYPE_NULL) {
+      WCETRACE(WCE_IO, "warning - read called w/IO_FILE_TYPE_NULL");
+      nread = 0;
+    }
+  } else {
+    nread = _fdtab[fd].devops->read_r(reent, _fdtab[fd].fd, buf, count, _fdtab[fd].cxt);
+  }
+
+  return(nread);
+}
+
+_ssize_t
+_write_r(struct _reent *reent, int fd, const void *buf, size_t count){
+  int nwritten = 0;
+  int werr;
+
+  WCETRACE(WCE_IO, "write(%d, %d, %x)", fd, count, _fdtab[fd].hnd);
+  EnterCriticalSection(&critsect);
+
+#if 1
+  if (fd == 2 || fd == 1)
+  {
+	  const char* out = fd == 2?"stderr: ":"stdout: ";
+    WCETRACE(WCE_IO, "%s : %s", out, buf);
+  }
+#endif
+
+  /* until we can call console stuff inside the PE loader */
+  if ((!__StdioInited) && (fd >= 0) && (fd <= 2))
+  {
+    WCETRACE(WCE_IO, "write to fd = %d with stdio uninitialized", fd);
+	LeaveCriticalSection(&critsect);    
+	return count;
+  }
+
+  if (_fdtab[fd].devops == NULL) {
+    if (_fdtab[fd].type == IO_FILE_TYPE_FILE || _fdtab[fd].type == IO_FILE_TYPE_CONSOLE) {
+      if (_WriteFile(_fdtab[fd].hnd, buf, count, (DWORD *)&nwritten, NULL) == FALSE) {
+		if ((fd == 1 || fd == 2) && (_fdtab[fd].hnd == (HANDLE)-1))
+		{
+			/* ignore writting errors to stdout and stderr. happens when we don't have a console installed */ 
+			/* ### TODO replace this with something better */
+			nwritten = count;
+		}
+		else
+		{
+			WCETRACE(WCE_IO, "_WriteFile: hnd %x error %d\n", _fdtab[fd].hnd, GetLastError());
+			errno = EIO;
+        LeaveCriticalSection(&critsect);
+	        return(-1);
+		}
+      }
+    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
+      if ((nwritten = (int)send(fd, buf, count, 0)) == SOCKET_ERROR) {
+        /* werr = WSAGetLastError(); */ 
+        werr = 1;
+        WCETRACE(WCE_IO, "send: sock %d error %d",  _fdtab[fd].hnd, werr);
+        errno = _winerr2errno(werr);
+        LeaveCriticalSection(&critsect);
+        return(-1);
+      }
+    } else if (_fdtab[fd].type == IO_FILE_TYPE_NULL) {
+		// pretty normal, no?
+//      WCETRACE(WCE_IO, "warning - write called w/IO_FILE_TYPE_NULL");
+      nwritten = count;
+    }
+  } else {
+    nwritten = _fdtab[fd].devops->write_r(reent, _fdtab[fd].fd, buf, count, _fdtab[fd].cxt);
+  }
+
+  LeaveCriticalSection(&critsect);
+  return nwritten;
+}
+
+off_t
+_lseek_r(struct _reent *reent, int fd, off_t offset, int whence) {
+  off_t newpos;
+  int method;
+  WCETRACE(WCE_IO, "lseek(%d, %d, %d)", fd, offset, whence);
+
+  FDCHECK(fd, 0);
+
+  if (_fdtab[fd].devops == NULL) {
+    switch (whence) {
+    case SEEK_SET:
+      method = FILE_BEGIN;
+      break;
+    case SEEK_CUR:
+      method = FILE_CURRENT;
+      break;
+    case SEEK_END:
+      method = FILE_END;
+      break;
+    default:
+      method = FILE_BEGIN;
+    }
+
+    if (_fdtab[fd].type == IO_FILE_TYPE_FILE) {
+      if ((newpos = _SetFilePointer(_fdtab[fd].hnd, (LONG)offset, NULL, (DWORD)method)) == -1) {
+        WCETRACE(WCE_IO, "_SetFilePointer(%x): error %d", _fdtab[fd].hnd, GetLastError());
+        errno = EIO;
+        newpos = -1;
+      } 
+    } else {
+      errno = EINVAL;
+      newpos = -1;
+    }
+  } else {
+    newpos = _fdtab[fd].devops->lseek_r(reent, _fdtab[fd].fd, offset, whence, _fdtab[fd].cxt);
+  }
+
+  WCETRACE(WCE_IO, "lseek returns %d", newpos);
+  return(newpos);
+}
+
+BOOL XCECopyFileW(
+  LPCWSTR lpExistingFileName, 
+  LPCWSTR lpNewFileName, 
+  BOOL bFailIfExists 
+); 
+
+int
+_link_r(struct _reent *reent, const char *old, const char *new)
+{
+  wchar_t wpathOld[MAX_PATH];
+  wchar_t wpathNew[MAX_PATH];
+  char pathOld[MAX_PATH];
+  char pathNew[MAX_PATH];
+  fixpath(old, pathOld);
+  fixpath(new, pathNew);
+  mbstowcs(wpathOld, pathOld, MAX_PATH);
+  mbstowcs(wpathNew, pathNew, MAX_PATH);
+  if(0==XCECopyFileW(wpathOld,wpathNew,FALSE))
+  {
+//    printf("failed rename '%s' to '%s'\n",pathOld,pathNew);
+  	errno = _winerr2errno(GetLastError());
+  	return(-1);
+  }
+  return 0;
+}
+
+int
+_unlink_r(struct _reent *reent, const char *path)
+{
+  wchar_t pathw[MAX_PATH];
+  char pathbuf[MAX_PATH];
+  BOOL res;
+
+  if (path == NULL)
+    return(-1);
+
+  fixpath(path, pathbuf);
+  mbstowcs(pathw, pathbuf, MAX_PATH);
+  res = DeleteFileW(pathw);
+
+  if (res == FALSE) {
+    errno = _winerr2errno(GetLastError());
+    return(-1);
+  }
+
+  return(0);
+}
+
+static int
+_fd_to_socket(struct fd_set *set, int *hndmap)
+{
+  int i;
+
+  if (set == NULL)
+    return(0);
+
+  for (i = 0; i < set->fd_count; i++) {
+    int fd = (int)set->fd_array[i];
+    FDCHECK(fd, 0);
+
+    /* On WINCE, only IO_FILE_TYPE_SOCKET is handled */
+    if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
+      SOCKET s = _fdtab[fd].sock;
+      hndmap[fd] = s;
+      WCETRACE(WCE_IO, "_fd_to_socket: fd = %d, handle = %d", fd, s);
+      set->fd_array[i] = s;
+    } else {
+      WCETRACE(WCE_IO, "_fd_to_socket: fd = %d is not a socket", fd);
+    }
+  }
+  return(0);
+}
+
+static void
+_socket_to_fd(fd_set *set, int *hndmap)
+{
+  int i, j, fd;
+
+  if (set == NULL)
+    return;
+
+  if (set->fd_count > MAXFDS) {
+    WCETRACE(WCE_IO, "select (_socket_to_fd) ERROR fd_count > MAXFDS (%d > %d)",
+             set->fd_count, MAXFDS);
+  }
+
+  for (i = 0; i < set->fd_count; i++) {
+    fd = -1;
+    /* Hunt for matching hnd in the hndmap */    
+    for (j = 0; j < MAXFDS; j++) {
+      if (hndmap[j] == set->fd_array[i]) {
+        fd = j;
+        break;
+      }
+    }
+
+    if (fd < 0 || fd > MAXFDS) {
+      WCETRACE(WCE_IO, "_socket_to_fd: ERROR weird fd %d", fd);
+    } else {
+      set->fd_array[i] = fd;
+    }
+  }
+}
+
+#if 0
+int
+select(int n, fd_set *rfds, fd_set* wfds, fd_set* xfds, struct timeval *timeout)
+{
+  int i;
+  int status;
+  fd_set r, w, x;
+  int werr, hndmap[MAXFDS];
+  SOCKET s;
+
+  WCETRACE(WCE_IO, "select(%d, %p, %p, %p, %p)", n, rfds, wfds, xfds, timeout);
+  if (timeout != NULL) {
+    WCETRACE(WCE_IO, "select: timeout {%d,%d}", timeout->tv_sec, timeout->tv_usec);
+  }
+
+  /* Initialze hndmap - this is the SOCKET->fd mapping for use later */
+  for (i = 0; i < MAXFDS; i++)
+    hndmap[i] = -1;
+
+  if (rfds != NULL) {
+    if (_fd_to_socket(rfds, hndmap) < 0) {
+      WCETRACE(WCE_IO, "select: bad rfds");
+      return(-1);
+    }
+  }
+
+  if (wfds != NULL) {
+    if (_fd_to_socket(wfds, hndmap) < 0) {
+      WCETRACE(WCE_IO, "select: bad wfds");
+      return(-1);
+    }
+  }
+
+  if (xfds != NULL) {
+    if (_fd_to_socket(xfds, hndmap) < 0) {
+      WCETRACE(WCE_IO, "select: bad xfds");
+      return(-1);
+    }
+  }
+
+  status = __MS_select(n, rfds, wfds, xfds, timeout);
+  WCETRACE(WCE_IO, "select: returns %d errno %d", status, errno);
+
+  /* Give up here if there is an select error */
+  if (status == SOCKET_ERROR) {
+    int werr = XCEWSAGetLastError();
+    errno = _winerr2errno(werr);
+    return(-1);
+  }
+
+  /* Finally we must translate socket descriptors back to fds */
+  if (rfds != NULL)
+    _socket_to_fd(rfds, hndmap);
+
+  if (wfds != NULL) 
+    _socket_to_fd(wfds, hndmap);
+
+  if (xfds != NULL) 
+    _socket_to_fd(xfds, hndmap);
+
+  return(status);
+}
+#endif
+
+int
+ioctl(int fd, unsigned int request, void *arg)
+{
+  DWORD high, low;
+  int length, pos, avail, *iptr;
+  int werr;
+  SOCKET s;
+
+  WCETRACE(WCE_IO, "ioctl(%d, %p %p)", fd, request, arg);
+
+  FDCHECK(fd, 0);
+
+  if (_fdtab[fd].devops == NULL) {
+    if (_fdtab[fd].type == IO_FILE_TYPE_FILE) {
+      switch (request) {
+      case FIONREAD:
+        if (arg == NULL) {
+          errno = EINVAL;
+          return(-1);
+        }
+        low = GetFileSize(_fdtab[fd].hnd, &high);
+
+        /* FIXME: Error checking */
+        length = (int)(((long long)high) << 32L) | (long long)low;
+        WCETRACE(WCE_IO, "ioctl(%d (FIONREAD) length %d", fd, length);
+
+        low = _SetFilePointer(_fdtab[fd].hnd, 0, (PLONG)&high, FILE_CURRENT);
+        if ((low == 0xffffffff) && (GetLastError() != NO_ERROR)) {
+          errno = EBADF;
+          return(-1);
+        }
+
+        pos = (int)(((long long)high) << 32L) | (long long)low;
+        avail = length - pos;
+        WCETRACE(WCE_IO, "ioctl(%d (FIONREAD) pos %d avail %d", fd, pos, avail);
+        iptr = (int *)arg;
+       *iptr = (avail > 0) ? avail : 0;
+        return(0);
+      default:
+        errno = ENOSYS;
+        return(-1);
+      }
+    } else if (_fdtab[fd].type == IO_FILE_TYPE_SOCKET) {
+      s = _fdtab[fd].sock;
+      WCETRACE(WCE_IO, "ioctl: doing ioctlsocket w/0x%x (fd %d hnd %x)", request, fd, s);
+      if (ioctlsocket(fd, request, arg) == SOCKET_ERROR) {
+        /* werr = WSAGetLastError(); */ 
+		werr = 1;
+        errno =  _winerr2errno(werr);
+        return(-1);
+      }
+    } else if(_fdtab[fd].type == IO_FILE_TYPE_NULL) {
+      errno = ENOSYS;
+      return(-1);
+    }
+  } else {
+    return(_fdtab[fd].devops->ioctl_r(NULL, _fdtab[fd].fd, request, _fdtab[fd].cxt, arg));
+  }
+
+  return(0);
+}
+
+int
+_getpid_r(struct _reent *reent)
+{
+  int pid;
+
+  pid = GetCurrentProcessId();
+//  return pid & 0x7FFFFFFF; // pedro: Reiner, what is the rationale for this in celib?
+  return pid;
+}
+
+int
+isatty(int fd)
+{
+  WCETRACE(WCE_IO, "isatty(%d)", fd);
+
+  if (!fdsinitialized)
+    return(FALSE);
+
+  if (_fdtab[fd].type == IO_FILE_TYPE_CONSOLE ||
+      _fdtab[fd].type == IO_FILE_TYPE_FIFO) {
+    WCETRACE(WCE_IO, "isatty(%d): yes", fd);
+    return(TRUE);
+  }
+
+  WCETRACE(WCE_IO, "isatty(%d): no", fd);
+  return(FALSE);
+}
+
+int
+ftruncate(int fd, off_t size)
+{
+  DWORD newpos;
+
+  FDCHECK(fd, 0);
+
+  if (_fdtab[fd].type != IO_FILE_TYPE_FILE) {
+    errno = EBADF;
+    return -1;
+  }
+
+  if ((newpos = _SetFilePointer(_fdtab[fd].hnd, size, NULL, 
+			       FILE_BEGIN)) == -1)
+    {
+      errno = _winerr2errno(GetLastError());
+      return -1;
+    }
+
+  if(!SetEndOfFile(_fdtab[fd].hnd))
+    {
+      errno = _winerr2errno(GetLastError());
+      return -1;
+    }
+
+  return 0;
+}
+
+// TODO: The fd entry is simply copied. When one of the files
+// is closed, the handle is also closed! There should be a 
+// refcount on the handles! That would require another table.
+
+// TODO: Consider using DuplicateHandle here.
+
+int
+dup(int fd)
+{
+  int newfd;
+
+
+  newfd = _getnewfd();
+
+  if(newfd >= 0)
+    memcpy(&_fdtab[newfd], &_fdtab[fd], sizeof(_fdent_t));
+
+  return newfd;
+}
+
+int
+dup2(int fd1, int fd2)
+{
+  if(fd2 < 0 || fd2 >= MAXFDS);
+    {
+      errno = EBADF;
+      return -1;
+    }
+
+  if(_fdtab[fd2].fd != -1)
+    close(fd2);
+
+  memcpy(&_fdtab[fd2], &_fdtab[fd1], sizeof(_fdent_t));
+
+  return fd2;
+}
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/stat.c
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/stat.c	2008-08-01 20:35:28 UTC (rev 1168)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/stat.c	2008-08-30 07:46:02 UTC (rev 1169)
@@ -21,7 +21,7 @@
 
   WCETRACE(WCE_IO, "fstat(%d)", fd);
 
-  FDCHECK(fd);
+  FDCHECK(fd, 0);
 #if 0
   static int first_time = 1;
 
Modified: trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/io.h
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/io.h	2008-08-01 20:35:28 UTC (rev 1168)
+++ trunk/cegcc/src/newlib/newlib/libc/sys/wince/sys/io.h	2008-08-30 07:46:02 UTC (rev 1169)
@@ -34,11 +34,12 @@
   _DEVOPS devops;
 } _fdent_t;
 
-#define FDCHECK(F) \
+#define FDCHECK(F, CS) \
 	do { \
 		if (F < 0 || F >= MAXFDS || _fdtab[F].fd == -1) { \
 			WCETRACE(WCE_IO, "Invalid file handle: %d", F); \
 			errno = EBADF; \
+                        if (CS) { LeaveCriticalSection(CS); } \
 			return(-1); \
 		} \
 	} while (0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-08-01 20:35:30
      
     | 
| Revision: 1168
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1168&view=rev
Author:   dannybackx
Date:     2008-08-01 20:35:28 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Add gosmore
Modified Paths:
--------------
    trunk/cegcc/website/software-that-works.html
Modified: trunk/cegcc/website/software-that-works.html
===================================================================
--- trunk/cegcc/website/software-that-works.html	2008-07-05 14:53:34 UTC (rev 1167)
+++ trunk/cegcc/website/software-that-works.html	2008-08-01 20:35:28 UTC (rev 1168)
@@ -36,6 +36,11 @@
 <td class="works">Yes, but include file patches required (they're in SVN)</td>
 </tr>
 <tr>
+<td class="project"> <a href="http://wiki.openstreetmap.org/index.php/Gosmore">Gosmore</a> </td>
+<td class="description"> Gosmore is a routing and viewer of OSM XML data such as the planet.osm</td>
+<td class="works">Yes</td>
+</tr>
+<tr>
 <td class="project"> <a href="http://sourceforge.net/projects/xwords">Crosswords for handhelds</a> </td>
 <td class="description"> Crosswords implements the rules of Scrabble(tm) for handhelds like PalmOS and PocketPC, (Linux too). Easy to port to other platforms, supports multiple languages and multi-device play via IR or UDP. Not vaporware: one of TIME.com's top 5 PalmOS apps</td>
 <td class="works">Yes</td>
@@ -147,11 +152,6 @@
 <td class="works">?</td>
 </tr>
 <tr>
-<td class="project"> <a href="http://sourceforge.net/projects/pocketgcc">Pocket GCC</a> </td>
-<td class="description"> PocketGCC is a port of well-known GNU C/C++ compiler and Binutils for ARM-WinCE-PE platform. Both crosscompiler and native builds are provided, allowing to develop applications for WindowsCE devices with ARM-compatible processor on the go without desktop</td>
-<td class="works">?</td>
-</tr>
-<tr>
 <td class="project"> <a href="http://sourceforge.net/projects/nethack">NetHack</a> </td>
 <td class="description"> NetHack is a popular single player dungeon exploration game that runs on a wide variety of computer systems.</td>
 <td class="works">?</td>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-07-05 14:53:41
      
     | 
| Revision: 1167
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1167&view=rev
Author:   dannybackx
Date:     2008-07-05 07:53:34 -0700 (Sat, 05 Jul 2008)
Log Message:
-----------
Looks like I have forgotten commits...
Modified Paths:
--------------
    trunk/cegcc/src/gdb/ChangeLog.ce
    trunk/cegcc/src/gdb/bfd/config.bfd
    trunk/cegcc/src/gdb/config.sub
    trunk/cegcc/src/gdb/configure.in
Modified: trunk/cegcc/src/gdb/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/gdb/ChangeLog.ce	2008-06-22 18:03:00 UTC (rev 1166)
+++ trunk/cegcc/src/gdb/ChangeLog.ce	2008-07-05 14:53:34 UTC (rev 1167)
@@ -1,3 +1,7 @@
+2008-07-05  Danny Backx  <dan...@us...>
+
+	* config.sub, configure.in, bfd/config.bfd : Add arm-*-mingw32ce*
+	and arm-*-cegcc* .
 2007-12-21  Danny Backx  <dan...@us...>
 
 	* configure.tgt : Add arm-*-mingw32ce* and arm-*-cegcc* .
Modified: trunk/cegcc/src/gdb/bfd/config.bfd
===================================================================
--- trunk/cegcc/src/gdb/bfd/config.bfd	2008-06-22 18:03:00 UTC (rev 1166)
+++ trunk/cegcc/src/gdb/bfd/config.bfd	2008-07-05 14:53:34 UTC (rev 1167)
@@ -214,7 +214,7 @@
     targ_underscore=no
     targ_cflags=-DARM_COFF_BUGFIX
     ;;
-  arm-wince-* | arm-*-wince | arm-wince-cegcc )
+  arm-wince-* | arm-*-wince | arm-wince-cegcc | arm-*-cegcc* | arm-*-mingw*)
     targ_defvec=armpe_little_vec
     targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
     targ_underscore=no
Modified: trunk/cegcc/src/gdb/config.sub
===================================================================
--- trunk/cegcc/src/gdb/config.sub	2008-06-22 18:03:00 UTC (rev 1166)
+++ trunk/cegcc/src/gdb/config.sub	2008-07-05 14:53:34 UTC (rev 1167)
@@ -667,6 +667,14 @@
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+	cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
 	mingw32)
 		basic_machine=i386-pc
 		os=-mingw32
Modified: trunk/cegcc/src/gdb/configure.in
===================================================================
--- trunk/cegcc/src/gdb/configure.in	2008-06-22 18:03:00 UTC (rev 1166)
+++ trunk/cegcc/src/gdb/configure.in	2008-07-05 14:53:34 UTC (rev 1167)
@@ -449,7 +449,7 @@
   sh-*-linux*)
     noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
     ;;    
-  sh*-*-pe|mips*-*-pe|*arm-wince-pe|*arm-wince-cegcc)
+  sh*-*-pe|mips*-*-pe|*arm-wince-pe|*arm-wince-cegcc | arm-*-cegcc | arm-*-mingw*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     noconfigdirs="$noconfigdirs target-examples"
     noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
@@ -1519,7 +1519,7 @@
     # ranlib from Darwin requires the -c flag to look at common symbols.
     extra_ranlibflags_for_target=" -c"
     ;;
-  mips*-*-pe | sh*-*-pe | *arm-wince-pe | *arm-wince-cegcc )
+  mips*-*-pe | sh*-*-pe | *arm-wince-pe | *arm-*-cegcc | arm-*-mingw*)
     target_makefile_frag="config/mt-wince"
     ;;
 esac
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-06-22 18:03:03
      
     | 
| Revision: 1166
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1166&view=rev
Author:   dannybackx
Date:     2008-06-22 11:03:00 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
Remove the function keyword for POSIX compliance.
Modified Paths:
--------------
    trunk/cegcc/src/ChangeLog
    trunk/cegcc/src/build-cegcc.sh
Modified: trunk/cegcc/src/ChangeLog
===================================================================
--- trunk/cegcc/src/ChangeLog	2008-06-20 18:04:30 UTC (rev 1165)
+++ trunk/cegcc/src/ChangeLog	2008-06-22 18:03:00 UTC (rev 1166)
@@ -1,3 +1,8 @@
+2008-06-22  Danny Backx  <dan...@so...>
+
+	* build-cegcc.sh : Remove all instances of the function keyword for
+	POSIX compliance. Based on info by Mosfet, see the mailing list.
+
 2008-06-20  Eric House <ee...@ee...>
 
 	* cegcc/importlibs/defs/aygshell.def, w32api/include/aygshell.h,
Modified: trunk/cegcc/src/build-cegcc.sh
===================================================================
--- trunk/cegcc/src/build-cegcc.sh	2008-06-20 18:04:30 UTC (rev 1165)
+++ trunk/cegcc/src/build-cegcc.sh	2008-06-22 18:03:00 UTC (rev 1166)
@@ -32,7 +32,7 @@
 mkdir -p ${BUILD_DIR} || exit 1
 mkdir -p ${PREFIX} || exit 1
 
-function build_binutils()
+build_binutils()
 {
     echo ""
     echo "BUILDING BINUTILS --------------------------"
@@ -53,7 +53,7 @@
     cd ${BASE_DIRECTORY} || exit 1
 }
 
-function build_import_libs()
+build_import_libs()
 {
     echo ""
     echo "Building import libs. --------------------------"
@@ -68,7 +68,7 @@
 }
 
 
-function copy_w32api_headers()
+copy_w32api_headers()
 {
     echo ""
     echo "Copying w32api headers. ----------------------"
@@ -82,7 +82,7 @@
     cp -fp ${BASE_DIRECTORY}/w32api/include/ddk/*.h ${PREFIX}/${TARGET}/include/w32api/ddk || exit 1
 }
 
-function build_dummy_cegccdll()
+build_dummy_cegccdll()
 {
     echo ""
     echo "Building dummy libcegcc.dll.a ----------------------"
@@ -94,7 +94,7 @@
     popd || exit 1
 }
 
-function build_bootstrap_gcc()
+build_bootstrap_gcc()
 {
     echo ""
     echo "Building bootstrap gcc. ----------------------"
@@ -124,7 +124,7 @@
     cd ${BASE_DIRECTORY} || exit 1
 }
 
-function build_newlib()
+build_newlib()
 {
     echo ""
     echo "Building newlib. --------------------------"
@@ -144,7 +144,7 @@
     cd ${BASE_DIRECTORY} || exit 1
 }
 
-function build_gcc()
+build_gcc()
 {
     echo ""
     echo "Building full gcc. --------------------------"
@@ -189,7 +189,7 @@
     popd || exit 1
 }
 
-function build_cegccdll()
+build_cegccdll()
 {
     echo ""
     echo "Building cegcc.dll --------------------------"
@@ -201,7 +201,7 @@
     make install || exit 1
 }
 
-function build_cegccthrddll()
+build_cegccthrddll()
 {
     echo ""
     echo "Building cegccthrd.dll --------------------------"
@@ -213,7 +213,7 @@
     make install || exit 1
 }
 
-function build_libstdcppdll()
+build_libstdcppdll()
 {
     echo ""
     echo "Building libstdc++.dll --------------------------"
@@ -225,7 +225,7 @@
     make install || exit 1
 }
 
-function build_gdb()
+build_gdb()
 {
     echo ""
     echo "BUILDING GDB --------------------------"
@@ -257,7 +257,7 @@
     make install || exit 1
 }
 
-function build_gdbstub()
+build_gdbstub()
 {
     echo ""
     echo "BUILDING GDB stub --------------------------"
@@ -281,7 +281,7 @@
     cd ${BASE_DIRECTORY} || exit 1
 }
 
-function build_profile()
+build_profile()
 {
     echo ""
     echo "BUILDING profiling libraries --------------------------"
@@ -302,7 +302,7 @@
     make install || exit 1
 }
 
-function build_docs()
+build_docs()
 {
     echo ""
     echo "INSTALLING documentation --------------------------"
@@ -324,7 +324,7 @@
     cp src/binutils/COPYING.NEWLIB ${PREFIX} || exit 1
 }
 
-function build_all()
+build_all()
 {
     build_binutils
     build_import_libs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-06-22 08:16:13
      
     | 
| Revision: 1164
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1164&view=rev
Author:   dannybackx
Date:     2008-06-20 10:55:25 -0700 (Fri, 20 Jun 2008)
Log Message:
-----------
Export BASE_DIRECTORY, required for mingwdll build.
Modified Paths:
--------------
    trunk/cegcc/src/ChangeLog
    trunk/cegcc/src/build-mingw32ce.sh
Modified: trunk/cegcc/src/ChangeLog
===================================================================
--- trunk/cegcc/src/ChangeLog	2008-06-10 21:48:19 UTC (rev 1163)
+++ trunk/cegcc/src/ChangeLog	2008-06-20 17:55:25 UTC (rev 1164)
@@ -1,3 +1,8 @@
+2008-06-20  Danny Backx  <dan...@us...>
+
+	* build-mingw32ce.sh: Export BASE_DIRECTORY, the mingwdll build stuff
+	requires it.
+
 2008-03-27  Danny Backx  <dan...@us...>
 
 	* mingwdll: Add new directory structure, containing mostly
Modified: trunk/cegcc/src/build-mingw32ce.sh
===================================================================
--- trunk/cegcc/src/build-mingw32ce.sh	2008-06-10 21:48:19 UTC (rev 1163)
+++ trunk/cegcc/src/build-mingw32ce.sh	2008-06-20 17:55:25 UTC (rev 1164)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-BASE_DIRECTORY=`dirname $0`
-BASE_DIRECTORY=`(cd ${BASE_DIRECTORY}; pwd)`
+export BASE_DIRECTORY=`dirname $0`
+export BASE_DIRECTORY=`(cd ${BASE_DIRECTORY}; pwd)`
 ME=`basename $0`
 
 #
@@ -434,6 +434,7 @@
 done
 
 export TARGET="arm-mingw32ce"
+#export TARGET="arm-wince-mingw32ce"
 export BUILD=`sh ${BASE_DIRECTORY}/gcc/config.guess`
 export PATH=${PREFIX}/bin:${PATH}
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-06-21 12:51:40
      
     | 
| Revision: 1165
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1165&view=rev
Author:   dannybackx
Date:     2008-06-20 11:04:30 -0700 (Fri, 20 Jun 2008)
Log Message:
-----------
Stuff from Eric House, and an additional include from me.
Modified Paths:
--------------
    trunk/cegcc/src/ChangeLog
    trunk/cegcc/src/cegcc/importlibs/defs/aygshell.def
    trunk/cegcc/src/w32api/ChangeLog.ce
    trunk/cegcc/src/w32api/include/aygshell.h
    trunk/cegcc/src/w32api/libce/aygshell.def
Modified: trunk/cegcc/src/ChangeLog
===================================================================
--- trunk/cegcc/src/ChangeLog	2008-06-20 17:55:25 UTC (rev 1164)
+++ trunk/cegcc/src/ChangeLog	2008-06-20 18:04:30 UTC (rev 1165)
@@ -1,3 +1,9 @@
+2008-06-20  Eric House <ee...@ee...>
+
+	* cegcc/importlibs/defs/aygshell.def, w32api/include/aygshell.h,
+	w32api/libce/aygshell.def (SHSendBackToFocusWindow, SHMBOF_NODEFAULT,
+	SHMBOF_NOTIFY, SHCMBM_OVERRIDEKEY, VK_TBACK) : Define.
+
 2008-06-20  Danny Backx  <dan...@us...>
 
 	* build-mingw32ce.sh: Export BASE_DIRECTORY, the mingwdll build stuff
Modified: trunk/cegcc/src/cegcc/importlibs/defs/aygshell.def
===================================================================
--- trunk/cegcc/src/cegcc/importlibs/defs/aygshell.def	2008-06-20 17:55:25 UTC (rev 1164)
+++ trunk/cegcc/src/cegcc/importlibs/defs/aygshell.def	2008-06-20 18:04:30 UTC (rev 1165)
@@ -87,6 +87,7 @@
 ;
 SHHandleWMSettingChange		@83     NONAME	; described as NONAME on MSDN
 SHHandleWMActivate		@84     NONAME	; described as NONAME on MSDN
+SHSendBackToFocusWindow		@97	NONAME  ; http://groups.google.hu/group/microsoft.public.windowsce.embedded/msg/e407143ac07929b9 gives ordinal 97 for SHSendBackToFocusWindow
 ;
 ; These are described by MinGW to be in aygshell.lib but are not published by name
 ; in the DLL, nor do we have confirmation of their ordinal.
@@ -208,7 +209,6 @@
 ; SHSavePWWarning
 ; SHScanBuffer
 ; SHScanFile
-; SHSendBackToFocusWindow
 ; SHSetAsWatermark
 ; SHSetBack
 ; SHSetBubbleRegion
Modified: trunk/cegcc/src/w32api/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/w32api/ChangeLog.ce	2008-06-20 17:55:25 UTC (rev 1164)
+++ trunk/cegcc/src/w32api/ChangeLog.ce	2008-06-20 18:04:30 UTC (rev 1165)
@@ -1,3 +1,13 @@
+2008-06-20  Danny Backx  <dan...@us...>
+
+	* include/aygshell.h: Include prsht.h.
+
+2008-06-20  Eric House <ee...@ee...>
+
+	* cegcc/importlibs/defs/aygshell.def, w32api/include/aygshell.h,
+	w32api/libce/aygshell.def (SHSendBackToFocusWindow, SHMBOF_NODEFAULT,
+	SHMBOF_NOTIFY, SHCMBM_OVERRIDEKEY, VK_TBACK) : Define.
+
 2008-05-22  Danny Backx  <dan...@us...>
 
 	* include/projects.h: Add.
Modified: trunk/cegcc/src/w32api/include/aygshell.h
===================================================================
--- trunk/cegcc/src/w32api/include/aygshell.h	2008-06-20 17:55:25 UTC (rev 1164)
+++ trunk/cegcc/src/w32api/include/aygshell.h	2008-06-20 18:04:30 UTC (rev 1165)
@@ -15,6 +15,7 @@
 #include <basetyps.h>	/* Make sure we have a CLSID definition */
 #include <shellapi.h>	/* for WINSHELLAPI */
 #include <sipapi.h>
+#include <prsht.h>
 
 /*
  * Menu Bar
@@ -223,6 +224,14 @@
 #define	SHCMBM_SETSUBMENU	0x0590
 #define	SHCMBM_GETSUBMENU	0x0591
 #define	SHCMBM_GETMENU		0x0592
+
+/* from http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1733046&SiteID=1 */
+#define SHMBOF_NODEFAULT    0x00000001
+#define SHMBOF_NOTIFY       0x00000002
+#define SHCMBM_OVERRIDEKEY  (WM_USER + 403)
+#define VK_TBACK VK_ESCAPE
+
+void SHSendBackToFocusWindow(UINT,WPARAM,LPARAM);
 #endif /* _WIN32_WCE */
 
 #if (_WIN32_WCE >= 0x0400)
Modified: trunk/cegcc/src/w32api/libce/aygshell.def
===================================================================
--- trunk/cegcc/src/w32api/libce/aygshell.def	2008-06-20 17:55:25 UTC (rev 1164)
+++ trunk/cegcc/src/w32api/libce/aygshell.def	2008-06-20 18:04:30 UTC (rev 1165)
@@ -87,6 +87,7 @@
 ;
 SHHandleWMSettingChange		@83     NONAME	; described as NONAME on MSDN
 SHHandleWMActivate		@84     NONAME	; described as NONAME on MSDN
+SHSendBackToFocusWindow		@97	NONAME  ; http://groups.google.hu/group/microsoft.public.windowsce.embedded/msg/e407143ac07929b9
 ;
 ; These are described by MinGW to be in aygshell.lib but are not published by name
 ; in the DLL, nor do we have confirmation of their ordinal.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-06-10 21:48:48
      
     | 
| Revision: 1163
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1163&view=rev
Author:   dannybackx
Date:     2008-06-10 14:48:19 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
Change P_tmpdir as Vincent Torri suggested.
Modified Paths:
--------------
    trunk/cegcc/src/newlib/ChangeLog.cegcc
    trunk/cegcc/src/newlib/newlib/libc/include/stdio.h
Modified: trunk/cegcc/src/newlib/ChangeLog.cegcc
===================================================================
--- trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-06-07 06:51:04 UTC (rev 1162)
+++ trunk/cegcc/src/newlib/ChangeLog.cegcc	2008-06-10 21:48:19 UTC (rev 1163)
@@ -1,3 +1,8 @@
+2008-06-10  Danny Backx  <dan...@us...>
+
+	* newlib/libc/include/stdio.h (P_tmpdir) : Point to a directory that
+	exists on CE, not /tmp.
+
 2007-12-23  Pavel Chernikov <pch...@gm...>
 
 	* newlib/libc/sys/wince/sys/dirent.h (readdir_r) : Add declaration.
Modified: trunk/cegcc/src/newlib/newlib/libc/include/stdio.h
===================================================================
--- trunk/cegcc/src/newlib/newlib/libc/include/stdio.h	2008-06-07 06:51:04 UTC (rev 1162)
+++ trunk/cegcc/src/newlib/newlib/libc/include/stdio.h	2008-06-10 21:48:19 UTC (rev 1163)
@@ -128,8 +128,12 @@
 #endif
 
 #ifndef __STRICT_ANSI__
+#ifdef UNDER_CE
+#define P_tmpdir        "/temp"
+#else
 #define P_tmpdir        "/tmp"
 #endif
+#endif
 
 #ifndef SEEK_SET
 #define	SEEK_SET	0	/* set file offset to offset */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-06-07 06:51:08
      
     | 
| Revision: 1162
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1162&view=rev
Author:   dannybackx
Date:     2008-06-06 23:51:04 -0700 (Fri, 06 Jun 2008)
Log Message:
-----------
Add community choice awards button
Modified Paths:
--------------
    trunk/cegcc/website/index.html
Modified: trunk/cegcc/website/index.html
===================================================================
--- trunk/cegcc/website/index.html	2008-05-22 19:49:18 UTC (rev 1161)
+++ trunk/cegcc/website/index.html	2008-06-07 06:51:04 UTC (rev 1162)
@@ -8,6 +8,7 @@
 <body>
 <p>
 <img src="images/banner1.png" alt="CeGCC cross compiler for PocketPC">
+<a href="http://sourceforge.net/awards/cca/?group_id=173455"><img src="http://sourceforge.net/awards/cca/badge_img.php?group_id=173455&style=5" border="0" /></a>
 <p>
 <table border="3">
 <tr><td width="66%">
@@ -22,22 +23,28 @@
 <p>
 We're aiming at providing a consistent and working set of development tools that
 generate code for Windows CE devices such as PDA's and smart phones.
-Our intended development platforms are
-the <a href="http://www.cygwin.com">cygwin</a> environment
-and <a href="http://www.linux.org">GNU/Linux</a> systems.
+Our intended development platforms are the usual GNU development workstations,
+e.g. <a href="http://www.linux.org">GNU/Linux</a>,
+<a href="http://www.freebsd.org">FreeBSD</a>, or 
+<a href="http://www.cygwin.com">cygwin</a>.
 <p>
 We have two products :
 <ul>
-	<li>arm-wince-mingw32ce : toolset to build native Windows CE applications
-	<li>arm-wince-cegcc : toolset to port unix source to Windows CE
+	<li>arm-mingw32ce : toolset to build native Windows CE applications
+	<li>arm-cegcc : toolset to port unix source to Windows CE
 </ul>
+<i>In versions prior to 0.55, these were called <b>arm-wince-mingw32ce</b>
+and <b>arm-wince-cegcc</b> but we changed this in agreement with other projects,
+to facilitate feedback of patches.</i>
+<p>
 Both toolsets allow you to develop on a PC,
 and create apps that run on a PDA or a WinCE cell phone.
 <p>
-What's the meaning of <b>arm-wince-cegcc</b> and <b>arm-wince-mingw32ce</b> ?
+What's the meaning of <b>arm-cegcc</b> and <b>arm-mingw32ce</b> ?
 They both describe the target platform :
 we're building for an <b>ARM</b> processor,
-running the <b>wince</b> (Windows CE) operating system.
+running the Windows CE operating system,
+on unknown hardware (could be any brand of PDA or smart phone).
 In the <b>cegcc</b> case, there's a portability layer;
 in the <b>mingw32ce</b> case there isn't.
 <p>
@@ -49,12 +56,12 @@
 		<td> Cygwin host </td>
 	</tr>
 	<tr>
-		<td> arm-wince-mingw32ce </td>
+		<td> arm-mingw32ce </td>
 		<td> Develop on Linux, create Windows CE native apps </td>
 		<td> Develop on Cygwin, create Windows CE native apps </td>
 	</tr>
 	<tr>
-		<td> arm-wince-cegcc</td>
+		<td> arm-cegcc</td>
 		<td> Develop on Linux, port *nix sources to Windows CE </td>
 		<td> Develop on Cygwin, port *nix sources to Windows CE </td>
 	</tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <dan...@us...> - 2008-05-22 19:49:35
      
     | 
| Revision: 1161
          http://cegcc.svn.sourceforge.net/cegcc/?rev=1161&view=rev
Author:   dannybackx
Date:     2008-05-22 12:49:18 -0700 (Thu, 22 May 2008)
Log Message:
-----------
Add new include to descript FindFirstFlashCard() and
FindNextFlashCard() which are now used by roadmap.
All definitions are on MSDN.
Modified Paths:
--------------
    trunk/cegcc/src/w32api/ChangeLog.ce
Added Paths:
-----------
    trunk/cegcc/src/w32api/include/projects.h
Modified: trunk/cegcc/src/w32api/ChangeLog.ce
===================================================================
--- trunk/cegcc/src/w32api/ChangeLog.ce	2008-05-11 15:51:40 UTC (rev 1160)
+++ trunk/cegcc/src/w32api/ChangeLog.ce	2008-05-22 19:49:18 UTC (rev 1161)
@@ -1,3 +1,7 @@
+2008-05-22  Danny Backx  <dan...@us...>
+
+	* include/projects.h: Add.
+
 2008-04-13  Danny Backx  <dan...@us...>
 	* include/commctrl.h (CommandBar_AddButtons): Change from a
 	function definition into a macro.
Added: trunk/cegcc/src/w32api/include/projects.h
===================================================================
--- trunk/cegcc/src/w32api/include/projects.h	                        (rev 0)
+++ trunk/cegcc/src/w32api/include/projects.h	2008-05-22 19:49:18 UTC (rev 1161)
@@ -0,0 +1,78 @@
+/*
+ * Definition of File and Application Management API.
+ * These are the APIs for finding flash cards and project files.
+ *
+ * You'll need to link -lnote_prj for this.
+ */
+#ifndef	_PROJECT_H_
+#define _PROJECT_H_
+
+#if __GNUC__ >= 3
+#pragma GCC system_header
+#endif
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#if _WIN32_WCE >= 300
+
+#include <windows.h>
+
+#define PA_MAX_PATHNAME 96 
+
+typedef enum EFileIDType {
+	FILE_ID_TYPE_OID  = 0,
+	FILE_ID_TYPE_PATH = 1,
+	FILE_ID_LAST      = 2
+} EFileIDType;
+
+typedef struct PAstruct {
+	EFileIDType m_IDtype;
+	union {
+		/* CEOID m_fileOID; */
+		TCHAR m_szPathname[PA_MAX_PATHNAME];
+	};
+} PAstruct;
+
+typedef BOOL (CALLBACK *EnumProjectsCallback)(DWORD dwOid, LPARAM lParam); 
+typedef BOOL (CALLBACK *EnumProjectsFilesExCallback)(PAstruct * pPA, LPARAM lParam);
+typedef BOOL (CALLBACK *EnumProjectsExCallback)(PAstruct* pPA, LPARAM lParam);
+
+BOOL FindNextFlashCard(HANDLE hFlashCard,
+		LPWIN32_FIND_DATA lpFindFlashData);
+HANDLE FindFirstFlashCard(LPWIN32_FIND_DATA lpFindFlashData);
+int EnumProjects(EnumProjectsCallback lpEnumProc,
+		DWORD dwOidFlash,
+		DWORD dwFlags,
+		LPARAM lParam);
+int EnumProjectsEx(EnumProjectsExCallback pfnEnumProc,
+		DWORD dwOidFlash,
+		DWORD dwFlags,
+		LPARAM lParam);
+int EnumProjectsFiles(EnumProjectsCallback lpEnumProc,
+		DWORD dwOidFlash,
+		DWORD dwFlags,
+		LPTSTR lpszProj,
+		LPTSTR lpszFileName,
+		LPARAM lParam);
+int EnumProjectsFilesEx (EnumProjectsFilesExCallback pfnEnumProc,
+		DWORD dwOidFlash,
+		DWORD dwFlags,
+		LPTSTR szProj,
+		LPTSTR szFileName,
+		LPARAM lParam);
+HANDLE FindFirstProjectFile(LPCTSTR lpFileName,
+		LPWIN32_FIND_DATA lpFindFileData,
+		DWORD dwOidFlash,
+		LPTSTR lpszProj);
+BOOL FindNextProjectFile(HANDLE hHandle, LPWIN32_FIND_DATA lpFindProjData);
+
+#define	PRJ_ENUM_MEMORY		0x1
+#define	PRJ_ENUM_FLASH		0x2
+#define	PRJ_ENUM_ALL_DEVICES	0x4
+#define	PRJ_ENUM_ALL_PROJ	0x10
+#define	PRJ_ENUM_HOME_PROJ	0x100
+
+#endif	/* _WIN32_WCE */
+#endif	/* _PROJECT_H_ */
Property changes on: trunk/cegcc/src/w32api/include/projects.h
___________________________________________________________________
Name: svn:eol-style
   + native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |