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: <dan...@us...> - 2007-06-16 10:11:02
|
Revision: 952 http://svn.sourceforge.net/cegcc/?rev=952&view=rev Author: dannybackx Date: 2007-06-16 03:10:58 -0700 (Sat, 16 Jun 2007) Log Message: ----------- test Added Paths: ----------- tags/x/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-16 08:15:43
|
Revision: 951 http://svn.sourceforge.net/cegcc/?rev=951&view=rev Author: dannybackx Date: 2007-06-16 01:15:42 -0700 (Sat, 16 Jun 2007) Log Message: ----------- Add a blurb about relocating an RPM. Got a question about this. Modified Paths: -------------- trunk/cegcc/docs/install-linux.html Modified: trunk/cegcc/docs/install-linux.html =================================================================== --- trunk/cegcc/docs/install-linux.html 2007-06-15 00:15:47 UTC (rev 950) +++ trunk/cegcc/docs/install-linux.html 2007-06-16 08:15:42 UTC (rev 951) @@ -58,6 +58,21 @@ After a successful installation, all of CeGCC can be found under the <i>/opt/cegcc</i> and <i>/opt/mingw32ce</i> directory trees. +<h3>Help : /opt is a bad place on my system</h3> +Some people have insufficient free space on /opt, +or /opt is not the place where they want this software to be. +There are two ways around this. +<ol start=1> + <li>Tell RPM to install in another place + <pre> +rpm -i --relocate /opt=/home/cegcc-opt cegcc-cegcc-0.15-1.i586.rpm + </pre> + <li>You can put rpm on quicksand, by pointing /opt to another place + <pre> +# mkdir /home/cegcc-opt +# ln -s /home/cegcc-opt /opt + </pre> +</ol> <h2>How do you use the release ?</h2> <p> To start using CeGCC, you'll have to put This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-15 00:17:23
|
Revision: 950 http://svn.sourceforge.net/cegcc/?rev=950&view=rev Author: pedroalves Date: 2007-06-14 17:15:47 -0700 (Thu, 14 Jun 2007) Log Message: ----------- * include/stdlib.h [__COREDLL__]: Include stdio.h. * include/stdio.h [__COREDLL__]: Include stdlib.h. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/stdio.h trunk/cegcc/src/mingw/include/stdlib.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-13 20:17:55 UTC (rev 949) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-15 00:15:47 UTC (rev 950) @@ -1,3 +1,8 @@ +2007-06-15 Pedro Alves <ped...@po...> + + * include/stdlib.h [__COREDLL__]: Include stdio.h. + * include/stdio.h [__COREDLL__]: Include stdlib.h. + 2007-06-09 Pedro Alves <ped...@po...> * mingwex/wince/time.c (time): Handle NULL input. Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2007-06-13 20:17:55 UTC (rev 949) +++ trunk/cegcc/src/mingw/include/stdio.h 2007-06-15 00:15:47 UTC (rev 950) @@ -28,6 +28,12 @@ #include <stdarg.h> #endif /* Not RC_INVOKED */ +#ifdef __COREDLL__ +/* + * On Windows CE, including stdio.h or stdlib.h has the same result. + */ +#include <stdlib.h> +#endif /* Flags for the iobuf structure */ #define _IOREAD 1 /* currently reading */ Modified: trunk/cegcc/src/mingw/include/stdlib.h =================================================================== --- trunk/cegcc/src/mingw/include/stdlib.h 2007-06-13 20:17:55 UTC (rev 949) +++ trunk/cegcc/src/mingw/include/stdlib.h 2007-06-15 00:15:47 UTC (rev 950) @@ -14,6 +14,13 @@ /* All the headers include this file. */ #include <_mingw.h> +#ifdef __COREDLL__ +/* + * On Windows CE, including stdio.h or stdlib.h has the same result. + */ +#include <stdio.h> +#endif + #define __need_size_t #define __need_wchar_t #define __need_NULL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-13 20:17:58
|
Revision: 949 http://svn.sourceforge.net/cegcc/?rev=949&view=rev Author: dannybackx Date: 2007-06-13 13:17:55 -0700 (Wed, 13 Jun 2007) Log Message: ----------- Add a small licensing sentence, and a version sentence to be replaced in distributed versions. Modified Paths: -------------- trunk/cegcc/README Modified: trunk/cegcc/README =================================================================== --- trunk/cegcc/README 2007-06-13 20:12:52 UTC (rev 948) +++ trunk/cegcc/README 2007-06-13 20:17:55 UTC (rev 949) @@ -1,11 +1,15 @@ CeGCC - cross-development tools for Windows CE (PocketPC). +This is the SVN version of CeGCC. + The CeGCC project aims to provide 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 GNU/Linux and Cygwin. This project is free software. See the files COPYING and COPYING.LIB for the GPL and LGPL licenses that cover much - but not all! - of this software. +The CeGCC project is an aggregation of several components, the original license +of each component applies. More information can be found in the docs subdirectory of the distribution, and on our website : This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-13 20:13:02
|
Revision: 948 http://svn.sourceforge.net/cegcc/?rev=948&view=rev Author: dannybackx Date: 2007-06-13 13:12:52 -0700 (Wed, 13 Jun 2007) Log Message: ----------- Auch, forgot to add the comment Pedro just asked for. Modified Paths: -------------- trunk/cegcc/docs/choosing.html Modified: trunk/cegcc/docs/choosing.html =================================================================== --- trunk/cegcc/docs/choosing.html 2007-06-13 20:09:19 UTC (rev 947) +++ trunk/cegcc/docs/choosing.html 2007-06-13 20:12:52 UTC (rev 948) @@ -15,6 +15,8 @@ <p> On the other hand, <i>arm-wince-mingw32ce</i> offers more complete C++ DLL support. We will probably implement a C++ DLL for the <i>arm-wince-mingw32ce</i> environment shortly. + Until we do so, you can easily build it for yourself by using + the <i>src/build-mingw32ce-dlls.sh</i> script. <h2>1. Porting a Unix-like application</h2> <p> <i>Arm-wince-cegcc</i> is a great tool to start porting your application to WinCE, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-13 20:09:30
|
Revision: 947 http://svn.sourceforge.net/cegcc/?rev=947&view=rev Author: dannybackx Date: 2007-06-13 13:09:19 -0700 (Wed, 13 Jun 2007) Log Message: ----------- Try getting all of this in better shape. Comments welcome. Modified Paths: -------------- trunk/cegcc/docs/build-toolchain.html trunk/cegcc/docs/choosing.html trunk/cegcc/docs/debugging.html trunk/cegcc/docs/details.html trunk/cegcc/docs/dll.html trunk/cegcc/docs/index.html trunk/cegcc/docs/install-linux.html trunk/cegcc/docs/layer.html trunk/cegcc/docs/license.html trunk/cegcc/docs/profile.html trunk/cegcc/docs/structure.html trunk/cegcc/docs/using.html trunk/cegcc/docs/what.html Modified: trunk/cegcc/docs/build-toolchain.html =================================================================== --- trunk/cegcc/docs/build-toolchain.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/build-toolchain.html 2007-06-13 20:09:19 UTC (rev 947) @@ -131,7 +131,9 @@ <H3>1.4.3 </H3> <H1>2. Building on Cygwin</H1> <P> -To be written by someone who knows about Cygwin... +The scripts <i>build-cegcc.sh</i> and <i>build-mingw32ce.sh</i> +work on Cygwin in the same way as they do on Linux. +<p> <A NAME="#common"><H1>3 Platform independent information</H1></A> <H2>3.1 How the scripts interact</H2> <H2>3.2 Installation directory</H2> @@ -260,5 +262,24 @@ directories prior to using the build scripts. The build tends to be less reliable if part of an old build is still present. <H2>6.3 </H2> + </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/choosing.html =================================================================== --- trunk/cegcc/docs/choosing.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/choosing.html 2007-06-13 20:09:19 UTC (rev 947) @@ -6,26 +6,51 @@ <img src="../images/banner1.png" alt="CeGCC cross compiler for PocketPC"> <h1>Choosing in which environment to develop</h1> <p> - <h2>A Unix-like application</h2> + Remember that <i>arm-wince-cegcc</i> implements a unix-like layer on top of Windows CE, + and that <i>arm-wince-mingw32ce</i> implements the native CE API. <p> - <h2>Use only the Windows CE API</h2> + <b>Our recommendation is to use the <i>arm-wince-mingw32ce</i> toolset whenever possible</b> + because the newlib-based unix-like layer that <i>arm-wince-cegcc</i> implements is + incomplete (it's newlib, not glibc) and sometimes confusing and incompatible with coredll. <p> - <h2>Choosing in which environment to develop</h2> + On the other hand, <i>arm-wince-mingw32ce</i> offers more complete C++ DLL support. + We will probably implement a C++ DLL for the <i>arm-wince-mingw32ce</i> environment shortly. + <h2>1. Porting a Unix-like application</h2> <p> + <i>Arm-wince-cegcc</i> is a great tool to start porting your application to WinCE, + as it offers a unix-like layer on top of the Windows CE API. + <p> + This doesn't come without risks though (it is very easy to mix up stdio API's + from coredll and newlib, and they're incompatible). + Also be aware that Windows CE has many Unicode based system calls, + you'll have to make sure your application can deal with that. + <h2>2. Porting an application that uses only the Windows CE API</h2> + <p> + It should be abundantly clear that the right tool for this job is the <i>arm-wince-mingw32ce</i> + toolset. + <h2>3. Recompiling a CE application that was built with Embedded Visual C++</h2> + <p> <p>If you want to build an existing Windows CE application that already - builds with eVC or MSVC, or you want to develop a Windows CE application that - only depends on the Win32 API and the limited libc support coredll.dll (the - native runtime) offers, then what you want is mingw32ce.</p> - <p>If you want to port an application that depends on a more complete c runtime, - the cegcc toolchain will be a better environment. Cegcc offers unified - file descriptors, (in-process only) signals, (TODO: to be completed).</p> - <h2>Microsoft environment equivalents</h2> + builds with eVC, then you probably think you're not porting an application. + <p> + The right tool to use is <i>arm-wince-mingw32ce</i>, + but you need to be aware that some of the C or C++ extensions supported by + eVC aren't available in our toolset. + <h2>4. Porting an application that was built with MicroSoft Visual C++</h2> + <p> + <p>An application that is built not with eVC but MSVC (MicroSoft Visual C++) + is not typically a Windows CE but a Windows application. + This may be an issue because Windows CE supports only a limited subset of + the Windows API. + <p> + Once more, the right tool to use is <i>arm-wince-mingw32ce</i>. + <h2>5. Microsoft environment equivalents</h2> <p>The <b>/ENTRY</b> option to the Microsoft compiler is equivalent to ld's <b>-e</b> option.</P> - <h2>Console Applications</h2> + <h2>6. Console Applications</h2> <h>In the NT/9x target versions of Microsoft's tools, there is have some - default behaviour, such as <i>if main is defined then CONSOLE subsytem is the - default</i>. + default behaviour, such as + <i>if main is defined then CONSOLE subsytem is the default</i>. <p>Windows CE applications don't have that functionality, as they must always specify the Windows CE subsystem: <a href="http://msdn2.microsoft.com/en-us/library/fcc1zstk.aspx"> http://msdn2.microsoft.com/en-us/library/fcc1zstk.aspx</a> <p>If you want to develop a console based application, take a look at Pocket @@ -34,4 +59,22 @@ one, a default one will be linked in that will call the standard int main (int argc, char** argv) with argc and argv properly filled.</p> </body> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </html> Modified: trunk/cegcc/docs/debugging.html =================================================================== --- trunk/cegcc/docs/debugging.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/debugging.html 2007-06-13 20:09:19 UTC (rev 947) @@ -8,6 +8,7 @@ did with the cross-debugger that's part of the <font color="red"><b>0.02</b></font> binary pre-release of cegcc. +(Don't worry about the old version number, all of this is still valid.) <p> I've annotated it slightly. My input is in <font color="green"><i>green italic</i></font>, @@ -315,4 +316,22 @@ </pre> </p> </body> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </html> Modified: trunk/cegcc/docs/details.html =================================================================== --- trunk/cegcc/docs/details.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/details.html 2007-06-13 20:09:19 UTC (rev 947) @@ -222,4 +222,22 @@ dannypc: {74} </pre> </body> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </html> Modified: trunk/cegcc/docs/dll.html =================================================================== --- trunk/cegcc/docs/dll.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/dll.html 2007-06-13 20:09:19 UTC (rev 947) @@ -5,13 +5,18 @@ </HEAD> <BODY> <P> -CeGCC ships with three DLL files. -You can find them at +Depending on the package you're using, CeGCC ships with a different number of DLL files. +The <i>arm-wince-cegcc</i> distribution has three DLLs : <PRE> -/usr/ppc/arm-wince-cegcc/lib/device/cegcc.dll -/usr/ppc/arm-wince-cegcc/lib/device/cegccthrd.dll -/usr/ppc/arm-wince-cegcc/lib/device/libstdc++.dll +/opt/cegcc/arm-wince-cegcc/lib/device/cegcc.dll +/opt/cegcc/arm-wince-cegcc/lib/device/cegccthrd.dll +/opt/cegcc/arm-wince-cegcc/lib/device/libstdc++.dll </PRE> +the <i>arm-wince-mingw32ce</i> distribution currently only has one DLL : +<PRE> +/opt/mingw32ce/arm-wince-mingw32ce/bin/mingwm10.dll +</PRE> +Note that these absolute file names are the ones found in the RPM images that we distribute. <P> The good thing about those DLLs is they allow you to create smaller and more efficient applications. @@ -23,7 +28,7 @@ that this application or a part of it was not found. No reference to which DLL you're missing. <P> -The DLLs which we ship in <i>/usr/ppc/arm-wince-cegcc/lib/device</i> +The DLLs which we ship in <i>/opt/cegcc/arm-wince-cegcc/lib/device</i> are stripped version, meant to be installed on your PDA. In the directory above, files of the same name (but bigger) exist. They are unstripped versions (they still contain named symbol definitions), @@ -32,9 +37,28 @@ Depending on the tools available to you, you will want to run commands such as <PRE> -pcp /usr/ppc/arm-wince-cegcc/lib/device/cegcc.dll /windows/cegcc.dll -pcp /usr/ppc/arm-wince-cegcc/lib/device/cegccthrd.dll /windows/cegccthrd.dll -pcp /usr/ppc/arm-wince-cegcc/lib/device/libstdc++.dll /windows/libstdc++.dll +pcp /opt/cegcc/arm-wince-cegcc/lib/device/cegcc.dll :/windows/cegcc.dll +pcp /opt/cegcc/arm-wince-cegcc/lib/device/cegccthrd.dll :/windows/cegccthrd.dll +pcp /opt/cegcc/arm-wince-cegcc/lib/device/libstdc++.dll :/windows/libstdc++.dll +pcp /opt/mingw32ce/arm-wince-mingw32ce/bin/mingwm10.dll :/windows/mingwm10.dll </PRE> </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/index.html =================================================================== --- trunk/cegcc/docs/index.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/index.html 2007-06-13 20:09:19 UTC (rev 947) @@ -41,4 +41,22 @@ functionality is part of ActiveSync, which usually ships with your PDA. On linux, the RAPI implementation is provided by the <a href="http://synce.sourceforge.net">SynCE</a> project.</p> </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/install-linux.html =================================================================== --- trunk/cegcc/docs/install-linux.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/install-linux.html 2007-06-13 20:09:19 UTC (rev 947) @@ -44,23 +44,27 @@ You can install the CeGCC RPM just like any other one, by using the <pre> - rpm -i cegcc-0.09-2.i586.rpm + rpm -i cegcc-cegcc-0.15-1.i586.rpm + rpm -i cegcc-mingw32ce-0.15-1.i586.rpm </pre> command. +You'll need to be the superuser (root) for this to work. For unknown reasons, the RPM sometimes asks for the <i>libiconv</i> to be installed first. A workaround is to use the --nodeps option : <pre> - rpm -i --nodeps cegcc-0.09-2.i586.rpm + rpm -i --nodeps cegcc-cegcc-0.15-1.i586.rpm </pre> <p> After a successful installation, all of CeGCC can be found under the -<i>/usr/ppc</i> directory tree. +<i>/opt/cegcc</i> and +<i>/opt/mingw32ce</i> directory trees. <h2>How do you use the release ?</h2> <p> To start using CeGCC, you'll have to put -the directory <i>/usr/ppc/bin</i> in your path, e.g. like this : +the directories <i>/opt/cegcc/bin</i> and/or +<i>/opt/mingw32ce/bin</i> in your path, e.g. like this : <pre> - export PATH=$PATH:/usr/ppc/bin + export PATH=$PATH:/opt/cegcc/bin:/opt/mingw32ce/bin </pre> <p> To make this permanent, you'll want to apply such a change to your login environment, @@ -124,43 +128,24 @@ <H2>Known problems</H2> <P> None that we care to mention here. -<!-- - - Button row at the top of the page. - - --> -<table bgcolor="blue" border="6"> <tr> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="http://cegcc.sf.net/docs/index.html"> - Documentation - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="http://svn.sourceforge.net/cegcc"> - SVN Repository - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="http://sf.net/projects/cegcc"> - Project page on SourceForge - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="http://sf.net/project/showfiles.php?group_id=173455"> - Download - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="install-linux.html"> - Installation on Linux - </a> - </font> </td> -</tr></table> -<!-- - - End of the button row - - --> </p> </body> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </html> Modified: trunk/cegcc/docs/layer.html =================================================================== --- trunk/cegcc/docs/layer.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/layer.html 2007-06-13 20:09:19 UTC (rev 947) @@ -43,8 +43,23 @@ to either the current directory from the parent process, or the path extracted from the executable file we're running. Similarly a PATH variable is also put in the environment. -<p> -More information about this is in -<a href="layer.html">The unix-like layer provided by CeGCC</a>. </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/license.html =================================================================== --- trunk/cegcc/docs/license.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/license.html 2007-06-13 20:09:19 UTC (rev 947) @@ -56,4 +56,22 @@ <li><a href="http://www.gnu.org/licenses/gpl-faq.html">GPL FAQ</a> </ul> </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/profile.html =================================================================== --- trunk/cegcc/docs/profile.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/profile.html 2007-06-13 20:09:19 UTC (rev 947) @@ -491,4 +491,22 @@ but the startup function (<i>WinMainCRTStartup</i>, e.g. in <i>src/mingw/crt3.c</i>) calls the same functions as <i>exit</i>. </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/structure.html =================================================================== --- trunk/cegcc/docs/structure.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/structure.html 2007-06-13 20:09:19 UTC (rev 947) @@ -87,4 +87,22 @@ <P> Current versions of Windows CE use coredll.dll instead. </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/using.html =================================================================== --- trunk/cegcc/docs/using.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/using.html 2007-06-13 20:09:19 UTC (rev 947) @@ -309,6 +309,47 @@ Note that the <i>arm-wince-cegcc</i> target has different characteristics than <i>arm-wince-mingw32ce</i> target. The <errno.h> file is an example of such a difference : -it does exist, and works, in <i>arm-wince-cegcc<i/>. +it does exist, and works, in <i>arm-wince-cegcc</i>. +<h2>Mixing coredll.dll and cegcc stdio</h2> +<p> +When you're using the <i>arm-wince-cegcc</i> tools, +the unix-like layer kicks in : +the <i>cegcc.dll</i> library provides you with all of +<a href="http://sources.redhat.com/newlib/">newlib</a>, +a library originally written to offer a cheap C library for embedded environments. +<p> +Newlib comes with its own implementation of <i>stdio</i>, +functions like <i>fopen</i>, <i>fprintf</i>, <i>fclose</i>, <i>scanf</i>, <i>printf</i>, +and many more. +<p> +The trouble is that coredll.dll, +Windows CE's runtime library, also comes with these functions, +and the two libraries are incompatible with each other. +<p> +Getting in trouble with this is not all that easy, so we hope you don't go down this road. +Should you ever find yourself in a position where you find that stdio functions mysteriously +fail on you, then think about this. +The way to figure out which functions your application is using is +to use the <i>arm-wince-cegcc-objdump</i> utility. +It'll tell you from which library each function is obtained. +All of stdio should come from the same library. </BODY> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </HTML> Modified: trunk/cegcc/docs/what.html =================================================================== --- trunk/cegcc/docs/what.html 2007-06-13 19:52:22 UTC (rev 946) +++ trunk/cegcc/docs/what.html 2007-06-13 20:09:19 UTC (rev 947) @@ -69,14 +69,32 @@ After completing the download, all you have to do is install it, using a command such as : <pre> -rpm -i --nodeps cegcc-0.11-1.i586.rpm +rpm -i --nodeps cegcc-cegcc-0.14-1.i586.rpm </pre> The --nodeps argument is sometimes necessary, I'm not sure why. <p> -After that, all the commands should be available under /usr/ppc as described +After that, all the commands should be available under /opt/cegcc or /opt/mingw32ce as described in the rest of this documentation. <h1>The Cygwin based distribution</h1> <p> To be written. </body> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="http://cegcc.sourceforge.net"> CeGCC Home Page on SourceForge </a> + <li> <a href="index.html"> CeGCC Documentation </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-13 19:52:30
|
Revision: 946 http://svn.sourceforge.net/cegcc/?rev=946&view=rev Author: dannybackx Date: 2007-06-13 12:52:22 -0700 (Wed, 13 Jun 2007) Log Message: ----------- New file Added Paths: ----------- trunk/cegcc/docs/license.html Added: trunk/cegcc/docs/license.html =================================================================== --- trunk/cegcc/docs/license.html (rev 0) +++ trunk/cegcc/docs/license.html 2007-06-13 19:52:22 UTC (rev 946) @@ -0,0 +1,59 @@ +<HTML> +<HEAD> +<TITLE>CeGCC License<TITLE> +</HEAD> +<BODY> +<img src="../images/banner1.png" alt="CeGCC cross compiler for PocketPC"> +<H1>CeGCC License</H1> +<p> +The licensing of free software products is not an easy issue. +Aggregated products like cegcc are even more complicated to describe accurately. +<p> +To understand all this, you'll need to know about the different types of material involved, +and about the way their licenses work. +The collection of all that is the CeGCC licensing. +<p> +I see three types of material : +<ul> + <li>software that is used to develop, but that doesn't itself get distributed with the application being developed + <li>software that ends up in the application being developed + <li>documentation +</ul> +<p> +CeGCC is an aggregation of several free software products, +and you'll see that they come with different licenses. +A well known license is the GNU Public License (also known as GPL), +it is often described as <i>viral</i>, +meaning that it tends to infect software. +<p> +It is important to understand that only the software in the first bullet above +carries such licenses. +Because of the fact that this software never ends up in the application being developed, +the viral aspect doesn't apply. +<p> +The only other thing you basically need to know is that the licenses for each original piece +of software from which cegcc is aggregated still apply. +All the software added specifically by the cegcc project authors carries the most liberal +license we can apply; see the source files themselves. +<p> +If this all looks very confusing, +maybe we can convince you by showing that projects like +<a href="http://www.gnu.org/software/gcc">gcc</a> +also follow this approach. +Here is an example from the GCC documentation : +<pre> +The GNU Compiler Collection is free software. See the file COPYING for +copying permission. The manuals, and some of the runtime libraries, are +under different terms; see the individual source files for details. +</pre> +<p> +<H2>Links about licensing</H2> +<ul> + <li><A HREF="http://www.gnu.org/licenses/gpl-faq.html#MereAggregation"> + Aggregation</a> + <li><a href="http://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean"> + Compatible with GPL</a> + <li><a href="http://www.gnu.org/licenses/gpl-faq.html">GPL FAQ</a> +</ul> +</BODY> +</HTML> Property changes on: trunk/cegcc/docs/license.html ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-13 18:22:48
|
Revision: 945 http://svn.sourceforge.net/cegcc/?rev=945&view=rev Author: dannybackx Date: 2007-06-13 11:22:30 -0700 (Wed, 13 Jun 2007) Log Message: ----------- * rshd.c : Remove #include <pkfuncs.h>. * Makefile : Add references to PipeLib directory so rshd can be built without installing PipeLib. Modified Paths: -------------- trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/Makefile trunk/cegcc/tools/rshd/rshd.c Modified: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog 2007-06-13 15:23:43 UTC (rev 944) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-06-13 18:22:30 UTC (rev 945) @@ -1,3 +1,9 @@ +2007-06-13 Danny Backx <dan...@us...> + + * rshd.c : Remove #include <pkfuncs.h>. + * Makefile : Add references to PipeLib directory so rshd can be built + without installing PipeLib. + 2007-06-10 Pedro Alves <ped...@po...> Initial import. Modified: trunk/cegcc/tools/rshd/Makefile =================================================================== --- trunk/cegcc/tools/rshd/Makefile 2007-06-13 15:23:43 UTC (rev 944) +++ trunk/cegcc/tools/rshd/Makefile 2007-06-13 18:22:30 UTC (rev 945) @@ -1,6 +1,6 @@ TARGET=arm-wince-mingw32ce -LDFLAGS=-lws2 -lPipeLib -CFLAGS=-O0 -g3 +LDFLAGS=-lws2 -L../PipeLib/PipeLib -lPipeLib +CFLAGS=-O0 -g3 -I../PipeLib/PipeLib WARNFLAGS=-Wall -Wextra INCLUDES= Modified: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c 2007-06-13 15:23:43 UTC (rev 944) +++ trunk/cegcc/tools/rshd/rshd.c 2007-06-13 18:22:30 UTC (rev 945) @@ -31,7 +31,6 @@ #include <windows.h> #include <winsock2.h> -#include <pkfuncs.h> #include <PipeLib.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-13 15:23:49
|
Revision: 944 http://svn.sourceforge.net/cegcc/?rev=944&view=rev Author: pedroalves Date: 2007-06-13 08:23:43 -0700 (Wed, 13 Jun 2007) Log Message: ----------- We don't need this hack anymore. * mingw-fake_crt: Remove. Modified Paths: -------------- trunk/cegcc/src/ChangeLog Removed Paths: ------------- trunk/cegcc/src/mingw-fake_crt/ Modified: trunk/cegcc/src/ChangeLog =================================================================== --- trunk/cegcc/src/ChangeLog 2007-06-13 15:03:53 UTC (rev 943) +++ trunk/cegcc/src/ChangeLog 2007-06-13 15:23:43 UTC (rev 944) @@ -1,5 +1,9 @@ 2007-06-13 Pedro Alves <ped...@po...> + * mingw-fake_crt: Remove. + +2007-06-13 Pedro Alves <ped...@po...> + * script.sh: Rename to ... * build-mingw32ce-dlls.sh: ... this. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-13 15:03:57
|
Revision: 943 http://svn.sourceforge.net/cegcc/?rev=943&view=rev Author: pedroalves Date: 2007-06-13 08:03:53 -0700 (Wed, 13 Jun 2007) Log Message: ----------- * script.sh: Rename to ... * build-mingw32ce-dlls.sh: ... this. Modified Paths: -------------- trunk/cegcc/src/ChangeLog Added Paths: ----------- trunk/cegcc/src/build-mingw32ce-dlls.sh Removed Paths: ------------- trunk/cegcc/src/script.sh Modified: trunk/cegcc/src/ChangeLog =================================================================== --- trunk/cegcc/src/ChangeLog 2007-06-10 20:44:04 UTC (rev 942) +++ trunk/cegcc/src/ChangeLog 2007-06-13 15:03:53 UTC (rev 943) @@ -1,3 +1,8 @@ +2007-06-13 Pedro Alves <ped...@po...> + + * script.sh: Rename to ... + * build-mingw32ce-dlls.sh: ... this. + 2007-06-02 Danny Backx <dan...@us...> * cegcc/libstdc++/Makefile : Remove THE_SYSTEM_LIBS variable, somehow Copied: trunk/cegcc/src/build-mingw32ce-dlls.sh (from rev 844, trunk/cegcc/src/script.sh) =================================================================== --- trunk/cegcc/src/build-mingw32ce-dlls.sh (rev 0) +++ trunk/cegcc/src/build-mingw32ce-dlls.sh 2007-06-13 15:03:53 UTC (rev 943) @@ -0,0 +1,90 @@ +#!/bin/bash -x + +# Based on script from: +# http://cygwin.com/ml/cygwin-apps/2006-05/msg00044.html + +TARGET=arm-wince-mingw32ce +PREFIX=/opt/mingw32ce +GCC_VERSION=4.1.0 + +export PATH=${PREFIX}/bin:${PATH} + +srcdir=`readlink -f ./gcc` +builddir=`readlink -f build-mingw32ce` + +pushd ${PREFIX}/${TARGET}/lib + +LIBVER=$(grep libtool_VERSION= ${srcdir}/libstdc++-v3/configure | sed -e 's/libtool_VERSION=//') +LIBVER_c=$(echo $LIBVER | awk -F: '{print $1}') +LIBVER_r=$(echo $LIBVER | awk -F: '{print $2}') +LIBVER_a=$(echo $LIBVER | awk -F: '{print $3}') +LIBSTDCPP_DLLVER=$(($LIBVER_c - $LIBVER_a)) + +## no need for a DLLVER for libgcc; it's guaranteed to only add functions, +## never remove or change thier signature. So it'll always be backwards-compatible. + +## It's probably not necessary, but we'll use the LIBSTDCPP_DLLVER for +## libsupc++ as well (after all, all of libsupc++ appears IN libstdc++ +## so if libsupc++ changes in a backwards-non-compatible way, then libstdc++ +## will, too -- and the gcc folks will modify its LIBVER. The downside here +## is that if libsupc++ is unchanged or remains backwards compatible, but +## some other part of libstdc++ changes badly -- we will unnecessarily bump +## libsupc++'s DLLNUM. 'sokay. + +pushd ${PREFIX}/lib/gcc/${TARGET}/${GCC_VERSION} +${TARGET}-dlltool --output-def libgcc.def --export-all libgcc.a +${builddir}/gcc/gcc/xgcc -shared -olibgcc.dll \ + -Wl,--out-implib,libgcc.dll.a \ + ./libgcc.def \ + ./libgcc.a +#no versioned implib, no need to ln +popd + +${TARGET}-dlltool --output-def libsupc++.def --export-all libsupc++.a +${builddir}/gcc/gcc/xgcc -shared -olibsupc++-${LIBSTDCPP_DLLVER}.dll \ + -Wl,--out-implib,libsupc++-${LIBSTDCPP_DLLVER}.dll.a \ + ./libsupc++.def \ + ./libsupc++.a +rm -f libsupc++.dll.a +ln -s libsupc++-${LIBSTDCPP_DLLVER}.dll.a libsupc++.dll.a + +${TARGET}-dlltool --output-def libstdc++.def --export-all libstdc++.a +${builddir}/gcc/gcc/xgcc -shared -olibstdc++-${LIBSTDCPP_DLLVER}.dll \ + -Wl,--out-implib,libstdc++-${LIBSTDCPP_DLLVER}.dll.a \ + ./libstdc++.def \ + ./libstdc++.a + +rm -f libstdc++.dll.a +ln -s libstdc++-${LIBSTDCPP_DLLVER}.dll.a libstdc++.dll.a + +mkdir -p ${builddir}/device +pushd ${builddir}/device +rm -f libsupc++-${LIBSTDCPP_DLLVER}.dll +rm -f libstdc++-${LIBSTDCPP_DLLVER}.dll +rm -f libgcc.dll + +cp -f ${PREFIX}/lib/gcc/${TARGET}/${GCC_VERSION}/libgcc.dll . +cp -f ${PREFIX}/${TARGET}/lib/libsupc++-${LIBSTDCPP_DLLVER}.dll . +cp -f ${PREFIX}/${TARGET}/lib/libstdc++-${LIBSTDCPP_DLLVER}.dll . + +${TARGET}-strip libgcc.dll +${TARGET}-strip libsupc++-${LIBSTDCPP_DLLVER}.dll +${TARGET}-strip libstdc++-${LIBSTDCPP_DLLVER}.dll +popd + +## MUNGE the .la files +mv libstdc++.la libstdc++.la.SAVE +cat libstdc++.la.SAVE |\ + sed -e "s/^dlname=.*\$/dlname='libstdc++-${LIBSTDCPP_DLLVER}.dll'/" \ + -e "s/^library_names=.*\$/library_names='libstdc++.dll.a'/" >\ + libstdc++.la +rm -f libstdc++.la.SAVE + +mv libsupc++.la libsupc++.la.SAVE +cat libsupc++.la.SAVE |\ + sed -e "s/^dlname=.*\$/dlname='libsupc++-${LIBSTDCPP_DLLVER}.dll'/" \ + -e "s/^library_names=.*\$/library_names='libsupc++.dll.a'/" >\ + libsupc++.la +rm -f libsupc++.la.SAVE + +popd Deleted: trunk/cegcc/src/script.sh =================================================================== --- trunk/cegcc/src/script.sh 2007-06-10 20:44:04 UTC (rev 942) +++ trunk/cegcc/src/script.sh 2007-06-13 15:03:53 UTC (rev 943) @@ -1,90 +0,0 @@ -#!/bin/bash -x - -# Based on script from: -# http://cygwin.com/ml/cygwin-apps/2006-05/msg00044.html - -TARGET=arm-wince-mingw32ce -PREFIX=/opt/mingw32ce -GCC_VERSION=4.1.0 - -export PATH=${PREFIX}/bin:${PATH} - -srcdir=`readlink -f ./gcc` -builddir=`readlink -f build-mingw32ce` - -pushd ${PREFIX}/${TARGET}/lib - -LIBVER=$(grep libtool_VERSION= ${srcdir}/libstdc++-v3/configure | sed -e 's/libtool_VERSION=//') -LIBVER_c=$(echo $LIBVER | awk -F: '{print $1}') -LIBVER_r=$(echo $LIBVER | awk -F: '{print $2}') -LIBVER_a=$(echo $LIBVER | awk -F: '{print $3}') -LIBSTDCPP_DLLVER=$(($LIBVER_c - $LIBVER_a)) - -## no need for a DLLVER for libgcc; it's guaranteed to only add functions, -## never remove or change thier signature. So it'll always be backwards-compatible. - -## It's probably not necessary, but we'll use the LIBSTDCPP_DLLVER for -## libsupc++ as well (after all, all of libsupc++ appears IN libstdc++ -## so if libsupc++ changes in a backwards-non-compatible way, then libstdc++ -## will, too -- and the gcc folks will modify its LIBVER. The downside here -## is that if libsupc++ is unchanged or remains backwards compatible, but -## some other part of libstdc++ changes badly -- we will unnecessarily bump -## libsupc++'s DLLNUM. 'sokay. - -pushd ${PREFIX}/lib/gcc/${TARGET}/${GCC_VERSION} -${TARGET}-dlltool --output-def libgcc.def --export-all libgcc.a -${builddir}/gcc/gcc/xgcc -shared -olibgcc.dll \ - -Wl,--out-implib,libgcc.dll.a \ - ./libgcc.def \ - ./libgcc.a -#no versioned implib, no need to ln -popd - -${TARGET}-dlltool --output-def libsupc++.def --export-all libsupc++.a -${builddir}/gcc/gcc/xgcc -shared -olibsupc++-${LIBSTDCPP_DLLVER}.dll \ - -Wl,--out-implib,libsupc++-${LIBSTDCPP_DLLVER}.dll.a \ - ./libsupc++.def \ - ./libsupc++.a -rm -f libsupc++.dll.a -ln -s libsupc++-${LIBSTDCPP_DLLVER}.dll.a libsupc++.dll.a - -${TARGET}-dlltool --output-def libstdc++.def --export-all libstdc++.a -${builddir}/gcc/gcc/xgcc -shared -olibstdc++-${LIBSTDCPP_DLLVER}.dll \ - -Wl,--out-implib,libstdc++-${LIBSTDCPP_DLLVER}.dll.a \ - ./libstdc++.def \ - ./libstdc++.a - -rm -f libstdc++.dll.a -ln -s libstdc++-${LIBSTDCPP_DLLVER}.dll.a libstdc++.dll.a - -mkdir -p ${builddir}/device -pushd ${builddir}/device -rm -f libsupc++-${LIBSTDCPP_DLLVER}.dll -rm -f libstdc++-${LIBSTDCPP_DLLVER}.dll -rm -f libgcc.dll - -cp -f ${PREFIX}/lib/gcc/${TARGET}/${GCC_VERSION}/libgcc.dll . -cp -f ${PREFIX}/${TARGET}/lib/libsupc++-${LIBSTDCPP_DLLVER}.dll . -cp -f ${PREFIX}/${TARGET}/lib/libstdc++-${LIBSTDCPP_DLLVER}.dll . - -${TARGET}-strip libgcc.dll -${TARGET}-strip libsupc++-${LIBSTDCPP_DLLVER}.dll -${TARGET}-strip libstdc++-${LIBSTDCPP_DLLVER}.dll -popd - -## MUNGE the .la files -mv libstdc++.la libstdc++.la.SAVE -cat libstdc++.la.SAVE |\ - sed -e "s/^dlname=.*\$/dlname='libstdc++-${LIBSTDCPP_DLLVER}.dll'/" \ - -e "s/^library_names=.*\$/library_names='libstdc++.dll.a'/" >\ - libstdc++.la -rm -f libstdc++.la.SAVE - -mv libsupc++.la libsupc++.la.SAVE -cat libsupc++.la.SAVE |\ - sed -e "s/^dlname=.*\$/dlname='libsupc++-${LIBSTDCPP_DLLVER}.dll'/" \ - -e "s/^library_names=.*\$/library_names='libsupc++.dll.a'/" >\ - libsupc++.la -rm -f libsupc++.la.SAVE - -popd This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 20:45:46
|
Revision: 942 http://svn.sourceforge.net/cegcc/?rev=942&view=rev Author: pedroalves Date: 2007-06-10 13:44:04 -0700 (Sun, 10 Jun 2007) Log Message: ----------- Initial import of rshd. * COPYING, README, TODO, ChangeLog, Makefile, rshd.c, tester.c: New files. Added Paths: ----------- trunk/cegcc/tools/rshd/ trunk/cegcc/tools/rshd/COPYING trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/Makefile trunk/cegcc/tools/rshd/README trunk/cegcc/tools/rshd/TODO trunk/cegcc/tools/rshd/rshd.c trunk/cegcc/tools/rshd/tester.c Added: trunk/cegcc/tools/rshd/COPYING =================================================================== --- trunk/cegcc/tools/rshd/COPYING (rev 0) +++ trunk/cegcc/tools/rshd/COPYING 2007-06-10 20:44:04 UTC (rev 942) @@ -0,0 +1,342 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog (rev 0) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-06-10 20:44:04 UTC (rev 942) @@ -0,0 +1,6 @@ +2007-06-10 Pedro Alves <ped...@po...> + + Initial import. + + * COPYING, README, TODO, ChangeLog, Makefile, rshd.c, tester.c: New + files. Property changes on: trunk/cegcc/tools/rshd/ChangeLog ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/rshd/Makefile =================================================================== --- trunk/cegcc/tools/rshd/Makefile (rev 0) +++ trunk/cegcc/tools/rshd/Makefile 2007-06-10 20:44:04 UTC (rev 942) @@ -0,0 +1,76 @@ +TARGET=arm-wince-mingw32ce +LDFLAGS=-lws2 -lPipeLib +CFLAGS=-O0 -g3 +WARNFLAGS=-Wall -Wextra + +INCLUDES= + +ALLFLAGS=$(CFLAGS) $(INCLUDES) $(WARNFLAGS) + +CC=$(TARGET)-gcc + +BINS = rshd.exe tester.exe +STRIPPED_BINS = rshd-stripped.exe tester-stripped.exe + +LIBS = +TARGETS = $(BINS) $(LIBS) + +srcdir=. +distdir=rshd-0.1.0 +TAR = tar +TARFLAGS = z +TARFILEEXT = .tar.gz + +SRCDIST_FILES=\ + rshd.c tester.c Makefile README TODO COPYING ChangeLog + +BINDIST_FILES=\ + rshd.exe + +all: $(TARGETS) +bins: $(BINS) +libs: $(LIBS) + +rshd.exe: rshd.c Makefile + $(CC) -o $@ $< $(ALLFLAGS) $(LDFLAGS) + +rshd-stripped.exe: rshd.exe + $(TARGET)-strip $< -o $@ + +tester.exe: tester.c Makefile + $(CC) -o $@ $< $(ALLFLAGS) + +tester-stripped.exe: tester.exe + $(TARGET)-strip $< -o $@ + +download: rshd-stripped.exe tester-stripped.exe + pcp rshd-stripped.exe ":/rshd.exe" + pcp tester-stripped.exe ":/tester.exe" + +clean: + rm -f $(BINS) $(STRIPPED_BINS) $(LIBS) + +dist: srcdist bindist + +srcdist: all + rm -rf $(distdir) + mkdir $(distdir) + chmod 755 $(distdir) + for i in $(SRCDIST_FILES); do \ + cp -p $(srcdir)/$$i $(distdir)/$$i ; \ + done + rm -f $(distdir).tar.gz + $(TAR) $(TARFLAGS)cf $(distdir)-src$(TARFILEEXT) $(distdir) + +bindist: all + rm -rf $(distdir) + mkdir $(distdir) + chmod 755 $(distdir) + for i in $(BINDIST_FILES); do \ + cp -p $(srcdir)/$$i $(distdir)/$$i ; \ + done + rm -f $(distdir).tar.gz + $(TAR) $(TARFLAGS)cf $(distdir)-bin$(TARFILEEXT) $(distdir) + + +.PHONY: all install download clean dist bindist srcdist Property changes on: trunk/cegcc/tools/rshd/Makefile ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/rshd/README =================================================================== --- trunk/cegcc/tools/rshd/README (rev 0) +++ trunk/cegcc/tools/rshd/README 2007-06-10 20:44:04 UTC (rev 942) @@ -0,0 +1,25 @@ + README for rshd for Windows CE + +This directory contains the rshd for Windows CE server. + +<TODO: how to build> + Depends on PipeLib. + PipeLib is found at the cegcc site. + +<TODO: how to run> + +<TODO: a note on (missing) security> + +Have fun! + +Pedro Alves + +-- + +See the file COPYING in the various directories, for a description of +the GNU General Public License terms under which you can copy the +files. + +REPORTING BUGS: +ce...@so... +pe...@po... Property changes on: trunk/cegcc/tools/rshd/README ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/rshd/TODO =================================================================== --- trunk/cegcc/tools/rshd/TODO (rev 0) +++ trunk/cegcc/tools/rshd/TODO 2007-06-10 20:44:04 UTC (rev 942) @@ -0,0 +1,12 @@ +- Handle/test/pass child command line args. + +- What should be done with stdin echo? Should we do it, or not? Need + to test against a real rshd server see what happens there. + +- autotoolize. + +- Write a proper README.txt file. + +- Implement authentication using files or the registry. + +- Convert to service, and write a control panel applet ? Property changes on: trunk/cegcc/tools/rshd/TODO ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c (rev 0) +++ trunk/cegcc/tools/rshd/rshd.c 2007-06-10 20:44:04 UTC (rev 942) @@ -0,0 +1,899 @@ +/* rshd for Windows CE. + + Copyright (C) 2007, Pedro M. P. Alves + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + + Originally based on rlogind from GNUWINCE by Voxware Inc., + rewritten as native Windows CE application using PipeLib + and mingw32ce. */ + +#include <sys/types.h> +#include <stdio.h> +#include <string.h> +#include <fcntl.h> +#include <stdarg.h> +#include <malloc.h> + +#include <windows.h> +#include <winsock2.h> +#include <pkfuncs.h> + +#include <PipeLib.h> + +#ifndef COUNTOF +#define COUNTOF(STR) (sizeof (STR) / sizeof ((STR)[0])) +#endif + +static BOOL debug = FALSE; + + + +static void +logprintf (const char *fmt, ...) +{ + if (0) + { + FILE *logfile = fopen("/rshd.log", "a+"); + + if (logfile) + { + va_list ap; + va_start (ap, fmt); + vfprintf (logfile, fmt, ap); + va_end (ap); + fclose (logfile); + } + } + else if (debug) + { + va_list ap; + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + fflush (stderr); + va_end (ap); + } +} + +/* Map the Windows error number in ERROR to a locale-dependent error + message string and return a pointer to it. Typically, the values + for ERROR come from GetLastError. + + The string pointed to shall not be modified by the application, + but may be overwritten by a subsequent call to strwinerror + + The strwinerror function does not change the current setting + of GetLastError. */ + +char * +strwinerror (DWORD error) +{ + static char buf[1024]; + TCHAR *msgbuf; + DWORD lasterr = GetLastError (); + DWORD chars = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, + error, + 0, /* Default language */ + (LPVOID)&msgbuf, + 0, + NULL); + if (chars != 0) + { + /* If there is an \r\n appended, zap it. */ + if (chars >= 2 + && msgbuf[chars - 2] == '\r' + && msgbuf[chars - 1] == '\n') + { + chars -= 2; + msgbuf[chars] = 0; + } + + if (chars > ((COUNTOF (buf)) - 1)) + { + chars = COUNTOF (buf) - 1; + msgbuf [chars] = 0; + } + + wcstombs (buf, msgbuf, chars + 1); + LocalFree (msgbuf); + } + else + sprintf (buf, "unknown win32 error (%ld)", error); + + SetLastError (lasterr); + return buf; +} + +void +perror (const char *s) +{ + if (s && *s) + fprintf (stderr, "%s: %s\n", s, strwinerror (GetLastError ())); + else + fprintf (stderr, "%s\n", strwinerror (GetLastError ())); +} + + + +struct client_data_t +{ + int clientid; + /* stdin/stdout */ + int sockfd; + + /* stderr */ + int stderrsockfd; + + /* remote */ + struct sockaddr_in sin; + + /* pipe handles for stdin/stdout/stderr. */ + HANDLE readh[3]; + HANDLE writeh[3]; + + /* stop request */ + volatile BOOL stop; + + long refcount; +}; + +static void +addref_data (struct client_data_t * data) +{ + InterlockedIncrement (&data->refcount); +} + +static void +release_data (struct client_data_t * data) +{ + if (InterlockedDecrement (&data->refcount) == 0) + { + logprintf ("Connection from %s:%d terminated\n", + inet_ntoa (data->sin.sin_addr), + ntohs (data->sin.sin_port)); + free (data); + } +} + +static void +init_client_data (struct client_data_t *data) +{ + static int clientid = 0; + int i; + + memset (&data->sin, 0, sizeof (data->sin)); + + data->clientid = ++clientid; + data->sockfd = data->stderrsockfd = -1; + + for (i = 0; i < 3; i++) + { + data->readh[0] = INVALID_HANDLE_VALUE; + data->writeh[0] = INVALID_HANDLE_VALUE; + } + + data->stop = FALSE; +} + +/* check if hostname is in users .rhost file */ +static int +rsh_userok (const char *hostname, const char *user) +{ +#if 0 + struct passwd *pw; + char s[256] = ""; + FILE *f; + if ((pw = getpwnam (user)) == NULL) + return 0; + strcpy (s, pw->pw_dir); + strcat (s, "/.rhosts"); + if ((f = fopen (s, "r")) == NULL) + return 0; + while (fgets (s, sizeof (s), f)) + { + char *p; + p = strchr (s, '\n'); + if (p) + *p = 0; + p = strchr (s, '\r'); + if (p) + *p = 0; + if (strcmp (hostname, s) == 0) + { + fclose (f); + return 1; + } + } + fclose (f); + return 0; +#endif + (void)hostname; + (void)user; + return 1; +} + +int +rexec_userok (const char *user, const char *pass) +{ +#if 0 + struct passwd *pw; + char s[256] = ""; + if ((pw = getpwnam(user)) == NULL) + return 0; + + if (strncmp(pw->pw_passwd, pass, 13) != 0) + return 0; +#endif + (void)user; + (void)pass; + return 1; +} + +static DWORD WINAPI +stdin_thread (void *arg) +{ + struct client_data_t *data = arg; + const char *thread_name = "stdin_thread"; + + addref_data (data); + + /* We don't need the reading side. */ + CloseHandle (data->readh[0]); + data->readh[0] = INVALID_HANDLE_VALUE; + + while (!data->stop) + { + int read = 0; + char buf[1]; + + read = recv (data->sockfd, buf, sizeof(buf), 0); + if (read < 0) + { + DWORD err = WSAGetLastError (); + switch (err) + { + case WSAECONNRESET: + case WSAEINTR: + if (!data->stop) + /* only be verbose if we were not expecting it. */ + logprintf ("%s: connection reset.\n", thread_name); + break; + default: + logprintf ("%s: recv ERROR, winerr %d\n", thread_name, err); + break; + } + break; + } + else if (read == 0) + { + logprintf ("%s: connection closed\n", thread_name); + break; + } + + if (read) + { + int written; + DWORD dwwritten; + +#if 1 + /* echo data back ... */ + written = send (data->sockfd, buf, read, 0); + if (written < 0) + logprintf ("%s: write ERROR, winerr %d\n", + thread_name, + GetLastError ()); + else if (written < read) + logprintf ("%s: ERROR only wrote %d of %d bytes\n", + thread_name, written, read); +#endif + + /* ... and stuff it into the child's stdin. */ + if (!WriteFile (data->writeh[0], buf, read, &dwwritten, NULL)) + { + logprintf ("%s: broken pipe (2)\n", thread_name); + break; + } + } + } + + release_data (data); + logprintf ("%s gone\n", thread_name); + return 0; +} + +static DWORD WINAPI +stdout_thread (void *arg) +{ + struct client_data_t *data = arg; + const char *thread_name = "stdout_thread"; + + addref_data (data); + + while (!data->stop) + { + DWORD read = 0; + char buf[256]; + if (!ReadFile (data->readh[1], buf, sizeof (buf), &read, FALSE)) + { + logprintf ("%s: broken pipe\n", thread_name); + break; + } + else if (data->writeh[1] != INVALID_HANDLE_VALUE) + { + /* We can't close the write side of the pipe until the + child opens its version. Since it will only be open on the + first stdout access, we have to wait until the read side returns + something - which means the child opened stdout. */ + CloseHandle (data->writeh[1]); + data->writeh[1] = INVALID_HANDLE_VALUE; + } + if (read) + { + int written = send (data->sockfd, buf, read, 0); + if (written < 0) + logprintf ("%s: write ERROR, winerr %d\n", + thread_name, + GetLastError ()); + else if ((DWORD) written < read) + logprintf ("%s: ERROR only wrote %d of %d bytes\n", + thread_name, written, read); + } + } + + release_data (data); + logprintf ("%s gone\n", thread_name); + return 0; +} + +static DWORD WINAPI +stderr_thread (void *arg) +{ + struct client_data_t *data = arg; + const char *thread_name = "stderr_thread"; + int sockfd; + + addref_data (data); + + sockfd = data->stderrsockfd; + if (sockfd == -1) + /* If we don't have a separate stderr channel, send the data + as if it came through stdout. */ + sockfd = data->sockfd; + + while (!data->stop) + { + DWORD read = 0; + char buf[256]; + + if (!ReadFile (data->readh[2], buf, sizeof (buf), &read, FALSE)) + { + logprintf ("%s: broken pipe\n", thread_name); + break; + } + else if (data->writeh[2] != INVALID_HANDLE_VALUE) + { + /* We can't close the write side of the pipe until the + child opens its version. Since it will only be open on the + first stderr access, we have to wait until the read side returns + something - which means the child opened stderr. */ + CloseHandle (data->writeh[2]); + data->writeh[2] = INVALID_HANDLE_VALUE; + } + if (read) + { + int written = send (sockfd, buf, read, 0); + if (written < 0) + logprintf ("%s: write ERROR, winerr %d\n", + thread_name, + GetLastError ()); + else if ((DWORD) written < read) + logprintf ("%s: ERROR only wrote %d of %d bytes\n", + thread_name, written, read); + } + } + + release_data (data); + logprintf ("%s gone\n", thread_name); + return 0; +} + +static void +to_back_slashes (char *path) +{ + for (; *path; ++path) + if ('/' == *path) + *path = '\\'; +} + +/* Start a new process. + Returns the new process' handle on success, NULL on failure. */ +static HANDLE +create_child (char *program, HANDLE *readh, HANDLE *writeh) +{ + BOOL ret; + char *args; + int argslen; + PROCESS_INFORMATION pi; + wchar_t *wargs, *wprogram; + wchar_t prev_path[3][MAX_PATH]; + size_t i; + + if (program == NULL || program[0] == '\0') + { + fprintf (stderr, + "No executable specified, specify executable to control.\n"); + return NULL; + } + + argslen = 0; + args = ""; + + to_back_slashes (program); + wargs = alloca ((argslen + 1) * sizeof (wchar_t)); + mbstowcs (wargs, args, argslen); + wprogram = alloca ((strlen (program) + 1) * sizeof (wchar_t)); + mbstowcs (wprogram, program, strlen (program) + 1); + + /* Do the PipeLib/WinCE dup dance. */ + + for (i = 0; i < 3; i++) + { + wchar_t devname[MAX_PATH]; + if (!CreatePipe (&readh[i], &writeh[i], NULL, 0)) + return NULL; + + GetPipeName (readh[i], devname); + DWORD dwLen = MAX_PATH; + GetStdioPathW (i, prev_path[i], &dwLen); + SetStdioPathW (i, devname); + } + + ret = CreateProcessW (wprogram, /* image name */ + wargs, /* command line */ + NULL, /* security, not supported */ + NULL, /* thread, not supported */ + FALSE, /* inherit handles, not supported */ + 0, /* start flags */ + NULL, /* environment, not supported */ + NULL, /* current directory, not supported */ + NULL, /* start info, not supported */ + &pi); /* proc info */ + + for (i = 0; i < 3; i++) + SetStdioPathW (i, prev_path[i]); + + if (!ret) + { + DWORD err = GetLastError (); + fprintf (stderr, "Error creating process \"%s%s\", (error %d): %s\n", + program, args, (int) err, strwinerror (err)); + + for (i = 0; i < 3; i++) + { + CloseHandle (readh[i]); + CloseHandle (writeh[i]); + } + return NULL; + } + else + logprintf ("Process created: %s\n", program); + + CloseHandle (pi.hThread); + pi.hThread = NULL; + + return pi.hProcess; +} + +static int +rresvport (int *alport) +{ + struct sockaddr_in sin; + int s; + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + s = socket (AF_INET, SOCK_STREAM, 0); + if (s == -1) + return -1; + + for (;;) + { + sin.sin_port = htons ((USHORT) *alport); + if (bind (s, (struct sockaddr *) &sin, sizeof(sin)) == 0) + return s; + + if (WSAGetLastError () != WSAEADDRINUSE) + { + closesocket (s); + return -1; + } + (*alport)--; + if (*alport == IPPORT_RESERVED / 2) + { + closesocket (s); + return -1; + } + } +} + +int +connect_stderr (int in, unsigned short stderr_port) +{ + int s; + int lport = IPPORT_RESERVED - 1; + struct sockaddr_in sin; + int len = sizeof (sin); + + logprintf ("Connecting stderr to remote port %d\n", stderr_port); + if (getpeername (in, (struct sockaddr *) &sin, &len) == -1) + { + perror ("getpeername"); + return -1; + } + + for (;;) + { + if ((s = rresvport (&lport)) == -1) + { + perror ("rresvport"); + return -1; + } + + sin.sin_port = htons (stderr_port); + if (connect (s, (struct sockaddr *) &sin, sizeof(sin)) == -1) + { + closesocket (s); + if (WSAGetLastError () == WSAEADDRINUSE) + { + lport--; + continue; + } + + logprintf ("connect: %s\n", strwinerror (WSAGetLastError ()));; + closesocket (s); + return -1; + } + + logprintf ("Using resvport %d\n", lport); + break; + } + + return s; +} + +static WINAPI DWORD +handle_connection (void *arg) +{ + int s2 = (int) arg; /* sizeof (void*) == sizeof (int) */ + int stderrsockfd = -1; + unsigned short stderr_port = 0; + int cc; + char c, *p; + char stderrport[100] = ""; + char locuser[0x101] = ""; + char remuser[0x101] = ""; + char command[8193]; + int len = sizeof (struct sockaddr_in); + struct hostent *hp; + const char *peername; + struct linger linger; + + struct client_data_t* client_data; + + HANDLE waith[4]; + HANDLE hndproc; + DWORD tid[3]; + size_t i; + int enabled = 1; + /* int disabled = 0; */ + + logprintf ("handle_conn: STARTED\n"); + + client_data = malloc (sizeof (*client_data)); + init_client_data (client_data); + addref_data (client_data); + + /* Allow rapid reuse of this port. */ + if (setsockopt (s2, SOL_SOCKET, SO_REUSEADDR, + (char *) &enabled, sizeof (enabled)) < 0) + { + perror ("setsockopt (SO_KEEPALIVE)"); + goto shutdown; + } + + /* Enable TCP keep alive process. */ + if (setsockopt (s2, SOL_SOCKET, SO_KEEPALIVE, + (char *) &enabled, sizeof (enabled)) < 0) + { + perror ("setsockopt (SO_KEEPALIVE)"); + goto shutdown; + } + + linger.l_onoff = 1; + linger.l_linger = 60; +#if 0 + if (setsockopt (s2, SOL_SOCKET, SO_LINGER, (char *)&linger, + sizeof (linger)) < 0) + { + perror ("setsockopt (SO_LINGER)"); + goto shutdown; + } +#endif + + /* Tell TCP not to delay small packets. This greatly speeds up + interactive response. */ + if (setsockopt (s2, IPPROTO_TCP, TCP_NODELAY, + (char *) &enabled, sizeof (enabled)) < 0) + { + perror ("setsockopt (TCP_NODELAY)"); + goto shutdown; + } + + if (getpeername (s2, (struct sockaddr *) &client_data->sin, &len) == -1) + { + perror ("getpeername"); + goto shutdown; + } + + /* Verify that the client's address is an Internet adress. */ + if (client_data->sin.sin_family != AF_INET) + { + fprintf (stderr, "malformed \"from\" address (af %d)\n", + client_data->sin.sin_family); + goto shutdown; + } + + hp = gethostbyaddr ((char *) &client_data->sin.sin_addr, + sizeof(client_data->sin.sin_addr), PF_INET); + + peername = (hp != NULL) + ? hp->h_name + : "unknown"; + + logprintf ("Connection from (%s) %s:%d...\n", + peername, + inet_ntoa (client_data->sin.sin_addr), + ntohs (client_data->sin.sin_port)); + + /* get stderr port. */ + p = stderrport; + while ((cc = recv (s2, &c, 1, 0)) > 0 && c != 0) + *p++ = c; + *p = 0; + + + if ((stderr_port = atoi (stderrport)) > 0) + { + stderrsockfd = connect_stderr (s2, stderr_port); + if (stderrsockfd == -1) + { + logprintf ("cannot connect stderr\n"); + goto shutdown; + } + } + + if (cc == -1) + { + logprintf ("error reading stderr port: %s\n", + strwinerror (GetLastError ())); + goto shutdown; + } + + p = locuser; + while ((cc = recv (s2, &c, 1, 0)) > 0 && c != 0) + *p++ = c; + *p = 0; + if (cc == -1) + { + logprintf ("error reading user name: %s\n", + strwinerror (GetLastError ())); + goto shutdown; + } + + p = remuser; + while ((cc = recv (s2, &c, 1, 0)) > 0 && c != 0) + *p++ = c; + *p = 0; + + if (cc == -1) + { + logprintf ("error reading rem user/password: %s\n", + strwinerror (GetLastError ())); + goto shutdown; + } + + p = command; + while ((cc = recv (s2, &c, 1, 0)) > 0 && c != 0) + *p++ = c; + *p = 0; + if (cc == -1) + { + logprintf ("error reading command: %s\n", strwinerror (GetLastError ())); + goto shutdown; + } + logprintf ("Local user: %s\nRemote user: %s\nCommand: %s\n", + locuser, remuser, command); +#if 0 + if (!hp || !rsh_userok (hp->h_name, remuser)) + { /* check .rhosts */ + char *s = "Permission denied\n"; + send (s2, s, strlen (s) + 1, 0); + goto shutdown; + } +#endif + + /* send OK */ + send (s2, "", 1, 0); + + logprintf ("handle_connection: starting command... \n"); + hndproc = create_child (command, client_data->readh, client_data->writeh); + if (!hndproc) + { + logprintf ("handle_connection: ERROR can't create child process, " + "winerr %d\n", GetLastError ()); + goto shutdown; + } + + client_data->sockfd = s2; + client_data->stderrsockfd = stderrsockfd; + + waith[0] = CreateThread (NULL, 0, stdin_thread, client_data, 0, &tid[0]); + waith[1] = CreateThread (NULL, 0, stdout_thread, client_data, 0, &tid[1]); + waith[2] = CreateThread (NULL, 0, stderr_thread, client_data, 0, &tid[2]); + waith[3] = hndproc; + + switch (WaitForMultipleObjects (COUNTOF (waith), waith, FALSE, INFINITE)) + { + case WAIT_OBJECT_0: + case WAIT_OBJECT_0 + 1: + case WAIT_OBJECT_0 + 2: + TerminateProcess (hndproc, 0); + break; + case WAIT_OBJECT_0 + 3: + break; + default: + logprintf ("WaitForMultipleObjects' default reached\n"); + break; + } + + client_data->stop = TRUE; + + for (i = 0; i < 4; i++) + CloseHandle (waith[i]); + + for (i = 0; i < 3; i++) + { + CloseHandle (client_data->writeh[i]); + CloseHandle (client_data->readh[i]); + } + + shutdown: + logprintf ("Shutting down connection from %s:%d...\n", + inet_ntoa (client_data->sin.sin_addr), + ntohs (client_data->sin.sin_port)); + + /* close sockets */ + shutdown (s2, 2); + closesocket (s2); + if (stderrsockfd != -1) + { + shutdown (stderrsockfd, 2); + closesocket (stderrsockfd); + } + + release_data (client_data); + + /* maybe we should wait for all the still alive threads again? */ + + return 0; +} + +static void +accept_connections (void) +{ + int s; + struct sockaddr_in sin; + USHORT port = 0; + struct hostent *phe; + int i; + char ac[80]; + + port = 514; + + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + + if ((s = socket (AF_INET, SOCK_STREAM, 0)) == -1) + { + perror ("socket"); + exit (1); + } + + sin.sin_port = htons(port); + if (bind (s, (struct sockaddr *) &sin, sizeof (sin)) != 0) + { + perror ("bind"); + closesocket (s); + exit (1); + } + + /* 10 is the maximum backlog allowed */ + if (listen (s, 10) != 0) + { + perror ("listen"); + closesocket (s); + exit (1); + } + + if (gethostname (ac, sizeof(ac)) == SOCKET_ERROR) + { + fprintf (stderr, "Error %d when getting local host name.\n", + WSAGetLastError()); + exit (1); + } + printf ("Host name is %s.\n", ac); + + phe = gethostbyname (ac); + if (phe == NULL) + { + fprintf (stderr, "Yow! Bad host lookup.\n"); + exit (1); + } + + for (i = 0; phe->h_addr_list[i] != 0; ++i) + { + struct in_addr addr; + memcpy (&addr, phe->h_addr_list[i], sizeof (struct in_addr)); + printf ("Address %d: %s\n", i, inet_ntoa (addr)); + } + + logprintf ("rshd ready\n\n"); + for (;;) + { + HANDLE connThread; + int s2; + + logprintf ("Listening on port %d...\n", port); + if ((s2 = accept (s, NULL, NULL)) == -1) + { + perror ("accept"); + closesocket (s); + exit (1); + } + + logprintf ("handle_conn: accepted\n"); + connThread = CreateThread (NULL, 0, + handle_connection, + (LPVOID)s2, 0, NULL); + CloseHandle (connThread); + logprintf ("CreateThread (connThread) returns\n"); + } +} + +int +main (int argc, char **argv) +{ + WSADATA wsad; + WSAStartup (MAKEWORD (2, 0), &wsad); + + if (argc > 1 && strcmp(argv[1], "-d") == 0) + debug = 1; + + accept_connections (); + return 0; +} Property changes on: trunk/cegcc/tools/rshd/rshd.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/rshd/tester.c =================================================================== --- trunk/cegcc/tools/rshd/tester.c (rev 0) +++ trunk/cegcc/tools/rshd/tester.c 2007-06-10 20:44:04 UTC (rev 942) @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <windows.h> + +int main () +{ + int counter = 0; + int i; + for (i = 0; i < 3; i++) + { + printf ("counter = %d\n", counter++); + Sleep (300); + } + + for (i = 0; i < 3; i++) + { + int num; + printf ("write a num:"); + scanf ("%d", &num); + printf ("written = %d\n", num); + } + + printf ("exiting\n"); + Sleep (3000); + return 0; +} Property changes on: trunk/cegcc/tools/rshd/tester.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-10 18:52:44
|
Revision: 941 http://svn.sourceforge.net/cegcc/?rev=941&view=rev Author: dannybackx Date: 2007-06-10 11:52:39 -0700 (Sun, 10 Jun 2007) Log Message: ----------- Apparently sf.net isn't always working as a synonym to sourceforge.net . Modified Paths: -------------- trunk/cegcc/website/index.html Modified: trunk/cegcc/website/index.html =================================================================== --- trunk/cegcc/website/index.html 2007-06-10 18:49:13 UTC (rev 940) +++ trunk/cegcc/website/index.html 2007-06-10 18:52:39 UTC (rev 941) @@ -78,26 +78,26 @@ <ul> <li> <a href="docs/index.html"> Documentation </a> <li> <a href="docs/install-linux.html"> Installation on Linux </a> - <li> <a href="http://sf.net/projects/cegcc"> Project page on SourceForge </a> - <li> <a href="http://cegcc.wiki.sf.net"> CeGCC wiki </a> + <li> <a href="http://sourceforge.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sourceforge.net"> CeGCC wiki </a> </ul> </td> <td align=left valign=top bgcolor="#ededed" width="50%"> <h2 align=center>Getting it</h2> <ul> - <li> <a href="http://sf.net/project/showfiles.php?group_id=173455"> Download CeGCC </a> + <li> <a href="http://sourceforge.net/project/showfiles.php?group_id=173455"> Download CeGCC </a> <li> <a href="http://svn.sourceforge.net/cegcc"> SVN Repository </a> </ul> <h2 align=center>Support</h2> <ul> - <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> </ul> </td> </tr></table> <p> You can contact us via the -<a href="mailto:ceg...@li...">mailing list</a>. +<a href="mailto:ceg...@li...">mailing list</a>. <p> <a href="http://sourceforge.net"><img src="http://images.sourceforge.net/sfx/logo.gif" alt="Powered by Sourceforge.net"></a> <a href="http://validator.w3.org/check?uri=referer"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-10 18:49:20
|
Revision: 940 http://svn.sourceforge.net/cegcc/?rev=940&view=rev Author: dannybackx Date: 2007-06-10 11:49:13 -0700 (Sun, 10 Jun 2007) Log Message: ----------- Reorganize the website's entry point. Modified Paths: -------------- trunk/cegcc/website/index.html Modified: trunk/cegcc/website/index.html =================================================================== --- trunk/cegcc/website/index.html 2007-06-10 18:07:36 UTC (rev 939) +++ trunk/cegcc/website/index.html 2007-06-10 18:49:13 UTC (rev 940) @@ -8,43 +8,6 @@ <body> <p> <img src="images/banner1.png" alt="CeGCC cross compiler for PocketPC"> -<!-- - - Button row at the top of the page. - - --> -<table bgcolor="blue" border="6"> <tr> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="docs/index.html"> - Documentation - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="http://svn.sourceforge.net/cegcc"> - SVN Repository - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="http://sf.net/projects/cegcc"> - Project page on SourceForge - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="http://sf.net/project/showfiles.php?group_id=173455"> - Download - </a> - </font> </td> - <td bgcolor="#CCCC00" > <font size="+2" color="#222200"> - <a href="docs/install-linux.html"> - Installation on Linux - </a> - </font> </td> -</tr></table> -<!-- - - End of the button row - - --> <p> <table border="3"> <tr><td width="66%"> @@ -53,6 +16,9 @@ The CeGCC project implements cross-development tools for Windows CE (PocketPC). You can develop on a PC, and create apps that run on a PDA or a WinCE cell phone. </font> +</td> +</tr> +</table> <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. @@ -68,6 +34,13 @@ 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> ? +They both describe the target platform : +we're building for an <b>ARM</b> processor, +running the <b>wince</b> (Windows CE) operating system. +In the <b>cegcc</b> case, there's a portability layer; +in the <b>mingw32ce</b> case there isn't. +<p> Combine this with our development platforms, and you get four choices : <table border="1"> <tr> @@ -87,6 +60,11 @@ </tr> </table> <p> +Our project is based on a collection of (mostly GNU) software : +<a href="http://www.gnu.org/software/gcc">GCC</a>, +<a href="http://www.gnu.org/software/binutils/">binutils</a>, +<a href="http://sources.redhat.com/newlib/">newlib</a>, +<a href="http://www.gnu.org/software/gdb">GDB</a>, ... . This project is <a href="http://www.gnu.org/philosophy/free-sw.html">free software</a> - read all about that and @@ -94,77 +72,30 @@ on <a href="http://www.gnu.org">the GNU website</a>. <p> -Our project is based on a collection of (mostly GNU) software : -<ul> -<li><a href="http://www.gnu.org/software/gcc">GCC</a> - the GNU compiler for C, C++, .. -<li><a href="http://www.gnu.org/software/binutils/">binutils</a> - - the GNU binary utilities (gas, gld, ..) -<li><a href="http://sources.redhat.com/newlib/">newlib</a> - - a C library intended for use on embedded systems -<li><a href="http://www.gnu.org/software/gdb">GDB</a> - the GNU debugger -</ul> +<table border=0 cellspacing=10 width="100%"> <tr> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Information</h2> + <ul> + <li> <a href="docs/index.html"> Documentation </a> + <li> <a href="docs/install-linux.html"> Installation on Linux </a> + <li> <a href="http://sf.net/projects/cegcc"> Project page on SourceForge </a> + <li> <a href="http://cegcc.wiki.sf.net"> CeGCC wiki </a> + </ul> + </td> + <td align=left valign=top bgcolor="#ededed" width="50%"> + <h2 align=center>Getting it</h2> + <ul> + <li> <a href="http://sf.net/project/showfiles.php?group_id=173455"> Download CeGCC </a> + <li> <a href="http://svn.sourceforge.net/cegcc"> SVN Repository </a> + </ul> + <h2 align=center>Support</h2> + <ul> + <li> <a href="mailto:ceg...@li...">Questions ? Use the mailing list</a>. + <li> <a href="http://sourceforge.net/tracker/?group_id=173455&atid=865514"> CeGCC Bug tracker </a> + </ul> + </td> +</tr></table> <p> -What's the meaning of <b>arm-wince-cegcc</b> and <b>arm-wince-mingw32ce</b> ? -They both describe the target platform : -<ul> -<li> -the <b>arm-wince-cegcc</b> target platform -implies we're building for an <b>ARM</b> processor, -running the <b>wince</b> operating system, -and producing <b>pe</b> executable files -to be linked with the <b>CEGCC</b> library. -As we said earlier, this is a porting environment : -the CEGCC library offers a layer of unix-like functionality on top of Windows CE. -<li> -the <b>arm-wince-mingw32ce</b> target platform is closer to WinCE. -It is based on a subset of the <a href="http://www.mingw.org">MinGW</a> project, -which offers a MINimalistic Gnu environment for Windows platforms. -The primary difference with <b>arm-wince-cegcc</b> is that there is not porting layer, -which means that apps built with <b>arm-wince-mingw32ce</b> use the pure -<a href="http://www.microsoft.com/windowsce">Windows CE</a> API. -</ul> -<p> -We used to have <i>pe</i> in the target description. -(It used to be <b>arm-wince-pe</b>, inherited from another project.) -In that, PE stands for Portable Executable file format, -and it's -<a href="http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx">Microsoft's implementation of COFF</a> -(the Common Object File Format). -<a href="http://www.arm.com">ARM</a> is a -<a href="http://en.wikipedia.org/wiki/ARM_architecture">RISC processor family</a> -which is found in many embedded systems, -also implemented by Intel as their -<a href="http://www.intel.com/design/intelxscale">Xscale</a> -processor line. -Wince is shorthand for the -<a href="http://www.microsoft.com/windowsce">Windows CE</a> operating system. -Windows CE is the technology base for environments such as -PocketPC, Smartphone, and -<a href="http://www.microsoft.com/windowsmobile">Windows Mobile</a>. -<p> -Our project is hosted by -<a href="http://sf.net">SourceForge.net</a>, -here is a link to our -<a href="http://sf.net/projects/cegcc">project page</a>. -You're welcome to use the -<a href="http://cegcc.wiki.sourceforge.net">wiki</a> -to share your experience with CeGCC. - -<p> -Bugfixes, improvements to these core products are actively sent back to the -projects so everyone will benefit. -<p> -One of the project goals is to properly describe how to build a cross-compiler, -and how to cross-develop for the Windows CE environment using the GNU tools. -This documentation is still very scarce but is work in progress, -until we've "finished" that, some of the info is also -in the mailing list archives. -The idea is to put the documentation <a href="docs/index.html">here</a>. -<p> -</td> -</tr> -</table> -<p> You can contact us via the <a href="mailto:ceg...@li...">mailing list</a>. <p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-10 18:07:37
|
Revision: 939 http://svn.sourceforge.net/cegcc/?rev=939&view=rev Author: dannybackx Date: 2007-06-10 11:07:36 -0700 (Sun, 10 Jun 2007) Log Message: ----------- Ah, we can use a wiki facility on SF too; just enabled it. Modified Paths: -------------- trunk/cegcc/website/index.html Modified: trunk/cegcc/website/index.html =================================================================== --- trunk/cegcc/website/index.html 2007-06-10 17:52:59 UTC (rev 938) +++ trunk/cegcc/website/index.html 2007-06-10 18:07:36 UTC (rev 939) @@ -146,6 +146,10 @@ <a href="http://sf.net">SourceForge.net</a>, here is a link to our <a href="http://sf.net/projects/cegcc">project page</a>. +You're welcome to use the +<a href="http://cegcc.wiki.sourceforge.net">wiki</a> +to share your experience with CeGCC. + <p> Bugfixes, improvements to these core products are actively sent back to the projects so everyone will benefit. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-10 17:53:02
|
Revision: 938 http://svn.sourceforge.net/cegcc/?rev=938&view=rev Author: dannybackx Date: 2007-06-10 10:52:59 -0700 (Sun, 10 Jun 2007) Log Message: ----------- Add some clarifications, remove reference to the wiki (it appears to be dead). Modified Paths: -------------- trunk/cegcc/website/index.html Modified: trunk/cegcc/website/index.html =================================================================== --- trunk/cegcc/website/index.html 2007-06-10 17:48:54 UTC (rev 937) +++ trunk/cegcc/website/index.html 2007-06-10 17:52:59 UTC (rev 938) @@ -50,7 +50,8 @@ <tr><td width="66%"> <p> <font size="+1"> -CeGCC is a project that offers cross-development tools for Windows CE (PocketPC). +The CeGCC project implements cross-development tools for Windows CE (PocketPC). +You can develop on a PC, and create apps that run on a PDA or a WinCE cell phone. </font> <p> We're aiming at providing a consistent and working set of development tools that @@ -59,6 +60,33 @@ the <a href="http://www.cygwin.com">cygwin</a> environment and <a href="http://www.linux.org">GNU/Linux</a> systems. <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 +</ul> +Both toolsets allow you to develop on a PC, +and create apps that run on a PDA or a WinCE cell phone. +<p> +Combine this with our development platforms, and you get four choices : +<table border="1"> + <tr> + <td> </td> + <td> GNU/Linux host </td> + <td> Cygwin host </td> + </tr> + <tr> + <td> arm-wince-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> Develop on Linux, port *nix sources to Windows CE </td> + <td> Develop on Cygwin, port *nix sources to Windows CE </td> + </tr> +</table> +<p> This project is <a href="http://www.gnu.org/philosophy/free-sw.html">free software</a> - read all about that and @@ -76,21 +104,29 @@ <li><a href="http://www.gnu.org/software/gdb">GDB</a> - the GNU debugger </ul> <p> -We're implementing all these tools for the <b>arm-wince-cegcc</b> target platform, -which means we're building for an <b>ARM</b> processor, +What's the meaning of <b>arm-wince-cegcc</b> and <b>arm-wince-mingw32ce</b> ? +They both describe the target platform : +<ul> +<li> +the <b>arm-wince-cegcc</b> target platform +implies we're building for an <b>ARM</b> processor, running the <b>wince</b> operating system, and producing <b>pe</b> executable files to be linked with the <b>CEGCC</b> library. -This target implements a porting environment : -the CEGCC library basically offers a layer of unix-like functionality on top of Windows CE. -<p> -We also offer a development environment that is closer to the WinCE platform, -this is called <b>arm-wince-mingw32ce</b>. +As we said earlier, this is a porting environment : +the CEGCC library offers a layer of unix-like functionality on top of Windows CE. +<li> +the <b>arm-wince-mingw32ce</b> target platform is closer to WinCE. It is based on a subset of the <a href="http://www.mingw.org">MinGW</a> project, which offers a MINimalistic Gnu environment for Windows platforms. +The primary difference with <b>arm-wince-cegcc</b> is that there is not porting layer, +which means that apps built with <b>arm-wince-mingw32ce</b> use the pure +<a href="http://www.microsoft.com/windowsce">Windows CE</a> API. +</ul> <p> We used to have <i>pe</i> in the target description. -PE stands for Portable Executable file format, +(It used to be <b>arm-wince-pe</b>, inherited from another project.) +In that, PE stands for Portable Executable file format, and it's <a href="http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx">Microsoft's implementation of COFF</a> (the Common Object File Format). @@ -110,9 +146,6 @@ <a href="http://sf.net">SourceForge.net</a>, here is a link to our <a href="http://sf.net/projects/cegcc">project page</a>. -You're welcome to use the -<a href="wiki">wiki</a> -to share your experience with CeGCC. <p> Bugfixes, improvements to these core products are actively sent back to the projects so everyone will benefit. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 17:50:27
|
Revision: 937 http://svn.sourceforge.net/cegcc/?rev=937&view=rev Author: pedroalves Date: 2007-06-10 10:48:54 -0700 (Sun, 10 Jun 2007) Log Message: ----------- Missing changelog entry: * include/winbase.h (ActivateDevice, ActivateDeviceEx, DeactivateDevice): Declare. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-06-10 17:41:04 UTC (rev 936) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-06-10 17:48:54 UTC (rev 937) @@ -1,5 +1,7 @@ 2007-06-10 Pedro Alves <ped...@po...> + * include/winbase.h (ActivateDevice, ActivateDeviceEx, + DeactivateDevice): Declare. * include/devload.h: New file. 2007-05-31 Carsten S\xF8rensen <sur...@ri...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 17:41:06
|
Revision: 936 http://svn.sourceforge.net/cegcc/?rev=936&view=rev Author: pedroalves Date: 2007-06-10 10:41:04 -0700 (Sun, 10 Jun 2007) Log Message: ----------- * include/winbase.h (ActivateDevice, ActivateDeviceEx, DeactivateDevice): Declare. * include/devload.h: New file. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/winbase.h Added Paths: ----------- trunk/cegcc/src/w32api/include/devload.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-06-10 17:33:42 UTC (rev 935) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-06-10 17:41:04 UTC (rev 936) @@ -1,3 +1,7 @@ +2007-06-10 Pedro Alves <ped...@po...> + + * include/devload.h: New file. + 2007-05-31 Carsten S\xF8rensen <sur...@ri...> * include/winuser.h (SYSTEM_COLOR_BASE_OFFSET): Define. Added: trunk/cegcc/src/w32api/include/devload.h =================================================================== --- trunk/cegcc/src/w32api/include/devload.h (rev 0) +++ trunk/cegcc/src/w32api/include/devload.h 2007-06-10 17:41:04 UTC (rev 936) @@ -0,0 +1,25 @@ +#ifndef _DEVLOAD_H +#define _DEVLOAD_H +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +/* NOTE: This strictly does not belong in the Win32 API. */ + +#include <windows.h> + +#define DEVFLAGS_NONE 0x00000000 +#define DEVFLAGS_UNLOAD 0x00000001 +#define DEVFLAGS_LOADLIBRARY 0x00000002 +#define DEVFLAGS_NOLOAD 0x00000004 +#define DEVFLAGS_NAKEDENTRIES 0x00000008 +#define DEVFLAGS_BOOTPHASE_1 0x00001000 +#define DEVFLAGS_IRQ_EXCLUSIVE 0x00000100 +#define DEVFLAGS_TRUSTEDCALLERONLY 0x00010000 + +#define DEVLOAD_CLIENTINFO_VALNAME L"ClientInfo" +#define DEVLOAD_HANDLE_VALNAME L"Hnd" +#define DEVLOAD_DEVNAME_VALNAME L"Name" +#define DEVLOAD_DEVKEY_VALNAME L"Key" + +#endif Property changes on: trunk/cegcc/src/w32api/include/devload.h ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/cegcc/src/w32api/include/winbase.h =================================================================== --- trunk/cegcc/src/w32api/include/winbase.h 2007-06-10 17:33:42 UTC (rev 935) +++ trunk/cegcc/src/w32api/include/winbase.h 2007-06-10 17:41:04 UTC (rev 936) @@ -2517,11 +2517,14 @@ #ifdef _WIN32_WCE #include <kfuncs.h> -#define lstrcpyW wcscpy -#define lstrcatW wcscat -#define lstrlenW wcslen +#define lstrcpyW wcscpy +#define lstrcatW wcscat +#define lstrlenW wcslen -#endif +WINBASEAPI HANDLE WINAPI ActivateDevice(LPCWSTR, DWORD); +WINBASEAPI HANDLE WINAPI ActivateDeviceEx(LPCWSTR, LPCVOID, DWORD, LPVOID); +WINBASEAPI BOOL WINAPI DeactivateDevice(HANDLE); +#endif /* _WIN32_WCE */ #ifdef __cplusplus } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 17:33:43
|
Revision: 935 http://svn.sourceforge.net/cegcc/?rev=935&view=rev Author: pedroalves Date: 2007-06-10 10:33:42 -0700 (Sun, 10 Jun 2007) Log Message: ----------- Adding emacs modelines Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-06-09 17:47:55 UTC (rev 934) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-06-10 17:33:42 UTC (rev 935) @@ -268,3 +268,10 @@ * include/kfuncs.h (EventModify) : Declare. (TlsCall) : Add WINBASEAPI and WINAPI to declaration. + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 13:47:52
|
Revision: 933 http://svn.sourceforge.net/cegcc/?rev=933&view=rev Author: pedroalves Date: 2007-06-09 10:33:42 -0700 (Sat, 09 Jun 2007) Log Message: ----------- Adding a tools dir. Added Paths: ----------- trunk/cegcc/tools/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 13:47:50
|
Revision: 931 http://svn.sourceforge.net/cegcc/?rev=931&view=rev Author: pedroalves Date: 2007-06-05 14:28:31 -0700 (Tue, 05 Jun 2007) Log Message: ----------- * Makefile (MAKEFLAGS): Override -j flag by always setting -j 1. Modified Paths: -------------- trunk/cegcc/src/cegcc/cegccdll/ChangeLog trunk/cegcc/src/cegcc/cegccdll/Makefile Modified: trunk/cegcc/src/cegcc/cegccdll/ChangeLog =================================================================== --- trunk/cegcc/src/cegcc/cegccdll/ChangeLog 2007-06-05 21:23:28 UTC (rev 930) +++ trunk/cegcc/src/cegcc/cegccdll/ChangeLog 2007-06-05 21:28:31 UTC (rev 931) @@ -1,3 +1,7 @@ +2007-06-05 Carsten S\xF8rensen <sur...@ri...> + + * Makefile (MAKEFLAGS): Override -j flag by always setting -j 1. + 2006-10-15 Pedro Alves <ped...@po...> * ChangeLog: New file. Modified: trunk/cegcc/src/cegcc/cegccdll/Makefile =================================================================== --- trunk/cegcc/src/cegcc/cegccdll/Makefile 2007-06-05 21:23:28 UTC (rev 930) +++ trunk/cegcc/src/cegcc/cegccdll/Makefile 2007-06-05 21:28:31 UTC (rev 931) @@ -1,8 +1,12 @@ # generate cegcc.dll from libc.a, libc.a, libm.a, libgcc.a # based on script from Mamaich's version of the toolchain <http://mamaich.cjb.net/> # -# Pedro Alves <ped...@po...> (C) 2006 +# Pedro Alves <ped...@po...> (C) 2006, 2007 +# FIXME: override -j > 1, because this makefile doesn't +# support parallel builds. +MAKEFLAGS:=$(MAKEFLAGS) -j 1 + PREFIX?=/opt/cegcc # BUILD_DIR=$TOP_SRCDIR/build/$MY_HOST_ARCH/$TGT_ARCH This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 13:47:49
|
Revision: 932 http://svn.sourceforge.net/cegcc/?rev=932&view=rev Author: pedroalves Date: 2007-06-09 07:37:30 -0700 (Sat, 09 Jun 2007) Log Message: ----------- * mingwex/wince/time.c (time): Handle NULL input. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/time.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-05 21:28:31 UTC (rev 931) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-09 14:37:30 UTC (rev 932) @@ -1,3 +1,7 @@ +2007-06-09 Pedro Alves <ped...@po...> + + * mingwex/wince/time.c (time): Handle NULL input. + 2007-05-28 Pedro Alves <ped...@po...> * moldname.def.in (unlink): Don't export from coredll.dll. Modified: trunk/cegcc/src/mingw/mingwex/wince/time.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/time.c 2007-06-05 21:28:31 UTC (rev 931) +++ trunk/cegcc/src/mingw/mingwex/wince/time.c 2007-06-09 14:37:30 UTC (rev 932) @@ -5,9 +5,10 @@ { SYSTEMTIME s; FILETIME f; + time_t t; if (timer == NULL) - return 0; + timer = &t; GetSystemTime (&s); SystemTimeToFileTime (&s, &f); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 07:47:23
|
Revision: 934 http://svn.sourceforge.net/cegcc/?rev=934&view=rev Author: pedroalves Date: 2007-06-09 10:47:55 -0700 (Sat, 09 Jun 2007) Log Message: ----------- Adding PipeLib's device, lib and testers. Added Paths: ----------- trunk/cegcc/tools/PipeLib/ trunk/cegcc/tools/PipeLib/PipeDev/ trunk/cegcc/tools/PipeLib/PipeDev/Makefile trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.cpp trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.h trunk/cegcc/tools/PipeLib/PipeLib/ trunk/cegcc/tools/PipeLib/PipeLib/Makefile trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.cpp trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.h trunk/cegcc/tools/PipeLib/PipeTest/ trunk/cegcc/tools/PipeLib/PipeTest/Makefile trunk/cegcc/tools/PipeLib/PipeTest/PipeTest.cpp trunk/cegcc/tools/PipeLib/TestClient/ trunk/cegcc/tools/PipeLib/TestClient/Makefile trunk/cegcc/tools/PipeLib/TestClient/TestClient.cpp Added: trunk/cegcc/tools/PipeLib/PipeDev/Makefile =================================================================== --- trunk/cegcc/tools/PipeLib/PipeDev/Makefile (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeDev/Makefile 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,20 @@ +TARGET=arm-wince-mingw32ce + +CXX=$(TARGET)-g++ +AR=$(TARGET)-ar + +WARNFLAGS=-Wall -Wextra + +INCLUDES= + +ALLFLAGS=$(INCLUDES) $(CXXFLAGS) $(WARNFLAGS) + +all: PipeDev.dll + +PipeDev.dll: PipeDevice.cpp + $(CXX) $< -shared -o $@ $(ALLFLAGS) + +clean: + rm -f PipeDev.dll + +.PHONE: all clean Property changes on: trunk/cegcc/tools/PipeLib/PipeDev/Makefile ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.cpp =================================================================== --- trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.cpp (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.cpp 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,911 @@ +/* Copyright (c) 2007, Pedro Alves + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#include "PipeDevice.h" + +#include <windows.h> +#include <devload.h> +#include <set> +#include <string> + +#ifndef min +#define min(A, B) ((A) < (B) ? (A) : (B)) +#endif + +typedef struct _DEVICE_PSL_NOTIFY +{ + DWORD dwSize; + DWORD dwFlags; + HANDLE hProc; + HANDLE hThread; +} DEVICE_PSL_NOTIFY, *PDEVICE_PSL_NOTIFY; + +#ifndef FILE_DEVICE_PSL +#define FILE_DEVICE_PSL 259 +#endif + +#define IOCTL_PSL_NOTIFY \ + CTL_CODE (FILE_DEVICE_PSL, 255, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define DLL_PROCESS_EXITING 4 + +#define PIPEDEV_API extern "C" __declspec (dllexport) + +//#define DEBUG_MODE +//#define NOLOCKS +//#define DEBUG_LOCKS + +#ifdef DEBUG_LOCKS +# define G(CS) (__LINE__, CS) +#else +# define G(CS) (CS) +#endif + +class CSWrapper +{ +public: + explicit CSWrapper (CRITICAL_SECTION* cs) : cs_(*cs) {} + ~CSWrapper () {} + + void Lock () + { +#ifndef NOLOCKS + EnterCriticalSection (&cs_); +#endif + } + void Unlock () + { +#ifndef NOLOCKS + LeaveCriticalSection (&cs_); +#endif + } +private: + CRITICAL_SECTION& cs_; +}; + +class CS : public CSWrapper +{ +public: + CS () : CSWrapper (&cs_) + { +#ifndef NOLOCKS + InitializeCriticalSection (&cs_); +#endif + } + ~CS () + { +#ifndef NOLOCKS + DeleteCriticalSection (&cs_); +#endif + } +private: + CRITICAL_SECTION cs_; +}; + +class FastCS +{ +public: + FastCS () : Count(0) + { +#ifndef NOLOCKS + /* auto - only release one at a time. */ + EventHandle = CreateEvent (NULL, FALSE, FALSE, NULL); +#endif + } + ~FastCS () + { +#ifndef NOLOCKS + CloseHandle (EventHandle); +#endif + } + + void Lock () + { +#ifndef NOLOCKS + if (InterlockedIncrement (&Count) == 1) + /* first come - first serve. */ + return; + + /* everyone else, get in line. */ + WaitForSingleObject (EventHandle, INFINITE); +#endif + } + void Unlock () + { +#ifndef NOLOCKS + if (InterlockedDecrement (&Count) > 0) + /* release one pending */ + SetEvent (EventHandle); +#endif + } +private: + HANDLE EventHandle; + LONG Count; +}; + +class RecursiveCS +{ +public : + RecursiveCS () + : Count(0) + , RecursionCount(0) + , ThreadID(0) + + { +#ifndef NOLOCKS + /* auto - only release one at a time. */ + EventHandle = CreateEvent (NULL, FALSE, FALSE, NULL); +#endif + } + + ~RecursiveCS () + { +#ifndef NOLOCKS + CloseHandle (EventHandle); +#endif + } + + void Lock () + { +#ifndef NOLOCKS + if (ThreadID == GetCurrentThreadId ()) + { + InterlockedIncrement (&RecursionCount); + return; + } + + if (InterlockedIncrement (&Count) == 1) + InterlockedExchange (&RecursionCount, 0); + else + WaitForSingleObject (EventHandle, INFINITE); + + ThreadID = GetCurrentThreadId (); +#endif + } + + void Unlock () + { +#ifndef NOLOCKS + if (RecursionCount == 0) + { + if (InterlockedDecrement (&Count) > 0) + { + /* release one thread */ + SetEvent (EventHandle); + } + } + else + { + InterlockedDecrement (&RecursionCount); + } +#endif + } + +private: + HANDLE EventHandle; + LONG Count; + LONG RecursionCount; + DWORD ThreadID; +}; + + +template <class T> +class LockGuard +{ +public: +#ifdef DEBUG_LOCKS + LockGuard (int line, T &cs) : cs_(cs), lineno(line) + { + WCHAR buf[100]; + wsprintf (buf, L"line : %d", line); + MessageBoxW(0, buf, L"lock", 0); + + cs_.Lock (); + } + ~LockGuard () + { + WCHAR buf[100]; + wsprintf (buf, L"line : %d", lineno); + MessageBoxW(0, buf, L"unlock", 0); + + cs_.Unlock (); + } +#else + explicit LockGuard (T &cs) : cs_(cs) { cs_.Lock (); } + ~LockGuard () { cs_.Unlock (); } +#endif + +private: + T &cs_; + +#ifdef DEBUG_LOCKS + int lineno; +#endif +}; + +class PipeOpenContext; + +class PipeDeviceContext +{ +public: + typedef ::LockGuard<PipeDeviceContext> LockGuard; + + explicit PipeDeviceContext (LPCWSTR activepath) + : OpenCount(0) + , WROpenCount(0) + , DeviceName(NULL) + , Aborting(FALSE) + , head(0) + , count(0) + { + ActivePath = wcsdup (activepath); + ReadEvent = CreateEvent (NULL, FALSE, FALSE, NULL); + WriteEvent = CreateEvent (NULL, FALSE, FALSE, NULL); + + /* This should wake all threads, so it is manual reset. */ + AbortEvent = CreateEvent (NULL, TRUE, FALSE, NULL); + } + + ~PipeDeviceContext () + { + if (DeviceName) + free (DeviceName); + if (ActivePath) + free (ActivePath); + CloseHandle (ReadEvent); + CloseHandle (WriteEvent); + CloseHandle (AbortEvent); + } + + DWORD size () + { + return count; + } + + DWORD tail () + { + return (head + count) & (sizeof (buffer) - 1); + } + + void Lock () + { + cs.Lock (); + } + + void Unlock () + { + cs.Unlock (); + } + + DWORD writeBytes (const void* data_, DWORD dsize) + { + DWORD fit = sizeof (buffer) - size (); + fit = min (dsize, fit); + const BYTE* data = (const BYTE*)data_; + BYTE* b = buffer + tail (); + for (DWORD i = 0; i < fit; i++) + b[i & (sizeof (buffer) - 1)] = data[i]; + count += fit; + return fit; + } + + DWORD readBytes (void* buf_, DWORD bsize) + { + BYTE* buf = (BYTE*)buf_; + DWORD fit = min (bsize, size ()); + + const BYTE* h = buffer + head; + for (DWORD i = 0; i < fit; i++) + buf[i] = h[i & (sizeof (buffer) - 1)]; + count -= fit; + head += fit; + head &= (sizeof (buffer) - 1); + return fit; + } + +public: + DWORD OpenCount; + DWORD WROpenCount; + + WCHAR* ActivePath; + + HANDLE ReadEvent; + HANDLE WriteEvent; + HANDLE AbortEvent; + + WCHAR* DeviceName; + BOOL Aborting; + +private: + BYTE buffer[0x1000]; + DWORD head; + DWORD count; + + RecursiveCS cs; +}; + +class PipeOpenContext +{ +public: + PipeOpenContext (PipeDeviceContext* devctx, + DWORD accessCode, DWORD shareMode) + : DeviceContext (devctx) + , dwAccessCode (accessCode) + , dwShareMode (shareMode) + {} + + ~PipeOpenContext () + {} + + PipeDeviceContext* DeviceContext; + DWORD dwAccessCode; + DWORD dwShareMode; +}; + +static CRITICAL_SECTION open_pipes_cs; + +extern "C" BOOL WINAPI +DllMain (HANDLE /*hinstDLL*/, DWORD dwReason, LPVOID /*lpvReserved*/) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + InitializeCriticalSection (&open_pipes_cs); + break; + case DLL_PROCESS_DETACH: + DeleteCriticalSection (&open_pipes_cs); + break; + } + + return TRUE; +} + +static void +LogMessage (const char* msg, ...) +{ +#if 0 + va_list ap; + va_start (ap, msg); + FILE* log = fopen ("log.txt", "a+"); + vfprintf (log, msg, ap); + fclose (log); + va_end (ap); +#else + (void)msg; +#endif +} + +struct LogScope +{ + explicit LogScope (const char* func) + : func_(func) + { + LogMessage ("entering %s\n", func_); + } + ~LogScope () + { + LogMessage ("leaving %s\n", func_); + } + + const char* func_; +}; + +#define LOGSCOPE(MSG) LogScope scope ## __LINE__(#MSG) + +/* This is needed for MSVC. */ +struct ltwstr +{ + bool operator () (const std::wstring& s1, const std::wstring& s2) const + { + return wcscmp (s1.c_str (), s2.c_str ()) < 0; + } +}; + +typedef std::set<std::wstring, ltwstr> vwstring; +static vwstring open_pipes; + +PIPEDEV_API BOOL Deinit (PipeDeviceContext* pDeviceContext); + +static HANDLE +GetDeviceHandle (PipeDeviceContext* pDeviceContext) +{ + LOGSCOPE (GetDeviceHandle); + HKEY hActive; + DWORD Type; + HANDLE hDev = INVALID_HANDLE_VALUE; + + DWORD status = RegOpenKeyEx (HKEY_LOCAL_MACHINE, pDeviceContext->ActivePath, + 0, 0, &hActive); + if (status != ERROR_SUCCESS) + return INVALID_HANDLE_VALUE; + + DWORD Len = sizeof(hDev); + status = RegQueryValueEx (hActive, DEVLOAD_HANDLE_VALNAME, NULL, &Type, + (PUCHAR)&hDev, &Len); + if (status != ERROR_SUCCESS) + { + /* weird */ + } + + RegCloseKey (hActive); + + return hDev; +} + +PIPEDEV_API DWORD +Init (LPCTSTR pContext) +{ + LOGSCOPE ("Init"); + CSWrapper cs (&open_pipes_cs); + LockGuard<CSWrapper> guard G(cs); + +#ifdef DEBUG_MODE + MessageBoxW (0, pContext, L"Init", 0); +#endif + + /* TODO: The key here isn't exactly the best. Maybe we should use + the device name instead, and get that from the registry - that would + also get rid of the IOCTL calls. */ + if (open_pipes.find (pContext) != open_pipes.end ()) + /* already open, PipeLib will try another one. */ + return 0; + + PipeDeviceContext* pDeviceContext = new PipeDeviceContext (pContext); + if (pDeviceContext == NULL) + return 0; + + open_pipes.insert (pContext); + + return (DWORD)pDeviceContext; +} + +#ifdef DEBUG_MODE +static int close_calls; +#endif + +PIPEDEV_API BOOL +Deinit (PipeDeviceContext* pDeviceContext) +{ + LOGSCOPE ("Deinit"); + /* All file handles must to be closed before deinitialising + the driver. */ + +#ifdef DEBUG_MODE + WCHAR buf[100]; + wsprintf (buf, L"opencount %d : calls %d", pDeviceContext->OpenCount, + close_calls); + MessageBoxW (0, buf, L"Deinit", 0); +#endif + + if (pDeviceContext == NULL) + return FALSE; + + { + PipeDeviceContext::LockGuard guard G(*pDeviceContext); + + if (pDeviceContext->OpenCount != 0) + return FALSE; + } + +#ifdef DEBUG_MODE + MessageBoxW (0, L"deactivate success", L"Deinit", 0); +#endif + + /* Allow reuse. */ + open_pipes.erase (pDeviceContext->ActivePath); + + /* Race? Is it possible that there can be another process + calling any function on the device while we are + Dinitializing it? Doesn't CE take care of that? */ + delete pDeviceContext; + return TRUE; +} + +PIPEDEV_API DWORD +Open (PipeDeviceContext* pDeviceContext, DWORD AccessCode, DWORD ShareMode) +{ + LOGSCOPE ("Open"); + +#ifdef DEBUG_MODE + wchar_t buf[100]; + wsprintf (buf, L"opencount %d", pDeviceContext->OpenCount); + MessageBoxW (0, buf, L"open 1", 0); +#endif + + PipeOpenContext* pOpenContext = + new PipeOpenContext (pDeviceContext, AccessCode, ShareMode); + +#ifdef DEBUG_MODE + MessageBoxW (0, L"going to lock", L"open 2", 0); +#endif + + PipeDeviceContext::LockGuard guard G(*pOpenContext->DeviceContext); + +#ifdef DEBUG_MODE + MessageBoxW (0, L"locked", L"open 3", 0); +#endif + + pDeviceContext->OpenCount++; + + if (AccessCode & GENERIC_WRITE) + pDeviceContext->WROpenCount++; + +#ifdef DEBUG_MODE + wsprintf (buf, L"opencount %d", pDeviceContext->OpenCount); + MessageBoxW (0, buf, L"open", 0); +#endif + + return (DWORD)pOpenContext; +} + +struct DeactivatorData +{ + HANDLE th; + HANDLE dev; +}; + +static DWORD WINAPI +Deactivator (void* arg) +{ + LOGSCOPE ("Deactivator"); + + DeactivatorData* data = (DeactivatorData*)arg; + +#ifdef DEBUG_MODE + wchar_t buf[100]; + wsprintf (buf, L"%x", data->dev); + MessageBoxW(0, buf, L"close: dev handle", 0); + if (!DeactivateDevice (data->dev)) + MessageBoxW(0, buf, L"deactivate failed", 0); + else + MessageBoxW(0, buf, L"after deactivate", 0); +#else + DeactivateDevice (data->dev); +#endif + + CloseHandle (data->th); + delete data; + + return 0; +} + +static void +DeactivatePipeDevice (PipeDeviceContext* dev) +{ + LOGSCOPE ("DeactivatePipeDevice"); + + HANDLE hdev = GetDeviceHandle (dev); + DeactivatorData* data = new DeactivatorData (); + data->dev = hdev; + data->th = CreateThread (NULL, 0, Deactivator, data, + CREATE_SUSPENDED, NULL); + ResumeThread (data->th); +} + +PIPEDEV_API BOOL +Close (PipeOpenContext* pOpenContext) +{ + LOGSCOPE ("Close"); +#ifdef DEBUG_MODE + close_calls++; + + wchar_t buf[100]; + if (pOpenContext) + { + wsprintf (buf, L"opencount %d : %p", + pOpenContext->DeviceContext->OpenCount, + pOpenContext); + MessageBoxW (0, buf, L"close", 0); + } + else + { + wsprintf (buf, L"openctx %p", pOpenContext); + MessageBoxW (0, buf, L"close", 0); + } +#endif + + if (pOpenContext == NULL) + return FALSE; + + PipeDeviceContext* dev = pOpenContext->DeviceContext; + + PipeDeviceContext::LockGuard guard G(*dev); + + if (dev->OpenCount == 0) + return FALSE; + + dev->OpenCount--; + + if (pOpenContext->dwAccessCode & GENERIC_WRITE) + { + dev->WROpenCount--; + if (dev->WROpenCount == 0) + /* Wake up the reading side so it can see + the broken pipe. */ + SetEvent (dev->AbortEvent); + } + + delete pOpenContext; + +#ifdef DEBUG_MODE + wsprintf (buf, L"opencount %d", dev->OpenCount); + MessageBoxW (0, buf, L"close 2", 0); +#endif + + if (dev->OpenCount == 0) + { +#if 0 + HANDLE hdev = GetDeviceHandle (dev); + DeactivateDevice (hdev); +#else + DeactivatePipeDevice (dev); +#endif + } + + return TRUE; +} + +PIPEDEV_API DWORD +Read (PipeOpenContext* pOpenContext, LPVOID pBuffer_, DWORD dwCount) +{ + LOGSCOPE ("Read"); + + if (IsBadReadPtr (pBuffer_, dwCount)) + { + SetLastError (ERROR_INVALID_PARAMETER); + return -1; + } + + BYTE* pBuffer = (BYTE*)pBuffer_; + DWORD needed = dwCount; + + if (pOpenContext == NULL + || (pOpenContext->dwAccessCode & GENERIC_READ) == 0) + return (DWORD)-1; + + PipeDeviceContext* dev = pOpenContext->DeviceContext; + + BOOL breaknext = FALSE; + HANDLE Events[2]; + + do + { + { + PipeDeviceContext::LockGuard guard G(*dev); + + Events[0] = dev->WriteEvent; + Events[1] = dev->AbortEvent; + + if (dev->Aborting) + /* this device is long gone */ + return (DWORD)-1; + + if (dev->WROpenCount == 0) + /* broken pipe */ + return (DWORD)-1; + + if (dev->OpenCount == 0) + /* weird */ + return (DWORD)-1; + + DWORD read = dev->readBytes (pBuffer, dwCount); + pBuffer += read; + dwCount -= read; + + if (read) + SetEvent (dev->ReadEvent); + + if (dwCount == 0) + break; + + if (breaknext) + break; + } + + switch (WaitForMultipleObjects (2, Events, FALSE, INFINITE)) + { + case WAIT_OBJECT_0: + breaknext = TRUE; + break; + default: + // MessageBoxW (0, L"pipe aborted", L"Read", 0); + /* With either wait error or AbortEvent + signaled, return with error. */ + return (DWORD)-1; + } + } + while (dwCount); + + return needed - dwCount; +} + +PIPEDEV_API DWORD +Write (PipeOpenContext* pOpenContext, LPCVOID pBuffer_, DWORD dwCount) +{ + LOGSCOPE ("Write"); + + if (IsBadReadPtr (pBuffer_, dwCount)) + { + SetLastError (ERROR_INVALID_PARAMETER); + return -1; + } + + const BYTE* pBuffer = (const BYTE*)pBuffer_; + DWORD needed = dwCount; + +#ifdef DEBUG_MODE + wchar_t buf[100]; + wsprintf (buf, L"opencount %d", pOpenContext->DeviceContext->OpenCount); + MessageBoxW (0, buf, L"write", 0); +#endif + + if (pOpenContext == NULL + || (pOpenContext->dwAccessCode & GENERIC_WRITE) == 0) + return (DWORD)-1; + + PipeDeviceContext* dev = pOpenContext->DeviceContext; + + BOOL breaknext = FALSE; + HANDLE Events[2]; + + do + { + { + PipeDeviceContext::LockGuard guard G(*dev); + +#ifdef DEBUG_MODE + MessageBoxW (0, L"lock acquired", L"write", 0); +#endif + + Events[0] = dev->ReadEvent; + Events[1] = dev->AbortEvent; + + if (dev->Aborting) + /* this device is long gone */ + return (DWORD)-1; + + if (dev->OpenCount == 0) + /* weird */ + return (DWORD)-1; + + /* According to MSDN, attempting to read from a pipe without writers, + generates a broken pipe error, but the opposite isn't forbidden, so we + allow writing to a pipe without a reader. */ + + DWORD wrote = dev->writeBytes (pBuffer, dwCount); + pBuffer += wrote; + dwCount -= wrote; + + /* According to MSDN, a write of 0, also wakes + the reading end of the pipe. */ + PulseEvent (dev->WriteEvent); + + if (dwCount == 0) + break; + + if (breaknext) + break; + } + + switch (WaitForMultipleObjects (2, Events, FALSE, INFINITE)) + { + case WAIT_OBJECT_0: + breaknext = TRUE; + break; + default: + // MessageBoxW (0, L"pipe aborted", L"Write", 0); + /* With either wait error or AbortEvent + signaled, return with error. */ + return (DWORD) -1; + } + } + while (dwCount); + + return needed - dwCount; +} + +PIPEDEV_API DWORD +Seek (PipeOpenContext* /*pOpenContext*/, long /*Amount*/, WORD /*wType*/) +{ + LOGSCOPE ("Seek"); + /* Pipes don't support seeking. */ + return (DWORD)-1; +} + +PIPEDEV_API BOOL +IOControl (PipeOpenContext* pOpenContext, DWORD dwCode, + PBYTE pBufIn, DWORD dwLenIn, + PBYTE pBufOut, DWORD dwLenOut, PDWORD pdwActualOut) +{ + LOGSCOPE ("IOControl"); + + /* Kill unused warnings. */ + (void)pBufIn; + (void)dwLenIn; + (void)pBufOut; + (void)dwLenOut; + (void)pdwActualOut; + + BOOL bRet = FALSE; + + if (pOpenContext == NULL) + return FALSE; + + PipeDeviceContext* dev = pOpenContext->DeviceContext; + PipeDeviceContext::LockGuard guard G(*dev); + +#ifdef DEBUG_MODE + wchar_t buf[100]; + wsprintf (buf, L"%x : %d", dwCode, dev->OpenCount); + MessageBoxW (0, buf, L"IOControl", 0); +#endif + + if (dwCode == IOCTL_PSL_NOTIFY) + { + PDEVICE_PSL_NOTIFY pPslPacket = (PDEVICE_PSL_NOTIFY)pBufIn; + + if (pPslPacket->dwSize == sizeof (DEVICE_PSL_NOTIFY) + && pPslPacket->dwFlags == DLL_PROCESS_EXITING) + { +#ifdef DEBUG_MODE + WCHAR buf[100]; + wsprintf (buf, L"%p : %p", pPslPacket->hProc, pPslPacket->hThread); + MessageBoxW(0, buf, L"process dying", 0); +#endif + dev->Aborting = TRUE; + /* Unlock all blocked threads. */ + SetEvent (dev->AbortEvent); + } + return TRUE; + } + + switch (dwCode) + { + case PIPE_IOCTL_SET_PIPE_NAME: + if (dev->DeviceName) + free (dev->DeviceName); + dev->DeviceName = wcsdup ((WCHAR*)pBufIn); + bRet = TRUE; + break; + case PIPE_IOCTL_GET_PIPE_NAME: + wcscpy ( (WCHAR*)pBufOut, dev->DeviceName); + *pdwActualOut = (wcslen (dev->DeviceName) + 1) * sizeof (WCHAR); + bRet = TRUE; + break; + } + + return bRet; +} + +PIPEDEV_API void +PowerDown (PipeDeviceContext* /*pDeviceContext*/) +{ +} + +PIPEDEV_API void +PowerUp (PipeDeviceContext* /*pDeviceContext*/) +{ +} Property changes on: trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.cpp ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.h =================================================================== --- trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.h (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.h 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,41 @@ +/* Copyright (c) 2007, Pedro Alves + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#ifndef __PIPEDEVICE_H__ +#define __PIPEDEVICE_H__ + +#include <windows.h> +#include <winioctl.h> + +#define PIPE_IOCTL_SET_PIPE_NAME \ + CTL_CODE(FILE_DEVICE_STREAMS, 2048, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define PIPE_IOCTL_GET_PIPE_NAME \ + CTL_CODE(FILE_DEVICE_STREAMS, 2049, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define DEVICE_DLL_NAME L"PipeDev.dll" + +#endif Property changes on: trunk/cegcc/tools/PipeLib/PipeDev/PipeDevice.h ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/PipeLib/Makefile =================================================================== --- trunk/cegcc/tools/PipeLib/PipeLib/Makefile (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeLib/Makefile 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,22 @@ +TARGET=arm-wince-mingw32ce + +CXX=$(TARGET)-g++ +AR=$(TARGET)-ar + +INCLUDES=-I../PipeDev/ + +ALLFLAGS=$(INCLUDES) $(CXXFLAGS) + +all: libPipeLib.a + +PipeLib.o: PipeLib.cpp + $(CXX) $< -c -o $@ $(ALLFLAGS) + +libPipeLib.a: PipeLib.o + rm -f $@ + $(AR) r $@ $< + +clean: + rm -f libPipeLib.a PipeLib.o + +.PHONE: all clean Property changes on: trunk/cegcc/tools/PipeLib/PipeLib/Makefile ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.cpp =================================================================== --- trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.cpp (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.cpp 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,218 @@ +/* Copyright (c) 2007, Pedro Alves + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#include <PipeDevice.h> + +#include <windows.h> +#include <devload.h> +#include <stdlib.h> + +#define KEY_NAME_BASE L"PipeDevice_" +#define NAME_BASE L"PD" /* Pipe Device */ +#define MAX_INSTANCES 99 + +#if 0 + +/* Doesn't work on CE < 5 ... */ +static int +FindFreeInstanceIndex (void) +{ + HANDLE h; + DEVMGR_DEVICE_INFORMATION di; + WCHAR wzName[6]; + for (int i=0; i < MAX_INSTANCES; i++) + { + wsprintf (wzName, L"%s%02d:", NAME_BASE, i); + di.dwSize = sizeof (di); + h = FindFirstDevice (DeviceSearchByLegacyName, wzName, &di); + if (h == INVALID_HANDLE_VALUE) + return i; + CloseHandle (h); + } + return -1; +} +#endif + +static void +PrepareRegistryForInstance (DWORD dwIndex, WCHAR** wzKey) +{ + DWORD dw; + HKEY hk; + WCHAR szKeyName[255]; + WCHAR wzPrefix[4]; //3 letter + zero character + DWORD dwDisp; + swprintf (wzPrefix, L"%s%d", NAME_BASE, dwIndex / 10); + + swprintf (szKeyName, L"Drivers\\%s%d", KEY_NAME_BASE, dwIndex); + *wzKey = wcsdup (szKeyName); + + if (ERROR_SUCCESS != RegCreateKeyEx (HKEY_LOCAL_MACHINE, + szKeyName, 0, NULL, 0, + KEY_WRITE, NULL, &hk, &dwDisp)) + { + wprintf (L"Failed to create registry key %s, error = %d\n", + szKeyName, (int) GetLastError ()); + return; + } + + RegSetValueEx (hk, L"dll", 0, REG_SZ, (BYTE *)DEVICE_DLL_NAME, + sizeof (DEVICE_DLL_NAME)); + RegSetValueEx (hk, L"prefix", 0, REG_SZ, (BYTE *)wzPrefix, + sizeof (wzPrefix)); + + dw = dwIndex % 10; + RegSetValueEx (hk, L"index", 0, REG_DWORD, (BYTE *)&dw, sizeof (dw)); + + dw = DEVFLAGS_LOADLIBRARY | DEVFLAGS_NAKEDENTRIES; + RegSetValueEx (hk, L"Flags", 0, REG_DWORD, (BYTE *)&dw, sizeof (dw)); + + RegCloseKey (hk); +} + +static BOOL +SetPipeName (HANDLE p, WCHAR* name) +{ + if (!DeviceIoControl (p, PIPE_IOCTL_SET_PIPE_NAME, + (LPVOID) name, (wcslen (name) + 1) * sizeof (WCHAR), + NULL, 0, NULL, NULL)) + return FALSE; + return TRUE; +} + +extern "C" BOOL +GetPipeName (HANDLE p, WCHAR* name) +{ + DWORD actual; + if (!DeviceIoControl (p, PIPE_IOCTL_GET_PIPE_NAME, + NULL, 0, + (LPVOID)name, MAX_PATH * sizeof (WCHAR), + &actual, NULL)) + return FALSE; + return TRUE; +} + +extern "C" BOOL +CreatePipe (PHANDLE hReadPipe, + PHANDLE hWritePipe, + LPSECURITY_ATTRIBUTES lpPipeAttributes, + DWORD nSize) +{ + int inst; + WCHAR* wsKey; + HANDLE h; + + *hReadPipe = NULL; + *hWritePipe = NULL; + + for (inst = 0 ; inst < MAX_INSTANCES; inst++) + { + PrepareRegistryForInstance (inst, &wsKey); + h = ActivateDevice (wsKey, 0); + RegDeleteKey (HKEY_LOCAL_MACHINE, wsKey); + free (wsKey); + + /* Although MSDN documentcs that error should + return INVALID_HANDLE_VALUE, I see it returning + NULL here. */ + if (h != INVALID_HANDLE_VALUE && h != NULL) + break; + } + + if (inst == MAX_INSTANCES) + return FALSE; + + /* name + num + ':' + '0' */ + wchar_t device_name[(sizeof (NAME_BASE) - 1) + 2 + 1 + 1]; + wsprintf (device_name, L"%s%02d:", NAME_BASE, inst); + + *hReadPipe = CreateFile (device_name, + GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + + SetPipeName (*hReadPipe, device_name); + + *hWritePipe = CreateFile (device_name, + GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + + return TRUE; +} + +#if 0 + +struct PeekStruct +{ + DWORD Size; /* for future extension */ + PVOID lpBuffer, + DWORD nBufferSize, + + /* TODO: We need to use MapPtr for this to work */ + LPDWORD lpBytesRead, + LPDWORD lpTotalBytesAvail, + LPDWORD lpBytesLeftThisMessage + }; + +BOOL +PeekNamedPipe (HANDLE hNamedPipe, + LPVOID lpBuffer, + DWORD nBufferSize, + LPDWORD lpBytesRead, + LPDWORD lpTotalBytesAvail, + LPDWORD lpBytesLeftThisMessage + ) +{ + DWORD avail; + DWORD actual; + + PeekStruct data; + data.Size = sizeof (PeekStruct); + data.lpBuffer = lpBuffer; + data.nBufferSize = nBufferSize; + data.lpBytesRead = lpBytesRead; + data.lpTotalBytesAvail = lpTotalBytesAvail; + data.lpBytesLeftThisMessage = lpBytesLeftThisMessage; + + if (!DeviceIoControl (hNamedPipe, PIPE_IOCTRL_PEEK_NAMED_PIPE, + NULL, 0, + (LPVOID)&data, sizeof (PeekStruct), &actual, NULL)) + return FALSE; + + /* We can detect here if we are talking to an older driver. */ + if (actual != data.Size) + return FALSE; + + return FALSE; +} + +#endif Property changes on: trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.cpp ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.h =================================================================== --- trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.h (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.h 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,43 @@ +/* Copyright (c) 2007, Pedro Alves + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#ifndef __PIPE_LIB_H__ +#define __PIPE_LIB_H__ + +#ifdef __cplusplus +extern "C" +{ +#endif + +BOOL CreatePipe (PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD); +BOOL GetPipeName (HANDLE, WCHAR*); + +#ifdef __cplusplus +} +#endif + + +#endif Property changes on: trunk/cegcc/tools/PipeLib/PipeLib/PipeLib.h ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/PipeTest/Makefile =================================================================== --- trunk/cegcc/tools/PipeLib/PipeTest/Makefile (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeTest/Makefile 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,21 @@ +TARGET=arm-wince-mingw32ce + +CXX=$(TARGET)-g++ +AR=$(TARGET)-ar + +WARNFLAGS=-Wall -Wextra + +INCLUDES=-I../PipeLib +LIBS=-L../PipeLib -lPipeLib + +ALLFLAGS=$(INCLUDES) $(CXXFLAGS) $(WARNFLAGS) + +all: PipeTest.exe + +PipeTest.exe: PipeTest.cpp Makefile + $(CXX) $< -o $@ $(ALLFLAGS) $(LIBS) $(LDFLAGS) + +clean: + rm -f PipeTest.exe + +.PHONE: all clean Property changes on: trunk/cegcc/tools/PipeLib/PipeTest/Makefile ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/PipeTest/PipeTest.cpp =================================================================== --- trunk/cegcc/tools/PipeLib/PipeTest/PipeTest.cpp (rev 0) +++ trunk/cegcc/tools/PipeLib/PipeTest/PipeTest.cpp 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,172 @@ +/* Copyright (c) 2007, Pedro Alves + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <windows.h> +#include <commctrl.h> + +#include <PipeLib.h> + +extern "C" BOOL GetStdioPathW(int, wchar_t*, DWORD*); +extern "C" BOOL SetStdioPathW(int, const wchar_t*); + +volatile BOOL stop = 0; + +static HANDLE readh[3]; +static HANDLE writeh[3]; + +static DWORD WINAPI +stdin_thread (void*) +{ + /* We don't need the reading side. */ + CloseHandle (readh[0]); + readh[0] = INVALID_HANDLE_VALUE; + + while (!stop) + { + DWORD read = 0; + char buf[1]; + + if (!ReadFile ((HANDLE) fileno (stdin), buf, sizeof (buf), &read, FALSE)) + { + OutputDebugStringW (L"stdin: broken pipe\n"); + break; + } + + if (read) + { + DWORD written = 0; + WriteFile (writeh[0], buf, read, &written, NULL); + } + } + + OutputDebugStringW(L"stdin thread gone\n"); + return 0; +} + +static DWORD WINAPI +stdout_thread (void*) +{ + /* We can't close the write side of the pipe until the + child opens its version. Since it will only be open on the + first stdout access, we have to wait until the read side returns + something - which means the child opened stdout. */ + + while (!stop) + { + DWORD read = 0; + char buf[1]; + if (!ReadFile (readh[1], buf, sizeof (buf), &read, FALSE)) + { + OutputDebugStringW (L"stout: broken pipe\n"); + break; + } + else if (writeh[1] != INVALID_HANDLE_VALUE) + { + /* We can now close our wr side. */ + CloseHandle (writeh[1]); + writeh[1] = INVALID_HANDLE_VALUE; + + } + if (read) + { + DWORD written = 0; + WriteFile ((HANDLE) fileno (stdout), buf, read, &written, NULL); + } + } + OutputDebugStringW(L"stdout thread gone\n"); + return 0; +} + + +void +create_inferior (const wchar_t *command, wchar_t** /* child_argv */) +{ + PROCESS_INFORMATION processInfo; + wchar_t prev_path[3][MAX_PATH]; + BOOL bRet; + + for (size_t i = 0; i < 3; i++) + { + wchar_t devname[MAX_PATH]; + if (!CreatePipe (&readh[i], &writeh[i], NULL, 0)) + return; + +#if 0 + CloseHandle (readh[i]); + CloseHandle (writeh[i]); + continue; +#endif + + GetPipeName (readh[i], devname); + DWORD dwLen = MAX_PATH; + GetStdioPathW (i, prev_path[i], &dwLen); + SetStdioPathW (i, devname); + } + + bRet = CreateProcess (command, L"", NULL, NULL, FALSE, 0, + NULL, NULL, NULL, &processInfo); + + if (!bRet) + return; + + for (size_t i = 0; i < 3; i++) + { + SetStdioPathW (i, prev_path[i]); + } + + HANDLE h[3]; + h[0] = CreateThread (NULL, 0, stdin_thread, NULL, 0, NULL); + h[1] = CreateThread (NULL, 0, stdout_thread, NULL, 0, NULL); + h[2] = processInfo.hProcess; + + switch (WaitForMultipleObjects (sizeof (h) / sizeof (h[0]), h, + FALSE, INFINITE)) + { + case WAIT_OBJECT_0: + stop = 1; + TerminateProcess (processInfo.hProcess, 0); + break; + case WAIT_OBJECT_0 + 1: + stop = 1; + TerminateProcess (processInfo.hProcess, 0); + break; + case WAIT_OBJECT_0 + 2: + stop = 1; + + // CloseHandle ((HANDLE) fileno (stdin)); + // TerminateThread (h[0], 0); + // TerminateThread (h[1], 0); + break; + default: + break; + } + + CloseHandle (h[0]); + CloseHandle (h[1]); + CloseHandle (processInfo.hProcess); + CloseHandle (processInfo.hThread); + for (int i = 0; i < 3; i++) + { + CloseHandle (writeh[i]); + } + + for (int i = 0; i < 3; i++) + { + CloseHandle (readh[i]); + } + return; +} + +int WINAPI +WinMain (HINSTANCE /*hInstance*/, + HINSTANCE /*hPrevInstance*/, + LPTSTR /*lpCmdLine*/, + int /*nCmdShow*/) +{ + wchar_t* child_argv[3] = {0}; + + create_inferior (L"TestClient.exe", child_argv); + return 0; +} Property changes on: trunk/cegcc/tools/PipeLib/PipeTest/PipeTest.cpp ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/TestClient/Makefile =================================================================== --- trunk/cegcc/tools/PipeLib/TestClient/Makefile (rev 0) +++ trunk/cegcc/tools/PipeLib/TestClient/Makefile 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,21 @@ +TARGET=arm-wince-mingw32ce + +CXX=$(TARGET)-g++ +AR=$(TARGET)-ar + +WARNFLAGS=-Wall -Wextra + +INCLUDES= +LIBS= + +ALLFLAGS=$(INCLUDES) $(CXXFLAGS) $(WARNFLAGS) + +all: TestClient.exe + +TestClient.exe: TestClient.cpp Makefile + $(CXX) $< -o $@ $(ALLFLAGS) $(LIBS) $(LDFLAGS) + +clean: + rm -f TestClient.exe + +.PHONE: all clean Property changes on: trunk/cegcc/tools/PipeLib/TestClient/Makefile ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/tools/PipeLib/TestClient/TestClient.cpp =================================================================== --- trunk/cegcc/tools/PipeLib/TestClient/TestClient.cpp (rev 0) +++ trunk/cegcc/tools/PipeLib/TestClient/TestClient.cpp 2007-06-09 17:47:55 UTC (rev 934) @@ -0,0 +1,20 @@ +#include <windows.h> + +int WINAPI WinMain(HINSTANCE /*hInstance*/, + HINSTANCE /*hPrevInstance*/, + LPTSTR /*lpCmdLine*/, + int /*nCmdShow*/) +{ + int count = 0; + + for (int i = 0; i < 10; i++) + { + printf ("count = %d\n", count++); + Sleep (1000); + } + + // DWORD* zero = 0; + // return *zero; + + return 0; +} Property changes on: trunk/cegcc/tools/PipeLib/TestClient/TestClient.cpp ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-02 12:50:41
|
Revision: 927 http://svn.sourceforge.net/cegcc/?rev=927&view=rev Author: dannybackx Date: 2007-06-02 05:50:39 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Change as Pedro suggested. Modified Paths: -------------- trunk/cegcc/src/ChangeLog trunk/cegcc/src/cegcc/libstdc++/Makefile Modified: trunk/cegcc/src/ChangeLog =================================================================== --- trunk/cegcc/src/ChangeLog 2007-06-02 12:46:10 UTC (rev 926) +++ trunk/cegcc/src/ChangeLog 2007-06-02 12:50:39 UTC (rev 927) @@ -1,3 +1,9 @@ +2007-06-02 Danny Backx <dan...@us...> + + * cegcc/libstdc++/Makefile : Remove THE_SYSTEM_LIBS variable, somehow + it broke the build, and apparently I was once wrong in thinking this + needed to be different for some builds. + 2007-05-28 Danny Backx <dan...@us...> * build-cegcc.sh (build_libstdcppdll) : Add error handling. Modified: trunk/cegcc/src/cegcc/libstdc++/Makefile =================================================================== --- trunk/cegcc/src/cegcc/libstdc++/Makefile 2007-06-02 12:46:10 UTC (rev 926) +++ trunk/cegcc/src/cegcc/libstdc++/Makefile 2007-06-02 12:50:39 UTC (rev 927) @@ -16,8 +16,6 @@ STRIP=$(TARGET)-strip WINDRES=$(TARGET)-windres -THE_SYSTEM_LIBS?="-lcegcc -lcoredll" - LIB_PATH=$(PREFIX)/$(TARGET)/lib LDFLAGS += -Wl,-Map,${MY_DIR}/$(DLLNAME).map @@ -56,19 +54,6 @@ $(STRIP) ${MY_DIR}/$(DLLNAME)-stripped.dll @mv -vf ${MY_DIR}/$(DLLNAME)-stripped.dll ${MY_DIR}/stripped/$(DLLNAME) -# ${MY_DIR}/$(DLLNAME).a \ -# ${MY_DIR}/$(DLLNAME).def \ -# ${MY_DIR}/$(DLLNAME): -# $(CC) $(LDFLAGS) -shared \ -# -Wl,--enable-auto-import \ -# -Wl,--enable-runtime-pseudo-reloc \ -# -Wl,--export-all-symbols \ -# -o ${MY_DIR}/$(DLLNAME) \ -# -Wl,--out-implib,${MY_DIR}/$(DLLNAME).a \ -# -Wl,--output-def,${MY_DIR}/$(DLLNAME).def \ -# -Wl,--whole-archive ${MY_DIR}/_tmp/*.o \ -# -Wl,-no-whole-archive -lcegcc -lcoredll - ${MY_DIR}/$(DLLNAME).a \ ${MY_DIR}/$(DLLNAME).def \ ${MY_DIR}/$(DLLNAME): @@ -80,7 +65,7 @@ -Wl,--out-implib,${MY_DIR}/$(DLLNAME).a \ -Wl,--output-def,${MY_DIR}/$(DLLNAME).def \ -Wl,--whole-archive ${MY_DIR}/_tmp/*.o \ - -Wl,-no-whole-archive ${THE_SYSTEM_LIBS} + -Wl,-no-whole-archive -lcegcc -lcoredll installdll: ${MY_DIR}/stripped/$(DLLNAME) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-02 12:46:30
|
Revision: 926 http://svn.sourceforge.net/cegcc/?rev=926&view=rev Author: dannybackx Date: 2007-06-02 05:46:10 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Put this code in SVN, has been on my disk for too long. This is the -fcoverage-base option that allows you to specify at compile time where the application will put the coverage files. This has been submitted to gcc-patches. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/common.opt trunk/cegcc/src/gcc/gcc/coverage.c trunk/cegcc/src/gcc/gcc/doc/gcov.texi trunk/cegcc/src/gcc/gcc/libgcov.c trunk/cegcc/src/gcc/gcc/opts.c trunk/cegcc/src/gcc/gcc/toplev.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-06-02 12:46:10 UTC (rev 926) @@ -1,3 +1,12 @@ +2007-06-02 Danny Backx <dan...@us...> + * toplev.h opts.c coverage.c common.opt libgcov.c : Add support for + -fcoverage-base option. This supports --coverage in a + cross-development environment where it is not always easy to use run + time environment variables. This option works at compile time. This + has been submitted to gcc-patches. + * doc/gcov.texi : Add documentation for -fcoverage-base. + + 2006-12-21 Danny Backx <dan...@us...> * config/arm/t-strongarm-pe config/arm/t-strongarm-elf config/arm/t-pe Modified: trunk/cegcc/src/gcc/gcc/common.opt =================================================================== --- trunk/cegcc/src/gcc/gcc/common.opt 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/common.opt 2007-06-02 12:46:10 UTC (rev 926) @@ -309,6 +309,10 @@ Common Report Var(flag_no_common,0) Do not put uninitialized globals in the common section +fcoverage-base= +Common Joined Var(flag_coverage_base) +Directory in which to put coverage analysis files, for cross-compiler environments + fcprop-registers Common Report Var(flag_cprop_registers) Perform a register copy-propagation optimization pass Modified: trunk/cegcc/src/gcc/gcc/coverage.c =================================================================== --- trunk/cegcc/src/gcc/gcc/coverage.c 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/coverage.c 2007-06-02 12:46:10 UTC (rev 926) @@ -89,6 +89,7 @@ static char *bbg_file_name; static unsigned bbg_file_opened; static int bbg_function_announced; +char *coverage_base = NULL; /* Name of the count data file. */ static char *da_file_name; @@ -813,24 +814,22 @@ TREE_CHAIN (field) = fields; fields = field; - /* - * Additional environment variable for cross-development. - */ - if (gcov_cross_prefix = getenv ("GCOV_CROSS_PREFIX")) - { - filename = concat (gcov_cross_prefix, "/", da_file_name, NULL); - filename_len = strlen (filename); - filename_string = build_string (filename_len + 1, filename); - } + /* Additional command line argument for cross-development */ + if (coverage_base) + { + filename = concat (coverage_base, "/", da_file_name, NULL); + filename_len = strlen (filename); + filename_string = build_string (filename_len + 1, filename); + } else - { - filename = getpwd (); - filename = (filename && da_file_name[0] != '/' - ? concat (filename, "/", da_file_name, NULL) - : da_file_name); - filename_len = strlen (filename); - filename_string = build_string (filename_len + 1, filename); - } + { + filename = getpwd (); + filename = (filename && da_file_name[0] != '/' + ? concat (filename, "/", da_file_name, NULL) + : da_file_name); + filename_len = strlen (filename); + filename_string = build_string (filename_len + 1, filename); + } if (filename != da_file_name) free (filename); Modified: trunk/cegcc/src/gcc/gcc/doc/gcov.texi =================================================================== --- trunk/cegcc/src/gcc/gcc/doc/gcov.texi 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/doc/gcov.texi 2007-06-02 12:46:10 UTC (rev 926) @@ -543,10 +543,14 @@ absolute directory structure on the target system. The program will try to create the needed directory structure, if it is not already present. -To support cross-profiling, a program compiled with @option{-fprofile-arcs} -can relocate the data files based on two environment variables on the target -platform, or one on the host platform: +There are two options to support cross-profiling. A command line argument +to the compiler (-fcoverage-base) allows you to override the directory +stored in the object file; this happens at compile time. Alternatively, +two runtime environment variables allow you to relocate the data files. +Both options have effect only on programs compiled with @option{-fprofile-arcs}. +The two environment variables: + @itemize @bullet @item GCOV_PREFIX contains the prefix to add to the absolute paths @@ -559,11 +563,6 @@ @emph{Note:} GCOV_PREFIX_STRIP has no effect if GCOV_PREFIX is undefined, empty or non-absolute. - -@item -GCOV_CROSS_PREFIX is a host platform environment variable. Use it to specify -a target directory to prefix the compiled file name with, replacing the -compile directory. @end itemize For example, if the object file @file{/user/build/foo.o} was built with @@ -574,13 +573,19 @@ @samp{GCOV_PREFIX=/target/run} and @samp{GCOV_PREFIX_STRIP=1}. Such a setting will name the data file @file{/target/run/build/foo.gcda}. -Alternatively, you can set @samp{GCOV_CROSS_PREFIX=/target/run/build} when +Alternatively, you can use @samp{-fcoverage-base=/target/run/build} when compiling, to achieve the same effect. The object file will no longer contain the information @file{/user/build/foo.o} but @file{/target/run/build/foo.o}. The host and target mechanisms are independent of each other, so they can be used together. +The build time command line option can be used like this : + +@smallexample +gcc -fcoverage-base=/target/run -fprofile-arcs -o t.exe t.c +@end smallexample + You must move the data files to the expected directory tree in order to use them for profile directed optimizations (@option{--use-profile}), or to use the @command{gcov} tool. Modified: trunk/cegcc/src/gcc/gcc/libgcov.c =================================================================== --- trunk/cegcc/src/gcc/gcc/libgcov.c 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/libgcov.c 2007-06-02 12:46:10 UTC (rev 926) @@ -328,7 +328,17 @@ #endif if (!gcov_open (gi_filename)) { +#ifndef UNDER_CE fprintf (stderr, "profiling:%s:Cannot open\n", gi_filename); +#else + { + wchar_t x[256]; + int l = strlen(gi_filename); + l = (l < 256) ? l : 255; + mbstowcs(x, gi_filename, l); + MessageBoxW(0, x, L"gcov_open couldn't open file", 0); + } +#endif continue; } } Modified: trunk/cegcc/src/gcc/gcc/opts.c =================================================================== --- trunk/cegcc/src/gcc/gcc/opts.c 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/opts.c 2007-06-02 12:46:10 UTC (rev 926) @@ -836,6 +836,10 @@ fix_register (arg, 0, 0); break; + case OPT_fcoverage_base_: + coverage_base = xstrdup(arg); + break; + case OPT_fdiagnostics_show_location_: if (!strcmp (arg, "once")) diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE; Modified: trunk/cegcc/src/gcc/gcc/toplev.h =================================================================== --- trunk/cegcc/src/gcc/gcc/toplev.h 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/toplev.h 2007-06-02 12:46:10 UTC (rev 926) @@ -132,6 +132,7 @@ extern int flag_unswitch_loops; extern int flag_cprop_registers; extern int time_report; +extern char *coverage_base; /* Things to do with target switches. */ extern void print_version (FILE *, const char *); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-05-31 21:58:29
|
Revision: 925 http://svn.sourceforge.net/cegcc/?rev=925&view=rev Author: pedroalves Date: 2007-05-31 14:58:28 -0700 (Thu, 31 May 2007) Log Message: ----------- * include/winuser.h (SYSTEM_COLOR_BASE_OFFSET): Define. (COLOR_3DDKSHADOW, COLOR_3DFACE, COLOR_3DHILIGHT, COLOR_3DHIGHLIGHT, COLOR_3DLIGHT, COLOR_BTNHILIGHT, COLOR_3DSHADOW, COLOR_ACTIVEBORDER, COLOR_ACTIVECAPTION, COLOR_APPWORKSPACE, COLOR_BACKGROUND, COLOR_DESKTOP, COLOR_BTNFACE, COLOR_BTNHIGHLIGHT, COLOR_BTNSHADOW, COLOR_BTNTEXT, COLOR_CAPTIONTEXT, COLOR_GRAYTEXT, COLOR_HIGHLIGHT, COLOR_HIGHLIGHTTEXT, COLOR_INACTIVEBORDER, COLOR_INACTIVECAPTION, COLOR_INACTIVECAPTIONTEXT, COLOR_INFOBK, COLOR_INFOTEXT, COLOR_MENU, COLOR_MENUTEXT, COLOR_SCROLLBAR, COLOR_WINDOW, COLOR_WINDOWFRAME, COLOR_WINDOWTEXT, COLOR_HOTLIGHT, COLOR_GRADIENTACTIVECAPTION, COLOR_GRADIENTINACTIVECAPTION): Add SYSTEM_COLOR_BASE_OFFSET. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/winuser.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-05-31 20:40:22 UTC (rev 924) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-05-31 21:58:28 UTC (rev 925) @@ -1,5 +1,19 @@ 2007-05-31 Carsten S\xF8rensen <sur...@ri...> + * include/winuser.h (SYSTEM_COLOR_BASE_OFFSET): Define. + (COLOR_3DDKSHADOW, COLOR_3DFACE, COLOR_3DHILIGHT, COLOR_3DHIGHLIGHT, + COLOR_3DLIGHT, COLOR_BTNHILIGHT, COLOR_3DSHADOW, COLOR_ACTIVEBORDER, + COLOR_ACTIVECAPTION, COLOR_APPWORKSPACE, COLOR_BACKGROUND, + COLOR_DESKTOP, COLOR_BTNFACE, COLOR_BTNHIGHLIGHT, COLOR_BTNSHADOW, + COLOR_BTNTEXT, COLOR_CAPTIONTEXT, COLOR_GRAYTEXT, COLOR_HIGHLIGHT, + COLOR_HIGHLIGHTTEXT, COLOR_INACTIVEBORDER, COLOR_INACTIVECAPTION, + COLOR_INACTIVECAPTIONTEXT, COLOR_INFOBK, COLOR_INFOTEXT, COLOR_MENU, + COLOR_MENUTEXT, COLOR_SCROLLBAR, COLOR_WINDOW, COLOR_WINDOWFRAME, + COLOR_WINDOWTEXT, COLOR_HOTLIGHT, COLOR_GRADIENTACTIVECAPTION, + COLOR_GRADIENTINACTIVECAPTION): Add SYSTEM_COLOR_BASE_OFFSET. + +2007-05-31 Carsten S\xF8rensen <sur...@ri...> + * include/commctrl.h (tagREBARBANDINFOA, tagREBARBANDINFOW) [_WIN32_WCE]: Hide cxHeader field. (CMDBAR_HELP, CMDBAR_OK): Define. Modified: trunk/cegcc/src/w32api/include/winuser.h =================================================================== --- trunk/cegcc/src/w32api/include/winuser.h 2007-05-31 20:40:22 UTC (rev 924) +++ trunk/cegcc/src/w32api/include/winuser.h 2007-05-31 21:58:28 UTC (rev 925) @@ -837,40 +837,45 @@ #define MWMO_WAITALL 1 #define MWMO_ALERTABLE 2 #define MWMO_INPUTAVAILABLE 4 -#define COLOR_3DDKSHADOW 21 -#define COLOR_3DFACE 15 -#define COLOR_3DHILIGHT 20 -#define COLOR_3DHIGHLIGHT 20 -#define COLOR_3DLIGHT 22 -#define COLOR_BTNHILIGHT 20 -#define COLOR_3DSHADOW 16 -#define COLOR_ACTIVEBORDER 10 -#define COLOR_ACTIVECAPTION 2 -#define COLOR_APPWORKSPACE 12 -#define COLOR_BACKGROUND 1 -#define COLOR_DESKTOP 1 -#define COLOR_BTNFACE 15 -#define COLOR_BTNHIGHLIGHT 20 -#define COLOR_BTNSHADOW 16 -#define COLOR_BTNTEXT 18 -#define COLOR_CAPTIONTEXT 9 -#define COLOR_GRAYTEXT 17 -#define COLOR_HIGHLIGHT 13 -#define COLOR_HIGHLIGHTTEXT 14 -#define COLOR_INACTIVEBORDER 11 -#define COLOR_INACTIVECAPTION 3 -#define COLOR_INACTIVECAPTIONTEXT 19 -#define COLOR_INFOBK 24 -#define COLOR_INFOTEXT 23 -#define COLOR_MENU 4 -#define COLOR_MENUTEXT 7 -#define COLOR_SCROLLBAR 0 -#define COLOR_WINDOW 5 -#define COLOR_WINDOWFRAME 6 -#define COLOR_WINDOWTEXT 8 -#define COLOR_HOTLIGHT 26 -#define COLOR_GRADIENTACTIVECAPTION 27 -#define COLOR_GRADIENTINACTIVECAPTION 28 +#ifdef _WIN32_WCE +#define SYSTEM_COLOR_BASE_OFFSET 0x40000000 +#else +#define SYSTEM_COLOR_BASE_OFFSET 0 +#endif +#define COLOR_3DDKSHADOW (SYSTEM_COLOR_BASE_OFFSET + 21) +#define COLOR_3DFACE (SYSTEM_COLOR_BASE_OFFSET + 15) +#define COLOR_3DHILIGHT (SYSTEM_COLOR_BASE_OFFSET + 20) +#define COLOR_3DHIGHLIGHT (SYSTEM_COLOR_BASE_OFFSET + 20) +#define COLOR_3DLIGHT (SYSTEM_COLOR_BASE_OFFSET + 22) +#define COLOR_BTNHILIGHT (SYSTEM_COLOR_BASE_OFFSET + 20) +#define COLOR_3DSHADOW (SYSTEM_COLOR_BASE_OFFSET + 16) +#define COLOR_ACTIVEBORDER (SYSTEM_COLOR_BASE_OFFSET + 10) +#define COLOR_ACTIVECAPTION (SYSTEM_COLOR_BASE_OFFSET + 2) +#define COLOR_APPWORKSPACE (SYSTEM_COLOR_BASE_OFFSET + 12) +#define COLOR_BACKGROUND (SYSTEM_COLOR_BASE_OFFSET + 1) +#define COLOR_DESKTOP (SYSTEM_COLOR_BASE_OFFSET + 1) +#define COLOR_BTNFACE (SYSTEM_COLOR_BASE_OFFSET + 15) +#define COLOR_BTNHIGHLIGHT (SYSTEM_COLOR_BASE_OFFSET + 20) +#define COLOR_BTNSHADOW (SYSTEM_COLOR_BASE_OFFSET + 16) +#define COLOR_BTNTEXT (SYSTEM_COLOR_BASE_OFFSET + 18) +#define COLOR_CAPTIONTEXT (SYSTEM_COLOR_BASE_OFFSET + 9) +#define COLOR_GRAYTEXT (SYSTEM_COLOR_BASE_OFFSET + 17) +#define COLOR_HIGHLIGHT (SYSTEM_COLOR_BASE_OFFSET + 13) +#define COLOR_HIGHLIGHTTEXT (SYSTEM_COLOR_BASE_OFFSET + 14) +#define COLOR_INACTIVEBORDER (SYSTEM_COLOR_BASE_OFFSET + 11) +#define COLOR_INACTIVECAPTION (SYSTEM_COLOR_BASE_OFFSET + 3) +#define COLOR_INACTIVECAPTIONTEXT (SYSTEM_COLOR_BASE_OFFSET + 19) +#define COLOR_INFOBK (SYSTEM_COLOR_BASE_OFFSET + 24) +#define COLOR_INFOTEXT (SYSTEM_COLOR_BASE_OFFSET + 23) +#define COLOR_MENU (SYSTEM_COLOR_BASE_OFFSET + 4) +#define COLOR_MENUTEXT (SYSTEM_COLOR_BASE_OFFSET + 7) +#define COLOR_SCROLLBAR (SYSTEM_COLOR_BASE_OFFSET + 0) +#define COLOR_WINDOW (SYSTEM_COLOR_BASE_OFFSET + 5) +#define COLOR_WINDOWFRAME (SYSTEM_COLOR_BASE_OFFSET + 6) +#define COLOR_WINDOWTEXT (SYSTEM_COLOR_BASE_OFFSET + 8) +#define COLOR_HOTLIGHT (SYSTEM_COLOR_BASE_OFFSET + 26) +#define COLOR_GRADIENTACTIVECAPTION (SYSTEM_COLOR_BASE_OFFSET + 27) +#define COLOR_GRADIENTINACTIVECAPTION (SYSTEM_COLOR_BASE_OFFSET + 28) #define CTLCOLOR_MSGBOX 0 #define CTLCOLOR_EDIT 1 #define CTLCOLOR_LISTBOX 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |