summaryrefslogtreecommitdiff
path: root/wince
diff options
context:
space:
mode:
authorVadim Konovalov <vkonovalov@lucent.com>2003-07-26 02:17:11 +0400
committerJarkko Hietaniemi <jhi@iki.fi>2003-07-27 15:08:23 +0000
commit8f33b42a5befbbd0d1d798a463bfe4ac2ba9bf10 (patch)
tree85154c3991f97ea383c80d44a2adbd283a803ddb /wince
parent531e2ba17c3281a8e6bbb5e7c03fd7923b41370f (diff)
downloadperl-8f33b42a5befbbd0d1d798a463bfe4ac2ba9bf10.tar.gz
WinCE port addition
From: "Konovalov, Vadim" <vkonovalov@spb.lucent.com> Message-ID: <845FCFF2D4C0FC468B485E8777C7A00C200D42@cio-test001.spb.lucent.com> p4raw-id: //depot/perl@20219
Diffstat (limited to 'wince')
-rw-r--r--wince/Makefile.ce7
-rw-r--r--wince/README.compile44
-rw-r--r--wince/README.perlce2
-rw-r--r--wince/compile.bat2
-rw-r--r--wince/wince.c122
-rw-r--r--wince/wince.h1
6 files changed, 105 insertions, 73 deletions
diff --git a/wince/Makefile.ce b/wince/Makefile.ce
index 5d452203f6..4115316bbe 100644
--- a/wince/Makefile.ce
+++ b/wince/Makefile.ce
@@ -762,7 +762,7 @@ $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
#----------------------------------------------------------------------------------
Extensions: ..\win32\buildext.pl $(PERLDEP) $(CONFIGPM)
$(HPERL) -I..\lib -I..\win32 -MCross=$(CROSS_NAME) ..\win32\buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) \
- !POSIX !Time/HiRes !XS/Typemap
+ !POSIX
Extensions_clean:
-if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
@@ -829,9 +829,6 @@ XDLLOBJS = $(XDLLOBJS) $(DLLDIR)\malloc.obj
!IF "$(CRYPT_SRC)" != ""
XDLLOBJS = $(XDLLOBJS) $(DLLDIR)\fcrypt.obj
!ENDIF
-!IF "$(CRYPT_SRC)" != ""
-XDLLOBJS = $(XDLLOBJS) $(DLLDIR)\fcrypt.obj
-!ENDIF
{$(SRCDIR)}.c{$(DLLDIR)}.obj:
$(CC) -c $(CFLAGS_O) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ $<
@@ -847,7 +844,7 @@ $(DLLDIR)\toke.obj:
# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
!IF "$(USE_IMP_SYS)" == "define"
-$(DLLDIR)\perllib$(o) : perllib.c ..\win32\perlhost.h .\vdir.h .\vmem.h
+$(DLLDIR)\perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
$(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
rem (frustrated) mv perllib.obj $(DLLDIR)
!ENDIF
diff --git a/wince/README.compile b/wince/README.compile
deleted file mode 100644
index 3325402414..0000000000
--- a/wince/README.compile
+++ /dev/null
@@ -1,44 +0,0 @@
-Change config.ce. The makefile will automatically generate new
-config.h.
-
-To generate a new Config.pm, delete config.h or
-touch config.ce.
-
-The socket stuff has been rewritten so fds from ceio are used. This
-makes it easy to use them as perl file handles.
-
-Socket and IO dlls compiled. Seem to work.
-
-The sequence for building a new target is:
-
-make -f Makefile.ce clean # clean up
-make -f Makefile.ce all # build for target
-
-CROSS_NAME macro is provided to name your current cross compilation.
-It is "wince" by default, but may be any other identifier to
-differentiate and co-exist miscellaneous configurations.
-So your command often will be
-
-make -f Makefile.ce all CROSS_NAME=[my-cross-name]
-
-It is implemented an easy way to build most of module extensions.
-First, you need to do
-
- nmake host-install CROSS_NAME=[my-cross-name]
-
-This command will install a set of files into your perl directory.
-That will allow you to do cross-compiling for your CE device.
-Those files are C libraries, h-files, Cross.pm, Config.pm. Note
-that it will use first found perl in your path. You should think about
-your PATH variable and change it at your will before copying such files.
-
-After that to do cross-compiling you need to invoke
-
- perl -MCross Makefile.PL
-
-or
-
- perl -MCross=[my-cross-name] Makefile.PL
-
-to prepare Makefile, and then nmake, nmake install, as usually you do.
-'test' tartget is still not ready.
diff --git a/wince/README.perlce b/wince/README.perlce
index dfe962fe04..34a3e37a51 100644
--- a/wince/README.perlce
+++ b/wince/README.perlce
@@ -58,8 +58,6 @@ PERLFILES
files from a perl for win32 installation and put the
distributed files into the right directories.
- Do not copy any Win32/X86 dlls from your PC to the device...
-
The following files are a reasonable minimum if you want to do
some socket stuff:
diff --git a/wince/compile.bat b/wince/compile.bat
index 72c70429fc..79ed2fb80c 100644
--- a/wince/compile.bat
+++ b/wince/compile.bat
@@ -6,7 +6,7 @@ rem
set ARG-1=PV=
set ARG-2=INST_VER=
-set ARG-3=INSTALL_ROOT=\Storage Card\perl-tests\perl@19053
+set ARG-3=INSTALL_ROOT=\Storage Card\perl58m
set ARG-4=WCEROOT=%SDKROOT%
set ARG-5=CEPATH=%WCEROOT%
set ARG-6=CELIBDLLDIR=d:\personal\pocketPC\celib-palm-3.0
diff --git a/wince/wince.c b/wince/wince.c
index 675d934479..cb3c388e1b 100644
--- a/wince/wince.c
+++ b/wince/wince.c
@@ -364,12 +364,6 @@ win32_signal(int sig, Sighandler_t subcode)
return FALSE;
}
-DllExport void
-win32_clearenv()
-{
- return;
-}
-
DllExport char ***
win32_environ(void)
@@ -610,13 +604,14 @@ win32_uname(struct utsname *name)
void
sig_terminate(pTHX_ int sig)
{
- Perl_warn(aTHX_ "Terminating on signal SIG%s(%d)\n",PL_sig_name[sig], sig);
+ Perl_warn(aTHX_ "Terminating on signal SIG%s(%d)\n",PL_sig_name[sig], sig);
/* exit() seems to be safe, my_exit() or die() is a problem in ^C
thread
*/
exit(sig);
}
+void
DllExport int
win32_async_check(pTHX)
{
@@ -638,7 +633,6 @@ win32_async_check(pTHX)
goto Raise;
break;
#endif
-
/* We use WM_USER to fake kill() with other signals */
case WM_USER: {
sig = msg.wParam;
@@ -753,6 +747,41 @@ do_raise(pTHX_ int sig)
return 1;
}
+/* Timing related stuff */
+
+int
+do_raise(pTHX_ int sig)
+{
+ if (sig < SIG_SIZE) {
+ Sighandler_t handler = w32_sighandler[sig];
+ if (handler == SIG_IGN) {
+ return 0;
+ }
+ else if (handler != SIG_DFL) {
+ (*handler)(sig);
+ return 0;
+ }
+ else {
+ /* Choose correct default behaviour */
+ switch (sig) {
+#ifdef SIGCLD
+ case SIGCLD:
+#endif
+#ifdef SIGCHLD
+ case SIGCHLD:
+#endif
+ case 0:
+ return 0;
+ case SIGTERM:
+ default:
+ break;
+ }
+ }
+ }
+ /* Tell caller to exit thread/process as approriate */
+ return 1;
+}
+
static UINT timerid = 0;
static VOID CALLBACK TimerProc(HWND win, UINT msg, UINT id, DWORD time)
@@ -1690,6 +1719,70 @@ qualified_path(const char *cmd)
return Nullch;
}
+/* The following are just place holders.
+ * Some hosts may provide and environment that the OS is
+ * not tracking, therefore, these host must provide that
+ * environment and the current directory to CreateProcess
+ */
+
+DllExport void*
+win32_get_childenv(void)
+{
+ return NULL;
+}
+
+DllExport void
+win32_free_childenv(void* d)
+{
+}
+
+DllExport void
+win32_clearenv(void)
+{
+ char *envv = GetEnvironmentStrings();
+ char *cur = envv;
+ STRLEN len;
+ while (*cur) {
+ char *end = strchr(cur,'=');
+ if (end && end != cur) {
+ *end = '\0';
+ xcesetenv(cur, "", 0);
+ *end = '=';
+ cur = end + strlen(end+1)+2;
+ }
+ else if ((len = strlen(cur)))
+ cur += len+1;
+ }
+ FreeEnvironmentStrings(envv);
+}
+
+DllExport char*
+win32_get_childdir(void)
+{
+ dTHX;
+ char* ptr;
+ char szfilename[(MAX_PATH+1)*2];
+ if (USING_WIDE()) {
+ WCHAR wfilename[MAX_PATH+1];
+ GetCurrentDirectoryW(MAX_PATH+1, wfilename);
+ W2AHELPER(wfilename, szfilename, sizeof(szfilename));
+ }
+ else {
+ GetCurrentDirectoryA(MAX_PATH+1, szfilename);
+ }
+
+ New(0, ptr, strlen(szfilename)+1, char);
+ strcpy(ptr, szfilename);
+ return ptr;
+}
+
+DllExport void
+win32_free_childdir(char* d)
+{
+ dTHX;
+ Safefree(d);
+}
+
/* XXX this needs to be made more compatible with the spawnvp()
* provided by the various RTLs. In particular, searching for
* *.{com,bat,cmd} files (as done by the RTLs) is unimplemented.
@@ -2165,13 +2258,6 @@ Perl_win32_init(int *argcp, char ***argvp)
MALLOC_INIT;
}
-void
-Perl_win32_term(void)
-{
- OP_REFCNT_TERM;
- MALLOC_TERM;
-}
-
DllExport void
Perl_win32_term(void)
{
@@ -2211,12 +2297,6 @@ win32_wait(int *status)
}
int
-do_spawn(char *cmd)
-{
- return xcesystem(cmd);
-}
-
-int
Perl_do_spawn(pTHX_ char *cmd)
{
return do_spawn(aTHX_ cmd);
diff --git a/wince/wince.h b/wince/wince.h
index c82c7a696f..f4264dd8bd 100644
--- a/wince/wince.h
+++ b/wince/wince.h
@@ -64,6 +64,7 @@ XCE_EXPORT void XCEShowMessageA(const char *fmt, ...);
#define ftime xceftime
#define ctime xcectime
#define gettimeofday xcegettimeofday
+#define GetSystemTimeAsFileTime XCEGetSystemTimeAsFileTime
XCE_EXPORT int xcesetuid(uid_t id);
XCE_EXPORT int xceseteuid(uid_t id);