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
27 dnl Initialize automake
28 AM_INIT_AUTOMAKE(gerbv, 1.1.0-pre)
30 dnl Create a configuration header
31 AM_CONFIG_HEADER(config.h)
33 dnl Initialize maintainer mode
36 ############################################################
38 # Checks for cygwin/mingw32
44 # if you want -mno-cygwin, then add it to MINGW_CFLAGS or CYGWIN_CFLAGS
45 # in your configure environment. After all you may or may not
46 # want to always force -mno-cygwin on all users.
49 CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}"
50 CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}"
54 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
55 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}"
62 ############################################################
64 ############################################################
66 # Checks for our configure args
72 [ --enable-debug Enable fairly verbose debug output],
74 if test $enableval = "yes"; then
81 AC_DEFINE_UNQUOTED(DEBUG, $debug, [Define to 1 to enable debugging code])
83 dnl --enable-exportpng
84 AC_ARG_ENABLE(exportpng,
85 [ --disable-exportpng Disable PNG export.],
87 if test $enableval = "yes"; then
89 AC_DEFINE(EXPORT_PNG,,[Support for export of PNG's])
94 AC_DEFINE(EXPORT_PNG,,[Support for export of PNG's])
97 dnl --with-maxfiles : sets maximum number of simultaneous loaded files
99 [ --with-maxfiles Maximum number of simultaneous loaded files (default 20).],
100 AC_DEFINE_UNQUOTED(MAX_FILES, $withval,[Maximum number of simultaneous loaded files]),
101 AC_DEFINE(MAX_FILES, 20, [Maximum number of simultaneous loaded files])
104 dnl --enable-unit-mm : Set default unit for coordinates in status bar to mm
105 AC_ARG_ENABLE(unit-mm,
106 [ --enable-unit-mm Set default unit for coordinates in status bar to mm],
108 if test "$enableval" = "yes"; then
112 if test "$default_unit" = "mm"; then
113 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MMS, [Default unit to display in statusbar])
115 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MILS, [Default unit to display in statusbar])
121 [ --disable-cairo Disable the use of cairo for rendering],
123 if test "$enableval" = "yes"; then
133 AM_CONDITIONAL(USE_CAIRO, test x$use_cairo = xyes)
134 if test "$use_cairo" = "yes"; then
138 AC_DEFINE(RENDER_USING_GDK, 1, [Define to use gdk instead of cairo for rendering])
143 ############################################################
146 ############################################################
151 dnl Build time sanity check... (?)
154 dnl Checks for programs.
159 # if we have gcc then add -Wall
160 if test "x$GCC" = "xyes"; then
161 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
162 CFLAGS="$CFLAGS -Wall"
166 # Check for pkg-config
167 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
168 if test "$PKG_CONFIG" = "no"; then
169 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
175 ############################################################
177 ############################################################
186 ############################################################
188 ############################################################
190 # GTK and cairo checks
194 if test "$use_cairo" = "yes"; then
196 PKG_CHECK_MODULES(CAIRO, cairo >= 1.2.0, , [AC_MSG_ERROR([
197 *** Cairo > 1.2.0 required but not found. Please install first or if
198 you wish to use the old GDK rendering (with possible loss of some
199 functionality) then use the --disable-cairo argument to configure ***
200 Please review the following errors:
204 CAIRO_VER=`$PKG_CONFIG cairo --modversion`
209 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0, , [AC_MSG_ERROR([
210 *** GTK >= 2.4.0 is required but was not found. Please review
211 the following errors:
215 GTK_VER=`$PKG_CONFIG gtk+-2.0 --modversion`
219 ############################################################
222 ############################################################
227 if test "$exportpng" = "yes" ; then
228 AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config], [notfound])
229 if test "$LIBPNG_CONFIG" = "notfound" ; then
230 AC_ERROR([You have requested png export but libpng-config could not be found. You may
231 build $PACKAGE without png support by using --disable-exportpng])
234 AC_MSG_CHECKING([for libpng cflags])
235 PNG_CFLAGS="`$LIBPNG_CONFIG --cflags`"
236 AC_MSG_RESULT([$PNG_CFLAGS])
238 AC_MSG_CHECKING([for libpng libs])
239 PNG_LIBS="`$LIBPNG_CONFIG --ldflags`"
240 AC_MSG_RESULT([$PNG_LIBS])
241 dnl AC_CHECK_LIB($PNG_LIBS, png_write_info,,
242 dnl AC_MSG_ERROR(*** Must have libpng to get export-png to work))
252 ############################################################
255 AC_CHECK_HEADERS(unistd.h getopt.h string.h sys/mman.h sys/types.h sys/stat.h stdlib.h regex.h libgen.h)
257 AC_CHECK_FUNCS(getopt_long)
260 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS $PNG_CFLAGS $GTK_CFLAGS $CAIRO_CFLAGS $WIN32_CFLAGS"
261 LIBS="$GDK_PIXBUF_LIBS $PNG_LIBS $GTK_LIBS $CAIRO_LIBS"
264 ############################################################
266 # scheme configure stuff
269 AC_DEFINE([STANDALONE], [0],[Scheme interpreter not used standalone])
270 AC_DEFINE([USE_DL],[1],[Dynamic linking in Scheme interpreter])
271 AC_DEFINE([SUN_DL],[1],[DL Sun method])
272 AC_DEFINE([USE_MATH],[1],[Math in Scheme interpreter])
273 AC_DEFINE([USE_ASCII_NAMES],[1],[ASCII names in Scheme interpreter])
274 AC_DEFINE([USE_COLON_HOOKS],[1],[Colon Hooks in Scheme interpreter])
275 AC_DEFINE([USE_STRING_HOOKS],[1],[String Hooks in Scheme interpreter])
276 AC_DEFINE([USE_INTERFACE],[1],[Use extension interface of Scheme interpreter])
280 ############################################################
282 AC_OUTPUT( Makefile \
284 doc/PNG-print/Makefile \
288 example/eaglecad1/Makefile \
289 example/nollezappare/Makefile \
290 example/numpres/Makefile \
291 example/jj/Makefile \
292 example/dan/Makefile \
293 example/ekf2/Makefile \
294 example/am-test/Makefile \
295 example/cslk/Makefile \
296 example/orcad/Makefile \
297 example/Mentor-BoardStation/Makefile \
305 ** Configuration summary for $PACKAGE $VERSION:
312 GTK Version: $GTK_VER
313 Cairo Version: $CAIRO_VER
315 Rendering engine: $RENDERER