Skip to content

Commit d4e361d

Browse files
committed
fixed: compilation problem on x86_64 systems.
1 parent ef1d7e9 commit d4e361d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

librange/source/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ LIBS = unix
88

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

11-
LDPATH=-L /usr/lib/ocaml/site-lib/pcre/ -L /usr/local/lib -L /usr/lib
11+
LDPATH=-L /usr/lib/ocaml/site-lib/pcre/ -L /usr/local/lib -L /usr/lib
12+
13+
OCAML_PCRE=$(shell ocamlfind query pcre)
14+
OCAML_STDLIB=$(shell ocamlfind query unix)
1215

1316
librange.so: camlcode.o librange.o
14-
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
17+
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
1518

1619

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

2932
camlcode.o: ncl
30-
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
33+
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
3134

3235
librange.o: librange.c
33-
gcc -Wall -g -c librange.c -I /usr/lib/ocaml
36+
gcc -fPIC -Wall -g -c librange.c -I $(OCAML_STDLIB)
3437

3538
cleaner: clean
3639
rm -f librange.so librange.o testrange camlcode.o pcre_stubs.o

0 commit comments

Comments
 (0)