Commits

Reid van Melle  committed b294ca5

Build system cleanup. Got the pkg-config information for clutter and
clutter-cairo and used it

  • Participants
  • Parent commits 68ecf13

Comments (0)

Files changed (4)

File configure.ac

 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(clutter-ocaml,0.1)
-AC_CONFIG_MACRO_DIR ([m4])
+# AC_CONFIG_MACRO_DIR ([m4])
+m4_include([pkgconfig.m4])
+
+PKG_PROG_PKG_CONFIG([0.22])
 
 AC_PROG_INSTALL
 
 #PKG_CHECK_MODULES([GTK2], [gtk+-2.0 >= 2.12.0])
 #PKG_CHECK_MODULES([CAIRO], [cairo >= 1.4.8])
 #PKG_CHECK_MODULES([GTHREAD2], [gthread-2.0 >= 2.14.1])
-#PKG_CHECK_MODULES([CLUTTER], [clutter-0.7 >= 0.7])
-#PKG_CHECK_MODULES([CLUTTER_CAIRO], [clutter-cairo-0.7 >= 0.7])
+PKG_CHECK_MODULES(CLUTTER, clutter-0.8 >= 0.8)
+PKG_CHECK_MODULES(CLUTTER_CAIRO, clutter-cairo-0.8 >= 0.8)
 
 dnl Check for basic OCaml environment & findlib.
 AC_PROG_OCAML
 dnl Use ocamlfind to find the required packages ...
 
 dnl Check for required OCaml packages.
-AC_CHECK_OCAML_PKG(unix)
-if test "x$pkg_unix" != "xyes"; then
-    AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
-fi
-
 AC_CHECK_OCAML_PKG(bigarray)
 if test "x$pkg_bigarray" != "xyes"; then
     AC_MSG_ERROR([Cannot find required OCaml package 'bigarray'])

File examples/Makefile.in

 
 OCAMLOPTPACKAGES := -linkpkg $(OCAMLCPACKAGES)
 OCAMLOPTFLAGS	:= -w s -I ../src
-CLUTTER_FLAGS   := $(shell pkg-config --libs clutter-0.8)
-CLUTTER_CAIRO_FLAGS := $(shell pkg-config --libs clutter-cairo-0.8)
+
+CLUTTER_FLAGS   := @CLUTTER_LIBS@
+CLUTTER_CAIRO_FLAGS := @CLUTTER_CAIRO_LIBS@
+
 OCAMLOPTLIBS	:= $(OCAMLCLIBS) -cclib '$(CLUTTER_FLAGS)' -cclib '$(CLUTTER_CAIRO_FLAGS)' -cclib -lclutter-ocaml ../src/mlclutter.cmxa
 
 # test-cogl-primitives test-cogl-tex-file

File src/Makefile.in

 	./propcc.exe $<
 
 # Flags for the C compiler.
-CFLAGS=-DFULL_UNROLL -O2 -I`ocamlc -where` `pkg-config --cflags clutter-0.8` `pkg-config --cflags clutter-cairo-0.8` `pkg-config --cflags gtk+-2.0`
+
+CLUTTER_FLAGS   := @CLUTTER_CFLAGS@
+CLUTTER_CAIRO_FLAGS := @CLUTTER_CAIRO_CFLAGS@
+CFLAGS=-DFULL_UNROLL -O2 -I`ocamlc -where` $(CLUTTER_FLAGS) $(CLUTTER_CAIRO_FLAGS) 
+
 .c.o:
 	$(OCAMLC) -c -ccopt "$(CFLAGS)" $<
 

File tests/Makefile.in

 pkg_cairo	= @pkg_cairo@
 
 OCAMLCPACKAGES	:= -package lablgtk2,bigarray,cairo
-
 OCAMLCFLAGS	:= -g -w s -I ../src ../src/mlclutter.cma
 OCAMLCLIBS	:= -cclib -L../src 
 
 OCAMLOPTPACKAGES := -linkpkg $(OCAMLCPACKAGES)
 OCAMLOPTFLAGS	:= -w s -I ../src
-CLUTTER_FLAGS   := $(shell pkg-config --libs clutter-0.8)
-CLUTTER_CAIRO_FLAGS := $(shell pkg-config --libs clutter-cairo-0.8)
+
+CLUTTER_FLAGS   := @CLUTTER_LIBS@
+CLUTTER_CAIRO_FLAGS := @CLUTTER_CAIRO_LIBS@
+
 OCAMLOPTLIBS	:= $(OCAMLCLIBS) -cclib '$(CLUTTER_FLAGS)' -cclib '$(CLUTTER_CAIRO_FLAGS)' -cclib -lclutter-ocaml ../src/mlclutter.cmxa
 
 # test-cogl-tex-file --> need to finish this one
 	ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) -o $@ $^
 
 test-behave.opt: test-behave.cmx
-	ocamlfind $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) -o $@ $^
+	ocamlfind ocamlopt $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) -o $@ $^
 
 test-cogl-primitives: test-cogl-primitives.cmo
 	ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) -o $@ $^