Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More build fun!

--HG--
extra : convert_revision : 53fc370096c378730fa3aa70ae9d957bb882bcae
  • Loading branch information...
commit 6348ae011c5c2417b4d34ac018c2a9dcdaffe6a2 1 parent a95a094
@bos authored
View
5 LLVM.hs
@@ -94,6 +94,7 @@ import Foreign.Marshal.Array (withArrayLen)
import Foreign.ForeignPtr (ForeignPtr, FinalizerPtr, newForeignPtr,
withForeignPtr)
import Foreign.Ptr (Ptr, nullPtr)
+import Prelude hiding (mod)
import System.IO.Unsafe (unsafePerformIO)
import qualified LLVM.Base as Base
@@ -199,8 +200,8 @@ addGlobal mod typ name =
Value <$> Base.addGlobal modPtr (fromType typ) namePtr
setInitializer :: Value -> Value -> IO ()
-setInitializer global const =
- Base.setInitializer (fromValue global) (fromValue const)
+setInitializer global cnst =
+ Base.setInitializer (fromValue global) (fromValue cnst)
typeOf :: Value -> Type
typeOf val = unsafePerformIO $ Type <$> Base.typeOf (fromValue val)
View
1  LLVM/Internal.hs
@@ -10,6 +10,7 @@ module LLVM.Internal
import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)
import Foreign.Ptr (Ptr)
+import Prelude hiding (mod)
import qualified LLVM.Base as Base
View
2  Setup.lhs
@@ -1,3 +1,3 @@
#!/usr/bin/env runhaskell
> import Distribution.Simple
-> main = defaultMain
+> main = defaultMainWithHooks defaultUserHooks
View
42 configure.ac
@@ -0,0 +1,42 @@
+AC_INIT([HaskLLVM],[0.1],[bos@serpentine.com], [llvm])
+
+AC_CONFIG_SRCDIR([LLVM/ExecutionEngine.hs])
+
+AC_CONFIG_FILES([llvm.buildinfo])
+
+AC_PROG_CXX
+
+AC_ARG_WITH(llvm_prefix,
+ [AS_HELP_STRING([--with-llvm-prefix],
+ [use the version of LLVM at the given location])],
+ llvm_prefix="$withval",
+ llvm_prefix=/usr/local)dnl
+
+AC_ARG_WITH(llvm_includedir,
+ [AS_HELP_STRING([--with-llvm-includedir],
+ [use LLVM headers at the given location])],
+ llvm_includedir="$withval",
+ llvm_includedir="$llvm_prefix/include")dnl
+
+AC_ARG_WITH(llvm_libdir,
+ [AS_HELP_STRING([--with-llvm-libdir],
+ [use LLVM libraries at the given location])],
+ llvm_libdir="$withval",
+ llvm_libdir="$llvm_prefix/lib")dnl
+
+CPPFLAGS="-I$llvm_includedir $CPPFLAGS"
+
+AC_CHECK_HEADERS([llvm-c/Core.h], [],
+ [AC_MSG_ERROR(could not find LLVM C bindings in $llvm_includedir/llvm-c)])
+
+LIBS="-lLLVMSupport -lLLVMSystem $LIBS"
+LDFLAGS="-L$llvm_libdir $LDFLAGS"
+
+# We have to link using the C++ compiler.
+CC=$CXX
+
+AC_CHECK_LIB(LLVMCore, LLVMModuleCreateWithName)
+
+AC_SUBST([llvm_libdir])
+
+AC_OUTPUT
View
17 llvm.cabal
@@ -9,6 +9,17 @@ maintainer: Bryan O'Sullivan <bos@serpentine.com>
category: Compilers/Interpreters
cabal-version: >= 1.2.1
+extra-source-files:
+ configure
+ configure.ac
+ llvm.buildinfo.in
+
+extra-tmp-files:
+ autom4te.cache
+ config.log
+ config.status
+ llvm.buildinfo
+
flag bytestring-in-base
description: bytestring was part of the base library in ghc-6.6
days. The bytestring low level interface is in
@@ -23,10 +34,8 @@ library
else
build-depends: base < 2.0 || >= 2.2, bytestring >= 0.9
- extensions: ForeignFunctionInterface, CPP
- ghc-options: -W -pgml g++
- extra-libraries: LLVMCore
- ld-options: /home/bos/lib64/LLVMExecutionEngine.o /home/bos/lib64/LLVMJIT.o -lLLVMTarget -lLLVMSupport -lLLVMSystem
+ extensions: ForeignFunctionInterface
+ ghc-options: -Wall -Werror
exposed-modules:
LLVM
Please sign in to comment.
Something went wrong with that request. Please try again.