1 dnl Process this file with autoconf to produce a configure script.
5 dnl remember to edit the .pc file name
6 dnl and lqr/Makefile.am if you change these
7 m4_define([library_base_name], [lqr])
8 m4_define([api_version], [1])
11 m4_define([library_sname], [library_base_name-api_version])
12 m4_define([library_name], [liblqr-api_version])
15 dnl These three define the library version number
16 m4_define([package_major_version], [0])
17 m4_define([package_minor_version], [5])
18 m4_define([package_micro_version], [0git])
20 m4_define([package_version],
21 [package_major_version.package_minor_version.package_micro_version])
23 m4_define([ltversion_current], [4])
24 m4_define([ltversion_revision], [0])
25 m4_define([ltversion_age], [4])
27 AC_INIT([library_name], [package_version])
29 AC_PREFIX_DEFAULT([/usr])
31 AC_DEFINE(LIBRARY_NAME, PACKAGE_NAME, [Library name])
33 AC_DEFINE(PACKAGE_MAJOR_VERSION, package_major_version, [Package major version])
34 AC_DEFINE(PACKAGE_MINOR_VERSION, package_minor_version, [Package minor version])
35 AC_DEFINE(PACKAGE_MICRO_VERSION, package_micro_version, [Package micro version])
37 AC_DEFINE(LTVERSION_CURRENT, ltversion_current, [Library current version])
38 AC_DEFINE(LTVERSION_REVISON, ltversion_revision, [Library revision])
39 AC_DEFINE(LTVERSION_AGE, ltversion_age, [Library age])
41 LIBRARY_BASE_NAME=library_base_name
42 AC_SUBST(LIBRARY_BASE_NAME)
43 API_VERSION=api_version
45 LIBRARY_NAME=library_name
46 AC_SUBST(LIBRARY_NAME)
47 LIBRARY_SNAME=library_sname
48 AC_SUBST(LIBRARY_SNAME)
50 PACKAGE_VERSION=package_major_version.package_minor_version.package_micro_version
51 AC_SUBST(PACKAGE_VERSION)
53 LTVERSION=ltversion_current:ltversion_revision:ltversion_age
56 AC_CONFIG_SRCDIR([lqr/lqr_carver.c])
57 AC_CONFIG_HEADERS([config.h])
59 AC_CONFIG_MACRO_DIR([m4])
61 AM_INIT_AUTOMAKE([-Wall -Werror])
79 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
83 dnl Use -Wall if we have gcc.
85 if test "x$GCC" = "xyes"; then
87 *[\ \ ]-Wall[\ \ ]*) ;;
88 *) CFLAGS="$CFLAGS -Wall" ;;
93 GLIB_REQUIRED_VERSION=2.8.0
95 PKG_CHECK_MODULES(GLIB,
96 glib-2.0 >= $GLIB_REQUIRED_VERSION)
98 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
101 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
104 GLIB_DIR=`$PKG_CONFIG --variable=libdir glib-2.0`
107 AC_CHECK_FUNCS(bind_textdomain_codeset)
109 DATADIR="${datadir}/library_name"
112 AC_ARG_ENABLE([install-man],
113 [AS_HELP_STRING([--enable-install-man], [Install man pages])],
114 [AS_CASE(["${enableval}"],
115 [yes], [install_man=true],
116 [no], [install_man=false],
117 [AC_MSG_ERROR([bad value ${enableval} for --enable-install-man])]
120 AM_CONDITIONAL([INSTMAN], [test x$install_man = xtrue])
122 AC_ARG_ENABLE([legacy-macros],
123 [AS_HELP_STRING([--disable-legacy-macros], [Disable legacy macros])],
124 [AS_CASE([["${enableval}"]],
125 [yes], [legacy_macros=true],
126 [no], [legacy_macros=false],
127 [AC_MSG_ERROR([bad value ${enableval} for --enable-legacy-macros])]
129 [legacy_macros=true])
130 AS_IF([test "x$legacy_macros" = "xfalse"],
131 [AC_DEFINE([LQR_DISABLE_LEGACY_MACROS],[],[Disable legacy macros])],
135 AC_ARG_ENABLE([declspec],
136 [AS_HELP_STRING([--disable-declspec], [Disable Win32 __declspec directives (only meaningful for building static library on MinGW)])],
137 [AS_CASE([["${enableval}"]],
138 [yes], [declspec=true],
139 [no], [declspec=false],
140 [AC_MSG_ERROR([bad value ${enableval} for --enable-declspec])]
143 AS_IF([test "x$declspec" = "xfalse"],
144 [AC_DEFINE([LQR_DISABLE_DECLSPEC],[],[Disable __declspec directives])],
149 AC_MSG_CHECKING([[if we are on Win32]])
159 AS_IF([test "x$is_win32" = "xtrue"],
160 [AC_MSG_RESULT([yes]); LT_NOUNDEF_FLAG="-no-undefined"; FVISIBILITY_FLAG=""],
161 [AC_MSG_RESULT([no]); LT_NOUNDEF_FLAG=""; FVISIBILITY_FLAG="-fvisibility=\"hidden\""],
164 AC_SUBST(LT_NOUNDEF_FLAG)
165 AC_SUBST(FVISIBILITY_FLAG)
167 AC_DEFINE([LQR_EXPORTS],[],[Flag for Windows DLL creation])