build: added a way to override GObject introspection paths
[adg-lua.git] / configure.ac
blob308c8722934f128114edbcab85ed306b9d456142
1 m4_define([adg_lua_version],[0.0.1])
3 m4_define([cpml_prereq],[0.6.3])
4 m4_define([cpml_api_version],1.0)
5 m4_define([adg_prereq],cpml_prereq)
6 m4_define([adg_api_version],1.0)
7 m4_define([lua_prereq],5.1.0)
8 m4_define([gi_prereq],[0.9.5])dnl Same as ADG
11 # Initialization
13 dnl autoconf and automake versions here should be the same
14 dnl as the ones required by the adg package (just for laziness)
15 AC_PREREQ([2.62])
16 AC_INIT([adg-lua],adg_lua_version,[http://dev.entidi.com/p/adg/],[adg-lua],[http://adg.entidi.com/])
17 AC_CONFIG_SRCDIR([configure.ac])
18 AC_CONFIG_AUX_DIR([build])
19 AC_CONFIG_MACRO_DIR([build])
20 AM_INIT_AUTOMAKE([1.11 gnits no-dist-gzip dist-bzip2 -Wall -Wno-portability])
21 AM_SILENT_RULES([yes])
24 # Check for programs
26 AC_PROG_CC
27 AC_PROG_SED
28 PKG_PROG_PKG_CONFIG
29 AC_PATH_PROG([LGOB_PARSER],[lgob-gir-parser],[/usr/bin/lgob-gir-parser])
30 AC_PATH_PROG([LGOB_GENERATOR],[lgob-generator],[/usr/bin/lgob-generator])
33 # Libtool initialization
35 AC_MSG_CHECKING([which libtool initialization strategy to adopt])
36 AC_MSG_RESULT([m4_ifset([LT_INIT],[LT-INIT],[AC-PROG-LIBTOOL])])
37 m4_ifset([LT_INIT],
38          [LT_INIT([disable-static win32-dll])],
39          [AC_DISABLE_STATIC
40           AC_LIBTOOL_WIN32_DLL
41           AC_PROG_LIBTOOL])
44 # Check for required packages
46 PKG_CHECK_MODULES([CPML],[cpml-1 >= ]cpml_prereq)
47 PKG_CHECK_MODULES([ADG],[adg-1 >= ]adg_prereq)
48 PKG_CHECK_MODULES([LUA],[lua >= ]lua_prereq)
51 # Check for required GObject introspection
53 GOBJECT_INTROSPECTION_REQUIRE(gi_prereq)
54 AC_ARG_WITH(girdir,
55             [AC_HELP_STRING([--with-girdir=DIR],
56                             [where the gir files are installed @<:@default=check@:>@])],
57             [],[with_girdir="${INTROSPECTION_GIRDIR}"])
58 AC_SUBST([GIRDIR],${with_girdir})
61 # Check for Lua/lgob dirs
63 AC_ARG_WITH(lua-includedir,
64             [AS_HELP_STRING([--with-lua-includedir],
65                             [prefix where Lua headers are installed @<:@default=check@:>@])],
66             [],[with_lua_includedir="$(${PKG_CONFIG} --variable=INSTALL_INC --define-variable=prefix='${prefix}' lua)"])
67 AC_SUBST([LUA_INCLUDEDIR],"${with_lua_includedir}")
68 AC_ARG_WITH(lua-lmoduledir,
69             [AS_HELP_STRING([--with-lua-lmoduledir],
70                             [prefix where Lua code is installed @<:@default=check@:>@])],
71             [],[with_lua_lmoduledir="$(${PKG_CONFIG} --variable=INSTALL_LMOD --define-variable=prefix='${prefix}' lua)"])
72 AC_SUBST([LUA_LMODULEDIR],"${with_lua_lmoduledir}")
73 AC_ARG_WITH(lua-cmoduledir,
74             [AS_HELP_STRING([--with-lua-cmoduledir],
75                             [prefix where Lua C modules are installed @<:@default=check@:>@])],
76             [],[with_lua_cmoduledir="$(${PKG_CONFIG} --variable=INSTALL_CMOD --define-variable=prefix='${prefix}' lua)"])
77 AC_SUBST([LUA_CMODULEDIR],"${with_lua_cmoduledir}")
80 # Substitutions
82 AC_SUBST([CPML_API_VERSION],cpml_api_version)
83 AC_SUBST([ADG_API_VERSION],adg_api_version)
86 # Generation
88 AC_CONFIG_FILES([Makefile
89                  cpml/Makefile
90                  adg/Makefile
91                  examples/Makefile])
92 AC_OUTPUT
95 # Report
97 AC_MSG_NOTICE([generating report
99 AC_PACKAGE_NAME adg_lua_version will be built with the following options:
100 ----------------------------------------------------------
101               CPML bindings version: cpml_api_version
102                ADG bindings version: adg_api_version
103                 Path to Lua headers: ${with_lua_includedir}
104             Path to Lua shared code: ${with_lua_lmoduledir}
105               Path to Lua C modules: ${with_lua_cmoduledir}
106                   Path to gir files: ${with_girdir}