Commits

camlspotter committed f572730

now uses opam llvm

  • Participants
  • Parent commits 12271f9

Comments (0)

Files changed (3)

File llvm/OMakefile

-# | Package name
-PACK=ocaml-llvm
-
-# | Local files and URLS required to build the package
-URLS[]=
-  http://llvm.org/releases/2.8/llvm-2.8.tgz
-  install.sh
-
-REQUIRED_PACKS[]=
-
-##################
-
-PACKDIR=$(OCAMLFIND_DESTDIR)/$(PACK)
-
-# | Real URLS in $(URLS) which must be downloaded
-DOWNLOAD_URLS[]=$(list_filter $(fun x, $(is_url $(x))), $(URLS))
-
-# | Locally stored file paths
-LOCAL_FILES[]=$(list_filter $(fun x, $(not $(is_url $(x)))), $(URLS))
-
-# | The downloaded paths (accumulated in the following rule)
-DOWNLOAD_FILES[]=
-
-# | Downloading rules
-foreach(url, $(DOWNLOAD_URLS))
-    DOWNLOAD_FILES+=$(WGet $(url), .)
-    export
-
-REQUIRED_INSTALLS[]=
-foreach(pack, $(REQUIRED_PACKS))
-    REQUIRED_INSTALLS+=$(Installed $(pack))
-    export
-
-# | installed/$(PACK) is the list of md5 of $(OBJS)
-$(INSTALLED)/$(PACK): $(DOWNLOAD_FILES) $(LOCAL_FILES) $(REQUIRED_INSTALLS)
-    section:
-        ./install.sh
-        objs=$(GET_OCAMLFIND_OBJS $(PACK))
-        objs=$(addprefix $(PACKDIR)/, $(objs))
-        println(Creating $@ = $(string $(objs)))
-#    chan=$(fopen $@, w)
-#    fprintln($(chan), OBJS_IN_PACKDIR[]=$(string $(objs)))
-#    close($(chan))
-#    println(Install=> $(string $(objs)))
-        CreateInstalled($(PACK), $(objs))
-
-clean:
-	rm -rf _build
-

File llvm/install.sh

-#!/bin/sh
-
-set -e
-
-if [ ! -d _build ]; then mkdir _build; fi
-
-cd _build
-
-echo Extracting llvm-2.8.tgz...
-tar zxf ../llvm-2.8.tgz
-
-cd llvm-2.8
-
-# OCaml related things are installed to a tmp dir
-OCAML_TMP_INSTALL=`pwd`/../ocaml-libdir
-./configure --prefix=$PREFIX --enable-shared --with-ocaml-libdir=$OCAML_TMP_INSTALL
-
-if [ ! -e $OCAML_TMP_INSTALL ]; then
-    mkdir $OCAML_TMP_INSTALL
-fi
-
-# Build
-OCAML_ANNOT=1 make
-make install
-
-# libLLVM*.a C++ libs are copied to $PREFIX/lib. We do not need it in OCaml installation
-find $OCAML_TMP_INSTALL -type l | xargs rm
-
-# Copy ocamlspot spit file
-cp `find bindings/ocaml/ -iname *.spit -o -iname *.cmti` $OCAML_TMP_INSTALL
-
-# Build META file
-FLAGS=`llvm-config --libs --ldflags`
-OCAML_FLAGS=`for i in $FLAGS; do echo -n "-cclib $i "; done` 
-
-cat << EOF > $OCAML_TMP_INSTALL/META
-requires = ""
-version = "2.8"
-description = "LLVM 2.8 OCaml binding"
-browse_interfaces = " Llvm Llvm_analysis Llvm_bitreader Llvm_bitwriter Llvm_executionengine Llvm_scalar_opts Llvm_target "
-archive(byte) = "llvm.cma llvm_analysis.cma llvm_executionengine.cma llvm_bitreader.cma llvm_bitwriter.cma llvm_scalar_opts.cma llvm_target.cma"
-archive(native) = "llvm.cmxa llvm_analysis.cmxa llvm_executionengine.cmxa llvm_bitreader.cmxa llvm_bitwriter.cmxa llvm_scalar_opts.cmxa llvm_target.cmxa"
-linkopts = "-cc g++ $OCAML_FLAGS"
-EOF
-
-# Install the all files
-ocamlfind remove ocaml-llvm
-ocamlfind install ocaml-llvm $OCAML_TMP_INSTALL/*

File opam_packages/OMakefile

 OMyOPAM(dbm)
 OMyOPAM(gapi-ocaml)
 OMyOPAM(core_bench)
+OMyOPAM(llvm)