Fix compiler flags so it compiles OK on all architectures.
[perl4caml.git] / Makefile
index 9be234b..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.27 2004-12-11 13:38:32 rich Exp $
+# $Id: Makefile,v 1.28 2004-12-11 15:40:08 rich Exp $
 
 include Makefile.config
 
@@ -16,8 +16,10 @@ 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)