Ticket #1029: boost-tools.patch
File boost-tools.patch, 29.7 KB (added by , 15 years ago) |
---|
-
tools/build/v2/build-system.jam
diff -N -r -u -b boost_1_34_0/tools/build/v2/build-system.jam boost_1_34_0_amiga/tools/build/v2/build-system.jam
old new 113 113 site-path = [ modules.peek : SystemRoot ] $(user-path) ; 114 114 } 115 115 116 if [ os.name ] = AMIGA 117 { 118 site-path = /SDK/Local/Data $(user-path) ; 119 } 120 116 121 load-config site-config : $(site-path) ; 117 122 118 123 # -
tools/build/v2/tools/amiga.jam
diff -N -r -u -b boost_1_34_0/tools/build/v2/tools/amiga.jam boost_1_34_0_amiga/tools/build/v2/tools/amiga.jam
old new 1 # Copyright 2007 Steven Solie 2 # Distributed under the Boost Software License, Version 1.0. 3 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 4 5 # AmigaOS amiga.jam 6 # 7 8 import toolset : flags ; 9 import property ; 10 import generators ; 11 import os ; 12 import type ; 13 import feature ; 14 import set ; 15 import common ; 16 import errors ; 17 import property-set ; 18 19 toolset.register amiga ; 20 21 import unix ; 22 toolset.inherit-generators amiga : unix ; 23 toolset.inherit-flags amiga : unix ; 24 toolset.inherit-rules amiga : unix ; 25 26 27 # Declare generators 28 generators.override amiga.searched-lib-generator : searched-lib-generator ; 29 generators.register-c-compiler amiga.compile.c : C : OBJ : <toolset>amiga ; 30 generators.register-c-compiler amiga.compile.c++ : CPP : OBJ : <toolset>amiga ; 31 32 33 rule init ( version ? : command * : options * ) 34 { 35 local condition = [ common.check-init-parameters amiga : version $(version) ] ; 36 local command = [ common.get-invocation-command amiga : g++ : $(command) ] ; 37 38 common.handle-options amiga : $(condition) : $(command) : $(options) ; 39 40 flags amiga.link NEED_STRIP $(condition)/<debug-symbols>off : "" ; 41 } 42 43 44 # Declare flags and actions 45 flags amiga.compile OPTIONS <optimization>off : -O0 ; 46 flags amiga.compile OPTIONS <optimization>speed : -O3 ; 47 flags amiga.compile OPTIONS <optimization>space : -Os ; 48 flags amiga.compile OPTIONS <inlining>off : -fno-inline ; 49 flags amiga.compile OPTIONS <inlining>on : -Wno-inline ; 50 flags amiga.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ; 51 flags amiga.compile OPTIONS <warnings>off : -w ; 52 flags amiga.compile OPTIONS <warnings>on : -Wall -Wwrite-strings ; 53 flags amiga.compile OPTIONS <warnings>all : -Wall -Wwrite-strings -pedantic ; 54 flags amiga.compile OPTIONS <warnings-as-errors>on : -Werror ; 55 flags amiga.compile OPTIONS <debug-symbols>on : -ggdb ; 56 flags amiga.compile OPTIONS <profiling>on : -pg ; 57 flags amiga.compile DEFINES <define> ; 58 flags amiga.compile INCLUDES <include> ; 59 60 flags amiga.link OPTIONS <debug-symbols>on : -ggdb ; 61 flags amiga.link OPTIONS <profiling>on : -pg ; 62 flags amiga.link LINKPATH <library-path> ; 63 flags amiga.link LIBRARIES <library-file> ; 64 65 66 actions compile.c 67 { 68 "$(CONFIG_COMMAND)" -mcrt=clib2 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" 69 } 70 71 72 actions compile.c++ 73 { 74 "$(CONFIG_COMMAND)" -mcrt=clib2 -ftemplate-depth-128 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" 75 } 76 77 78 actions link bind LIBRARIES 79 { 80 $(CONFIG_COMMAND) -mcrt=clib2 $(OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -lstdc++ -lm -lunix 81 $(NEED_STRIP)strip $(NEED_STRIP)-R.comment $(NEED_STRIP)"$(<)" 82 } 83 84 85 actions piecemeal archive 86 { 87 ar -crs "$(<:T)" "$(>:T)" 88 } -
tools/build/v2/tools/builtin.jam
diff -N -r -u -b boost_1_34_0/tools/build/v2/tools/builtin.jam boost_1_34_0_amiga/tools/build/v2/tools/builtin.jam
old new 61 61 case MACOSX : host-os = darwin ; 62 62 case KFREEBSD : host-os = freebsd ; 63 63 case LINUX : host-os = linux ; 64 case AMIGA : host-os = amiga ; 64 65 case * : host-os = unix ; 65 66 } 66 67 } -
tools/build/v2/tools/common.jam
diff -N -r -u -b boost_1_34_0/tools/build/v2/tools/common.jam boost_1_34_0_amiga/tools/build/v2/tools/common.jam
old new 697 697 case cw : tag += cw ; 698 698 case darwin* : tag += ; 699 699 case edg* : tag += edg ; 700 case amiga* : tag += amiga ; 700 701 case gcc* : 701 702 { 702 703 switch [ $(property-set).get <toolset-gcc:flavor> ] -
tools/build/v2/util/os.jam
diff -N -r -u -b boost_1_34_0/tools/build/v2/util/os.jam boost_1_34_0_amiga/tools/build/v2/util/os.jam
old new 94 94 local home = [ environ HOMEDRIVE HOMEPATH ] ; 95 95 .home-directories = $(home[1])$(home[2]) [ environ HOME ] [ environ USERPROFILE ] ; 96 96 } 97 else if $(.name) = AMIGA 98 { 99 .home-directories = ; # AmigaOS is single user only 100 } 97 101 else 98 102 { 99 103 .home-directories = [ environ HOME ] ; -
tools/build/v2/util/path.jam
diff -N -r -u -b boost_1_34_0/tools/build/v2/util/path.jam boost_1_34_0_amiga/tools/build/v2/util/path.jam
old new 490 490 return [ native-UNIX $(result) ] ; 491 491 } 492 492 493 rule native-AMIGA ( path ) 494 { 495 return $(path) ; 496 } 497 498 rule make-AMIGA ( native ) 499 { 500 return [ native-UNIX $(native) ] ; 501 } 502 493 503 # 494 504 # split-VMS: splits input native path into 495 505 # device dir file (each part is optional), -
tools/jam/src/build.jam
diff -N -r -u -b boost_1_34_0/tools/jam/src/build.jam boost_1_34_0_amiga/tools/jam/src/build.jam
old new 164 164 [ opt --debug : -s -O3 -fno-inline -pg ] 165 165 -I$(--python-include) 166 166 : -L$(--python-lib[1]) -l$(--python-lib[2]) ; 167 ## GCC 4.x on AmigaOS 168 toolset amiga gcc : "-mcrt=clib2 -o " : -D 169 : 170 [ opt --release : -O3 ] 171 [ opt --debug : -ggdb -O0 ] : 172 -lunix ; 167 173 ## Intel C/C++ for Linux 168 174 toolset intel-linux icc : "-o " : -D 169 175 : … … 402 408 { 403 409 jam.source += execmac.c filemac.c pathmac.c ; 404 410 } 411 else if $(AMIGA) 412 { 413 jam.source += execamiga.c fileamiga.c pathamiga.c ; 414 } 405 415 else 406 416 { 407 417 jam.source += execunix.c fileunix.c pathunix.c ; … … 455 465 if $(NT) { actions piecemeal together existing [DELETE] { 456 466 del /F /Q $(>) 457 467 } } 458 if $(UNIX) { actions piecemeal together existing [DELETE] {468 if $(UNIX) || $(AMIGA) { actions piecemeal together existing [DELETE] { 459 469 rm -f $(>) 460 470 } } 461 471 if $(VMS) { actions piecemeal together existing [DELETE] { … … 464 474 if $(NT) { 465 475 --chmod+w = "attrib -r " ; 466 476 } 467 if $(UNIX) {477 if $(UNIX) || $(AMIGA) { 468 478 --chmod+w = "chmod +w " ; 469 479 } 470 480 if $(VMS) { … … 480 490 if $(NT) { actions [MKDIR] { 481 491 md $(<) 482 492 } } 483 if $(UNIX) { actions [MKDIR] {493 if $(UNIX) || $(AMIGA) { actions [MKDIR] { 484 494 mkdir $(<) 485 495 } } 486 496 if $(VMS) { actions [MKDIR] { … … 526 536 return $(exe) ; 527 537 } 528 538 if ! $(--def[2]) { actions [COMPILE] { 529 "$(--cc)" $(--bin)$(<:D=) $(--dir)$(<:D) $(--out)$(<) $(--def)$(--defs) $(--flags) "$(--libs)" $(>)539 "$(--cc)" $(--bin)$(<:D=) $(--dir)$(<:D) $(--out)$(<) $(--def)$(--defs) $(--flags) $(>) "$(--libs)" 530 540 } } 531 541 else { actions [COMPILE] { 532 "$(--cc)" $(--bin)$(<:D=) $(--dir)$(<:D) $(--out)$(<) $(--def[1])$(--defs:J=$(--def[2]))$(--def[3]) $(--flags) "$(--libs)" $(>)542 "$(--cc)" $(--bin)$(<:D=) $(--dir)$(<:D) $(--out)$(<) $(--def[1])$(--defs:J=$(--def[2]))$(--def[3]) $(--flags) $(>) "$(--libs)" 533 543 } } 534 544 if $(VMS) { actions [COMPILE.LINK] { 535 545 "$(--link)" $(--link-bin)$(<:D=) $(--link-dir)$(<:D) $(--link-out)$(<) $(--link-def)$(--link-defs) $(--link-flags) "$(--link-libs)" $(>J=", ") … … 548 558 if $(NT) { actions [LINK] { 549 559 copy $(>) $(<) 550 560 } } 551 if $(UNIX) { actions [LINK] {561 if $(UNIX) || $(AMIGA) { actions [LINK] { 552 562 ln -fs $(>) $(<) 553 563 } } 554 564 if $(VMS) { actions [LINK] { … … 564 574 del /f $(<) 565 575 rename $(>) $(<) 566 576 } } 567 if $(UNIX) { actions [MOVE] {577 if $(UNIX) || $(AMIGA) { actions [MOVE] { 568 578 mv -f $(>) $(<) 569 579 } } 570 580 if $(VMS) { actions [MOVE] { … … 635 645 rename y.tab$(<[2]:S) $(<[2]) 636 646 ) else set _error_ = 637 647 } } 638 if $(UNIX) { actions [YACC] {648 if $(UNIX) || $(AMIGA) { actions [YACC] { 639 649 if ` "$(yacc)" $(>) ` ; then 640 650 mv -f y.tab$(<[1]:S) $(<[1]) 641 651 mv -f y.tab$(<[2]:S) $(<[2]) … … 782 792 copy /Y "$(>)" "$(<)" >NUL: 783 793 } 784 794 } 785 if $(UNIX) 795 if $(UNIX) || $(AMIGA) 786 796 { 787 797 actions [PACK] { 788 798 tar zcf "$(<)" "$(>)" … … 800 810 { 801 811 local zip = ; 802 812 if $(NT) { zip = $($(<).exe:S=.zip) ; } 803 if $(UNIX) { zip = $($(<).exe:S=.tgz) ; }813 if $(UNIX) || $(AMIGA) { zip = $($(<).exe:S=.tgz) ; } 804 814 zip = $(zip:S=)-$(VERSION)-$(RELEASE)-$(platform)$(zip:S) ; 805 815 DEPENDS $(zip) : $($(<).exe) ; 806 816 DEPENDS dist : $(zip) ; 807 817 #~ LOCATE on $(zip) = $(locate-target) ; 808 818 if $(NT) { [ZIP] $(zip) : $($(<).exe) ; } 809 if $(UNIX) { [PACK] $(zip) : $($(<).exe) ; }819 if $(UNIX) || $(AMIGA) { [PACK] $(zip) : $($(<).exe) ; } 810 820 .clean $(zip) ; 811 821 } 812 822 … … 828 838 829 839 local pack = ; 830 840 if $(NT) { pack = $(dst-dir).zip ; } 831 if $(UNIX) { pack = $(dst-dir).tgz ; }841 if $(UNIX) || $(AMIGA) { pack = $(dst-dir).tgz ; } 832 842 833 843 DEPENDS dist : $(pack) ; 834 844 DEPENDS $(pack) : $(dst-files) ; -
tools/jam/src/build.sh
diff -N -r -u -b boost_1_34_0/tools/jam/src/build.sh boost_1_34_0_amiga/tools/jam/src/build.sh
old new 29 29 echo "### ./build.sh gcc" 30 30 echo "###" 31 31 echo "### Toolsets supported by this script are:" 32 echo "### acc, como, darwin, gcc, intel-linux, kcc, kylix, mipspro,"33 echo "### mi ngw(msys), qcc, sunpro, tru64cxx, vacpp"32 echo "### acc, amiga, como, darwin, gcc, intel-linux, kcc, kylix," 33 echo "### mipspro, mingw(msys), qcc, sunpro, tru64cxx, vacpp" 34 34 echo "###" 35 35 echo "### A special toolset; cc, is available which is used as a fallback" 36 36 echo "### when a more specific toolset is not found and the cc command is" … … 64 64 if test -r /mingw/bin/gcc ; then 65 65 BOOST_JAM_TOOLSET=mingw 66 66 BOOST_JAM_TOOLSET_ROOT=/mingw/ 67 elif test_uname AmigaOS; then BOOST_JAM_TOOLSET=amiga 67 68 elif test_uname Darwin ; then BOOST_JAM_TOOLSET=darwin 68 69 elif test_uname IRIX ; then BOOST_JAM_TOOLSET=mipspro 69 70 elif test_uname IRIX64 ; then BOOST_JAM_TOOLSET=mipspro … … 134 135 BOOST_JAM_CC=cc 135 136 ;; 136 137 138 amiga) 139 BOOST_JAM_CC="gcc -mcrt=clib2" 140 BOOST_JAM_LIBS=-lunix 141 ;; 142 137 143 intel-linux) 138 144 if test -r /opt/intel/cc/9.0/bin/iccvars.sh ; then 139 145 BOOST_JAM_TOOLSET_ROOT=/opt/intel/cc/9.0/ … … 233 239 strings.c filesys.c builtins.c pwd.c class.c native.c w32_getreg.c\ 234 240 modules/set.c modules/path.c modules/regex.c modules/property-set.c\ 235 241 modules/sequence.c modules/order.c\ 236 execnt.c filent.c "242 execnt.c filent.c execamiga.c fileamiga.c pathamiga.c" 237 243 238 244 BJAM_UPDATE= 239 245 if test "$1" = "--update" -o "$2" = "--update" -o "$3" = "--update" -o "$4" = "--update" ; then … … 247 253 echo_run rm -rf bootstrap 248 254 echo_run mkdir bootstrap 249 255 if test ! -r jamgram.y -o ! -r jamgramtab.h ; then 250 echo_run ${BOOST_JAM_CC} ${BOOST_JAM_OPT_YYACC} ${YYACC_SOURCES} 256 echo_run ${BOOST_JAM_CC} ${BOOST_JAM_OPT_YYACC} ${YYACC_SOURCES} ${BOOST_JAM_LIBS} 251 257 if test -x "./bootstrap/yyacc0" ; then 252 258 echo_run ./bootstrap/yyacc0 jamgram.y jamgramtab.h jamgram.yy 253 259 fi … … 261 267 mv -f y.tab.h jamgram.h 262 268 fi 263 269 if test ! -r jambase.c ; then 264 echo_run ${BOOST_JAM_CC} ${BOOST_JAM_OPT_MKJAMBASE} ${MKJAMBASE_SOURCES} 270 echo_run ${BOOST_JAM_CC} ${BOOST_JAM_OPT_MKJAMBASE} ${MKJAMBASE_SOURCES} ${BOOST_JAM_LIBS} 265 271 if test -x "./bootstrap/mkjambase0" ; then 266 272 echo_run ./bootstrap/mkjambase0 jambase.c Jambase 267 273 fi 268 274 fi 269 echo_run ${BOOST_JAM_CC} ${BOOST_JAM_OPT_JAM} ${BJAM_SOURCES} 275 echo_run ${BOOST_JAM_CC} ${BOOST_JAM_OPT_JAM} ${BJAM_SOURCES} ${BOOST_JAM_LIBS} 270 276 fi 271 277 if test -x "./bootstrap/jam0" ; then 272 278 if test "${BJAM_UPDATE}" != "update" ; then -
tools/jam/src/execamiga.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/execamiga.c boost_1_34_0_amiga/tools/jam/src/execamiga.c
old new 1 /* 2 * This file is part of Jam - see jam.c for Copyright information. 3 */ 4 5 #include "jam.h" 6 7 #if defined(OS_AMIGA) 8 9 #include "lists.h" 10 #include "execcmd.h" 11 #include "patchlevel.h" 12 13 #include <string.h> 14 #include <stdlib.h> 15 16 #include <proto/exec.h> 17 #include <proto/dos.h> 18 19 #include <utility/hooks.h> 20 #include <dos/dos.h> 21 #include <dos/var.h> 22 23 #define MAX_ENV_SIZE 1024 /* maximum number of environ entries */ 24 25 26 /* clib2 specific controls */ 27 int __minimum_os_lib_version = 52; 28 char * __minimum_os_lib_error = "Requires AmigaOS 4.0"; 29 BOOL __open_locale = FALSE; 30 BOOL __disable_dos_requesters = TRUE; 31 32 33 static const char* version __attribute__((used)) = 34 "$VER: bjam "VERSION"-1 (2.6.2007)"; /* dd.mm.yyyy */ 35 36 37 /* 38 * execamiga.c - execute a shell script 39 * 40 * Uses the abc-shell to execute all commands synchronously. 41 */ 42 void execcmd 43 ( 44 char *string, 45 void (*func)(void *closure, int status, timing_info*), 46 void *closure, 47 LIST *shell 48 ) 49 { 50 timing_info time = {0, 0}; 51 52 static char tmpbuf[128]; 53 tmpbuf[0] = '\0'; 54 strlcpy(tmpbuf, "/t/bjamXXXXXX", sizeof(tmpbuf)); 55 56 int fd = mkstemp(tmpbuf); 57 if ( fd == -1 ) 58 { 59 printf("can't open command file\n"); 60 (*func)(closure, EXEC_CMD_FAIL, &time); 61 return; 62 } 63 64 int len = strlen(string); 65 if ( write(fd, string, len) != len ) 66 { 67 printf("can't write command file\n"); 68 (*func)(closure, EXEC_CMD_FAIL, &time); 69 unlink(tmpbuf); 70 close(fd); 71 return; 72 } 73 74 static char cmdbuf[128]; 75 cmdbuf[0] = '\0'; 76 snprintf(cmdbuf, sizeof(cmdbuf), "/sdk/c/sh %s", tmpbuf); 77 78 if ( DEBUG_EXECCMD ) 79 { 80 printf("string = '%s'\n", string); 81 printf("cmdbuf = '%s'\n", cmdbuf); 82 } 83 84 int status = system(cmdbuf); 85 86 unlink(tmpbuf); 87 close(fd); 88 89 if ( status == 0 ) 90 { 91 (*func)(closure, EXEC_CMD_OK, &time); 92 } 93 else 94 { 95 (*func)(closure, EXEC_CMD_FAIL, &time); 96 } 97 } 98 99 100 int execwait() 101 { 102 return 0; 103 } 104 105 106 /* 107 * environ - AmigaOS environment support 108 * 109 * The following code implements environ support for AmigaOS. 110 */ 111 void make_environ() __attribute__((constructor)); 112 void free_environ() __attribute__((destructor)); 113 114 char **environ = NULL; 115 116 117 int is_ascii_string(char* str) 118 { 119 while ( *str != '\0' ) 120 { 121 if ( !isascii(*str) ) 122 { 123 return 0; 124 } 125 126 ++str; 127 } 128 129 return 1; 130 } 131 132 133 uint32 copy_env(struct Hook *hook, APTR data, struct ScanVarsMsg *msg) 134 { 135 static uint32 env_size = 1; /* environ is null terminated */ 136 137 if ( env_size == MAX_ENV_SIZE ) 138 { 139 return 0; 140 } 141 142 if ( msg->sv_Name == 0 || 143 msg->sv_Var == 0 || 144 strlen(msg->sv_GDir) > 4 || /* excludes ENVARC: sub-directories */ 145 !is_ascii_string(msg->sv_Name) || 146 !is_ascii_string(msg->sv_Var) || 147 strstr(msg->sv_Name, ".prefs") != 0 || 148 strstr(msg->sv_Name, ".xml") != 0 || 149 strstr(msg->sv_Name, ".cfg") != 0 ) 150 151 { 152 return 0; 153 } 154 155 uint32 var_size = strlen(msg->sv_Name) + 1 + msg->sv_VarLen + 1; 156 char* var_buf = malloc(var_size); 157 if ( var_buf == 0 ) 158 { 159 return 0; 160 } 161 162 snprintf(var_buf, var_size, "%s=%s", msg->sv_Name, msg->sv_Var); 163 164 char **env = hook->h_Data; 165 env[env_size - 1] = var_buf; 166 ++env_size; 167 168 return 0; 169 } 170 171 172 void make_environ() 173 { 174 size_t environ_size = MAX_ENV_SIZE * sizeof(char*); 175 176 environ = (char**)malloc(environ_size); 177 if ( environ == 0 ) 178 { 179 return; 180 } 181 182 memset(environ, 0, environ_size); 183 184 struct Hook hook; 185 memset(&hook, 0, sizeof(struct Hook)); 186 hook.h_Entry = copy_env; 187 hook.h_Data = environ; 188 (void) IDOS->ScanVars(&hook, 0, 0); 189 } 190 191 192 void free_environ() 193 { 194 char **i; 195 for ( i = environ; *i != 0; ++i ) 196 { 197 free(*i); 198 } 199 200 free(environ); 201 } 202 203 204 #endif -
tools/jam/src/execnt.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/execnt.c boost_1_34_0_amiga/tools/jam/src/execnt.c
old new 40 40 * If $(JAMSHELL) is defined, uses that to formulate execvp()/spawnvp(). 41 41 * The default is: 42 42 * 43 * /bin/sh -c % [ on UNIX /AmigaOS]43 * /bin/sh -c % [ on UNIX ] 44 44 * cmd.exe /c % [ on Windows NT ] 45 45 * 46 46 * Each word must be an individual element in a jam variable value. -
tools/jam/src/execunix.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/execunix.c boost_1_34_0_amiga/tools/jam/src/execunix.c
old new 23 23 # endif 24 24 25 25 /* 26 * execunix.c - execute a shell script on UNIX/WinNT/OS2 /AmigaOS26 * execunix.c - execute a shell script on UNIX/WinNT/OS2 27 27 * 28 28 * If $(JAMSHELL) is defined, uses that to formulate execvp()/spawnvp(). 29 29 * The default is: 30 30 * 31 * /bin/sh -c % [ on UNIX /AmigaOS]31 * /bin/sh -c % [ on UNIX ] 32 32 * cmd.exe /c % [ on OS2/WinNT ] 33 33 * 34 34 * Each word must be an individual element in a jam variable value. -
tools/jam/src/fileamiga.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/fileamiga.c boost_1_34_0_amiga/tools/jam/src/fileamiga.c
old new 1 /* 2 * This file is part of Jam - see jam.c for Copyright information. 3 */ 4 5 #include "jam.h" 6 7 #if defined(OS_AMIGA) 8 9 #include "filesys.h" 10 #include "strings.h" 11 #include "pathsys.h" 12 13 #include <stdio.h> 14 #include <dirent.h> 15 #include <sys/types.h> 16 #include <sys/stat.h> 17 18 /* 19 * fileamiga.c - manipulate file names and scan directories on AmigaOS 20 * 21 * External routines: 22 * 23 * file_dirscan() - scan a directory for files 24 * file_time() - get timestamp of file, if not done by file_dirscan() 25 * file_archscan() - scan an archive for files 26 * 27 * File_dirscan() and file_archscan() call back a caller provided function 28 * for each file found. A flag to this callback function lets file_dirscan() 29 * and file_archscan() indicate that a timestamp is being provided with the 30 * file. If file_dirscan() or file_archscan() do not provide the file's 31 * timestamp, interested parties may later call file_time(). 32 */ 33 34 /* 35 * file_dirscan() - scan a directory for files 36 */ 37 void file_dirscan(char *dir, scanback func, void *closure) 38 { 39 PATHNAME f; 40 DIR *d; 41 struct dirent *dirent; 42 string filename[1]; 43 44 /* First enter directory itself */ 45 memset((char*)&f, '\0', sizeof(f)); 46 f.f_dir.ptr = dir; 47 f.f_dir.len = strlen(dir); 48 49 dir = *dir ? dir : "."; 50 51 /* Special case / : enter it */ 52 if ( f.f_dir.len == 1 && f.f_dir.ptr[0] == '/' ) 53 { 54 (*func)(closure, dir, 0 /* not stat()'ed */, (time_t)0); 55 } 56 57 /* Now enter contents of directory */ 58 if ( !(d = opendir(dir)) ) 59 { 60 return; 61 } 62 63 if ( DEBUG_BINDSCAN ) 64 { 65 printf("scan directory %s\n", dir); 66 } 67 68 string_new(filename); 69 70 while ( dirent = readdir(d) ) 71 { 72 f.f_base.ptr = dirent->d_name; 73 f.f_base.len = strlen(f.f_base.ptr); 74 75 string_truncate(filename, 0); 76 path_build(&f, filename, 0); 77 78 (*func)(closure, filename->value, 0 /* not stat()'ed */, (time_t)0); 79 } 80 81 string_free(filename); 82 83 closedir(d); 84 } 85 86 87 /* 88 * file_time() - get timestamp of file, if not done by file_dirscan() 89 */ 90 int file_time(char *filename, time_t *time) 91 { 92 struct stat statbuf; 93 94 if ( stat(filename, &statbuf) < 0 ) 95 { 96 return -1; 97 } 98 99 *time = statbuf.st_mtime; 100 101 return 0; 102 } 103 104 105 int file_is_file(char* filename) 106 { 107 struct stat statbuf; 108 109 if( stat( filename, &statbuf ) < 0 ) 110 { 111 return -1; 112 } 113 114 if (S_ISREG(statbuf.st_mode)) 115 { 116 return 1; 117 } 118 else 119 { 120 return 0; 121 } 122 } 123 124 125 /* 126 * file_archscan() - scan an archive for files 127 */ 128 void file_archscan(char *archive, scanback func, void *closure ) 129 { 130 } 131 132 #endif -
tools/jam/src/fileunix.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/fileunix.c boost_1_34_0_amiga/tools/jam/src/fileunix.c
old new 99 99 # endif 100 100 101 101 /* 102 * fileunix.c - manipulate file names and scan directories on UNIX /AmigaOS102 * fileunix.c - manipulate file names and scan directories on UNIX 103 103 * 104 104 * External routines: 105 105 * -
tools/jam/src/jam.h
diff -N -r -u -b boost_1_34_0/tools/jam/src/jam.h boost_1_34_0_amiga/tools/jam/src/jam.h
old new 205 205 # endif 206 206 207 207 /* 208 * AmigaOS SDK 209 */ 210 # if defined(__amigaos__) 211 212 # include <stdlib.h> 213 # include <stdio.h> 214 # include <string.h> 215 # include <time.h> 216 217 # define OSMAJOR "AMIGA=true" 218 # define OSMINOR "OS=AMIGA" 219 # define OS_AMIGA 220 # define PATH_DELIM '/' 221 222 # endif 223 224 /* 208 225 * God fearing UNIX 209 226 */ 210 227 … … 222 239 # define OS_AIX 223 240 # define NO_VFORK 224 241 # endif 225 # ifdef AMIGA226 # define OSMINOR "OS=AMIGA"227 # define OS_AMIGA228 # endif229 242 # ifdef __BEOS__ 230 243 # define unix 231 244 # define OSMINOR "OS=BEOS" -
tools/jam/src/Jambase
diff -N -r -u -b boost_1_34_0/tools/jam/src/Jambase boost_1_34_0_amiga/tools/jam/src/Jambase
old new 854 854 NOARSCAN ?= true ; 855 855 STDHDRS ?= /boot/develop/headers/posix ; 856 856 } 857 else if $(OS) = AMIGA 858 { 859 BINDIR ?= /sdk/local/c ; 860 C++ ?= g++ ; 861 C++FLAGS ?= -mcrt=clib2 ; 862 CC ?= gcc ; 863 CCFLAGS ?= -mcrt=clib2 ; 864 EXEMODE ?= ; 865 FILEMODE ?= ; 866 LIBDIR ?= /sdk/local/clib2/lib ; 867 LINKLIBS ?= -lunix ; 868 NOARSCAN ?= true ; 869 YACC ?= yacc ; 870 YACCFILES ?= y.tab ; 871 YACCFLAGS ?= -d ; 872 } 857 873 else if $(UNIX) 858 874 { 859 875 switch $(OS) … … 861 877 case AIX : 862 878 LINKLIBS ?= -lbsd ; 863 879 864 case AMIGA :865 CC ?= gcc ;866 YACC ?= "bison -y" ;867 868 880 case CYGWIN : 869 881 CC ?= gcc ; 870 882 CCFLAGS += -D__cygwin__ ; … … 2433 2445 } 2434 2446 2435 2447 # 2448 # AmigaOS specific actions 2449 # 2450 2451 else if $(AMIGA) 2452 { 2453 actions Link bind NEEDLIBS 2454 { 2455 $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) -lunix 2456 } 2457 } 2458 2459 # 2436 2460 # Backwards compatibility with jam 1, where rules were uppercased. 2437 2461 # 2438 2462 -
tools/jam/src/jambase.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/jambase.c boost_1_34_0_amiga/tools/jam/src/jambase.c
old new 555 555 "NOARSCAN ?= true ;\n", 556 556 "STDHDRS ?= /boot/develop/headers/posix ;\n", 557 557 "}\n", 558 "else if $(OS) = AMIGA\n", 559 "{\n", 560 "BINDIR ?= /sdk/local/c ;\n", 561 "C++ ?= g++ ;\n", 562 "C++FLAGS ?= -mcrt=clib2 ;\n", 563 "CC ?= gcc ;\n", 564 "CCFLAGS ?= -mcrt=clib2 ;\n", 565 "EXEMODE ?= ;\n", 566 "FILEMODE ?= ;\n", 567 "LIBDIR ?= /sdk/local/clib2/lib ;\n", 568 "LINKLIBS ?= -lunix ;\n", 569 "NOARSCAN ?= true ;\n", 570 "YACC ?= yacc ;\n", 571 "YACCFILES ?= y.tab ;\n", 572 "YACCFLAGS ?= -d ;\n", 573 "}\n", 558 574 "else if $(UNIX)\n", 559 575 "{\n", 560 576 "switch $(OS)\n", 561 577 "{\n", 562 578 "case AIX :\n", 563 579 "LINKLIBS ?= -lbsd ;\n", 564 "case AMIGA :\n",565 "CC ?= gcc ;\n",566 "YACC ?= \"bison -y\" ;\n",567 580 "case CYGWIN : \n", 568 581 "CC ?= gcc ;\n", 569 582 "CCFLAGS += -D__cygwin__ ;\n", … … 1660 1673 "$(LINK) -o $(<) $(LINKFLAGS) $(>) $(NEEDLIBS) \"$(LINKLIBS)\"\n", 1661 1674 "}\n", 1662 1675 "}\n", 1676 "else if $(AMIGA)\n", 1677 "{\n", 1678 "actions Link bind NEEDLIBS\n", 1679 "{\n", 1680 "$(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) -lunix\n", 1681 "}\n", 1682 "}\n", 1663 1683 "rule BULK { Bulk $(<) : $(>) ; }\n", 1664 1684 "rule FILE { File $(<) : $(>) ; }\n", 1665 1685 "rule HDRRULE { HdrRule $(<) : $(>) ; }\n", -
tools/jam/src/pathamiga.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/pathamiga.c boost_1_34_0_amiga/tools/jam/src/pathamiga.c
old new 1 /* 2 * This file is part of Jam - see jam.c for Copyright information. 3 */ 4 5 #include "jam.h" 6 7 #if defined(OS_AMIGA) 8 9 #include "pathsys.h" 10 #include "strings.h" 11 #include "newstr.h" 12 #include "filesys.h" 13 14 #include <dos/dosextens.h> 15 #include <proto/exec.h> 16 17 18 /* 19 * pathamiga.c - manipulate file names on AmigaOS 20 * 21 * External routines: 22 * 23 * path_parse() - split a file name into dir/base/suffix/member 24 * path_build() - build a filename given dir/base/suffix/member 25 * path_parent() - make a PATHNAME point to its parent dir 26 * 27 * file_parse() and path_build() just manipuate a string and a structure; 28 * they do not make system calls. 29 */ 30 31 32 /* 33 * path_parse() - split a file name into dir/base/suffix/member 34 */ 35 void path_parse(char *file, PATHNAME *f) 36 { 37 char *p, *q; 38 char *end; 39 40 memset( (char *)f, 0, sizeof( *f ) ); 41 42 /* Look for <grist> */ 43 if( file[0] == '<' && ( p = strchr( file, '>' ) ) ) 44 { 45 f->f_grist.ptr = file; 46 f->f_grist.len = p - file; 47 file = p + 1; 48 } 49 50 /* Look for dir/ */ 51 p = strrchr( file, '/' ); 52 53 if( p ) 54 { 55 f->f_dir.ptr = file; 56 f->f_dir.len = p - file; 57 58 /* Special case for / - dirname is /, not "" */ 59 if( !f->f_dir.len ) 60 f->f_dir.len = 1; 61 62 file = p + 1; 63 } 64 65 end = file + strlen( file ); 66 67 /* Look for (member) */ 68 if( ( p = strchr( file, '(' ) ) && end[-1] == ')' ) 69 { 70 f->f_member.ptr = p + 1; 71 f->f_member.len = end - p - 2; 72 end = p; 73 } 74 75 /* Look for .suffix */ 76 /* This would be memrchr() */ 77 p = 0; 78 q = file; 79 80 while( q = (char *)memchr( q, '.', end - q ) ) 81 p = q++; 82 83 if( p ) 84 { 85 f->f_suffix.ptr = p; 86 f->f_suffix.len = end - p; 87 end = p; 88 } 89 90 /* Leaves base */ 91 f->f_base.ptr = file; 92 f->f_base.len = end - file; 93 } 94 95 96 /* 97 * is_path_delim() - true iff c is a path delimiter 98 */ 99 static int is_path_delim(char c) 100 { 101 return c == PATH_DELIM; 102 } 103 104 105 /* 106 * as_path_delim() - convert c to a path delimiter if it isn't one 107 * already 108 */ 109 static char as_path_delim( char c ) 110 { 111 return is_path_delim(c) ? c : PATH_DELIM; 112 } 113 114 115 /* 116 * path_build() - build a filename given dir/base/suffix/member 117 */ 118 void path_build(PATHNAME *f, string *file, int binding) 119 { 120 file_build1( f, file ); 121 122 /* Don't prepend root if it's . or directory is rooted */ 123 if( f->f_root.len 124 && !( f->f_root.len == 1 && f->f_root.ptr[0] == '.' ) 125 && !( f->f_dir.len && f->f_dir.ptr[0] == '/' ) ) 126 { 127 string_append_range( file, f->f_root.ptr, f->f_root.ptr + f->f_root.len ); 128 /* If 'root' already ends with path delimeter, don't add yet another one. */ 129 if( ! is_path_delim( f->f_root.ptr[f->f_root.len-1] ) ) 130 string_push_back( file, as_path_delim( f->f_root.ptr[f->f_root.len] ) ); 131 } 132 133 if( f->f_dir.len ) 134 { 135 string_append_range( file, f->f_dir.ptr, f->f_dir.ptr + f->f_dir.len ); 136 } 137 138 /* Put / between dir and file */ 139 if( f->f_dir.len && ( f->f_base.len || f->f_suffix.len ) ) 140 { 141 /* Special case for dir / : don't add another / */ 142 if( !( f->f_dir.len == 1 && is_path_delim( f->f_dir.ptr[0] ) ) ) 143 string_push_back( file, as_path_delim( f->f_dir.ptr[f->f_dir.len] ) ); 144 } 145 146 if( f->f_base.len ) 147 { 148 string_append_range( file, f->f_base.ptr, f->f_base.ptr + f->f_base.len ); 149 } 150 151 if( f->f_suffix.len ) 152 { 153 string_append_range( file, f->f_suffix.ptr, f->f_suffix.ptr + f->f_suffix.len ); 154 } 155 156 if( f->f_member.len ) 157 { 158 string_push_back( file, '(' ); 159 string_append_range( file, f->f_member.ptr, f->f_member.ptr + f->f_member.len ); 160 string_push_back( file, ')' ); 161 } 162 } 163 164 165 /* 166 * path_parent() - make a PATHNAME point to its parent dir 167 */ 168 void path_parent(PATHNAME *f) 169 { 170 f->f_base.ptr = ""; 171 f->f_suffix.ptr = ""; 172 f->f_member.ptr = ""; 173 174 f->f_base.len = 0; 175 f->f_suffix.len = 0; 176 f->f_member.len = 0; 177 } 178 179 180 const char * path_tmpdir() 181 { 182 return "\t"; 183 } 184 185 186 const char * path_tmpnam(void) 187 { 188 static char tmpbuf[64]; 189 uint32 pid = ((struct Process*)IExec->FindTask(0))->pr_ProcessID; 190 snprintf(tmpbuf, sizeof(tmpbuf), "jam.%u.XXXXXX", pid); 191 (void) mktemp(tmpbuf); 192 193 return newstr(tmpbuf); 194 } 195 196 197 const char * path_tmpfile(void) 198 { 199 const char * result = 0; 200 201 static char pathbuf[4096]; 202 snprintf(pathbuf, sizeof(pathbuf), "%s%c%s", 203 path_tmpdir(), PATH_DELIM, path_tmpnam()); 204 205 return newstr(pathbuf); 206 } 207 208 #endif -
tools/jam/src/pathunix.c
diff -N -r -u -b boost_1_34_0/tools/jam/src/pathunix.c boost_1_34_0_amiga/tools/jam/src/pathunix.c
old new 25 25 # ifdef USE_PATHUNIX 26 26 27 27 /* 28 * pathunix.c - manipulate file names on UNIX, NT, OS2 , AmigaOS28 * pathunix.c - manipulate file names on UNIX, NT, OS2 29 29 * 30 30 * External routines: 31 31 * … … 458 458 } 459 459 460 460 461 # endif /* unix, NT, OS/2 , AmigaOS*/461 # endif /* unix, NT, OS/2 */