Skip to content

Commit

Permalink
fixed: compilation problem on x86_64 systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
jianingy committed Jun 8, 2012
1 parent ef1d7e9 commit d4e361d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions librange/source/Makefile
Expand Up @@ -8,10 +8,13 @@ LIBS = unix

PATH = /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

LDPATH=-L /usr/lib/ocaml/site-lib/pcre/ -L /usr/local/lib -L /usr/lib
LDPATH=-L /usr/lib/ocaml/site-lib/pcre/ -L /usr/local/lib -L /usr/lib

OCAML_PCRE=$(shell ocamlfind query pcre)
OCAML_STDLIB=$(shell ocamlfind query unix)

librange.so: camlcode.o librange.o
ld -shared --whole-archive -o librange.so camlcode.o librange.o /usr/lib/ocaml/libunix.a /usr/lib/ocaml/libasmrun.a /usr/lib/ocaml/site-lib/pcre/libpcre_stubs.a -lm -lpcre -ldl
ld -fPIC -Bsymbolic -shared --whole-archive -o librange.so camlcode.o librange.o $(OCAML_STDLIB)/libunix.a $(OCAML_STDLIB)/libasmrun.a $(OCAML_PCRE)/libpcre_stubs.a -lm -lpcre -ldl


# unused
Expand All @@ -27,10 +30,10 @@ install:
install -m 755 librange.so $(DESTDIR)/usr/lib/

camlcode.o: ncl
ocamlopt -I /usr/lib/ocaml/site-lib/pcre -output-obj -o camlcode.o unix.cmxa pcre.cmxa range_utils.cmx parser.cmx lexer.cmx memoize.cmx tinydns.cmx netmask.cmx admins.cmx netblocks.cmx hosts_netblocks.cmx evaluate.cmx range.cmx
ocamlopt -fPIC -I $(OCAML_PCRE) -output-obj -o camlcode.o unix.cmxa pcre/pcre.cmxa range_utils.cmx parser.cmx lexer.cmx memoize.cmx tinydns.cmx netmask.cmx admins.cmx netblocks.cmx hosts_netblocks.cmx evaluate.cmx range.cmx

librange.o: librange.c
gcc -Wall -g -c librange.c -I /usr/lib/ocaml
gcc -fPIC -Wall -g -c librange.c -I $(OCAML_STDLIB)

cleaner: clean
rm -f librange.so librange.o testrange camlcode.o pcre_stubs.o
Expand Down

0 comments on commit d4e361d

Please sign in to comment.