Fix compiler flags so it compiles OK on all architectures.
[perl4caml.git] / Makefile
index bf1444e..a92c178 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Interface to Perl from OCaml.
 # Copyright (C) 2003 Merjis Ltd.
-# $Id: Makefile,v 1.24 2004-11-25 21:33:20 rich Exp $
+# $Id: Makefile,v 1.28 2004-12-11 15:40:08 rich Exp $
 
 include Makefile.config
 
@@ -16,18 +16,15 @@ OCAMLOPTINCS := $(OCAMLCINCS)
 OCAMLCFLAGS := -w s -g $(OCAMLCINCS)
 OCAMLOPTFLAGS := -w s $(OCAMLOPTINCS)
 
+PERLCFLAGS := $(shell perl -e 'use Config; print $$Config{ccflags};')
+
 CC := gcc
-CFLAGS := -Wall -Wno-unused -I$(PERLINCDIR) $(EXTRA_CFLAGS)
+CFLAGS := -fPIC -Wall -Wno-unused -I$(PERLINCDIR) $(PERLCFLAGS) $(EXTRA_CFLAGS)
 
 LIBPERL := $(shell perl -MExtUtils::Embed -e ldopts)
 
 SED := sed
 
-# XXX Hack required by ocamlopt, and sometimes ocamlc.
-# To work out what this should be, try:
-# `perl -MExtUtils::Embed -e ldopts'
-DYNALOADER_HACK := /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
-
 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCINCS)
 
 WRAPPERS := \
@@ -49,6 +46,7 @@ WRAPPERS := \
        wrappers/pl_HTTP_Request.cmo \
        wrappers/pl_HTTP_Request_Common.cmo \
        wrappers/pl_HTTP_Response.cmo \
+       wrappers/pl_HTML_Form.cmo \
        wrappers/pl_LWP_UserAgent.cmo \
        wrappers/pl_Template.cmo \
        wrappers/pl_WWW_Mechanize.cmo