Fix compiler flags so it compiles OK on all architectures.
[perl4caml.git] / Makefile
index 8601df8..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.26 2004-12-01 12:41:29 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 := -fPIC -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 := \