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 [ --disable-exportpng Disable PNG export.],
50 if test $enableval = "yes"; then
60 dnl --with-maxfiles : sets maximum number of simultaneous loaded files
62 [ --with-maxfiles Maximum number of simultaneous loaded files (default 20).],
63 AC_DEFINE_UNQUOTED(MAX_FILES, $withval),
64 AC_DEFINE(MAX_FILES, 20)
67 dnl --enable-unit-mm : Set default unit for coordinates in status bar to mm
68 AC_ARG_ENABLE(unit-mm,
69 [ --enable-unit-mm Set default unit for coordinates in status bar to mm],
71 if test $enableval = "yes"; then
75 if test "$default_unit" = "mm"; then
76 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MMS)
78 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MILS)
82 dnl Initialize automake stuff (?)
83 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
85 dnl Create a configuration header
86 AM_CONFIG_HEADER(config.h)
88 dnl Build time sanity check... (?)
91 dnl Initialize maintainer mode (?)
94 dnl Checks for programs.
101 if test "$guile_in_use" = "yes" ; then
104 dnl Check that scm_make_real exist
105 AC_CHECK_LIB(guile, scm_make_real,,
106 AC_MSG_ERROR(**Upgrade Guile** At least version >= 1.4),
109 dnl Restore LIBS. Apperantly AC_CHECK_LIB destroys it.
116 dnl Change default location of gtk-config
117 AC_ARG_WITH(gtk-config, [ --with-gtk-config=path Change where gtk-config is located], [opt_gtkconfig=$withval])
119 if eval "test x$opt_gtkconfig != x" ; then
121 if test ! -r "$opt_gtkconfig"; then
123 AC_MSG_ERROR(Cannot find $opt_gtkconfig -- be sure that this pathname is correct)
126 GTK_CONFIG=$opt_gtkconfig
129 AM_PATH_GTK(1.2.3,,AC_MSG_ERROR([*** GTK+ >= 1.2.3 not installed - please install first ***]))
132 if test $GTK_CONFIG = "no"; then
133 AC_MSG_ERROR(Cannot find gtk-config -- be sure that gtk >= 0.99.7 is installed)
136 GTK_LIBS="`$GTK_CONFIG --libs`"
137 GTK_CFLAGS="`$GTK_CONFIG --cflags`"
139 dnl Why do I have to set prefix?
140 if eval "test x$prefix = xNONE"; then
141 prefix=$ac_default_prefix
145 if test "$exportpng" = "yes" ; then
147 AC_CHECK_LIB(png, png_write_info,,
148 AC_MSG_ERROR(*** Must have libpng to get export-png to work))
156 dnl This is because I can unquote only once. Should be $datadir/gerbv/scheme
157 if test -z "$opt_backend_dir"; then
158 if eval "test $datadir = '${prefix}/share'"; then
159 opt_backend_dir="$prefix/share/gerbv/scheme"
161 opt_backend_dir="$datadir/gerbv/scheme"
165 AC_DEFINE_UNQUOTED(BACKEND_DIR, "$opt_backend_dir")
166 BACKEND_DIR="$opt_backend_dir"
168 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
170 AC_CHECK_HEADERS(unistd.h getopt.h string.h malloc.h)
172 AC_CHECK_FUNCS(getopt_long)
181 AC_SUBST(GUILE_CFLAGS)
182 AC_SUBST(GUILE_LDFLAGS)
184 AC_SUBST(GDK_PIXBUF_CFLAGS)
185 AC_SUBST(GDK_PIXBUF_LIBS)
188 AC_SUBST(BACKEND_DIR)
190 AC_OUTPUT( Makefile \