-
Notifications
You must be signed in to change notification settings - Fork 15
/
configure.ac
176 lines (135 loc) · 4.45 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.68)
dnl remember to edit the .pc file name
dnl and lqr/Makefile.am if you change these
m4_define([library_base_name], [lqr])
m4_define([api_version], [1])
dnl Name of library
m4_define([library_sname], [library_base_name-api_version])
m4_define([library_name], [liblqr-api_version])
dnl These three define the library version number
m4_define([package_major_version], [0])
m4_define([package_minor_version], [5])
m4_define([package_micro_version], [0git])
m4_define([package_version],
[package_major_version.package_minor_version.package_micro_version])
m4_define([ltversion_current], [4])
m4_define([ltversion_revision], [0])
m4_define([ltversion_age], [4])
AC_INIT([library_name], [package_version])
AC_PREFIX_DEFAULT([/usr])
AC_DEFINE(LIBRARY_NAME, PACKAGE_NAME, [Library name])
AC_DEFINE(PACKAGE_MAJOR_VERSION, package_major_version, [Package major version])
AC_DEFINE(PACKAGE_MINOR_VERSION, package_minor_version, [Package minor version])
AC_DEFINE(PACKAGE_MICRO_VERSION, package_micro_version, [Package micro version])
AC_DEFINE(LTVERSION_CURRENT, ltversion_current, [Library current version])
AC_DEFINE(LTVERSION_REVISON, ltversion_revision, [Library revision])
AC_DEFINE(LTVERSION_AGE, ltversion_age, [Library age])
LIBRARY_BASE_NAME=library_base_name
AC_SUBST(LIBRARY_BASE_NAME)
API_VERSION=api_version
AC_SUBST(API_VERSION)
LIBRARY_NAME=library_name
AC_SUBST(LIBRARY_NAME)
LIBRARY_SNAME=library_sname
AC_SUBST(LIBRARY_SNAME)
PACKAGE_VERSION=package_major_version.package_minor_version.package_micro_version
AC_SUBST(PACKAGE_VERSION)
LTVERSION=ltversion_current:ltversion_revision:ltversion_age
AC_SUBST(LTVERSION)
AC_CONFIG_SRCDIR([lqr/lqr_carver.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_C_INLINE
AC_C_VOLATILE
AC_DISABLE_STATIC
AM_PROG_AR
LT_INIT([win32-dll])
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
AM_MAINTAINER_MODE
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
GLIB_REQUIRED_VERSION=2.8.0
PKG_CHECK_MODULES(GLIB,
glib-2.0 >= $GLIB_REQUIRED_VERSION)
GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
AC_SUBST(GLIB_CFLAGS)
GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
AC_SUBST(GLIB_LIBS)
GLIB_DIR=`$PKG_CONFIG --variable=libdir glib-2.0`
AC_SUBST(GLIB_DIR)
AC_CHECK_FUNCS(bind_textdomain_codeset)
DATADIR="${datadir}/library_name"
AC_SUBST(DATADIR)
AC_ARG_ENABLE([install-man],
[AS_HELP_STRING([--enable-install-man], [Install man pages])],
[AS_CASE(["${enableval}"],
[yes], [install_man=true],
[no], [install_man=false],
[AC_MSG_ERROR([bad value ${enableval} for --enable-install-man])]
)],
[install_man=false])
AM_CONDITIONAL([INSTMAN], [test x$install_man = xtrue])
AC_ARG_ENABLE([legacy-macros],
[AS_HELP_STRING([--disable-legacy-macros], [Disable legacy macros])],
[AS_CASE([["${enableval}"]],
[yes], [legacy_macros=true],
[no], [legacy_macros=false],
[AC_MSG_ERROR([bad value ${enableval} for --enable-legacy-macros])]
)],
[legacy_macros=true])
AS_IF([test "x$legacy_macros" = "xfalse"],
[AC_DEFINE([LQR_DISABLE_LEGACY_MACROS],[],[Disable legacy macros])],
[:]
)
AC_ARG_ENABLE([declspec],
[AS_HELP_STRING([--disable-declspec], [Disable Win32 __declspec directives (only meaningful for building static library on MinGW)])],
[AS_CASE([["${enableval}"]],
[yes], [declspec=true],
[no], [declspec=false],
[AC_MSG_ERROR([bad value ${enableval} for --enable-declspec])]
)],
[declspec=true])
AS_IF([test "x$declspec" = "xfalse"],
[AC_DEFINE([LQR_DISABLE_DECLSPEC],[],[Disable __declspec directives])],
[:]
)
AC_MSG_CHECKING([[if we are on Win32]])
AC_LANG([C])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#ifndef WIN32
#error
#endif
]])],
[[is_win32=true]],
[[is_win32=false]]
)
AS_IF([test "x$is_win32" = "xtrue"],
[AC_MSG_RESULT([yes]); LT_NOUNDEF_FLAG="-no-undefined"; FVISIBILITY_FLAG=""],
[AC_MSG_RESULT([no]); LT_NOUNDEF_FLAG=""; FVISIBILITY_FLAG="-fvisibility=\"hidden\""],
)
AC_SUBST(LT_NOUNDEF_FLAG)
AC_SUBST(FVISIBILITY_FLAG)
AC_DEFINE([LQR_EXPORTS],[],[Flag for Windows DLL creation])
AC_CONFIG_FILES([
Makefile
lqr/Makefile
man/Makefile
lqr-1.pc
])
AC_OUTPUT