X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=VdZ0zTL0Pwu2bcuE0cd7bSaLAGWXoxhFr1u/j4FSHzM=; b=XAyi+kxD9OuVBed9mlOzCznYk3lpCP1OMTmxT/SM4UBx0IcD4OKIQ3vGICDVWbWHLv pGGwVIhPNPlD79tQZcKVV0Yd0E84CWPclpOjeLfbz8xXNLnOcS/I7nJ7z6MJyI+dzJUr JsG2rBcqUFRILzL8d2PyWF9ekKpN7gllV6vgU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=TFa+LRp6eQ51ZLBT6T10HYK4vjiDvPvM2uSpbIQGLI5KNGBRKJfHIwrPm2RHlHtzr0 uborfQuSV6Ouok1fdArCub3ffSTBsNGzm9rApe45Lx2P7wWmusvgu+NbtM5rDFwK87RN 0+J7VnLLlET1K8QmglNm2GfTV+P2JCl/Shabg= MIME-Version: 1.0 Date: Wed, 26 Aug 2009 19:22:04 -0500 Message-ID: <93c172b50908261722r1c3e8767x4843a3285737dae0@mail.gmail.com> Subject: dash (Debian Ash), compiles but won't work ... yet ("Cannot fork") From: Rugxulo To: djgpp-workers AT delorie DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hey guys, Okay, I know this complex and maybe unnecessary since we have Bash, but just humor me. I don't actually expect any of you to actually mess with this, but I felt strongly that I should at least weakly attempt to compile Dash and see how close we can get with it. Call it morbid curiosity, boredom, whatever. And I don't know nearly enough, so please pardon / ignore any obvious errors (although comments welcome). Basically, with a few hacks it does compile but won't work. Same obvious issues apply (no fork support, PATH needs conversion, etc). It shouldn't be THAT hard to get this working. And it is much simpler and smaller code than Bash and would be a nice alternative (to avoid Bash bugs, perhaps). Anyways, you may hate my style (I'm not too fond of it), but here goes my lame .BAT / sed script. Have fun! ;-) ========================= @echo off REM Attempting to build DASH 0.5.5.1 (Debian Ash) w/ DJGPP 2.04 on Vista REM silly .BAT written by rugxulo _AT_ gmail _DOT_ com REM REM http://gondor.apana.org.au/~herbert/dash/ REM dash-0.5.5.1.tar.gz 14-Jan-2009 10:38 203K REM http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.5.1.tar.gz REM REM ---------------------------------------------------------------------- REM Known Problems: REM * $PATH incorrectly set REM = manually "export PATH=/dev/env/DJDIR/bin:/dev/c/Armslurp/utils" etc. REM * needs extension: "ls.exe" instead of just "ls" REM * doesn't work at all !! "Cannot fork" (not supported by DOS or DJGPP) REM = must change execve to something else (spawnve, djgpp_spawn, ???) REM REM TODO: Look at PDKSH 0.5.14 (OS/2 portion) and DJGPP's Bash 2.05 :: = http://gd.tuwien.ac.at/pc/dos/djgpp/beta/v2gnu/?fisel=bB :: = http://www.cs.mun.ca/~michael/pdksh/ REM ---------------------------------------------------------------------- sh -c "./configure --disable-dependency-tracking CFLAGS='-g -O' -C" sed -i -e "\,HAVE_GETRLIMIT 1,s,^,//," config.h echo #define JOBS 0 >> config.h echo #define _PATH_BSHELL "/bin/sh" >> config.h echo #define _PATH_DEVNULL "/dev/null" >> config.h sed -i -e "s,/tmp,/dev/env/DJDIR/tmp,g" src/mk* for %%a in (exec jobs var histedit) do sed -i -e "\,#include *.paths\.h.,s,^,//," src/%%a.c sed -i -e "\,EWOULDBLOCK,s,\&\&,){//," src/input.c sed -i -e "\,signo == SIGTSTP,{s,,0)){//,;n;s,^,//,;}" src/trap.c sed -i -e "\,FILS[OT]CK,s,^,//," -e "\,S_ISSOCK,s,^,//," -e "\,S_ISVTX,s,^,//," src/bltin/test.c sed -i -e "\,WCOREDUMP(status),s,,0," -e "\,wait3,s,^,errno=ECHILD; return -1; //," src/jobs.c sed -i -e "\,SIGCHLD,s,^,//," src/trap.c make if exist src\dash.exe dir src\dash.exe :: upx --best --lzma --all-filters src/dash.exe REM EOF