From: sewardj Date: Mon, 10 Apr 2000 15:39:09 +0000 (+0000) Subject: [project @ 2000-04-10 15:39:09 by sewardj] X-Git-Tag: Approximately_9120_patches~4754 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0826d0137d24268cdfb3375eb1ddc3f7035b7a41;p=ghc-hetmet.git [project @ 2000-04-10 15:39:09 by sewardj] Load the compiled Prelude directly from its build location, ghc/lib/std. --- diff --git a/ghc/interpreter/hugs.c b/ghc/interpreter/hugs.c index c1120b1..0d8df99 100644 --- a/ghc/interpreter/hugs.c +++ b/ghc/interpreter/hugs.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: hugs.c,v $ - * $Revision: 1.65 $ - * $Date: 2000/04/10 14:28:14 $ + * $Revision: 1.66 $ + * $Date: 2000/04/10 15:39:09 $ * ------------------------------------------------------------------------*/ #include @@ -80,6 +80,8 @@ static Void local failed ( Void ); static String local strCopy ( String ); static Void local browseit ( Module,String,Bool ); static Void local browse ( Void ); +static void local clearCurrentFile ( void ); + /* -------------------------------------------------------------------------- * Machine dependent code for Hugs interpreter: @@ -312,8 +314,9 @@ Bool state; { *toggle[i].flag = state; return; } + clearCurrentFile(); ERRMSG(0) "Unknown toggle `%c'", c - EEND; + EEND_NO_LONGJMP; } static Void local togglesIn(state) /* Print current list of toggles in*/ @@ -666,7 +669,7 @@ static Void local changeDir() { /* change directory */ String s = readFilename(); if (s && chdir(s)) { ERRMSG(0) "Unable to change to directory \"%s\"", s - EEND; + EEND_NO_LONGJMP; } } @@ -1727,6 +1730,7 @@ static Void local evaluator() { /* evaluate expr and print value */ bd = type; if (whatIs(bd)==QUAL) { + clearCurrentFile(); ERRMSG(0) "Unresolved overloading" ETHEN ERRTEXT "\n*** Type : " ETHEN ERRTYPE(type); ERRTEXT "\n*** Expression : " ETHEN ERREXPR(inputExpr); @@ -1743,6 +1747,7 @@ static Void local evaluator() { /* evaluate expr and print value */ } else { Cell d = provePred(ks,NIL,ap(classShow,bd)); if (isNull(d)) { + clearCurrentFile(); ERRMSG(0) "Cannot find \"show\" function for:" ETHEN ERRTEXT "\n*** expression : " ETHEN ERREXPR(inputExpr); ERRTEXT "\n*** of type : " ETHEN ERRTYPE(type); @@ -2266,6 +2271,7 @@ static Void local listNames() { /* list names matching optional pat*/ names = addNamesMatching((String)0,names); } if (isNull(names)) { /* Then print them out */ + clearCurrentFile(); ERRMSG(0) "No names selected" EEND_NO_LONGJMP; return; @@ -2329,7 +2335,6 @@ String argv[]; { modConIds = initialize(argc,argv); /* the initial modules to load */ setBreakAction ( HugsIgnoreBreak ); prelOK = loadThePrelude(); - if (combined) everybody(POSTPREL); if (!prelOK) { if (autoMain) @@ -2339,6 +2344,7 @@ String argv[]; { exit(1); } + if (combined) everybody(POSTPREL); loadActions(modConIds); if (autoMain) { diff --git a/ghc/interpreter/machdep.c b/ghc/interpreter/machdep.c index c8db399..c24076e 100644 --- a/ghc/interpreter/machdep.c +++ b/ghc/interpreter/machdep.c @@ -13,8 +13,8 @@ * included in the distribution. * * $RCSfile: machdep.c,v $ - * $Revision: 1.28 $ - * $Date: 2000/04/10 09:40:03 $ + * $Revision: 1.29 $ + * $Date: 2000/04/10 15:39:09 $ * ------------------------------------------------------------------------*/ #ifdef HAVE_SIGNAL_H @@ -208,6 +208,7 @@ static Bool local tryEndings ( String ); #if (DOS_FILENAMES || __CYGWIN32__) # define SLASH '\\' +# define SLASH_STR "\\" # define isSLASH(c) ((c)=='\\' || (c)=='/') # define PATHSEP ';' # define PATHSEP_STR ";" @@ -221,6 +222,7 @@ static Bool local tryEndings ( String ); # define DLL_ENDING ".pef" #else # define SLASH '/' +# define SLASH_STR "/" # define isSLASH(c) ((c)==SLASH) # define PATHSEP ':' # define PATHSEP_STR ":" @@ -612,7 +614,7 @@ Bool findFilesForModule ( Int nPath; Bool literate; String peStart, peEnd; - String augdPath; /* .:hugsPath:installDir/GhcPrel:installDir/lib */ + String augdPath; /* .:hugsPath:installDir/../lib/std:installDir/lib */ Time oTime, iTime; Bool oAvail, iAvail; @@ -621,7 +623,7 @@ Bool findFilesForModule ( *sSize = *oSize = *iSize = 0; augdPath = malloc( 2*(10+3+strlen(installDir)) - +strlen(hugsPath) +10/*paranoia*/); + +strlen(hugsPath) +50/*paranoia*/); if (!augdPath) internal("moduleNameToFileNames: malloc failed(2)"); @@ -634,7 +636,11 @@ Bool findFilesForModule ( if (combined) { strcat(augdPath, installDir); - strcat(augdPath, "GhcPrel"); + strcat(augdPath, ".."); + strcat(augdPath, SLASH_STR); + strcat(augdPath, "lib"); + strcat(augdPath, SLASH_STR); + strcat(augdPath, "std"); strcat(augdPath, PATHSEP_STR); } @@ -642,7 +648,7 @@ Bool findFilesForModule ( strcat(augdPath, "lib"); strcat(augdPath, PATHSEP_STR); - /* fprintf ( stderr, "augdpath = `%s'\n", augdPath ); */ + /* fprintf ( stderr, "augdpath = `%s'\n", augdPath ); */ peEnd = augdPath-1; while (1) {