summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 91ea5291f039a1a94d1bf17fd4c6b74fcd0f7716 (plain)
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
AC_INIT([Sound Juicer],[3.5.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=sound-juicer],[sound-juicer])

AC_PREREQ(2.52)

AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2 check-news])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([libjuicer/sj-extractor.c])
AC_CONFIG_HEADERS([config.h])

# Enable silent build when available (Automake 1.11)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

GNOME_COMMON_INIT
AM_MAINTAINER_MODE

# Do the gettext/i18n stuff
GETTEXT_PACKAGE=sound-juicer
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The name of the gettext package.])
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT


# Standard C and C++ compiler mojo
AC_ISC_POSIX
AM_PROG_CC_C_O
AC_HEADER_STDC
AC_PROG_LIBTOOL
AC_PROG_INSTALL
IT_PROG_INTLTOOL([0.40.0], [no-xml])

GNOME_COMPILE_WARNINGS([maximum])
GNOME_DEBUG_CHECK
GNOME_MAINTAINER_MODE_DEFINES

GTK_REQUIRED=2.90.0

AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])

# Use the GNOME documentation framework
GNOME_DOC_INIT

# Find GLib and GObject
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32 gthread-2.0 gobject-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

# Find libbrasero-media
PKG_CHECK_MODULES(BURN, libbrasero-media3)
AC_SUBST(BURN_CFLAGS)
AC_SUBST(BURN_LIBS)

# Set a flag if we have _can_eject, added in 2.21.5.
# oldlibs=$LIBS
LIBS="$LIBS $BURN_LIBS"
# AC_CHECK_FUNCS(nautilus_burn_drive_can_eject)
# LIBS="$oldlibs"

# Find the UI libraries
PKG_CHECK_MODULES(UI, gtk+-3.0 >= $GTK_REQUIRED gconf-2.0 gio-2.0 gmodule-export-2.0 libcanberra-gtk3)
AC_SUBST(UI_CFLAGS)
AC_SUBST(UI_LIBS)

PKG_CHECK_MODULES(GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0)
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)

# Find the GStreamer elements we use, and warn if they are not present.
GST_ELEMENT_CHECK(vorbisenc,1.0,,AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.]))
GST_ELEMENT_CHECK(flacenc,1.0,,AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.]))
GST_ELEMENT_CHECK(wavenc,1.0,,AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to Wave to fail.]))
GST_ELEMENT_CHECK(giosink,1.0,,AC_MSG_WARN([The 'giosink' element was not found. This will cause Sound Juicer to fail at runtime.]))

# MusicBrainz5
PKG_CHECK_MODULES(MUSICBRAINZ5, libmusicbrainz5 >= 5.0.1 libdiscid, [have_mb5=yes], [have_mb5=no])
AC_SUBST(MUSICBRAINZ5_CFLAGS)
AC_SUBST(MUSICBRAINZ5_LIBS)
if test "$have_mb5" = "yes" ; then
        AC_DEFINE([HAVE_MUSICBRAINZ5], 1, [Whether libmusicbrainz5 is available])
else
        AC_MSG_ERROR([libmusicbrainz5 needs to be available for sound-juicer to build])
fi

# ISO-CODES
PKG_CHECK_MODULES(ISO_CODES, [iso-codes])
if $PKG_CONFIG --variable=domains iso-codes | grep 3166 >/dev/null ; then
  AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
else
  AC_MSG_ERROR([iso-codes database does not support iso3166 country codes])
fi

# Find gio for the metadata extractor
PKG_CHECK_MODULES(GIO, gio-2.0)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)

# Find how and where to put the GConf schemas
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
if test "$GCONFTOOL" = "no"; then
        AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
fi
AM_GCONF_SOURCE_2


# Optionally enable G* deprecations
AC_MSG_CHECKING([whether to enable deprecation warnings])
AC_ARG_ENABLE([deprecations],
        [AS_HELP_STRING([--enable-deprecations],
        [enable deprecation warnings [default=no]])],
        [],[enable_deprecations=no])
AC_MSG_RESULT([$enable_deprecations])

if test "$enable_deprecations" = "no"; then
	DISABLE_DEPRECATED=""
	AC_SUBST(DISABLE_DEPRECATED)
fi

# We require Scroll Keeper 0.3.5 or above for the help
SCROLLKEEPER_BUILD_REQUIRED=0.3.5
AC_SUBST(SCROLLKEEPER_BUILD_REQUIRED)

AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])

# Finally, generate the files
AC_CONFIG_FILES([
sound-juicer.spec
Makefile
data/Makefile
data/sound-juicer.desktop.in
help/Makefile
help/sound-juicer/Makefile
libjuicer/Makefile
po/Makefile.in
src/Makefile
tests/Makefile
])

AC_OUTPUT