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 385 386 387 388 389 390 391 392 393 394 395 396
|
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.126 2001/12/03 01:50:03 jsh 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.126 $)
AC_INIT(src/sawmill.h)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(etc)
dnl Release versioning info
version="1.0.1"
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"
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)
XINERAMA_LIBS=""
AC_SUBST(XINERAMA_LIBS)
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
[XINERAMA_LIBS="-lXinerama"
AC_CHECK_HEADERS(X11/extensions/Xinerama.h)],
[],[$X_LIBS -lX11 -lXext])
CPPFLAGS="${_cppflags}"
dnl Check for librep
AM_PATH_REP(0.14)
rep_gtk_function=gtk-main-iteration-do
rep_gtk_version=0.14
AC_MSG_CHECKING([for correct rep-gtk version])
cat >conftest <<EOF
(condition-case nil
(progn
(require 'gui.gtk.gtk)
$rep_gtk_function
(throw 'quit 0))
(error
(throw 'quit 1)))
EOF
if REP_GTK_DONT_INITIALIZE=1 rep ./conftest 2>&5; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([You need rep-gtk version ${rep_gtk_version}+])
fi
rm -f conftest
dnl is X available?
if test "${no_x}" != "yes"; then
AC_DEFINE(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=no])
if test "$with_gdk_pixbuf" != "no"; then
AC_MSG_CHECKING([for gdk_pixbuf (xlib version)])
dnl gnome-config is the most broken shell script I've ever
dnl encountered. It often returns true even if it can't
dnl find the named module..!
if gnome-config gdk_pixbuf_xlib --cflags >/dev/null 2>&1; then
GDK_PIXBUF_VERSION=`gnome-config gdk_pixbuf_xlib --modversion`
AC_MSG_RESULT($GDK_PIXBUF_VERSION)
GDK_PIXBUF_CFLAGS=`gnome-config gdk_pixbuf_xlib --cflags`
GDK_PIXBUF_LIBS=`gnome-config gdk_pixbuf_xlib --libs`
AC_SUBST(GDK_PIXBUF_VERSION)
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
AC_DEFINE(HAVE_GDK_PIXBUF,1)
AC_DEFINE(NEED_PIXMAP_CACHE,1)
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
fi
if test "$with_gdk_pixbuf" = "no"; then
AM_PATH_IMLIB
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)
IMAGE_LIBS='${IMLIB_LIBS}'
IMAGE_CFLAGS='${IMLIB_CFLAGS}'
fi
AC_SUBST(IMAGE_LIBS)
AC_SUBST(IMAGE_CFLAGS)
AM_PATH_GTK(1.2.0)
AC_ARG_WITH(audiofile,
[ --with-audiofile Use libaudiofile for sound manipulation
--without-audiofile], [], [with_audiofile=yes])
if test "$with_audiofile" = "yes"; then
AC_MSG_CHECKING([for audiofile library])
AUDIOFILE_VERSION="`audiofile-config --version`"
if test $? -eq 0; then
AUDIOFILE_LIBS="`audiofile-config --libs`"
AUDIOFILE_CFLAGS="`audiofile-config --cflags`"
AC_MSG_RESULT([$AUDIOFILE_VERSION])
AC_SUBST(AUDIOFILE_LIBS)
AC_SUBST(AUDIOFILE_CFLAGS)
AC_DEFINE(HAVE_LIBAUDIOFILE)
else
AC_MSG_RESULT([no])
fi
fi
AC_ARG_WITH(esd,
[ --with-esd Use the Enlightened Sound Daemon
--without-esd], [], [with_esd=yes])
if test "$with_esd" = "yes"; then
AC_MSG_CHECKING([for enlightened sound daemon])
ESD_VERSION="`esd-config --version`"
if test $? -eq 0; then
ESD_LIBS="`esd-config --libs`"
ESD_CFLAGS="`esd-config --cflags`"
AC_MSG_RESULT([$ESD_VERSION])
AC_SUBST(ESD_LIBS)
AC_SUBST(ESD_CFLAGS)
AC_DEFINE(HAVE_ESD)
else
AC_MSG_RESULT([no])
fi
fi
AC_ARG_ENABLE(capplet,
[ --enable-capplet Build the sawfish GNOME capplet [default]
--disable-capplet Don't built the capplet], [],
[enable_capplet=yes])
if test "$enable_capplet" = "yes"; then
AC_MSG_CHECKING([for GNOME control center config])
GNOME_CC_CFLAGS="`(gnome-config --cflags capplet) 2>/dev/null`"
GNOME_CC_LIBS="`(gnome-config --libs capplet) 2>/dev/null`"
if test $? -ne 0; then
AC_MSG_RESULT([no])
AC_MSG_WARN([Can't run "gnome-config capplet", not building capplet])
else
AC_MSG_RESULT([yes])
AC_SUBST(GNOME_CC_CFLAGS)
AC_SUBST(GNOME_CC_LIBS)
add_subdir "capplet"
fi
fi
AC_ARG_ENABLE(themer,
[ --enable-themer Build the sawfish-themer program [default]
--disable-themer Don't build the themer], [],
[enable_themer=yes])
if test "$enable_themer" = yes; then
dnl configure redirects &5 to config.log
AC_MSG_CHECKING([for rep-gtk libglade wrapper])
if REP_GTK_DONT_INITIALIZE=1 rep --batch -l libglade 2>&5; then
AC_MSG_RESULT([yes])
add_subdir "themer"
else
AC_MSG_RESULT([no])
AC_MSG_WARN([Can't load rep's libglade wrapper, not building themer])
fi
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=maybe])
if test "$enable_gnome_widgets" != "no"; then
AC_MSG_CHECKING([for rep-gtk GNOME wrappers])
if REP_GTK_DONT_INITIALIZE=1 rep --batch -l gnomeui -l gdk-pixbuf -l gnome-canvas-pixbuf 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, otherwise compile dlmalloc.c
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 dlmalloc is broken on Tru64, and may be broken on some
dnl solaris platforms
case ${host} in
*-dec-osf*)
AC_DEFINE(LIBC_MALLOC)
;;
*-sparc-sun*)
AC_DEFINE(LIBC_MALLOC)
;;
*)
LIBOBJS="${LIBOBJS} dlmalloc.o"
AC_DEFINE(DOUG_LEA_MALLOC)
;;
esac
else
AC_DEFINE(DOUG_LEA_MALLOC)
AC_DEFINE(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=`(gnome-config --prefix) 2>/dev/null`
if test $? -ne 0; then
with_gnome_prefix='${prefix}'
fi
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(sawfishdir)
AC_SUBST(sawfishexecdir)
AC_SUBST(lispdir)
AC_SUBST(localedir)
AC_SUBST(HAVE_X11)
AC_SUBST(LIBOBJS)
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)
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:
|