]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 5 Feb 2009 01:46:43 +0000 (17:46 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 5 Feb 2009 01:46:43 +0000 (17:46 -0800)
.gitignore
Makefile
basis/io/launcher/windows/nt/nt-tests.factor
build-support/factor.sh
vm/Config.windows
vm/Config.windows.nt
vm/Config.windows.nt.x86.32
vm/Config.windows.nt.x86.64
vm/os-windows.c

index 05a53c02c6ac860ee0269849b92dbcd9ab913d24..435595f502cbdcec6f019cae08b41d2d1d4555dc 100644 (file)
@@ -11,6 +11,7 @@ Factor/factor
 *.image
 *.dylib
 factor
+factor.com
 *#*#
 .DS_Store
 .gdb_history
index b41e75672960061aeb87d889bd9ec080997a4fc1..e84a5f9c5ad3f09302d65ea4413ed4e78c07e8ca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,8 @@ else
        CFLAGS += -O3 $(SITE_CFLAGS)
 endif
 
-ifdef CONFIG
-       include $(CONFIG)
-endif
+CONFIG = $(shell ./build-support/factor.sh config-target)
+include $(CONFIG)
 
 ENGINE = $(DLL_PREFIX)factor$(DLL_SUFFIX)$(DLL_EXTENSION)
 
@@ -130,18 +129,20 @@ solaris-x86-64:
        $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86.64
 
 freetype6.dll:
-       wget http://factorcode.org/dlls/freetype6.dll
+       wget $(DLL_PATH)/freetype6.dll
        chmod 755 freetype6.dll
 
 zlib1.dll:
-       wget http://factorcode.org/dlls/zlib1.dll
+       wget $(DLL_PATH)/zlib1.dll
        chmod 755 zlib1.dll
 
-winnt-x86-32: freetype6.dll zlib1.dll
+windows-dlls: freetype6.dll zlib1.dll
+
+winnt-x86-32: windows-dlls
        $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.32
        $(MAKE) $(CONSOLE_EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.32
 
-winnt-x86-64:
+winnt-x86-64: windows-dlls
        $(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.64
        $(MAKE) $(CONSOLE_EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.64
 
@@ -167,7 +168,7 @@ factor: $(DLL_OBJS) $(EXE_OBJS)
 factor-console: $(DLL_OBJS) $(EXE_OBJS)
        $(LINKER) $(ENGINE) $(DLL_OBJS)
        $(CC) $(LIBS) $(LIBPATH) -L. $(LINK_WITH_ENGINE) \
-               $(CFLAGS) $(CFLAGS_CONSOLE) -o $@$(EXE_SUFFIX)$(EXE_EXTENSION) $(EXE_OBJS)
+               $(CFLAGS) $(CFLAGS_CONSOLE) -o factor$(EXE_SUFFIX)$(CONSOLE_EXTENSION) $(EXE_OBJS)
 
 clean:
        rm -f vm/*.o
index 93b1e8c2ffdbc3b769cf156e3b12328114f10ec3..4dd0eebed3395a0e6b553bebd35eb475ead80552 100644 (file)
@@ -1,7 +1,7 @@
 USING: io.launcher tools.test calendar accessors environment
 namespaces kernel system arrays io io.files io.encodings.ascii
 sequences parser assocs hashtables math continuations eval
-io.files.temp io.directories io.pathnames ;
+io.files.temp io.directories io.pathnames splitting ;
 IN: io.launcher.windows.nt.tests
 
 [ ] [
@@ -23,9 +23,12 @@ IN: io.launcher.windows.nt.tests
 
 [ f ] [ "notepad" get process-running? ] unit-test
 
+: console-vm ( -- path )
+    vm ".exe" ?tail [ ".com" append ] when ;
+
 [ ] [
     <process>
-        vm "-quiet" "-run=hello-world" 3array >>command
+        console-vm "-quiet" "-run=hello-world" 3array >>command
         "out.txt" temp-file >>stdout
     try-process
 ] unit-test
@@ -36,7 +39,7 @@ IN: io.launcher.windows.nt.tests
 
 [ ] [
     <process>
-        vm "-run=listener" 2array >>command
+        console-vm "-run=listener" 2array >>command
         +closed+ >>stdin
     try-process
 ] unit-test
@@ -47,7 +50,7 @@ IN: io.launcher.windows.nt.tests
 [ ] [
     launcher-test-path [
         <process>
-            vm "-script" "stderr.factor" 3array >>command
+            console-vm "-script" "stderr.factor" 3array >>command
             "out.txt" temp-file >>stdout
             "err.txt" temp-file >>stderr
         try-process
@@ -65,7 +68,7 @@ IN: io.launcher.windows.nt.tests
 [ ] [
     launcher-test-path [
         <process>
-            vm "-script" "stderr.factor" 3array >>command
+            console-vm "-script" "stderr.factor" 3array >>command
             "out.txt" temp-file >>stdout
             +stdout+ >>stderr
         try-process
@@ -79,7 +82,7 @@ IN: io.launcher.windows.nt.tests
 [ "output" ] [
     launcher-test-path [
         <process>
-            vm "-script" "stderr.factor" 3array >>command
+            console-vm "-script" "stderr.factor" 3array >>command
             "err2.txt" temp-file >>stderr
         ascii <process-reader> lines first
     ] with-directory
@@ -92,7 +95,7 @@ IN: io.launcher.windows.nt.tests
 [ t ] [
     launcher-test-path [
         <process>
-            vm "-script" "env.factor" 3array >>command
+            console-vm "-script" "env.factor" 3array >>command
         ascii <process-reader> contents
     ] with-directory eval
 
@@ -102,7 +105,7 @@ IN: io.launcher.windows.nt.tests
 [ t ] [
     launcher-test-path [
         <process>
-            vm "-script" "env.factor" 3array >>command
+            console-vm "-script" "env.factor" 3array >>command
             +replace-environment+ >>environment-mode
             os-envs >>environment
         ascii <process-reader> contents
@@ -114,7 +117,7 @@ IN: io.launcher.windows.nt.tests
 [ "B" ] [
     launcher-test-path [
         <process>
-            vm "-script" "env.factor" 3array >>command
+            console-vm "-script" "env.factor" 3array >>command
             { { "A" "B" } } >>environment
         ascii <process-reader> contents
     ] with-directory eval
@@ -125,7 +128,7 @@ IN: io.launcher.windows.nt.tests
 [ f ] [
     launcher-test-path [
         <process>
-            vm "-script" "env.factor" 3array >>command
+            console-vm "-script" "env.factor" 3array >>command
             { { "USERPROFILE" "XXX" } } >>environment
             +prepend-environment+ >>environment-mode
         ascii <process-reader> contents
@@ -151,7 +154,7 @@ IN: io.launcher.windows.nt.tests
     2 [
         launcher-test-path [
             <process>
-                vm "-script" "append.factor" 3array >>command
+                console-vm "-script" "append.factor" 3array >>command
                 "append-test" temp-file <appender> >>stdout
             try-process
         ] with-directory
index 44c047155d78a5c5bc9fa4b6714929e1bdf77a7e..e70ef40e5cab313a7aee3cca291322b8bd073186 100755 (executable)
@@ -236,7 +236,7 @@ find_word_size() {
 
 set_factor_binary() {
     case $OS in
-        winnt) FACTOR_BINARY=factor-console.exe;;
+        winnt) FACTOR_BINARY=factor.com;;
         *) FACTOR_BINARY=factor;;
     esac
 }
@@ -260,6 +260,7 @@ echo_build_info() {
     $ECHO FACTOR_BINARY=$FACTOR_BINARY
     $ECHO FACTOR_LIBRARY=$FACTOR_LIBRARY
     $ECHO FACTOR_IMAGE=$FACTOR_IMAGE
+    $ECHO CONFIG_TARGET=$CONFIG_TARGET
     $ECHO MAKE_TARGET=$MAKE_TARGET
     $ECHO BOOT_IMAGE=$BOOT_IMAGE
     $ECHO MAKE_IMAGE_TARGET=$MAKE_IMAGE_TARGET
@@ -289,20 +290,30 @@ set_build_info() {
     if [[ $OS == macosx && $ARCH == ppc ]] ; then
         MAKE_IMAGE_TARGET=macosx-ppc
         MAKE_TARGET=macosx-ppc
+       CONFIG_TARGET=macosx.ppc
     elif [[ $OS == linux && $ARCH == ppc ]] ; then
         MAKE_IMAGE_TARGET=linux-ppc
         MAKE_TARGET=linux-ppc
+       CONFIG_TARGET=linux.ppc
     elif [[ $OS == winnt && $ARCH == x86 && $WORD == 64 ]] ; then
         MAKE_IMAGE_TARGET=winnt-x86.64
         MAKE_TARGET=winnt-x86-64
+       CONFIG_TARGET=windows.nt.x86.64
+    elif [[ $OS == winnt && $ARCH == x86 && $WORD == 32 ]] ; then
+        MAKE_IMAGE_TARGET=winnt-x86.32
+        MAKE_TARGET=winnt-x86-32
+       CONFIG_TARGET=windows.nt.x86.32
     elif [[ $ARCH == x86 && $WORD == 64 ]] ; then
         MAKE_IMAGE_TARGET=unix-x86.64
         MAKE_TARGET=$OS-x86-64
+       CONFIG_TARGET=$OS.x86.64
     else
         MAKE_IMAGE_TARGET=$ARCH.$WORD
         MAKE_TARGET=$OS-$ARCH-$WORD
+        CONFIG_TARGET=$OS.$ARCH.$WORD
     fi
     BOOT_IMAGE=boot.$MAKE_IMAGE_TARGET.image
+    CONFIG_TARGET=vm/Config.$CONFIG_TARGET
 }
 
 parse_build_info() {
@@ -570,5 +581,6 @@ case "$1" in
     dlls) get_config_info; maybe_download_dlls;;
     net-bootstrap) get_config_info; update_boot_images; bootstrap ;;
     make-target) ECHO=false; find_build_info; echo $MAKE_TARGET ;;
+    config-target) ECHO=false; find_build_info; echo $CONFIG_TARGET ;;
     *) usage ;;
 esac
index 41eca86b5cfa358993ff6d6428978e28fddec560..45d2f0cb98f4151657078409f2382b840d1b477f 100644 (file)
@@ -2,6 +2,7 @@ CFLAGS += -DWINDOWS -mno-cygwin
 LIBS = -lm
 PLAF_DLL_OBJS += vm/os-windows.o
 EXE_EXTENSION=.exe
+CONSOLE_EXTENSION=.com
 DLL_EXTENSION=.dll
 LINKER = $(CC) -shared -mno-cygwin -o 
 LINK_WITH_ENGINE = -l$(DLL_PREFIX)factor$(DLL_SUFFIX)
index de28ba64bad30c67020c3d6bbcd86992a5d62705..ffaa899fe1e35cd875d0e7a46ef7f88207de8d57 100644 (file)
@@ -6,4 +6,5 @@ PLAF_EXE_OBJS += vm/resources.o
 PLAF_EXE_OBJS += vm/main-windows-nt.o
 CFLAGS += -mwindows
 CFLAGS_CONSOLE += -mconsole
+CONSOLE_EXTENSION = .com
 include vm/Config.windows
index 9a020a7bc184e60ea2b3f2cc50d1d2503b8d34e0..d27629fe8358552f93499239c2f1cb63a70aca9b 100644 (file)
@@ -1,3 +1,4 @@
+DLL_PATH=http://factorcode.org/dlls
 WINDRES=windres
 include vm/Config.windows.nt
 include vm/Config.x86.32
index f0c0a068cb91b7662e02043d8954482fb42c6068..13ef665b1953a40a275fa4009cb6604ad0cd2f27 100644 (file)
@@ -1,3 +1,5 @@
+#error "lol"
+DLL_PATH=http://factorcode.org/dlls/64
 CC=$(WIN64_PATH)-gcc.exe
 WINDRES=$(WIN64_PATH)-windres.exe
 include vm/Config.windows.nt
index c4d29ea57fb411f2d5b2b056610f251229a4a6a7..2abc04cb3b6e0df0ad317b7c7663b13787a153ac 100755 (executable)
@@ -109,17 +109,6 @@ const F_CHAR *default_image_path(void)
        snwprintf(temp_path, sizeof(temp_path)-1, L"%s.image", full_path); 
        temp_path[sizeof(temp_path) - 1] = 0;
 
-       if(!windows_stat(temp_path)) {
-               unsigned int len = wcslen(full_path);
-               F_CHAR magic[] = L"-console";
-               unsigned int magic_len = wcslen(magic);
-
-               if(!wcsncmp(full_path + len - magic_len, magic, MIN(len, magic_len)))
-                       full_path[len - magic_len] = 0;
-               snwprintf(temp_path, sizeof(temp_path)-1, L"%s.image", full_path); 
-               temp_path[sizeof(temp_path) - 1] = 0;
-       }
-
        return safe_strdup(temp_path);
 }