Skip to content

Commit

Permalink
ocamlbuild: many improvements (macos 10.5 fix, correct dllpath, etc)
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12033 85f007b7-540e-0410-9357-904b9bb8a0f7
  • Loading branch information
letouzey committed Mar 29, 2009
1 parent 0269921 commit 301d6bf
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 232 deletions.
20 changes: 3 additions & 17 deletions Makefile.build
Expand Up @@ -836,24 +836,10 @@ endif

%.cmxs: %.cmxa
$(SHOW)'OCAMLOPT -shared -o $@'
ifneq ($(HASNATDYNLINK),os5fixme)
$(HIDE)$(OCAMLOPT) -linkall -shared -o $@ $<
ifeq ($(HASNATDYNLINK),os5fixme)
$(HIDE)dev/ocamlopt_shared_os5fix.sh $(OCAMLOPT) $@ $<
else
$(HIDE)$(OCAMLOPT) -dstartup -linkall -shared -o $@ $<
# Fix1: add a dummy instruction before the caml generic functions
# Fix2: make all caml generic functions private
$(HIDE)rm -f $@ $@.startup.fixed.s
$(HIDE)cat $@.startup.s | sed \
-e "s/_caml_shared_startup__code_begin:/_caml_shared_startup__code_begin: ret/" \
-e "s/.globl _caml_curry/.private_extern _caml_curry/" \
-e "s/.globl _caml_apply/.private_extern _caml_apply/" \
-e "s/.globl _caml_tuplify/.private_extern _caml_tuplify/" \
> $@.startup.fixed.s
# Recompile fixed startup code
$(HIDE)as -o $@.startup.o $@.startup.fixed.s
# Build fixed .cmxs (assume plugins are on directory base and include all files)
$(HIDE)ld -bundle -flat_namespace -undefined warning -read_only_relocs suppress -o $@ `dirname $@`/*.o
$(HIDE)rm $@.startup.o $@.startup.s $@.startup.fixed.s
$(HIDE)$(OCAMLOPT) -linkall -shared -o $@ $<
endif

%.cmxs: %.cmx
Expand Down
2 changes: 1 addition & 1 deletion _tags
Expand Up @@ -50,8 +50,8 @@
## sub-directory inclusion

# Note: "checker" is deliberately not included
# Note: same for "config" (we create a special coq_config.ml)

"config": include
"parsing": include
"ide": include
"ide/utils": include
Expand Down
11 changes: 0 additions & 11 deletions bin.itarget

This file was deleted.

2 changes: 1 addition & 1 deletion coq.itarget
@@ -1,2 +1,2 @@
bin.otarget
binaries
vo.otarget
23 changes: 23 additions & 0 deletions dev/ocamlopt_shared_os5fix.sh
@@ -0,0 +1,23 @@
#/bin/sh

### Temporary fix for production of .cmxs on MacOS 10.5

OCAMLOPT=$1
CMXS=$2
CMXA=$3

$OCAMLOPT -dstartup -linkall -shared -o $CMXS $CMXA
# Fix1: add a dummy instruction before the caml generic functions
# Fix2: make all caml generic functions private
rm -f $CMXS $CMXS.startup.fixed.s
cat $CMXS.startup.s | sed \
-e "s/_caml_shared_startup__code_begin:/_caml_shared_startup__code_begin: ret/" \
-e "s/.globl _caml_curry/.private_extern _caml_curry/" \
-e "s/.globl _caml_apply/.private_extern _caml_apply/" \
-e "s/.globl _caml_tuplify/.private_extern _caml_tuplify/" \
> $CMXS.startup.fixed.s
# Recompile fixed startup code
as -o $CMXS.startup.o $CMXS.startup.fixed.s
# Build fixed .cmxs (assume plugins are on directory base and include all files)
ld -bundle -flat_namespace -undefined warning -read_only_relocs suppress -o $CMXS `dirname $CMXS`/*.o
rm $CMXS.startup.o $CMXS.startup.s $CMXS.startup.fixed.s

0 comments on commit 301d6bf

Please sign in to comment.