This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
forked from osdlyrics/osdlyrics
-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
182 lines (161 loc) · 5.41 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
m4_define([OL_MAJOR_VER], [0])
m4_define([OL_MINOR_VER], [5])
m4_define([OL_MICRO_VER], [0])
m4_define([OL_BUILD], [-git])
m4_define(OL_BUILD_VER,
m4_esyscmd_s([if test 'x]OL_BUILD[' = 'x-git'; then (git log -1 --format=format:%ad --date=short 2>/dev/null || date -u -r ChangeLog +%Y%m%d) | sed 's/-//g'; fi]))
m4_define([OL_VERSION], [OL_MAJOR_VER.OL_MINOR_VER.OL_MICRO_VER[]OL_BUILD[]OL_BUILD_VER])
AC_INIT([osdlyrics], [OL_VERSION], [https://github.com/osdlyrics/osdlyrics/issues])
AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CONFIG_SRCDIR([src/ol_main.c])
AC_CONFIG_HEADERS([config.h])
AC_DEFINE([PROGRAM_NAME], ["OSD Lyrics"], [The full name of the program to display])
AC_SUBST([PROGRAM_NAME], ["OSD Lyrics"])
# Checks for header files.
AC_PATH_X
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h stddef.h stdlib.h string.h sys/time.h unistd.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AM_PROG_CC_C_O
AC_PROG_RANLIB
AM_PATH_PYTHON([2.6])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Checks for library functions.
# AM_GNU_GETTEXT
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([ftruncate gettimeofday memset pathconf sqrt strcasecmp strchr strdup strerror strrchr strstr])
AM_ICONV
#define paths
OL_ICONDIR='${datadir}/${PACKAGE}/icons'
AC_SUBST(OL_ICONDIR)
OL_GUIDIR='${datadir}/${PACKAGE}'
AC_SUBST(OL_GUIDIR)
# gprof support
AC_ARG_WITH(gprof-support,
[ --with-gprof-support=DIR Include gmon.out file renaming support
--without-gprof-support Don't do gmon.out file renaming (default)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE([WITH_GPROF_SUPPORT], [], [Support gprof profiling])
CFLAGS="-pg $CFLAGS"
LDFLAGS="-pg $LDFLAGS"
AC_MSG_WARN(--with-gprof-support called without argument - using default)
gmondir="/tmp"
AC_SUBST(gmondir)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE([WITH_GPROF_SUPPORT], [], [Support gprof profiling])
CFLAGS="-pg $CFLAGS"
LDFLAGS="-pg $LDFLAGS"
gmondir="$withval"
AC_SUBST(gmondir)
;;
esac
])
# dev restrict support
AC_ARG_WITH(werror,
[ --with-werror Build with -Wall -Werror],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
CFLAGS="-Wall -Werror $CFLAGS"
;;
*)
AC_MSG_RESULT(no)
;;
esac
])
dnl app indicators in Ubuntu
APPINDICATOR_REQUIRED=0.0.7
AC_ARG_ENABLE(appindicator,
AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]),
[enable_appindicator=$enableval],
[enable_appindicator="auto"])
# Checks for libraries.
AC_CHECK_LIB([dl], [exp])
PKG_CHECK_MODULES([GTK2], [gtk+-2.0 >= 2.20.0,
gthread-2.0,
gmodule-export-2.0,
gio-2.0 >= 2.26,
gio-unix-2.0])
PKG_CHECK_MODULES([X11], [x11]) dnl For XGrabKey
PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
PKG_CHECK_MODULES([NOTIFY], [libnotify])
PKG_CHECK_EXISTS([libnotify >= 0.7],
AC_DEFINE(HAVE_LIBNOTIFY_0_7, 1, [Have libnotify >= 0.7]))
dnl AppIndicator support for Ubuntu
if test x$enable_appindicator = xauto ; then
PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],
enable_appindicator="yes",
enable_appindicator="no")
fi
if test x$enable_appindicator = xyes ; then
PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],,
AC_MSG_ERROR([appindicator-0.1 is not installed]))
PKG_CHECK_MODULES(APP_INDICATOR,
appindicator-0.1 >= $APPINDICATOR_REQUIRED)
AC_SUBST(APP_INDICATOR_CFLAGS)
AC_SUBST(APP_INDICATOR_LIBS)
AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
fi
AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)
# i18n support from GNU gettext.
GETTEXT_PACKAGE=osdlyrics
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
IT_PROG_INTLTOOL([0.35.0])
AM_GLIB_GNU_GETTEXT
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([
po/Makefile.in
Makefile
src/Makefile
src/tests/Makefile
data/Makefile
daemon/Makefile
python/__init__.py
players/Makefile
players/mpris1/Makefile
players/mpris2/Makefile
players/http/Makefile
players/mpd/Makefile
python/Makefile
python/dbusext/Makefile
lyricsources/Makefile
lyricsources/xiami/Makefile
lyricsources/lrc123/Makefile
lyricsources/viewlyrics/Makefile
lyricsources/netease/Makefile
tools/Makefile
])
AC_OUTPUT
AC_MSG_NOTICE([OSD Lyrics compilation options:])
AC_MSG_NOTICE([ * Version: $PACKAGE_VERSION])
AC_MSG_NOTICE([ * Prefix: $prefix])
if test "x$enable_appindicator" = "xyes"; then
AC_MSG_NOTICE([ * AppIndicator: yes])
else
AC_MSG_NOTICE([ * AppIndicator: no])
fi