~ubuntu-branches/ubuntu/trusty/ocamlbricks/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/no-ocamlopt-arches.diff/Makefile.d/ocamlmklib_wrapper.sh

  • Committer: Package Import Robot
  • Author(s): Lucas Nussbaum
  • Date: 2013-05-28 16:38:50 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20130528163850-njreq52k3sdi3szn
Tags: 0.90+bzr364.3-1
* New upstream snapshot. Should fix the build failures on
  non-native ocaml architectures.
* Add no-ocamlopt-arches.diff: work-around for partial upstream fix
  (see https://bugs.launchpad.net/ocamlbricks/+bug/1130098).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
#    This file is part of our reusable OCaml BRICKS library
 
4
#    Copyright (C) 2009 Jean-Vincent Loddo
 
5
#
 
6
#    This program is free software: you can redistribute it and/or modify
 
7
#    it under the terms of the GNU General Public License as published by
 
8
#    the Free Software Foundation, either version 2 of the License, or
 
9
#    (at your option) any later version.
 
10
#
 
11
#    This program is distributed in the hope that it will be useful,
 
12
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
#    GNU General Public License for more details.
 
15
#
 
16
#    You should have received a copy of the GNU General Public License
 
17
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
 
19
# Usage:
 
20
# ocamlmklib_wrapper $(OTHER_LIBRARY_FILES_TO_INSTALL)"
 
21
 
 
22
set -e
 
23
 
 
24
# Check script dependencies
 
25
type ocamlobjinfo
 
26
type ocamlmklib
 
27
type awk
 
28
 
 
29
function usage {
 
30
 echo 'Usage (in a Makefile):'
 
31
 echo '$(basename $0) $(C_OBJECTS_TO_LINK)'
 
32
 exit 1
 
33
}
 
34
 
 
35
OBJECTS=$(for i in "$@"; do echo $i.o; done)
 
36
INCLUDES=$(cd _build ; find -type d -printf "-I %p\n")
 
37
CMO=$(ocamlobjinfo _build/ocamlbricks.cma | awk '/Unit name/{x=tolower(substr($3,1,1)); r=substr($3,2); printf("%s%s.cmo\n",x,r);}')
 
38
CMX=$(ocamlobjinfo _build/ocamlbricks.cma | awk '/Unit name/{x=tolower(substr($3,1,1)); r=substr($3,2); printf("%s%s.cmx\n",x,r);}')
 
39
 
 
40
cd _build/
 
41
echo "Rebuilding library with ocamlmklib..."
 
42
set -x
 
43
ocamlmklib -custom -o ocamlbricks $OBJECTS $INCLUDES $CMO
 
44
ocamlmklib -custom -o ocamlbricks $OBJECTS $INCLUDES $CMX
 
45
set +x
 
46
ls -l ocamlbricks.cm{,x}a