Add explicit gmodule dependency
[grits] / configure.ac
1 m4_define([grits_release], [0.7])
2 m4_define([grits_version], [4:0:0])
3 m4_define([grits_subdir],  [grits4])
4
5 # Init and options
6 AC_INIT([grits], [grits_release], [andy753421@gmail.com])
7 AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign])
8 AC_CONFIG_HEADERS([config.h])
9 AC_CONFIG_MACRO_DIR([m4])
10 #AM_SILENT_RULES([yes])
11
12 # For library versioning
13 LIB_VERSION=grits_version
14 GRITS_SUBDIR=grits_subdir
15 AC_SUBST(LIB_VERSION)
16 AC_SUBST(GRITS_SUBDIR)
17
18 # Fix broken libtool
19 lt_cv_sys_lib_dlsearch_path_spec="/lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64"
20
21 # Check for required programs
22 AC_PROG_CC
23 AC_PROG_LIBTOOL
24 DOLT
25 PKG_PROG_PKG_CONFIG
26 GTK_DOC_CHECK(1.9)
27
28 # Check for required packages
29 PKG_CHECK_MODULES(GLIB,  glib-2.0 >= 2.14 gobject-2.0 gthread-2.0 gmodule-2.0)
30 PKG_CHECK_MODULES(CAIRO, cairo)
31 PKG_CHECK_MODULES(GTK,   gtk+-2.0 >= 2.16)
32 PKG_CHECK_MODULES(SOUP,  libsoup-2.4 >= 2.26)
33
34 # Check for glut for example plugin
35 AC_CHECK_LIB(glut, glutSolidTeapot, GLUT_LIBS="-lglut")
36 AM_CONDITIONAL(HAVE_GLUT, test "$GLUT_LIBS" != "")
37 AC_SUBST(GLUT_LIBS)
38
39 # Test for windowing system
40 case "${host}" in
41         *mingw32*) SYS="WIN" ;;
42         *cygwin*)  SYS="WIN" ;;
43         *apple*)   SYS="MAC" ;;
44         *)         SYS="X11" ;;
45 esac
46 AM_CONDITIONAL([SYS_WIN], test "$SYS" = "WIN")
47 AM_CONDITIONAL([SYS_MAC], test "$SYS" = "MAC")
48 AM_CONDITIONAL([SYS_X11], test "$SYS" = "X11")
49
50 # OpenGL flags
51 GL_CFLAGS="-DSYS_$SYS"
52 case "$SYS" in
53         "WIN") GL_LIBS="-lglu32 -lopengl32" ;;
54         "MAC") GL_LIBS="-framework OpenGL" ;;
55         "X11") GL_LIBS="-lGL -lGLU" ;;
56 esac
57 AC_SUBST([GL_CFLAGS])
58 AC_SUBST([GL_LIBS])
59
60 # Check for relative build
61 AC_ARG_ENABLE(relative, [AS_HELP_STRING([--enable-relative],
62         [enable runtime search paths @<:@default=no@:>@])],
63         [DOTS=".."; ac_default_prefix="/"])
64 AC_SUBST([DOTS])
65
66 # Output 
67 AC_CONFIG_FILES([
68         Makefile
69         src/Makefile
70         src/data/Makefile
71         src/objects/Makefile
72         src/plugins/Makefile
73         src/grits.pc
74         docs/Makefile
75         docs/api/Makefile
76 ])
77 AC_OUTPUT