File: configure.ac

package info (click to toggle)
easytag 2.4.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 13,004 kB
  • sloc: ansic: 35,121; sh: 4,199; cpp: 1,002; xml: 714; makefile: 543
file content (396 lines) | stat: -rw-r--r-- 15,763 bytes parent folder | download | duplicates (2)
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ([2.64])

dnl To set also in config.h.mingw
dnl defines ($PACKAGE_NAME, $PACKAGE_VERSION, etc.)
AC_INIT([EasyTAG], [2.4.3], [https://bugzilla.gnome.org/enter_bug.cgi?product=easytag], [easytag], [https://wiki.gnome.org/Apps/EasyTAG])

AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/easytag.h])
AC_CONFIG_MACRO_DIR([m4])

dnl -------------------------------
dnl Init automake
dnl -------------------------------
AM_INIT_AUTOMAKE([1.11.2 -Wall -Wno-portability check-news no-define dist-xz no-dist-gzip nostdinc subdir-objects])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])

dnl -------------------------------
dnl Init Libtool
dnl -------------------------------
LT_PREREQ([2.2])
LT_INIT([disable-static])

dnl -------------------------------
dnl Translation files.
dnl -------------------------------
IT_PROG_INTLTOOL([0.50.0])
AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Package name for gettext])
AS_IF([test "x$USE_NLS" != "xno"],
      [AC_DEFINE([ENABLE_NLS], [1], [Native Language support is enabled])])

dnl AppData
m4_ifdef([APPDATA_XML], [APPDATA_XML],
         [AC_MSG_ERROR([appdata-tools is required for appdata-xml.m4])])

dnl -------------------------------
dnl Checks for programs.
dnl -------------------------------
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_SED
PKG_PROG_PKG_CONFIG([0.24])

AX_GENERATE_CHANGELOG

AC_SUBST([GLIB_COMPILE_RESOURCES], [`$PKG_CONFIG --variable glib_compile_resources gio-2.0`])

AC_MSG_CHECKING([for glib-mkenums script])
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AS_IF([test "x$GLIB_MKENUMS" = "x"],
    [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
    [AC_SUBST([GLIB_MKENUMS])
     AC_MSG_RESULT([$GLIB_MKENUMS])])

dnl Man page, generated with xsltproc from DocBook XML.
AC_ARG_ENABLE([man],
    [AS_HELP_STRING([--disable-man], [Disable building the man page])])

AS_IF([test "x$enable_man" != "xno"],
    [AC_PATH_PROG([XSLTPROC], [xsltproc])
     JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.4//EN],
         [DocBook XML DTD V4.4], [have_docbookdtd=yes], [have_docbookdtd=no])
     JH_CHECK_XML_CATALOG(
         [http://docbook.sourceforge.net/release/xsl/current/html/refentry.xsl],
         [DocBook XSL Stylesheets], [have_docbookxsl=yes],
         [have_docbookxsl=no])
     AS_IF([test "x$ac_cv_path_XSLTPROC" != "x" \
         -a "x$have_docbookdtd" = "xyes" -a "x$have_docbookxsl" = "xyes"],
         [have_manutils=yes],
         [AS_IF([test "x$enable_man" = "xyes"],
             [AC_MSG_ERROR(
                 [man page generation requested but required utilities were not found])])
          have_manutils=no])],
    [have_manutils=no])

AM_CONDITIONAL([ENABLE_MAN], [test "x$have_manutils" = "xyes"])

dnl Check for testing utilities.
AC_ARG_ENABLE([tests],
              [AS_HELP_STRING([--disable-tests], [Disable support for tests run during make check])])

AS_IF([test "x$enable_tests" != "xno"],
      [AC_PATH_PROG([DESKTOP_FILE_VALIDATE], [desktop-file-validate])
       AS_IF([test "x$ac_cv_path_DESKTOP_FILE_VALIDATE" != "xyes"],
             [have_desktop_file_validate=yes],
             [have_desktop_file_validate=no])
       AC_PATH_PROG([GTESTER], [gtester])
       AC_PATH_PROG([GTESTER_REPORT], [gtester-report])
       AS_IF([test "x$ac_cv_path_GTESTER" != "xyes" -a "x$ac_cv_path_GTESTER_REPORT" != "xyes"],
             [have_gtester=yes],
             [have_gtester=no])],
      [have_desktop_file_validate=no
       have_gtester=no])

AS_IF([test "x$have_desktop_file_validate" = "xyes" -a "x$have_gtester" = "xyes"],
      [testing_utilities=yes],
      [testing_utilities=no
       AS_IF([test "x$enable_tests" = "xyes"],
             [AC_MSG_ERROR([tests were requested but the required utilities were not found])])])

AM_CONDITIONAL([EASYTAG_ENABLE_TESTS], [test "x$testing_utilities" = "xyes"])

dnl Help.
m4_ifdef([YELP_HELP_INIT], [YELP_HELP_INIT],
         [AC_MSG_ERROR([yelp-tools is required to build EasyTAG help])])

AC_PATH_PROG([YELP], [yelp])
AS_IF([test "x$ac_cv_path_YELP" = "x"],
      [AC_MSG_WARN([Yelp is required at runtime for user help])])

dnl -------------------------------
dnl Handle cross-compiling with mingw32.
dnl -------------------------------
AC_CANONICAL_HOST
AC_MSG_CHECKING([whether to build with mingw32 for a Windows host])
AS_CASE([$host_os],
        [*mingw*], [windows_host=yes],
        [windows_host=no])
AC_MSG_RESULT([$windows_host])

AM_CONDITIONAL([WINDOWS_HOST], [test "x$windows_host" = "xyes"])

AS_IF([test "x$windows_host" = "xyes"],
      [AC_CHECK_TOOL([WINDRES], [windres])
       AS_IF([test -z "$WINDRES"],
             [AC_MSG_ERROR([windres is required when building for a Windows host])])])

dnl -------------------------------
dnl Configure switches.
dnl -------------------------------
AC_ARG_ENABLE([mp3],
              [AS_HELP_STRING([--disable-mp3], [Disable support for MP3 files (default=auto)])])

AC_ARG_ENABLE([id3v23],
              [AS_HELP_STRING([--disable-id3v23], [Disable support for writing id3v2.3 tags (default=enabled)])])

AC_ARG_ENABLE([ogg],
              [AS_HELP_STRING([--disable-ogg], [Disable support for Ogg Vorbis files (default=auto)])])

AC_ARG_ENABLE([opus],
              [AS_HELP_STRING([--disable-opus], [Disable support for Opus Vorbis files (default=auto)])])

AC_ARG_ENABLE([speex],
              [AS_HELP_STRING([--disable-speex], [Disable support for Ogg Speex files (default=auto)])])

AC_ARG_ENABLE([flac],
              [AS_HELP_STRING([--disable-flac], [Disable support for FLAC files (default=auto)])])

AC_ARG_ENABLE([mp4],
              [AS_HELP_STRING([--disable-mp4], [Disable support for MP4 files (default=auto)])])

AC_ARG_ENABLE([wavpack],
              [AS_HELP_STRING([--disable-wavpack], [Disable support for Wavpack files (default=auto)])])

AC_ARG_ENABLE([nautilus_actions],
              [AS_HELP_STRING([--disable-nautilus-actions], [do not build the nautilus context menu actions (default=auto)])])



dnl -------------------------------
dnl Checks for libraries.
dnl -------------------------------

dnl Patch from Ben Taylor to fix a Solaris bug (for CDDB)
AC_CHECK_LIB([socket], [recv])


dnl ################################################
dnl # Ogg Vorbis libraries
dnl ################################################

OGG_DEPS="ogg >= 1.0 vorbis >= 1.0.1 vorbisfile"
AS_IF([test "x$enable_ogg" != "xno"],
      [PKG_CHECK_EXISTS([$OGG_DEPS], [have_ogg=yes], [have_ogg=no])],
      [have_ogg=no])

AS_IF([test "x$have_ogg" != "xno"],
      [AC_DEFINE([ENABLE_OGG], [], [Define for Ogg Vorbis support])],
      [OGG_DEPS=""
       AS_IF([test "x$enable_ogg" = "xyes"],
             [AC_MSG_ERROR([OGG Vorbis support requested but required dependencies ($OGG_DEPS) not found])])])

dnl ################################################
dnl # Opus libraries
dnl ################################################

OPUS_DEPS="opus >= 1.0 opusfile"
AS_IF([test "x$enable_opus" != "xno"],
      [PKG_CHECK_EXISTS([$OPUS_DEPS], [have_opus=yes], [have_opus=no])],
      [have_opus=no])

AS_IF([test "x$have_opus" != "xno"],
      [AS_IF([test "x$have_ogg" = "xno"],
             [AC_MSG_ERROR([Opus support requested but Ogg support disabled. Ogg support is required.])])
       AC_DEFINE([ENABLE_OPUS], [], [Define for Ogg Opus support])],
      [OPUS_DEPS=""
       AS_IF([test "x$enable_opus" = "xyes"],
             [AC_MSG_ERROR([Opus support requested but required dependencies ($OPUS_DEPS) not found])])])

dnl ################################################
dnl # libSpeex library
dnl ################################################

SPEEX_DEPS="speex"
AS_IF([test "x$enable_speex" != "xno"],
      [PKG_CHECK_EXISTS([$SPEEX_DEPS], [have_speex=yes], [have_speex=no])],
      [have_speex=no])

AS_IF([test "x$have_speex" != "xno"],
      [AS_IF([test "x$have_ogg" = "xno"],
             [AC_MSG_ERROR([Speex support requested but Ogg support disabled. Ogg support is required.])])
       AC_DEFINE([ENABLE_SPEEX], [], [Define for Speex support])],
      [SPEEX_DEPS=""
       AS_IF([test "x$enable_speex" = "xyes"],
             [AC_MSG_ERROR([OGG Speex support requested but required dependencies ($SPEEX_DEPS) not found])])])

dnl ################################################
dnl # libFLAC library
dnl ################################################

FLAC_DEPS="flac >= 1.1.4"
AS_IF([test "x$enable_flac" != "xno"],
      [PKG_CHECK_EXISTS([$FLAC_DEPS], [have_flac=yes], [have_flac=no])],
      [have_flac=no])

AS_IF([test "x$have_flac" != "xno"],
      [AC_DEFINE([ENABLE_FLAC], [], [Define for FLAC support])],
      [FLAC_DEPS=""
       AS_IF([test "x$enable_flac" = "xyes"],
             [AC_MSG_ERROR([FLAC support requested but required dependencies ($FLAC_DEPS) not found])])])

dnl ################################################
dnl # libid3tag and Id3lib libraries
dnl ################################################
ID3TAG_DEPS="id3tag"
AS_IF([test "x$enable_mp3" != "xno"],
      [PKG_CHECK_EXISTS([$ID3TAG_DEPS], [have_mp3=yes], [have_mp3=no])],
      [have_mp3=no])

AS_IF([test "x$have_mp3" != "xno"],
      [AC_DEFINE([ENABLE_MP3], [], [Define for MP3 support])],
      [ID3TAG_DEPS=""
       AS_IF([test "x$enable_mp3" = "xyes"],
             [AC_MSG_ERROR([MP3 support requested but required dependencies ($ID3TAG_DEPS) not found])])])

AS_IF([test "x$have_mp3" = "xyes" -a "x$enable_id3v23" != "xno"],
      dnl Check which libs are required by id3lib, libid3.la is fucked up
      [LIBS_SAVE="$LIBS"
       AC_SEARCH_LIBS([ID3Tag_Link], ["id3" "id3 -lstdc++" "id3 -lz" "id3 -lz -lstdc++"], [have_id3lib=yes], [have_id3lib=no])
        
       dnl expected version for cross compiling
       ID3LIB_MAJOR=3
       ID3LIB_MINOR=8
       ID3LIB_PATCH=0

       AC_MSG_CHECKING([the id3lib version])
       AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <id3.h>
#include <stdio.h>
]],                                   [[
    FILE *output;
    output=fopen("conftest.id3","w");
    fprintf(output,"ID3LIB_MAJOR=%d\nID3LIB_MINOR=%d\nID3LIB_PATCH=%d\n",ID3LIB_MAJOR_VERSION,ID3LIB_MINOR_VERSION,ID3LIB_PATCH_VERSION);
    fclose(output);
    return 0;
]])], [. ./conftest.id3; AC_MSG_RESULT([${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH}])], [AC_MSG_ERROR([could not determine id3lib version])], [echo $ac_n "cross compiling; assuming ${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH} $ac_c"])
       LIBS="$LIBS_SAVE"
       AC_DEFINE_UNQUOTED([ID3LIB_MAJOR], [$ID3LIB_MAJOR], [id3lib major version])
       AC_DEFINE_UNQUOTED([ID3LIB_MINOR], [$ID3LIB_MINOR], [id3lib minor version])
       AC_DEFINE_UNQUOTED([ID3LIB_PATCH], [$ID3LIB_PATCH], [id3lib patch level])

       AC_SUBST([ID3LIB_LIBS], [$ac_cv_search_ID3Tag_Link])
       AC_DEFINE([ENABLE_ID3LIB], [], [Define for ID3v2.3 support])
       ID3LIB_VERSION="(id3lib-$ID3LIB_MAJOR.$ID3LIB_MINOR.$ID3LIB_PATCH)"
       AC_CHECK_DECLS([ID3Field_SetEncoding,
                       ID3Field_GetEncoding,
                       ID3Field_IsEncodable],
                       [], [],
                      [[#include <id3.h>]])],
      [have_id3lib=no])


dnl ################################################
dnl # taglib library
dnl ################################################

TAGLIB_DEPS="taglib >= 1.9.1"
AS_IF([test "x$enable_mp4" != "xno"],
      [PKG_CHECK_EXISTS([$TAGLIB_DEPS], [have_taglib=yes], [have_taglib=no])],
      [have_taglib=no])

AS_IF([test "x$have_taglib" != "xno"],
      [AC_DEFINE([ENABLE_MP4], [], [Define for taglib MP4 support])],
      [TAGLIB_DEPS=""
       AS_IF([test "x$enable_mp4" = "xyes"],
             [AC_MSG_ERROR([Taglib MP4 support requested but required dependencies ($TAGLIB_DEPS) not found])])])

dnl ################################################
dnl # WavPack library
dnl ################################################
WAVPACK_DEPS="wavpack >= 4.40"
AS_IF([test "x$enable_wavpack" != "xno"],
      [PKG_CHECK_EXISTS([$WAVPACK_DEPS], [have_wavpack=yes], [have_wavpack=no])],
      [have_wavpack=no])

AS_IF([test "x$have_wavpack" != "xno"],
      [AC_DEFINE([ENABLE_WAVPACK], [], [Define for Wavpack support])],
      [WAVPACK_DEPS=""
       AS_IF([test "x$enable_wavpack" = "xyes"],
             [AC_MSG_ERROR([Wavpack support requested but required dependencies ($WAVPACK_DEPS) not found])])])

dnl ################################################
dnl # Nautilus
dnl ################################################
NAUTILUS_DEPS="libnautilus-extension >= 3.0 gio-unix-2.0"
AS_IF([test "x$enable_nautilus_actions" != "xno"],
      [PKG_CHECK_EXISTS([$NAUTILUS_DEPS], [have_libnautilus_extension=yes], [have_libnautilus_extension=no])],
      [have_libnautilus_extension=no])

AS_IF([test "x$have_libnautilus_extension" = "xno"],
      [NAUTILUS_DEPS=""
       AS_IF([test "x$enable_nautilus_actions" = "xyes"],
             [AC_MSG_ERROR([Nautilus Actions build requested but required dependencies ($NAUTILUS_DEPS) not found])])],
      [PKG_CHECK_MODULES([NAUTILUS], [$NAUTILUS_DEPS])
       NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
       AC_SUBST([NAUTILUS_EXTENSION_DIR], [$NAUTILUS_EXTENSION_DIR])])

AM_CONDITIONAL([ENABLE_NAUTILUS_ACTIONS], [test x"$have_libnautilus_extension" != x"no"])

dnl Check the pkg-config dependencies
GIO_DEPS="gio-2.0 >= 2.38.0"
AC_SUBST([GLIB_DEPRECATION_FLAGS],
         ["-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_38 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_38"])
GTK_DEPS="gtk+-3.0 >= 3.10.0"
AC_SUBST([GTK_DEPRECATION_FLAGS],
         ["-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_10 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_10"])
PKG_CHECK_MODULES([EASYTAG], [$GIO_DEPS $GTK_DEPS $OPUS_DEPS $OGG_DEPS $SPEEX_DEPS $FLAC_DEPS $ID3TAG_DEPS $TAGLIB_DEPS $WAVPACK_DEPS])

dnl Check for winsock
AC_SEARCH_LIBS([gethostbyname], [nsl socket], [],
    [saved_LIBS=$LIBS
     LIBS="-lws2_32 $LIBS"
     AC_MSG_CHECKING([for gethostbyname in ws2_32])
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]],
        [[gethostbyname ("");]])],
        [have_ws2=yes], [have_ws2=no LIBS=$saved_LIBS])
     AC_MSG_RESULT([$have_ws2])])

dnl Set warning flags
AX_IS_RELEASE([git-directory])
AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS],
                  [$ax_is_release])

GLIB_GSETTINGS

AC_CONFIG_FILES([ Makefile
                  doc/version.xml
                  help/Makefile
                  po/Makefile.in
                  src/win32/easytag.rc
               ])
AC_OUTPUT

echo 
echo Configuration for $PACKAGE_NAME $PACKAGE_VERSION :
echo --------------------------------
echo 
echo Source code location ....: $srcdir
echo Host System Type ........: $host
echo Preprocessor ............: $CC $CPPFLAGS
echo Compiler ................: $CC $CFLAGS
echo Compiler warnings .......: $WARN_CFLAGS
echo C++ Compiler warnings ...: $WARN_CXXFLAGS
echo Linker ..................: $CC $LDFLAGS $LIBS
echo MP3 file support ........: $have_mp3
echo ID3v2.3 tags support ....: $have_id3lib $ID3LIB_VERSION
echo Ogg Vorbis file support .: $have_ogg
echo Ogg Speex file support ..: $have_speex
echo Ogg Opus file support ...: $have_opus
echo FLAC file support .......: $have_flac
echo MP4 file support ........: $have_taglib
echo WavPack support .........: $have_wavpack
echo NLS/gettext .............: $USE_NLS
echo Nautilus actions ........: $have_libnautilus_extension
echo Tests during make check .: $testing_utilities
echo Install prefix ..........: $prefix
echo 
echo Now type 'make' to build $PACKAGE_NAME $PACKAGE_VERSION,
echo and then 'make install' for installation.
echo