1 dnl configuration script for gerbv
3 dnl gEDA - GNU Electronic Design Automation
4 dnl This file is part of gerbv.
6 dnl Copyright (C) 2000-2001 Stefan Petersen (spe@stacken.kth.se)
10 dnl This program is free software; you can redistribute it and/or modify
11 dnl it under the terms of the GNU General Public License as published by
12 dnl the Free Software Foundation; either version 2 of the License, or
13 dnl (at your option) any later version.
15 dnl This program is distributed in the hope that it will be useful,
16 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 dnl GNU General Public License for more details.
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with this program; if not, write to the Free Software
22 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
31 dnl --enable-batch : turn on guile/batch support
33 [ --enable-batch Enable batch support (ie use Guile).],
35 if test $enableval = "yes"; then
37 AC_DEFINE(GUILE_IN_USE)
41 dnl --with-backend-dir : tells where to store global backends if != default
42 AC_ARG_WITH(backend-dir,
43 [ --with-backend-dir Where to store backends if != default.],
44 opt_backend_dir=$withval)
46 dnl --enable-exportpng
47 AC_ARG_ENABLE(exportpng,
48 [ --enable-exportpng Enable PNG export (needs gdk-pixbuf and libpng).],
54 dnl Initialize automake stuff (?)
55 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
57 dnl Create a configuration header
58 AM_CONFIG_HEADER(config.h)
60 dnl Build time sanity check... (?)
63 dnl Initialize maintainer mode (?)
66 dnl Checks for programs.
73 if test "$guile_in_use" = "yes" ; then
76 dnl Check that scm_make_real exist
77 AC_CHECK_LIB(guile, scm_make_real,,
78 AC_MSG_ERROR(**Upgrade Guile** At least version >= 1.4),
81 dnl Restore LIBS. Apperantly AC_CHECK_LIB destroys it.
88 dnl Change default location of gtk-config
89 AC_ARG_WITH(gtk-config, [ --with-gtk-config=path Change where gtk-config is located], [opt_gtkconfig=$withval])
91 if eval "test x$opt_gtkconfig != x" ; then
93 if test ! -r "$opt_gtkconfig"; then
95 AC_MSG_ERROR(Cannot find $opt_gtkconfig -- be sure that this pathname is correct)
98 GTK_CONFIG=$opt_gtkconfig
101 AM_PATH_GTK(1.2.3,,AC_MSG_ERROR([*** GTK+ >= 1.2.3 not installed - please install first ***]))
104 if test $GTK_CONFIG = "no"; then
105 AC_MSG_ERROR(Cannot find gtk-config -- be sure that gtk >= 0.99.7 is installed)
108 GTK_LIBS="`$GTK_CONFIG --libs`"
109 GTK_CFLAGS="`$GTK_CONFIG --cflags`"
111 dnl Why do I have to set prefix?
112 if eval "test x$prefix = xNONE"; then
113 prefix=$ac_default_prefix
117 if test "$exportpng" = "yes" ; then
119 AC_CHECK_LIB(png, png_write_info,,
120 AC_MSG_ERROR(*** Must have libpng to get export-png to work))
128 dnl This is because I can unquote only once. Should be $datadir/gerbv/scheme
129 if test -z "$opt_backend_dir"; then
130 if eval "test $datadir = '${prefix}/share'"; then
131 opt_backend_dir="$prefix/share/gerbv/scheme"
133 opt_backend_dir="$datadir/gerbv/scheme"
137 AC_DEFINE_UNQUOTED(BACKEND_DIR, "$opt_backend_dir")
138 BACKEND_DIR="$opt_backend_dir"
140 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
142 AC_CHECK_HEADERS(unistd.h getopt.h string.h)
144 AC_CHECK_FUNCS(getopt_long)
153 AC_SUBST(GUILE_CFLAGS)
154 AC_SUBST(GUILE_LDFLAGS)
156 AC_SUBST(GDK_PIXBUF_CFLAGS)
157 AC_SUBST(GDK_PIXBUF_LIBS)
160 AC_SUBST(BACKEND_DIR)
162 AC_OUTPUT( Makefile \