Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Try to make cabal do the Right Thing

Ignore-this: 6a0e4d27cb3d25da3fc01d46583b2c35

darcs-hash:20091217121614-6ac22-d88c07ac0e236d7e15e9e0210eb49fc283d2d95b.gz
  • Loading branch information...
commit b6f21192202b4118c26d9619b12edfa258537227 1 parent 6dabafe
eb authored
4 Makefile
View
@@ -16,8 +16,8 @@ rts:
$(MAKE) -C evm
install: .PHONY
- $(MAKE) -C evm install PREFIX=$(PREFIX)
- $(MAKE) -C lib install PREFIX=$(PREFIX)
+ #$(MAKE) -C evm install PREFIX=$(PREFIX)
+ #$(MAKE) -C lib install PREFIX=$(PREFIX)
cabal install $(DB)
unregister:
12 Setup.hs
View
@@ -1,4 +1,6 @@
import Distribution.Simple
+import Distribution.Simple.InstallDirs
+import Distribution.Simple.LocalBuildInfo
import Distribution.PackageDescription
import System
@@ -21,6 +23,14 @@ postConfLib args flags desc local
= do exit <- system "make -C evm clean"
return ()
+addPrefix pfx var c = "export " ++ var ++ "=" ++ show pfx ++ "/" ++ c ++ ":$" ++ var
+
+postInstLib args flags desc local
+ = do let pfx = prefix (installDirTemplates local)
+ exit <- system $ "make -C evm install PREFIX=" ++ show pfx
+ return ()
+
main = defaultMainWithHooks (simpleUserHooks { postBuild = buildLib,
- postConf = postConfLib})
+ postConf = postConfLib,
+ postInst = postInstLib })
28 epic.cabal
View
@@ -14,14 +14,24 @@ Description: Epic is a simple functional language which compiles to
the Idris dependently typed programming language. It is invoked
as a library, as it is intended as a compiler back end.
-Build-depends: base, haskell98, mtl, Cabal, array, directory
-Build-type: Simple
-
-Extensions: MultiParamTypeClasses, FunctionalDependencies,
- ExistentialQuantification, OverlappingInstances
-Exposed-modules: Epic.Compiler
-Other-modules: Epic.Bytecode Epic.Parser Epic.Scopecheck
- Epic.Language Epic.Lexer Epic.CodegenC
- Epic.OTTLang Epic.Simplify Paths_epic
Data-files: evm/libevm.a evm/closure.h evm/stdfuns.h evm/stdfuns.c evm/mainprog.c
Extra-source-files: evm/closure.c evm/closure.h evm/stdfuns.h evm/mainprog.c evm/stdfuns.c evm/Makefile
+
+Cabal-Version: >= 1.2.3
+Build-type: Custom
+
+Library
+ Exposed-modules: Epic.Compiler
+ Other-modules: Epic.Bytecode Epic.Parser Epic.Scopecheck
+ Epic.Language Epic.Lexer Epic.CodegenC
+ Epic.OTTLang Epic.Simplify Paths_epic
+ Build-depends: base, haskell98, mtl, Cabal, array, directory
+
+
+Executable epic
+ Main-is: Main.lhs
+ Other-modules: Epic.Bytecode Epic.Parser Epic.Scopecheck
+ Epic.Language Epic.Lexer Epic.CodegenC
+ Epic.OTTLang Epic.Simplify Paths_epic
+ Build-depends: base, haskell98, mtl, Cabal, array, directory
+
4 evm/Makefile
View
@@ -1,6 +1,6 @@
CC = gcc
-#CFLAGS = -Wall -g
-CFLAGS = -Wall -O3
+CFLAGS = -Wall -g
+#CFLAGS = -Wall -O3
OBJS = closure.o stdfuns.o
INSTALLDIR = ${PREFIX}/lib/evm
16 evm/stdfuns.c
View
@@ -288,7 +288,7 @@ void* doWithin(int limit, void* proc, void* doOnFail)
struct timeval tv;
gettimeofday(&tv, NULL);
- int tnow, tthen = 1000000*(tv.tv_sec & 0xff)+tv.tv_usec;
+ int tnow, tthen = do_utime();
pthread_create(t, NULL, runThread, &th);
// printf("tthen %d\n", tthen);
@@ -303,14 +303,24 @@ void* doWithin(int limit, void* proc, void* doOnFail)
return ans;
}
gettimeofday(&tv, NULL);
- tnow = 1000000*(tv.tv_sec & 0xff)+tv.tv_usec;
+ tnow = do_utime();
+ usleep(100);
// printf("tnow %d\n", tnow);
}
- while(tnow<(tthen+limit));
+ while(tnow<(tthen+(limit*1000)));
pthread_cancel(*t);
return DO_EVAL(doOnFail,1);
}
+int do_utime() {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ static int start=0;
+ if (start==0) { start = tv.tv_sec; }
+
+ return 1000000*(tv.tv_sec - start)+tv.tv_usec;
+}
// Basic file handling
2  evm/stdfuns.h
View
@@ -48,6 +48,8 @@ void doUnlock(int lock);
void doFork(void* proc);
void* doWithin(int limit, void* proc, void* doOnFail);
+int do_utime() ;
+
int strToInt(char* str);
char* intToStr(int x);
Please sign in to comment.
Something went wrong with that request. Please try again.