summaryrefslogtreecommitdiff
path: root/configure.in
blob: 92090d37446845f833ad5852ec0702f067a65127 (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
141
142
143
144
145
146
147
148
149
AC_INIT([Sound Juicer],[3.4.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])
AM_CONFIG_HEADER([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.18 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-0.10 >= 0.10.32 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10)
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)

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

# Find optional MusicBrainz4
PKG_CHECK_MODULES(MUSICBRAINZ4, libmusicbrainz4 >= 4.0.1 libdiscid, [have_mb4=yes], [have_mb4=no])
AC_SUBST(MUSICBRAINZ4_CFLAGS)
AC_SUBST(MUSICBRAINZ4_LIBS)
if test "$have_mb4" = "yes" ; then
        AC_DEFINE([HAVE_MUSICBRAINZ4], 1, [Whether libmusicbrainz4 is available])
fi
AM_CONDITIONAL([HAVE_MUSICBRAINZ4], [test "$have_mb4" = "yes"])

# MusicBrainz3 fallback
if test "$have_mb4" != "yes" ; then
        PKG_CHECK_MODULES(MUSICBRAINZ3, libmusicbrainz3 >= 3.0.2, [have_mb3=yes], [have_mb3=no])
        AC_SUBST(MUSICBRAINZ3_CFLAGS)
        AC_SUBST(MUSICBRAINZ3_LIBS)
        if test "$have_mb3" = "yes" ; then
                AC_DEFINE([HAVE_MUSICBRAINZ3], 1, [Whether libmusicbrainz3 is available])
        else
                AC_MSG_ERROR([libmusicbrainz4 or libmusicbrainz3 need to be available for sound-juicer to build])
        fi

        oldlibs=$LIBS
        LIBS="$LIBS $MUSICBRAINZ3_LIBS"
        AC_CHECK_FUNCS(mb_extract_uuid)
        LIBS="$oldlibs"
fi
AM_CONDITIONAL([HAVE_MUSICBRAINZ3], [test "$have_mb3" = "yes"])

# 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