configure.ac 4.47 KB
Newer Older
1
AC_INIT([YAD], [12.1], [https://github.com/v1cont/yad/issues/], yad, [https://github.com/v1cont/yad/])
Victor Ananjesky's avatar
Victor Ananjesky committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
AC_CONFIG_AUX_DIR([build])

AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip])
AM_SILENT_RULES([yes])

AC_PREREQ([2.59])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src])

AM_MAINTAINER_MODE

IT_PROG_INTLTOOL([0.40.0])

AC_PROG_CC

18
AC_PATH_PROG([ENV], [env])
19

Victor Ananjevsky's avatar
Victor Ananjevsky committed
20
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.22.0 gtk+-unix-print-3.0])
Victor Ananjesky's avatar
Victor Ananjesky committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])

dnl rgb.txt
AC_ARG_WITH([rgb],
	[AS_HELP_STRING([--with-rgb=PATH],
			[set path to rgb.txt file (default - /etc/X11/rgb.txt)])],
	[with_rgb=$withval], [with_rgb=/etc/X11/rgb.txt])
AC_DEFINE_UNQUOTED([RGB_FILE], ["$with_rgb"], [Path to rgb.txt file])

dnl html widget
AC_ARG_ENABLE([html],
	[AS_HELP_STRING([--enable-html],
			[Build YAD with HTML widget])],
	[build_html=$enableval], [build_html=yes])
if test x$build_html = xyes; then
Victor Ananjevsky's avatar
Victor Ananjevsky committed
37
    PKG_CHECK_MODULES([HTML], [webkit2gtk-4.0], [have_html=yes], [have_html=no])
Victor Ananjesky's avatar
Victor Ananjesky committed
38 39 40 41 42 43 44 45
else
    have_html=no
fi
AC_SUBST([HTML_CFLAGS])
AC_SUBST([HTML_LIBS])
AM_CONDITIONAL([HTML], [test x$have_html = xyes])

if test x$have_html = xyes; then
Victor Ananjevsky's avatar
Victor Ananjevsky committed
46
    AC_DEFINE([HAVE_HTML], [1], [Define this if you have webkit2gt library])
Victor Ananjesky's avatar
Victor Ananjesky committed
47 48
fi

49 50 51 52 53 54 55 56 57 58 59
dnl status icon widget
AC_ARG_ENABLE([tray],
	[AS_HELP_STRING([--enable-tray],
			[Build YAD with status icon])],
	[build_tray=$enableval], [build_tray=yes])
AM_CONDITIONAL([TRAY], [test x$build_tray = xyes])

if test x$build_tray = xyes; then
    AC_DEFINE([HAVE_TRAY], [1], [Define this if you need status icon])
fi

Victor Ananjesky's avatar
Victor Ananjesky committed
60 61 62
dnl spell check
AC_ARG_ENABLE([spell],
	[AS_HELP_STRING([--enable-spell],
Victor Ananjevsky's avatar
Victor Ananjevsky committed
63 64
			[Build YAD with Spell check support (default - yes)])],
	[with_spell=$enableval], [with_spell=yes])
Victor Ananjesky's avatar
Victor Ananjesky committed
65
if test x$with_spell = xyes; then
66
    PKG_CHECK_MODULES([SPELL], [gspell-1], [have_spell=yes], [have_spell=no])
Victor Ananjesky's avatar
Victor Ananjesky committed
67 68 69 70 71 72 73 74 75 76 77 78 79
else
    have_spell=no
fi
AC_SUBST([SPELL_CFLAGS])
AC_SUBST([SPELL_LIBS])

if test x$have_spell = xyes; then
    AC_DEFINE([HAVE_SPELL], [1], [Define this if you need spell check support])
fi

dnl sourceview
AC_ARG_ENABLE([sourceview],
	[AS_HELP_STRING([--enable-sourceview],
Victor Ananjevsky's avatar
Victor Ananjevsky committed
80 81
			[Build YAD with GtkSourceView support (default - yes)])],
	[with_sourceview=$enableval], [with_sourceview=yes])
82
if test x$with_sourceview = xyes; then
83
    PKG_CHECK_MODULES([SOURCEVIEW], [gtksourceview-3.0 >= 3.18.0], [have_sourceview=yes], [have_sourceview=no])
Victor Ananjesky's avatar
Victor Ananjesky committed
84 85 86 87 88 89 90 91 92 93
else
    have_sourceview=no
fi
AC_SUBST([SOURCEVIEW_CFLAGS])
AC_SUBST([SOURCEVIEW_LIBS])

if test x$have_sourceview = xyes; then
    AC_DEFINE([HAVE_SOURCEVIEW], [1], [Define this if you need GtkSourceView support])
fi

94
dnl standalone build
95 96
AC_ARG_ENABLE([standalone],
	[AS_HELP_STRING([--enable-standalone],
Cem Keylan's avatar
Cem Keylan committed
97
			[Build standalone YAD binary (without gsettings)])],
98 99
	[build_sa=$enableval], [build_sa=no])
AM_CONDITIONAL([STANDALONE], [test x$build_sa = xyes])
100

101 102 103 104
if test x$build_sa = xyes; then
    AC_DEFINE([STANDALONE], [1], [Define this if you need standalone YAD binary])
fi

105 106 107 108 109 110
dnl tools
AC_ARG_ENABLE([tools],
	[AS_HELP_STRING([--enable-tools],
			[Build yad-tools utility])],
	[build_tools=$enableval], [build_tools=yes])
AM_CONDITIONAL([BUILD_TOOLS], [test x$build_tools = xyes])
Victor Ananjevsky's avatar
Victor Ananjevsky committed
111

Victor Ananjesky's avatar
Victor Ananjesky committed
112 113 114 115
dnl icon browser
AC_ARG_ENABLE([icon-browser],
	[AS_HELP_STRING([--enable-icon-browser],
			[Build YAD icon browser])],
116
	[build_ib=$enableval], [build_ib=yes])
Victor Ananjesky's avatar
Victor Ananjesky committed
117 118
AM_CONDITIONAL([BUILD_IB], [test x$build_ib = xyes])

119 120 121
# GSettings
GLIB_GSETTINGS

122 123
AC_SEARCH_LIBS(round, m)

Victor Ananjesky's avatar
Victor Ananjesky committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
# *******************************
# Internationalization
# ******************************* 

GETTEXT_PACKAGE=yad
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext domain])

AM_GLIB_GNU_GETTEXT

# *******************************

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

# *******************************

142 143 144 145
AC_CONFIG_LINKS([
src/yad-settings.sh:src/yad-settings.in
])

Victor Ananjesky's avatar
Victor Ananjesky committed
146 147 148 149
AC_CONFIG_FILES([
Makefile 
po/Makefile.in
src/Makefile
150
src/yad-settings
Victor Ananjesky's avatar
Victor Ananjesky committed
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
data/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/96x96/Makefile
data/icons/128x128/Makefile
data/yad.m4
data/yad.spec
])

AC_OUTPUT

echo
echo "Build configuratioh:"
167
echo "  Status icon          - $build_tray"
Victor Ananjesky's avatar
Victor Ananjesky committed
168 169
echo "  HTML widget          - $have_html"
echo "  GtkSourceView        - $have_sourceview"
Victor Ananjevsky's avatar
Victor Ananjevsky committed
170 171
echo "  Spell checking       - $have_spell"
echo "  Path to rgb.txt      - $with_rgb"
172
echo "  Standalone build     - $build_sa"
173
echo "  Tools                - $build_tools"
Victor Ananjesky's avatar
Victor Ananjesky committed
174 175
echo "  Icon browser         - $build_ib"
echo