Skip to content

Commit

Permalink
Fix #38: configue detects 32bit OCaml switch on 64bit host
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinemine committed Aug 22, 2019
1 parent 0355eb1 commit 9c248a6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ocamldep='ocamldep'
ocamldoc='ocamldoc'
ccinc="$CPPFLAGS"
cclib="$LDFLAGS"
asopt=''
asopt="$ASFLAGS"
ccdef=''
mlflags="$OCAMLFLAGS"
mloptflags="$OCAMLOPTFLAGS"
Expand Down Expand Up @@ -64,6 +64,7 @@ where options include:
Environment variables that affect configuration:
CC C compiler to use (default: try gcc, then cc)
CFLAGS extra flags to pass to the C compiler
ASFLAGS extra flags to pass to the assembler
CPPFLAGS extra includes, e.g. -I/path/to/gmp/include
LDFLAGS extra link flags, e.g. -L/path/to/gmp/lib
OCAMLFLAGS extra flags to pass to the ocamlc Caml compiler
Expand Down Expand Up @@ -313,7 +314,15 @@ arch='none'
case $host in
x86_64-*linux-gnu|x86_64-kfreebsd-gnu)
ccdef="-DZ_ELF -DZ_DOT_LABEL_PREFIX $ccdef"
arch='x86_64';;
if test $wordsize = 32; then
# 32-bit OCaml on a 64-bit host
arch='i686'
ccopt="-m32 $ccopt"
asopt="-m32 $asopt"
else
arch='x86_64'
fi
;;
i486-*linux-gnu|i686-*linux-gnu|i486-kfreebsd-gnu)
ccdef="-DZ_ELF -DZ_DOT_LABEL_PREFIX $ccdef"
arch='i686';;
Expand Down

0 comments on commit 9c248a6

Please sign in to comment.