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
69 dnl --enable-exportpng
70 AC_ARG_ENABLE(exportpng,
71 [ --disable-exportpng Disable PNG export.],
73 if test $enableval = "yes"; then
75 AC_DEFINE(EXPORT_PNG,,[Support for export of PNG's])
80 AC_DEFINE(EXPORT_PNG,,[Support for export of PNG's])
83 dnl --with-maxfiles : sets maximum number of simultaneous loaded files
85 [ --with-maxfiles Maximum number of simultaneous loaded files (default 20).],
86 AC_DEFINE_UNQUOTED(MAX_FILES, $withval,[Maximum number of simultaneous loaded files]),
87 AC_DEFINE(MAX_FILES, 20, [Maximum number of simultaneous loaded files])
90 dnl --enable-unit-mm : Set default unit for coordinates in status bar to mm
91 AC_ARG_ENABLE(unit-mm,
92 [ --enable-unit-mm Set default unit for coordinates in status bar to mm],
94 if test $enableval = "yes"; then
98 if test "$default_unit" = "mm"; then
99 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MMS, [Default unit to display in statusbar])
101 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MILS, [Default unit to display in statusbar])
106 ############################################################
109 ############################################################
112 dnl Build time sanity check... (?)
116 dnl Checks for programs.
121 # if we have gcc then add -Wall
122 if test "x$GCC" = "xyes"; then
123 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
124 CFLAGS="$CFLAGS -Wall"
130 ############################################################
132 ############################################################
137 # Check for pkg-config
138 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
139 if test "$PKG_CONFIG" = "no"; then
140 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
143 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0, , [AC_MSG_ERROR([
144 *** GTK+-2.0 not installed - please install first ***
145 Please review the following errors:
149 GTK_VER=`$PKG_CONFIG gtk+-2.0 --modversion`
153 ############################################################
155 ############################################################
160 PKG_CHECK_MODULES(CAIRO, cairo >= 1.0.0, , [AC_MSG_ERROR([
161 *** Cairo is not installed - please install first ***
162 Please review the following errors:
166 CAIRO_VER=`$PKG_CONFIG cairo --modversion`
170 ############################################################
172 ############################################################
177 if test "$exportpng" = "yes" ; then
178 AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config], [notfound])
179 if test "$LIBPNG_CONFIG" = "notfound" ; then
180 AC_ERROR([You have requested png export but libpng-config could not be found. You may
181 build $PACKAGE without png support by using --disable-exportpng])
184 AC_MSG_CHECKING([for libpng cflags])
185 PNG_CFLAGS="`$LIBPNG_CONFIG --cflags`"
186 AC_MSG_RESULT([$PNG_CFLAGS])
188 AC_MSG_CHECKING([for libpng libs])
189 PNG_LIBS="`$LIBPNG_CONFIG --libs`"
190 AC_MSG_RESULT([$PNG_LIBS])
191 dnl AC_CHECK_LIB($PNG_LIBS, png_write_info,,
192 dnl AC_MSG_ERROR(*** Must have libpng to get export-png to work))
202 ############################################################
204 #AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Program version])
206 AC_CHECK_HEADERS(unistd.h getopt.h string.h sys/mman.h sys/types.h sys/stat.h stdlib.h regex.h libgen.h)
208 AC_CHECK_FUNCS(getopt_long)
211 AC_SUBST(OTHERPATHSEP)
213 AC_SUBST(GDK_PIXBUF_CFLAGS)
214 AC_SUBST(GDK_PIXBUF_LIBS)
218 AC_SUBST(WIN32_CFLAGS)
220 ############################################################
222 # scheme configure stuff
225 AC_DEFINE([STANDALONE], [0],[Scheme interpreter not used standalone])
226 AC_DEFINE([USE_DL],[1],[Dynamic linking in Scheme interpreter])
227 AC_DEFINE([SUN_DL],[1],[DL Sun method])
228 AC_DEFINE([USE_MATH],[1],[Math in Scheme interpreter])
229 AC_DEFINE([USE_ASCII_NAMES],[1],[ASCII names in Scheme interpreter])
230 AC_DEFINE([USE_COLON_HOOKS],[1],[Colon Hooks in Scheme interpreter])
231 AC_DEFINE([USE_STRING_HOOKS],[1],[String Hooks in Scheme interpreter])
232 AC_DEFINE([USE_INTERFACE],[1],[Use extension interface of Scheme interpreter])
236 ############################################################
238 AC_OUTPUT( Makefile \
240 doc/PNG-print/Makefile \
244 example/eaglecad1/Makefile \
245 example/nollezappare/Makefile \
246 example/numpres/Makefile \
247 example/jj/Makefile \
248 example/dan/Makefile \
249 example/ekf2/Makefile \
250 example/am-test/Makefile \
251 example/cslk/Makefile \
252 example/orcad/Makefile \
253 example/Mentor-BoardStation/Makefile \
261 ** Configuration summary for $PACKAGE $VERSION: