File: configure.in

package info (click to toggle)
sawfish 1%3A1.3.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,636 kB
  • ctags: 1,327
  • sloc: lisp: 22,765; ansic: 15,810; sh: 10,203; makefile: 675; perl: 19
file content (384 lines) | stat: -rw-r--r-- 10,879 bytes parent folder | download
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
dnl  Process this file with autoconf to produce a configure script.
dnl  Copyright (C) 1998 John Harper <john@dcs.warwick.ac.uk>
dnl  $Id: configure.in,v 1.140 2008/02/18 20:59:59 jkozicki Exp $
dnl
dnl  This file is part of sawmill.
dnl
dnl  sawmill is free software; you can redistribute it and/or modify it
dnl  under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation; either version 2, or (at your option)
dnl  any later version.
dnl
dnl  sawmill is distributed in the hope that it will be useful, but
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with sawmill; see the file COPYING.  If not, write to
dnl  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

AC_REVISION($Revision: 1.141 $)

AC_INIT(src/sawmill.h)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(etc)

AM_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])

dnl Release versioning info
version="1.3.5.2"
subversion=""

output_files="src/Makefile lisp/Makefile scripts/Makefile themes/Makefile\
 lisp/sawfish/ui/Makefile lisp/sawfish/gtk/Makefile sounds/Makefile\
 man/Makefile po/Makefile Makedefs Makefile sawfish.spec\
 lisp/sawfish/gtk/widgets/font.jl"

SUBDIRS="src lisp scripts themes sounds man po"
AC_SUBST(SUBDIRS)

add_subdir () {
  sub=$1; shift
  SUBDIRS="$SUBDIRS $sub"
  output_files="$output_files $sub/Makefile"
  for ext in $*; do
    output_files="$output_files $sub/$ext"
  done
  unset sub
}

dnl Find the system type
AC_CANONICAL_HOST

dnl Remove trailing slash in $prefix if necessary
case "${prefix}" in
  */)
    prefix=`echo ${prefix} | sed -e 's/^\(.*\)\/$/\1/'`
    ;;
esac

sawfishdir='${datadir}/sawfish'
lispdir='${sawfishdir}/${version}/lisp'
localedir='${datadir}/locale'
sawfishexecdir='${libexecdir}/sawfish/${version}/${host_type}'

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_GCC_TRADITIONAL

dnl Workaround etc/install-sh not being found from subdirectories
if test "$INSTALL" = "$ac_install_sh"; then
  dnl Why is the backslash needed?
  INSTALL='\${top_srcdir}/etc/install-sh -c'
fi

dnl Checks for libraries.
AC_CHECK_LIB(nsl, xdr_void)
AC_CHECK_LIB(socket, bind)

dnl Checks for header files.
AC_PATH_XTRA
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/utsname.h unistd.h memory.h)

dnl Check for X headers, etc
_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"

AC_CHECK_HEADERS(X11/SM/SMlib.h X11/extensions/Xdbe.h, [], [], [#include <X11/Xlib.h> ])

dnl Checks for X extensions/libraries
XINERAMA_LIBS=""
XRANDR_LIBS=""
XFT_LIBS=""
XFT_CFLAGS=""

AC_SUBST(XINERAMA_LIBS)
AC_SUBST(XRANDR_LIBS)
AC_SUBST(XFT_LIBS)
AC_SUBST(XFT_CFLAGS)

AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
	     [XINERAMA_LIBS="-lXinerama"
	      AC_CHECK_HEADERS(X11/extensions/Xinerama.h)],
	     [],[$X_LIBS -lX11 -lXext])

AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
	     [XRANDR_LIBS="-lXrandr"
	      AC_CHECK_HEADERS(X11/extensions/Xrandr.h, [], [], 
	         [#include <X11/Xlib.h> ])],
	     [],[$X_LIBS -lX11 -lXext])

dnl Try using pkg-config first, since it looks like Xft2 may fail our
dnl hand-crafted tests
PKG_CHECK_MODULES(XFT, xft >= 1.0,
 [_cppflags=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
  AC_CHECK_HEADERS(X11/Xft/Xft.h)
  CPPFLAGS=$_cppflags],
 [AC_CHECK_LIB(Xft, XftDrawCreate,
	       [XFT_LIBS="-lXft -lXrender"
	       AC_CHECK_HEADERS(X11/Xft/Xft.h)],
	       [], [$X_LIBS -lX11 -lXext])])

CPPFLAGS="${_cppflags}"

dnl Checks for pango
PKG_CHECK_MODULES(PANGO, pango >= 1.8.0,
  [if $PKG_CONFIG --exists pangoxft; then
     AC_DEFINE(HAVE_PANGO_XFT, 1)
     PANGO_MODULES="pangoxft pangox"
     dnl for sawfish.gtk.widgets.font
     have_pango_xft=yes
     AC_SUBST(have_pango_xft)
   fi
   if test "x$PANGO_MODULES" != x; then
     AC_DEFINE(HAVE_PANGO, 1)
     AC_DEFINE(HAVE_PANGO_X, 1)
     PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_MODULES`
     PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_MODULES`
   fi], [: nothing])

dnl Check for librep
REP_MIN_VER="0.17.3"

PKG_CHECK_MODULES(LIBREP, librep >= ${REP_MIN_VER}
		  ,REP_EXECDIR="`pkg-config --variable=repcommonexecdir librep`"
		  REP_CFLAGS="`pkg-config --cflags librep`"
		  REP_LIBS="`pkg-config --libs librep`"
		  REP_MSGFMT="`which msgfmt`"
		  REP_VERSION="`pkg-config --variable=version librep`"
		  ,AC_MSG_ERROR([can not locate librep]))

dnl Check for rep-gtk
REP_GTK_MIN_VER="0.18.4"

PKG_CHECK_MODULES(REP_GTK, rep-gtk >= 0.18.4
		  ,
		  ,AC_MSG_ERROR([can not locate rep-gtk]))

dnl is X available?
if test "${no_x}" != "yes"; then
  AC_DEFINE(HAVE_X11,1,[have x11])
else
  AC_MSG_ERROR([You need X11 for sawfish])
fi

dnl Check for image handling libraries
AC_ARG_WITH(gdk-pixbuf,
 [  --with-gdk-pixbuf	  Use gdk-pixbuf for image management
  --without-gdk-pixbuf	  Use Imlib1 instead], [],
 [with_gdk_pixbuf=yes])
if test "$with_gdk_pixbuf" != "no"; then
  AC_MSG_CHECKING([for gdk_pixbuf (xlib version)])
    PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-xlib-2.0 >= 2.6.0)
    GDK_PIXBUF_VERSION=`pkg-config --modversion gdk-pixbuf-xlib-2.0`
    AC_SUBST(GDK_PIXBUF_VERSION)
    AC_SUBST(GDK_PIXBUF_CFLAGS)
    AC_SUBST(GDK_PIXBUF_LIBS)
    AC_DEFINE(HAVE_GDK_PIXBUF,1,[gdk pixbuf])
    AC_DEFINE(NEED_PIXMAP_CACHE,1,[pixmap cache])
    IMAGE_LIBS='${GDK_PIXBUF_LIBS}'
    IMAGE_CFLAGS='${GDK_PIXBUF_CFLAGS}'
    with_gdk_pixbuf=yes
  else
    AC_MSG_RESULT(no)
    if test "$with_gdk_pixbuf" = "yes"; then
      AC_MSG_ERROR([can't locate gdk-pixbuf-xlib library])
    else
      with_gdk_pixbuf=no
    fi
fi
if test "$with_gdk_pixbuf" = "no"; then
  AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
  AC_MSG_CHECKING([for Imlib])
  if test "$IMLIB_CONFIG" = "no"; then
    AC_MSG_RESULT([no])
    AC_MSG_ERROR([can't find imlib-config])
  else
    IMLIB_VERSION=`$IMLIB_CONFIG --version`
    dnl XXX do version check..
    AC_MSG_RESULT([version $IMLIB_VERSION])
    IMLIB_CFLAGS=`$IMLIB_CONFIG --cflags`
    IMLIB_LIBS=`$IMLIB_CONFIG --libs`
    if $IMLIB_CONFIG --libs | grep " -lpng" >/dev/null 2>&1; then true; else
      AC_MSG_ERROR([imlib must be built with support for png images])
    fi
    AC_DEFINE(HAVE_IMLIB,1,[have imlib])
    IMAGE_LIBS='${IMLIB_LIBS}'
    IMAGE_CFLAGS='${IMLIB_CFLAGS}'
    AC_SUBST(IMLIB_VERSION)
    AC_SUBST(IMLIB_CFLAGS)
    AC_SUBST(IMLIB_LIBS)
  fi
fi
AC_SUBST(IMAGE_LIBS)
AC_SUBST(IMAGE_CFLAGS)

AM_PATH_GTK_2_0(2.6.0)

AC_ARG_WITH(audiofile,
 [  --with-audiofile	  Use libaudiofile for sound manipulation
  --without-audiofile], [], [with_audiofile=yes])
if test "$with_audiofile" = "yes"; then
    PKG_CHECK_MODULES(AUDIOFILE, audiofile >= 0.2.3)
    AC_SUBST(AUDIOFILE_LIBS)
    AC_SUBST(AUDIOFILE_CFLAGS)
    AC_DEFINE(HAVE_LIBAUDIOFILE,1,[have libaudiofile])
fi

AC_ARG_WITH(esd,
 [  --with-esd		  Use the Enlightened Sound Daemon
  --without-esd], [], [with_esd=yes])
if test "$with_esd" = "yes"; then
    PKG_CHECK_MODULES(ESD, esound >= 0.2.23)
    AC_SUBST(ESD_LIBS)
    AC_SUBST(ESD_CFLAGS)
    AC_DEFINE(HAVE_ESD,1,[Have esound])
fi

AC_ARG_ENABLE(gnome-widgets,
 [  --enable-gnome-widgets  Use GNOME widgets in places [default]
  --disable-gnome-widgets Don't use GNOME widgets], [],
 [enable_gnome_widgets=no])

if test "$enable_gnome_widgets" != "no"; then
  AC_MSG_CHECKING([for rep-gtk GNOME wrappers])
  if REP_GTK_DONT_INITIALIZE=1 rep --batch -l gui.gtk-2.gnome-ui 2>&5; then 
    AC_MSG_RESULT([yes])
    REP_GTK_GNOME=yes
  else 
    AC_MSG_RESULT([no])
    REP_GTK_GNOME=no
    AC_MSG_WARN([Can't load rep's gnome wrappers])
  fi
else
  REP_GTK_GNOME=no
fi
AC_SUBST(REP_GTK_GNOME)

dnl Check for Doug Lea's malloc in libc
doug_lea_malloc=yes
AC_CHECK_FUNC(malloc_get_state, , doug_lea_malloc=no)
AC_CHECK_FUNC(malloc_set_state, , doug_lea_malloc=no)
if test "$doug_lea_malloc" = "no"; then
  dnl We used to compile our own version of dlmalloc on most
  dnl platforms that didn't have it in their libc. But the list
  dnl of exceptions was growing too long..
  AC_DEFINE(LIBC_MALLOC,1,[libc malloc])
else
  AC_DEFINE(DOUG_LEA_MALLOC,1,[Doug Lea malloc])
  AC_DEFINE(LIBC_MALLOC,1,[libc malloc])
fi

dnl Check for GNOME location
AC_ARG_WITH(gnome_prefix,
 [  --with-gnome-prefix=DIR Root of GNOME installation], [],
 [ with_gnome_prefix="" ])
AC_MSG_CHECKING([for GNOME prefix])
if test "x$with_gnome_prefix" = "x"; then
  with_gnome_prefix='${prefix}'
fi
AC_MSG_RESULT([$with_gnome_prefix])
GNOMEDIR=$with_gnome_prefix
AC_SUBST(GNOMEDIR)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_TYPE_SIZE_T

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gethostname socket snprintf getpagesize)

dnl Custom tests

dnl How do we get dependency lines in the Makefile?
if test "x${GCC}" = "xyes"; then
  MAKEDEP='$(CC) -MM'
else
  case ${host} in
    *-dec-osf*)
      dnl works on Tru64
      MAKEDEP='$(CC) -M'
      ;;
    *-sun-solaris*)
      dnl works on Solaris
      MAKEDEP='/usr/ccs/lib/cpp -M'
      ;;
    *)
      dnl disable dependences?
      MAKEDEP='true'
      ;;
  esac
fi
AC_SUBST(MAKEDEP)

dnl If using GCC and it doesn't look as though the cflags have been
dnl set explicitly, add some warning options. Turn off implicit-int
dnl warnings since the X11 includes on Solaris generate a lot of these
if test "x${GCC}" = "xyes" -a "x$CFLAGS" = "x-g -O2"; then
  CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes -Wno-implicit-int"
fi

AC_MSG_CHECKING(for languages to install)
AC_ARG_ENABLE(linguas,
  [  --enable-linguas=LANGS... Install language catalogs for language codes LANGS],
  [ LINGUAS="$enableval" ], [ LINGUAS="" ])
if test "x$LINGUAS" = x; then
  changequote({,})
  LINGUAS="`echo $srcdir/po/*.po | sed -e 's/[^ ]*\/po\/\([^ ]*\)\.po/\1/g'`"
  changequote([,])
fi
dnl too gross for words..
if test $REP_MSGFMT = true; then
  LINGUAS=""
fi
AC_MSG_RESULT($LINGUAS)
AC_SUBST(LINGUAS)

dnl Nonstandard exported symbols
AC_SUBST(version)
AC_SUBST(subversion)
AC_SUBST(sawfishdir)
AC_SUBST(sawfishexecdir)
AC_SUBST(lispdir)
AC_SUBST(localedir)
AC_SUBST(HAVE_X11)
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
AC_SUBST(X_EXTRA_LIBS)
AC_SUBST(IMLIB_CFLAGS)
AC_SUBST(IMLIB_LIBS)
AC_SUBST(REP_EXECDIR)
AC_SUBST(REP_CFLAGS)
AC_SUBST(REP_LIBS)
AC_SUBST(REP_VERSION)
AC_SUBST(REP_MSGFMT)

dnl Build all files
AC_OUTPUT(${output_files})

dnl If it doesn't look like GNU Make is being used, give a friendly warning
tem=`make --version -f /dev/null 2>&1 | grep GNU`
if test "x$tem" = "x"; then
  AC_MSG_WARN([You need to use GNU Make when compiling sawfish])
fi

dnl Local variables:
dnl major-mode: sh-mode
dnl End: