Re: [Seed7-users] Seed7 2012-11-04 (minor build error with DJGPP)
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Rugxulo <ru...@gm...> - 2012-11-17 02:48:05
|
Hi, On Fri, Nov 16, 2012 at 7:09 AM, Thomas Mertes <tho...@gm...> wrote: > On Thu, 15 Nov 2012 18:42:01 -0600, Rugxulo <ru...@gm...> wrote: >> >> Periodically, I retest your Seed7 with DJGPP, esp. when I remember >> it's been a few weeks since last time. > > You can subscribe to seed7-users here: > https://lists.sourceforge.net/lists/listinfo/seed7-users Done. :-) > I don't do announcements there either (maybe I should), but it is good > place for Seed7 related questions. It would be nice if you would send > future reports to seed7-users@lists.... This would also > inform others about your findings. Yes, of course, though I'm afraid DJGPP isn't the most popular thing in the world (anymore). >> Anyways, retesting latest download seems to "almost" build and work, >> not counting a few "make depend" errors that it apparently ignores >> (good idea?). > > The program chkccomp.c calls the C compiler several times to probe the > properties of the C compiler and the C run-time library. Normally the > errors generated by compilation attempts are redirected to a file. I knew it was being run but didn't know if it was safe to ignore some errors. Obviously most makefiles know whether to quit or keep going, but sometimes they don't work well when not tested in non-POSIX environments. > IIRC with DJGPP there were some problems with the redirection > of C compiler errors. I don't remember the details, but > REDIRECT_C_ERRORS is not defined in mk_djgpp.mak and this results > in the error messages you saw. I don't remember either. I know we briefly discussed it months ago. IIRC, gcc reports errors to stderr, and DOS' %COMSPEC% doesn't (usually) handle stderr redirection. So DJGPP comes with REDIR.EXE for that case, e.g. "redir -eo gcc ... > blah.txt". > BTW: The "make depend" errors caused by executing chkccomp.exe can be > safely ignored. Maybe I should add > echo "The following C compiler errors can be safely ignored" > to mk_djgpp.mak just before chkccomp.exe is called. Yes, probably. It's just that after certain errors you wonder if it will work at all. Sometimes yes, sometimes no. It's been fine for months, so this is the first (very minor) snafu I've seen. >> Once I do this minor change, then it builds and "hi chk_all" is >> (almost) the same as before (not counting a slight output sequence >> rearrangement about negative zero). >> >> Long story short, it won't actually finish compiling unless I add this >> to version.h : >> >> #define HOME_DIR_ENV_VAR "HOME" /* just a guess but seems to work okay >> */ > > The definition of HOME_DIR_ENV_VAR is generated by chkccomp.c . A missing > definition of HOME_DIR_ENV_VAR in version.h would mean that your > computer does neither define HOME nor USERPROFILE. Can you confirm that > the environment variables HOME and USERPROFILE are not defined on your > computer? That sounds like XP stuff. I don't have XP (anymore), so I can't test there. I can test under raw FreeDOS or DOSEMU or VirtualBox. Usually I just use DOSEMU, for silly reasons. DJGPP doesn't define $HOME nor $USERPROFILE by default. The always-loaded DJGPP.ENV file does have $USER, but I forget when that is loaded and when not. IIRC, I manually edited it to put HOME= under [sh] and [bash] so it wouldn't log Bash's _bhist in the root dir (C:\) accidentally. Though obviously I hate Bash and would prefer to avoid it if at all possible (as we are doing successfully so far). It's a pain, though it "mostly" (?) works, despite being old with a few rare bugs. If you think $HOME and/or $USERPROFILE should be set, I don't know what to tell you. DOS doesn't usually set $HOME because argv[0] can include full path (since DOS 3.x). So usually config files are lumped in the same subdir with their binaries. If really desperate, without a better alternative, I'd probably suggest making and using /dev/env/DJDIR/share/seed7 (since DJGPP must be installed just to build Seed7). There is some other weird stuff in the runtime re: env. vars, but it's not totally useful here, and I'd have to double-check it closer to remember what it does. (Good idea but not totally implemented about falling back to a default user-defined dirpath if env. var. isn't defined.) > In this case I would like to know what directory should be used as > home directory. I'm not sure what specifically would be ideal, honestly, but we can figure something out. > BTW: If HOME is not defined the function homeDir will raise the exception > FILE_ERROR. I don't know which Seed7 tools/examples rely on this, but it would be good to fix. > Many thanks in advance for your effort. More thanks to your efforts for supporting DJGPP. My only regret is not being able to help more. |