-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.in
187 lines (154 loc) · 5.14 KB
/
configure.in
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
183
184
185
186
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/testprog.c)
# version crud for libraries
LT_CURRENT=4
LT_AGE=2
LT_REVISION=0
# version for tar file
VERSION=2.2.0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_AGE)
AC_SUBST(LT_REVISION)
PACKAGE=xosd
AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_LIBTOOL
AC_PATH_XTRA
# We need two libtools, one that builds both shared and static, and
# one that builds only static. This is because the resulting libtool
# does not allow us to choose which to build at runtime.
sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
chmod +x libtool-disable-static
LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS -Wall"
M4DATADIR="$datadir/aclocal"
AC_SUBST(M4DATADIR)
dnl Checks for libraries.
AM_PATH_GTK
dnl Replace `main' with a function in -lX11:
AC_CHECK_LIB(X11, main)
dnl Replace `main' with a function in -lXext:
AC_CHECK_LIB(Xext, main)
dnl Replace `main' with a function in -lXt:
AC_CHECK_LIB(Xt, main)
dnl Replace `main' with a function in -libs:
AC_CHECK_LIB(ibs, main)
dnl Replace `main' with a function in -lpthread:
AC_CHECK_LIB(pthread, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_CHECK_FUNCS(strtol)
# nicked from the irmix project...
disable_xinerama="no"
AC_ARG_ENABLE(xinerama,
[ --disable-xinerama disable use of Xinerama extension],
disable_xinerama="yes")
dnl Override where to place libxmms_xosd.so
AC_ARG_WITH(plugindir,
[ --with-plugindir=<DIR> Set the xmms plugin directory ],
[ XMMS_PLUGIN_DIR="$withval" ],
[ XMMS_PLUGIN_DIR="" ])
dnl Override where to place pixmaps for libxmms_xosd.so
AC_ARG_WITH(pixmapdir,
[ --with-pixmapdir=<DIR> Set the directory for xmms plugin pixmaps ],
[ XMMS_PIXMAPDIR="$withval" ],
[ XMMS_PIXMAPDIR="${datadir}/xosd" ])
AC_SUBST(XMMS_PIXMAPDIR)
AC_DEFINE_UNQUOTED(XMMS_PIXMAPDIR, "$XMMS_PIXMAPDIR")
dnl Plugin selection starts
SELECTED_PLUGINS=
NEW_PLUGIN="yes"
AC_ARG_ENABLE(new-plugin,
[ --disable-new-plugin Disable new xmms plugin (enabled by default)],
[ NEW_PLUGIN="$enableval" ])
AC_MSG_CHECKING([whether new xmms plugin was requested])
AC_MSG_RESULT($NEW_PLUGIN)
if test "x$NEW_PLUGIN" = "xyes"; then
dnl --=mjs=-- Check for gdk-pixmap libs. There is probably a better
dnl way to do this, but I don't know it.
AC_PATH_PROG(gdk_pixbuf_config_script, gdk-pixbuf-config, "none")
dnl Check for xmms-config; set the plugin directory
AC_PATH_PROG(xmms_config_script, xmms-config, "none")
if test "x$xmms_config_script" = "xnone" ; then
echo "*** xmms-config script not found. xmms plugin will not be built"
elif test "x$gdk_pixbuf_config_script" = "xnone" ; then
echo "*** gdk-pixbuf-config script not found. xmms plugin will not be built"
else
XMMS_CFLAGS=`$xmms_config_script --cflags`
XMMS_LIBS=`$xmms_config_script --libs`
AC_MSG_CHECKING(for xmms plugin directory)
if test "x$XMMS_PLUGIN_DIR" = "x" ; then
XMMS_PLUGIN_DIR=`$xmms_config_script --general-plugin-dir`
fi
AC_MSG_RESULT($XMMS_PLUGIN_DIR)
GDK_PIXBUF_CFLAGS=`$gdk_pixbuf_config_script --cflags`
GDK_PIXBUF_LIBS=`$gdk_pixbuf_config_script --libs`
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
AC_SUBST(XMMS_CFLAGS)
AC_SUBST(XMMS_LIBS)
AC_SUBST(XMMS_PLUGIN_DIR)
SELECTED_PLUGINS="$SELECTED_PLUGINS xmms_plugin"
fi
fi
AC_ARG_ENABLE(old-plugin,
[ --enable-old-plugin Enable old xmms plugin (disabled by default)],
[ OLD_PLUGIN="$enableval" ],
[ OLD_PLUGIN="no" ])
AC_MSG_CHECKING([whether old xmms plugin was requested])
AC_MSG_RESULT($OLD_PLUGIN)
if test "x$OLD_PLUGIN" = "xyes"; then
if test "x$xmms_config_script" = "xnone" ; then
XMMS_CFLAGS=`$xmms_config_script --cflags`
XMMS_LIBS=`$xmms_config_script --libs`
AC_MSG_CHECKING(for xmms plugin directory)
if test "x$XMMS_PLUGIN_DIR" = "x" ; then
XMMS_PLUGIN_DIR=`$xmms_config_script --general-plugin-dir`
fi
AC_MSG_RESULT($XMMS_PLUGIN_DIR)
AC_SUBST(XMMS_CFLAGS)
AC_SUBST(XMMS_LIBS)
AC_SUBST(XMMS_PLUGIN_DIR)
echo "*** xmms-config script not found. Old xmms plugin will not be built"
else
SELECTED_PLUGINS="$SELECTED_PLUGINS xmms_plugin_oldplugin"
fi
fi
if test x$disable_xinerama = "xno"
then
dnl Replace `main' with a function in -lXinerama:
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
[X_LIBS="$X_LIBS -lXinerama"
AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
ac_have_xinerama="yes"],,
[$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
AM_CONDITIONAL(HAVE_XINERAMA, test x$ac_have_xinerama = "xyes")
fi
dnl Plugin selection ends
AC_SUBST(SELECTED_PLUGINS)
dnl Define XOSD_VERSION
dnl XOSD_VERSION=${VERSION}
AC_DEFINE_UNQUOTED(XOSD_VERSION, "${VERSION}")
EXTRA_DIST=xosd.spec
dnl Produce Output files
AC_OUTPUT([
Makefile
src/Makefile
src/libxosd/Makefile
src/xmms_plugin/Makefile
src/xmms_plugin_oldplugin/Makefile
macros/Makefile
man/Makefile
pixmaps/Makefile
script/Makefile
script/xosd-config
xosd.spec
],
[chmod +x script/xosd-config])