File: configure.ac

package info (click to toggle)
writerperfect 0.8.1-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,968 kB
  • sloc: sh: 10,287; cpp: 4,281; makefile: 194
file content (244 lines) | stat: -rw-r--r-- 6,936 bytes parent folder | download
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# Process this file with autoconf to create configure.

AC_PREREQ([2.65])

# ====================
# Version informations
# ====================
m4_define([writerperfect_version_major],[0])
m4_define([writerperfect_version_minor],[8])
m4_define([writerperfect_version_micro],[1])
m4_define([writerperfect_version],[writerperfect_version_major.writerperfect_version_minor.writerperfect_version_micro])

# =============
# Automake init
# =============
AC_INIT([writerperfect],[writerperfect_version])
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz dist-bzip2])
AM_SILENT_RULES([yes])
AC_LANG([C++])

# ===========================
# Find required base packages
# ===========================
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_LIBTOOL_WIN32_DLL
PKG_PROG_PKG_CONFIG([0.20])

# ====================
# Find additional apps
# ====================
PKG_CHECK_MODULES([WRITERPERFECTCORE],[
    libwpd-0.9
    libwpd-stream-0.9
])

# =================================
# Libtool/Version Makefile settings
# =================================
AC_SUBST(WRITERPERFECT_MAJOR_VERSION, [writerperfect_version_major])
AC_SUBST(WRITERPERFECT_MINOR_VERSION, [writerperfect_version_minor])
AC_SUBST(WRITERPERFECT_MICRO_VERSION, [writerperfect_version_micro])
AC_SUBST(WRITERPERFECT_VERSION, [writerperfect_version])
# AC_SUBST(LT_RELEASE, [writerperfect_version_major.writerperfect_version_minor])
LT_CURRENT=`expr 100 '*' writerperfect_version_major + writerperfect_version_minor`
# For 1.0.0 comment the first line and uncomment the second
LT_AGE=0
# LT_AGE=writerperfect_version_minor
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION, [writerperfect_version_micro])
AC_SUBST(LT_AGE)

# ==========================
# Platform check for windows
# ==========================
AC_MSG_CHECKING([for native Win32])
AS_CASE([$host],
	[*-*-mingw*], [
		native_win32=yes
		AC_CHECK_TOOL(WINDRES, windres)
		WPD2ODT_WIN32_RESOURCE=wpd2odt-win32res.lo
		WPG2ODG_WIN32_RESOURCE=wpg2odg-win32res.lo
		VSD2ODG_WIN32_RESOURCE=vsd2odg-win32res.lo
		WPS2ODT_WIN32_RESOURCE=wps2odt-win32res.lo
	], [
		native_win32=no
		WPD2ODT_WIN32_RESOURCE=
		WPG2ODG_WIN32_RESOURCE=
		VSD2ODG_WIN32_RESOURCE=
		WPS2ODT_WIN32_RESOURCE=
	]
)
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL([OS_WIN32], [test "x$native_win32" = "xyes"])
AC_SUBST(WPD2ODT_WIN32_RESOURCE)
AC_SUBST(WPG2ODG_WIN32_RESOURCE)
AC_SUBST(VSD2ODG_WIN32_RESOURCE)
AC_SUBST(WPS2ODT_WIN32_RESOURCE)

AC_MSG_CHECKING([for Win32 platform in general])
AS_CASE([$host],
	[*-*-mingw*|*-*-cygwin*], [platform_win32=yes],
	[platform_win32=no]
)
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL([PLATFORM_WIN32], [test "x$platform_win32" = "xyes"])

# ================
# Check for cflags
# ================
AC_ARG_ENABLE([werror],
	[AS_HELP_STRING([--disable-werror], [Treat all warnings as errors, usefull for development])],
	[enable_werror="$enableval"],
	[enable_werror=yes]
)
AS_IF([test x"$enable_werror" != "xno"], [
	CFLAGS="$CFLAGS -Werror"
	CXXFLAGS="$CXXFLAGS -Werror"
])

# ============
# Debug switch
# ============
AC_ARG_ENABLE([debug],
	[AS_HELP_STRING([--enable-debug], [Turn on debugging])],
	[enable_debug="$enableval"],
	[enable_debug=no]
)
AS_IF([test "x$enable_debug" = "xyes"], [
	DEBUG_CXXFLAGS="-DDEBUG -g"
], [
	DEBUG_CXXFLAGS="-DNDEBUG"
])
AC_SUBST(DEBUG_CXXFLAGS)

# ============
# Static tools
# ============
AC_ARG_ENABLE([static-tools],
	[AS_HELP_STRING([--enable-static-tools], [Link tools (binaries) statically])],
	[enable_static_tools="$enableval"],
	[enable_static_tools=no]
)
AS_IF([test "x$enable_static_tools" = "xyes"], [
	enable_static="yes"
], [
	AC_DISABLE_STATIC
])
AM_CONDITIONAL(STATIC_TOOLS, [test "x$enable_static_tools" = "xyes"])

# ======
# libgsf
# ======
AC_ARG_WITH(libgsf,
	[AS_HELP_STRING([--without-libgsf],
		[Use libgsf for output of structured files])],
	[with_libgsf="$withval"],
	[with_libgsf=auto]
)
AS_IF([test "x$with_libgsf" != "xno"], [
		PKG_CHECK_MODULES(WRITERPERFECTGSF, [
			libgsf-1 >= 1.12.0
			glib-2.0 >= 2.0.0
		], [have_libgsf=yes], [have_libgsf=no])
	], [have_libgsf=no])
AM_CONDITIONAL([USE_GSF_OUTPUT], [test "x$have_libgsf" = "xyes"])
AM_CONDITIONAL([GSF_HAS_COMPRESSION_LEVEL], [test "x$have_libgsf" = "xyes"])
AS_IF([test "x$have_libgsf" = "xno" -a "x$with_libgsf" = "xyes"], [
	AC_MSG_ERROR([libgsf requested but not found])
])

# ======
# libwpg
# ======
AC_ARG_WITH(libwpg,
	[AS_HELP_STRING([--without-libwpg],
		[Do not use libwpg for conversion of WordPerfect Graphics (embedded images will not be converted)])],
	[with_libwpg="$withval"],
	[with_libwpg=yes]
)
AS_IF([test "x$with_libwpg" != "xno"], [
		PKG_CHECK_MODULES(WRITERPERFECTWPG, [libwpg-0.2],
			[have_libwpg=yes], [have_libwpg=no])
	], [have_libwpg=no])
AM_CONDITIONAL([USE_LIBWPG], [test "x$have_libwpg" = "xyes"])
AS_IF([test "x$have_libwpg" = "xno" -a "x$with_libwpg" = "xyes"], [
	AC_MSG_ERROR([libwpg requested but not found])
])

# ======
# libwps
# ======
AC_ARG_WITH(libwps,
	[AS_HELP_STRING([--without-libwps],
		[Do not use for conversion of Microsoft Works Documents])],
	[with_libwps="$withval"],
	[with_libwps=auto]
)
AS_IF([test "x$with_libwps" != "xno"], [
		PKG_CHECK_MODULES(WRITERPERFECTWPS, [libwps-0.2],
			[have_libwps=yes], [have_libwps=no])
	], [have_libwps=no])
AM_CONDITIONAL([USE_LIBWPS], [test "x$have_libwps" = "xyes"])
AS_IF([test "x$have_libwps" = "xno" -a "x$with_libwps" = "xyes"], [
	AC_MSG_ERROR([libwps requested but not found])
])

# ========
# libvisio
# ========
AC_ARG_WITH(libvisio,
	[AS_HELP_STRING([--without-libvisio],
		[Use libvisio for conversion of Microsoft Visio Documents])],
	[with_libvisio="$withval"],
	[with_libvisio=auto]
)
AS_IF([test "x$with_libvisio" != "xno"], [
		PKG_CHECK_MODULES(WRITERPERFECTVSD, [libvisio-0.0],
			[have_libvisio=yes], [have_libvisio=no])
	], [have_libvisio=no])
AM_CONDITIONAL([USE_LIBVISIO], [test "x$have_libvisio" = "xyes"])
AS_IF([test "x$have_libvisio" = "xno" -a "x$with_libvisio" = "xyes"], [
	AC_MSG_ERROR([libvisio requested but not found])
])

# =====================
# Prepare all .in files
# =====================
AC_CONFIG_FILES([
Makefile
writerperfect.spec
writerperfect-zip
build/Makefile
build/win32/Makefile
filter/Makefile
cmdline/Makefile
cmdline/wpd2odt.rc
cmdline/wpg2odg.rc
cmdline/vsd2odg.rc
cmdline/wps2odt.rc
])
AC_OUTPUT

# ==============================================
# Display final informations about configuration
# ==============================================
AC_MSG_NOTICE([
==============================================================================
Build configuration:
	debug:           ${enable_debug}
	libgsf:          ${have_libgsf}
	libwpg:          ${have_libwpg}
	libwps:          ${have_libwps}
	libvisio:        ${have_libvisio}
	werror:          ${enable_werror}
==============================================================================
])