configure.ac 2.45 KB
Newer Older
Pedro Castro's avatar
Pedro Castro committed
1
dnl Process this file with autoconf to produce a configure script.
Olav Vitters's avatar
Olav Vitters committed
2

Pedro Castro's avatar
Pedro Castro committed
3 4
AC_PREREQ(2.63)
AC_INIT([gnome-subtitles],
Pedro Castro's avatar
Pedro Castro committed
5
	[1.4.2],
Pedro Castro's avatar
Pedro Castro committed
6 7
	[https://gitlab.gnome.org/GNOME/gnome-subtitles/issues/new],
	[gnome-subtitles],
Pedro Castro's avatar
Pedro Castro committed
8
	[https://www.gnomesubtitles.org])
Olav Vitters's avatar
Olav Vitters committed
9

Piotr Drąg's avatar
Piotr Drąg committed
10
YELP_HELP_INIT
Olav Vitters's avatar
Olav Vitters committed
11 12 13
GTK_DOC_CHECK([1.0])

AC_CONFIG_MACRO_DIR([m4])
Pedro Castro's avatar
Pedro Castro committed
14
AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \${ACLOCAL_FLAGS}"])
Olav Vitters's avatar
Olav Vitters committed
15 16
AC_CONFIG_SRCDIR([configure.ac])

17
AM_INIT_AUTOMAKE([1.9 tar-ustar])
Olav Vitters's avatar
Olav Vitters committed
18 19
AM_MAINTAINER_MODE

Pedro Castro's avatar
Pedro Castro committed
20 21
LT_PREREQ([2.2.6])
LT_INIT
22

Olav Vitters's avatar
Olav Vitters committed
23 24 25
AC_PROG_INSTALL
AC_PREFIX_PROGRAM(mono)

Pedro Castro's avatar
Pedro Castro committed
26 27
IT_PROG_INTLTOOL([0.50])

Olav Vitters's avatar
Olav Vitters committed
28 29 30 31 32 33 34 35
dnl Gettext stuff.

GETTEXT_PACKAGE=gnome-subtitles
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])

AM_GLIB_GNU_GETTEXT

Pedro Castro's avatar
Pedro Castro committed
36

Olav Vitters's avatar
Olav Vitters committed
37 38 39 40 41 42 43 44
dnl pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
	AC_MSG_ERROR([You need to install pkg-config])
fi

dnl C# compiler
AC_PATH_PROG(CSC, csc, no)
Pedro Castro's avatar
Pedro Castro committed
45
AC_PATH_PROG(MCS, mcs, no)
Olav Vitters's avatar
Olav Vitters committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
AC_PATH_PROG(MONO, mono, no)

CS="C#"
if test "x$CSC" = "xno" -a "x$MCS" = "xno"  ; then
	dnl AC_MSG_ERROR([You need to install a C# compiler])
	AC_MSG_ERROR([No $CS compiler found])
fi

if test "x$MCS" = "xno" ; then
	MCS=$CSC
fi

if test "x$MONO" = "xno"; then
	AC_MSG_ERROR([No mono runtime found])
fi

dnl create build dir if it does not exist
if test ! -d "build"
then
	mkdir build
fi

Pedro Castro's avatar
Pedro Castro committed
68 69 70
#Dependencies
MONO_REQUIRED_VERSION=4.0
GTKSHARP_REQUIRED_VERSION=2.99.3
Pedro Castro's avatar
Pedro Castro committed
71
GTK_REQUIRED_VERSION=3.12
Pedro Castro's avatar
Pedro Castro committed
72
GSTREAMER_REQUIRED_VERSION=1.0
Olav Vitters's avatar
Olav Vitters committed
73

Pedro Castro's avatar
Pedro Castro committed
74 75 76 77 78
PKG_CHECK_MODULES(MONO, [mono >= $MONO_REQUIRED_VERSION])
PKG_CHECK_MODULES(GTKSHARP, [gtk-sharp-3.0 >= $GTKSHARP_REQUIRED_VERSION])
PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= $GTK_REQUIRED_VERSION])
PKG_CHECK_MODULES(gstreamer, [gstreamer-video-1.0 >= $GSTREAMER_REQUIRED_VERSION])
PKG_CHECK_MODULES(gstreamer_plugins_base, [gstreamer-plugins-base-1.0 >= $GSTREAMER_REQUIRED_VERSION])
79 80 81
AC_SUBST(gstreamer_CFLAGS)
AC_SUBST(gstreamer_LIBS)

Olav Vitters's avatar
Olav Vitters committed
82

83
dnl Check gtk-sharp version
Pedro Castro's avatar
Pedro Castro committed
84
#PKG_CHECK_MODULES(GTKSHARP_INVALID, gtk-sharp-2.0 >= 2.12.2 gtk-sharp-2.0 <= 2.12.6, gtksharp_invalid=true, gtksharp_invalid=false)
85

Pedro Castro's avatar
Pedro Castro committed
86 87 88
#if test "x$gtksharp_invalid" = "xtrue"; then
# 	AC_MSG_ERROR([gtk-sharp versions between 2.12.2 and 2.12.6 (inclusive) are not supported.])
#fi
89

Pedro Castro's avatar
Pedro Castro committed
90
#PKG_PROG_PKG_CONFIG()
91

Olav Vitters's avatar
Olav Vitters committed
92 93
AC_SUBST(MCS)

Pedro Castro's avatar
Pedro Castro committed
94 95
dnl Handle GSettings
GLIB_GSETTINGS
Olav Vitters's avatar
Olav Vitters committed
96

Pedro Castro's avatar
Pedro Castro committed
97
AC_CONFIG_FILES([
Olav Vitters's avatar
Olav Vitters committed
98 99
Makefile
data/Makefile
100
data/org.gnome.GnomeSubtitles.desktop.in
Olav Vitters's avatar
Olav Vitters committed
101 102 103 104
src/Makefile
src/GnomeSubtitles/Execution/AssemblyInfo.cs
src/GnomeSubtitles/Execution/gnome-subtitles
help/Makefile
Pedro Castro's avatar
Pedro Castro committed
105 106
po/Makefile.in
])
Pedro Castro's avatar
Pedro Castro committed
107 108 109

AC_OUTPUT