-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
140 lines (109 loc) · 3.35 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
# ================= initialization =================== #
AC_INIT([Audio Recorder],[1.9.7],[https://bugs.launchpad.net/~audio-recorder],[audio-recorder])
AM_INIT_AUTOMAKE
AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_SRCDIR([src/main.c])
#AC_CONFIG_HEADERS([src/config.h])
AM_MAINTAINER_MODE
# ============== basic compiler settings ============= #
AC_PROG_CC
AC_HEADER_STDC
# *************************
# Checks for programs.
# *************************
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# ---- compile with -Wall -----
# CFLAGS="$CFLAGS -Wall -Wextra"
CFLAGS="$CFLAGS -Wall"
# ---- lib math (-lm) -----
# LDFLAGS="$LDFLAGS -lm"
# Edit: See the MATH_LIB variable below.
# ========== export compiler / linker options ======== #
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
# Math library -lm is required by Fedora during linking. Ubuntu can do with or without it.
# But Ubuntu fails to link if -lm is in the beginning of linking list, therefore we add -lm at the end.
# See src/Makefile.am
MATH_LIB=-lm
AC_SUBST(MATH_LIB)
# ============== look for dependencies =============== #
# check for headers needed for standard interfaces
AC_CHECK_HEADERS(
stdlib.h \
string.h \
stdio.h \
unistd.h
)
GLIB_REQUIRED=2.14.0
GTK_REQUIRED=3.0.0
GTHREAD_REQUIRED=2.0.0
# Notice: requires gstreamer 1.4
GSTREAMER_REQUIRED=1.4
APPINDICATOR_REQUIRED=0.3
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES(GSTREAMER, gstreamer-1.0 >= $GSTREAMER_REQUIRED)
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)
# Automatic installation of gstreamer plugins
PKG_CHECK_MODULES(GSTREAMER_PBUTILS, gstreamer-pbutils-1.0 >= $GSTREAMER_REQUIRED)
AC_SUBST(GSTREAMER_PBUTILS_CFLAGS)
AC_SUBST(GSTREAMER_PBUTILS_LIBS)
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GTHREAD_REQUIRED)
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.8)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
# Support AppIndicator?
# Ref: https://launchpad.net/indicator-application
PKG_CHECK_MODULES(APP_INDICATOR, appindicator3-0.1 >= $APPINDICATOR_REQUIRED)
AC_SUBST(APP_INDICATOR_CFLAGS)
AC_SUBST(APP_INDICATOR_LIBS)
# *************************
# Checks for library functions.
# *************************
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([exp pow])
# *************************
# Auto-set ALL_LINGUAS variable. See audio-recorder/po/*.po files.
# *************************
ALL_LINGUAS=`(cd "$srcdir/po" > /dev/null && ls *.po) | cut -d. -f1 | xargs`
GETTEXT_PACKAGE=audio-recorder
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
# For po/Makefile
# Ref: https://bugs.launchpad.net/ubuntu/+source/gettext/+bug/122343
top_builddir=`pwd`
AC_SUBST(top_builddir)
IT_PROG_INTLTOOL
# Support for GSetting schemas
GLIB_GSETTINGS
# Change default from /usr/local to /usr
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_FILES([
Makefile
src/Makefile
pixmaps/Makefile
icons/Makefile
icons/hicolor/Makefile
icons/hicolor/scalable/Makefile
icons/hicolor/scalable/apps/Makefile
icons/hicolor/scalable/status/Makefile
data/Makefile
po/Makefile.in
po/Makefile])
AC_OUTPUT