Add option "drill-copper" to draw / not draw drill holes in the copper
[geda-pcb/gde.git] / configure.ac
blobdf911649f120c37a396eee37a48cf10923671c15
1 dnl $Id$
2 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(src/draw.c)
5 AM_INIT_AUTOMAKE(pcb, 1.99v)
6 AM_CONFIG_HEADER(config.h)
8 AM_MAINTAINER_MODE
10 dnl determine host type
11 AC_CANONICAL_HOST
12 AC_MSG_CHECKING(for windows)
13 PCB_PATH_DELIMETER=":"
14 PCB_DIR_SEPARATOR_S="/"
15 PCB_DIR_SEPARATOR_C='/'
16 case $host in
17         *-*-cygwin* )
18                 CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}"
19                 CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}"
20                 ;;
22         *-*-mingw* )
23                 WIN32=yes
24                 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
25                 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}"
26                 ;;
28         * )
29                 WIN32=no
30                 ;;
31 esac
33 AC_MSG_RESULT($WIN32)
34 AC_SUBST(WIN32)
35 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
36 if test "x$WIN32" = "xyes" ; then
37         PCB_PATH_DELIMETER=";"
38         PCB_DIR_SEPARATOR_S="\\\\"
39         PCB_DIR_SEPARATOR_C='\\'
42 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char])
43 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string])
44 AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string])
47 dnl Checks for programs.
48 AC_PROG_CC
49 AC_C_INLINE
50 AC_PROG_CC_STDC
51 AM_PROG_CC_C_O
52 AC_PROG_CPP
53 AC_PROG_AWK
55 AM_PROG_LEX
56 AC_PATH_PROG(LEX_PATH, $LEX, [notfound])
57 if test "$LEX_PATH" = "notfound" ; then
58         AC_MSG_ERROR([Couldn't find a usable lex program.
59 Please install flex which is available from
60 ftp://ftp.gnu.org/pub/non-gnu/flex/
65 AC_PROG_YACC
66 AC_PATH_PROG(YACC_PATH, $YACC, [notfound])
67 if test "$YACC_PATH" = "notfound" ; then
68         AC_MSG_ERROR([Couldn't find a usable yacc program.
69 Please install bison which is available from
70 ftp://ftp.gnu.org/pub/gnu/bison/
74 AC_PROG_INSTALL
75 AC_PROG_RANLIB
78 # Used for building the win32 icons.
80 AC_PATH_PROG(TGIF, tgif, notfound)
81 AM_CONDITIONAL(MISSING_TGIF, test x$TGIF = xnotfound)
82 AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound)
83 AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound)
84 AM_CONDITIONAL(MISSING_XPMTOPPM, test x$PPMTOWINICON = xnotfound -o x$XPMTOPPM = xnotfound)
85 AC_PATH_PROG(CONVERT, convert, notfound)
86 AM_CONDITIONAL(MISSING_CONVERT, test x$CONVERT = xnotfound)
88 docs_yesno=yes
90 AC_MSG_CHECKING([if the documentation should be built])
91 AC_ARG_ENABLE([doc],
92 [  --enable-doc            Build and install the documentation [[default=yes]]],
94 if test "X$enable_doc" = "Xno" ; then
95         DOC=""
96         AC_MSG_RESULT([no])
97         docs_yesno=no
98 else
99         DOC=doc
100         AC_MSG_RESULT([yes])
101         docs_yesno=yes
105 DOC=doc
106 AC_MSG_RESULT([yes])
107 docs_yesno=yes
109 AC_SUBST(DOC)
111 if test "X$docs_yesno" = "Xyes" -a "X$USE_MAINTAINER_MODE" = "Xyes" ; then
112         AC_CHECK_PROGS(MKINFO, makeinfo, notfound)
113         if test "X$MKINFO" = "Xnotfound"; then
114                         AC_MSG_ERROR([You have requested a maintainer-mode build and a build
115 of the documentation.  For this to work, you must have version 4.6 or newer of
116 the GNU texinfo package.
118         fi
119    AC_MSG_CHECKING([for makeinfo version 4.6 or newer])
120    v=`$MKINFO --version | grep "GNU texinfo"`
121    if test $? -ne 0 ; then
122                 v=notfound
123    fi
125         case " $v " in
126                 *\ 4.[[6-9]]\ *)
127                         AC_MSG_RESULT([yes])
128                         ;;
130                 *)
131                         AC_MSG_RESULT([no])
132                         AC_MSG_ERROR([You have requested a maintainer-mode build and a build
133 of the documentation.  For this to work, you must have version 4.6 or newer of
134 the GNU texinfo package.  You seem to have
139                         ;;
140         esac
142         AC_PATH_PROG(PERL, perl, notfound)
143         if test "X$PERL" = "Xnotfound"; then
144                         AC_MSG_ERROR([You have requested a maintainer-mode build and a build
145 of the documentation.  For this to work, you must have perl installed.
147         fi
150 # FIXME:  for now, only try to add -rdynamic if we're using gcc.  We really
151 # need to figure out what the correct test is here.  In the mean time, this
152 # should let things build with SunPRO again.
153 if test "x$GCC" = "xyes"; then
154 AC_MSG_CHECKING([If the compiler accepts -rdynamic])
155 old_LDFLAGS="$LDFLAGS"
156 LDFLAGS="$LDFLAGS -rdynamic"
157 AC_LINK_IFELSE([int main(){}],
158         [AC_MSG_RESULT([yes])],
159         [LDFLAGS="$old_LDFLAGS"
160         AC_MSG_RESULT([no])
161         ])
164 # ------------- HID config -------------------
166 hid_guis=""
167 hid_printers=""
168 hid_exporters=""
169 hid_always=""
171 for hid in `cd $srcdir/src/hid; echo *`; do
172     F=$srcdir/src/hid/$hid/hid.conf
173     if test -f $F 
174     then
175     echo checking $F
176         . $F
177         case $type in
178           gui ) hid_guis="$hid_guis $hid" ;;
179           printer ) hid_printers="$hid_printers $hid" ;;
180           export ) hid_exporters="$hid_exporters $hid" ;;
181           always ) hid_always="$hid_always $hid" ;;
182         esac
183     fi
184 done
186 AC_MSG_CHECKING([for which gui to use])
187 AC_ARG_WITH([gui],
188 [  --with-gui=            Specify the GUI to use: batch gtk lesstif [[default=gtk]]],
190 [with_gui=gtk]
192 AC_MSG_RESULT([$with_gui])
193 case " $hid_guis no none " in
194      *\ $with_gui\ * ) HIDLIST="$with_gui" ;;
195      * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;;
196 esac
198 if test x"$with_gui" = x"none" -o x"$with_gui" = x"no"
199 then
200     HIDLIST=
203 AC_MSG_CHECKING([for whether to use DBUS])
204 AC_ARG_ENABLE([dbus],
205 [  --enable-dbus           Enable DBUS IPC],
206 [],[enable_dbus=no])
208 AC_MSG_RESULT([$enable_dbus])
209 AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes)
211 if test "x$enable_dbus" = "xyes"; then
212         case " $with_gui " in
213                 *\ gtk\ *) ;;
214                 *\ lesstif\ *) ;;
215                 * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID.
216 Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.])
217         esac
218         
219         # Check for pkg-config
220         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
221         if test "$PKG_CONFIG" = "no"; then
222                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
223         fi
225         PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61, , 
226                 [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure
227 Please review the following errors:
228 $DBUS_PKG_ERRORS])]
229         )
230         DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
231         
232         AC_DEFINE([HAVE_DBUS], 1,
233                 [Define to 1 if DBUS IPC is to be compiled in])
237 AC_MSG_CHECKING([for which printer to use])
238 AC_ARG_WITH([printer],
239 [  --with-printer=        Specify the printer: lpr [[default=lpr]]],
240 [],[with_printer=lpr])
241 AC_MSG_RESULT([$with_printer])
242 case " $hid_printers " in
243      *\ $with_printer\ * )
244          HIDLIST="$HIDLIST $with_printer"
245          ;;
246      * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;;
247 esac
249 AC_MSG_CHECKING([for which exporters to use])
250 AC_ARG_WITH([exporters],
251 [  --with-exporters=       Enable export devices: bom gerber nelma png ps [[default=bom gerber nelma png ps]]],
252 [],[with_exporters=$hid_exporters])
253 AC_MSG_RESULT([$with_exporters])
254 for e in `echo $with_exporters | sed 's/,/ /g'`; do
255     case " $hid_exporters " in
256       *\ $e\ * )
257          HIDLIST="$HIDLIST $e"
258          ;;
259       * ) AC_MSG_ERROR([$e is not a valid exporter]) ;;
260     esac
261 done
263 if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then
264         case " ${HIDLIST} " in
265                 *\ png\ *)
266                         AC_MSG_ERROR([you have requested the png HID but turned off all output
267 formats!  If you do not want gif/jpeg/png output, use --with-exporters to list
268 which exporters you want and do not list png there.])
269                         ;;
271                 *)
272                         ;;
273         esac
276 for e in $HIDLIST; do
277     HIDLIBS="$HIDLIBS lib$e.a"
278 done
280 AC_SUBST(HIDLIST)
281 AC_SUBST(HIDLIBS)
283 # ------------- end HID config -------------------
285 AC_PATH_PROGS(M4, gm4 m4, [none])
286 if test "X$M4" = "Xnone" ; then
287         AC_MSG_ERROR([Did not find a m4 executible.  You need to make sure
288         that m4 is installed on your system and that m4 is in your path])
290 AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug])
291 pcb_m4_r=`echo "eval(-2/2)" | $M4`
292 if test "$pcb_m4_r" != "-1" ; then
293         AC_MSG_RESULT([yes])
294         AC_MSG_ERROR([It appears that $M4 has a bug involving division
295 with negative numbers.  In particular it just returned the result that
296 -2/2 = $pcb_m4_r instead of -1.  This is a known bug in GNU m4-1.4.9.  Please
297 install a non-broken m4.])
298 else
299         AC_MSG_RESULT([no])
303 AC_PATH_PROGS(WISH, wish wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
304 if test "X$WISH" = "Xnone" ; then
305         AC_MSG_ERROR([Did not find the wish executible.  You need to make sure
306         that tcl is installed on your system and that wish is in your path])
309 AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
310 GNUM4=$M4
311 AC_SUBST(GNUM4)
312 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
314 AC_CHECK_PROGS(LATEX, latex, notfound)
315 AM_CONDITIONAL(MISSING_LATEX, test x$LATEX = xnotfound)
317 AC_CHECK_PROGS(PDFLATEX, pdflatex, notfound)
318 AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound)
320 AC_CHECK_PROGS(DVIPS, dvips, notfound)
321 AM_CONDITIONAL(MISSING_DVIPS, test x$DVIPS = xnotfound)
323 AC_CHECK_PROGS(PS2PDF, ps2pdf, notfound)
324 AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound)
326 dnl Checks for libraries.
327 AC_CHECK_LIB(m, sqrt)
328 AC_CHECK_LIB(dl, dlopen)
329 AC_CHECK_LIB(xnet, gethostbyname)
330 AC_CHECK_LIB(fl, yywrap)
331 AC_CHECK_FUNCS(strerror)
332 AC_CHECK_FUNCS(regcomp re_comp)
333 AC_CHECK_FUNCS(logf expf rint)
334 AC_CHECK_FUNCS(vsnprintf)
335 AC_CHECK_FUNCS(getpwuid gethostname getcwd)
336 AC_CHECK_FUNCS(random)
337 AC_CHECK_FUNCS(stat)
339 # normally used for all file i/o
340 AC_CHECK_FUNCS(popen)
342 # for lrealpath.c
343 AC_CHECK_FUNCS(realpath canonicalize_file_name)
344 libiberty_NEED_DECLARATION(canonicalize_file_name)
346 AC_HEADER_STDC
347 AC_CHECK_HEADERS(limits.h string.h sys/types.h regex.h pwd.h)
348 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h)
349 AC_CHECK_HEADERS(dlfcn.h)
351 if test "x${WIN32}" = "xyes" ; then
352         AC_CHECK_HEADERS(windows.h)
355 for e in $HIDLIST; do
356     case $e in
357       lesstif )
358         AC_PATH_XTRA
359         CPPFLAGS="$CFLAGS $X_CFLAGS"
360         AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
361         AC_CHECK_LIB(ICE, main, , , $X_LIBS)
362         AC_CHECK_LIB(SM, main, , , $X_LIBS)
363         AC_CHECK_LIB(Xext, main, , , $X_LIBS)
364         AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
365         AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
366         AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
367         AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS)
368         case $ac_cv_lib_Xm_XmCreateMainWindow in
369           no )
370             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
371             ;;
372           * ) ;;
373         esac
374         AC_CHECK_HEADERS(Xm/Xm.h)
375         case $ac_cv_header_Xm_Xm_h in
376           no )
377             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
378             ;;
379           * ) ;;
380         esac
381         ;;
383       gtk )
384         # Check for pkg-config
385         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
386         if test "$PKG_CONFIG" = "no"; then
387                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
388         fi
390         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0, , 
391                 [AC_MSG_ERROR([Cannot find gtk+ >= 2.4.0, install it and rerun ./configure
392 Please review the following errors:
393 $GTK_PKG_ERRORS])]
394         )
395         GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
396         
397         # if we are building for gtk >= 2.8.0, we can use gdk_display_warp_pointer()
398         # otherwise we need XWarpPointer and we'll pull in the required headers with
399         # gdk/gdkx.h and we'll need to link with X11
400         if ! $PKG_CONFIG gtk+-2.0 --atleast-version=2.8.0 ; then
401                 CPPFLAGS="$CFLAGS $GTK_CFLAGS"
402                 AC_CHECK_HEADERS([gdk/gdkx.h])
403         fi
405         # Search for glib
406         PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.4.0, , 
407                 [AC_MSG_ERROR([Cannot find glib >= 2.4.0, install it and rerun ./configure.
408 Please review the following errors:
409 $GLIB_PKG_ERRORS])]
410         )
411         GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
412         ;;
414       nelma|png )
415         # Check for gdlib-config for gd (www.boutell.com/gd)
416         AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no)
417         if test "$GDLIB_CONFIG" = "no"; then
418                 AC_MSG_RESULT([Cannot find gdlib-config.
419 Make sure it is installed and in your PATH.
420 gdlib-config is part of the GD library available from www.boutell.com/gd.
421 This is needed for the png HID.  I will look for libgd anyway and maybe
422 you will get lucky.
424                 if test "$WIN32" != "yes" ; then
425                         AC_CHECK_LIB(gd,main,,
426                         AC_MSG_ERROR([You have requested the nelma and/or png HID  but -lgd could not be found]))
427                 else 
428                         AC_CHECK_LIB(bgd,main,,
429                         AC_MSG_ERROR([You have requested the nelma and/or png HID  but -lbgd could not be found]))
430                 fi
431         else
432                 if test "$WIN32" = "yes" ; then
433                         GD=bgd
434                 else
435                         GD=gd
436                 fi
437                 AC_MSG_CHECKING([for libgd cflags])
438                 GD_CFLAGS="`$GDLIB_CONFIG --cflags`"
439                 AC_MSG_RESULT([$GD_CFLAGS])
440                 AC_MSG_CHECKING([for libgd libs])
441                 GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}"
442                 AC_MSG_RESULT([$GD_LIBS])
443         fi
444    
445         # since some linux systems evidently install gdlib-config but fail to
446         # install the headers (nice), check for the header too and fail if it
447         # is not there.
448         CFLAGS="$CFLAGS $GD_CFLAGS"
449         CPPFLAGS="$CPPFLAGS $GD_CFLAGS"
450         AC_CHECK_HEADERS(gd.h)
451         case $ac_cv_header_gd_h in
452              no )
453                 AC_MSG_ERROR([
454 You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd.
455 This is needed for the nelma and/or png HID.
457                 ;;
458              * ) ;;
459         esac
460         
461         # Some versions of gd (prior to the expiration of the
462         # patent related to gif compression) do not support
463         # gif output.  Check for that here.
464         save_LIBS="$LIBS"
465         LIBS="$save_LIBS $GD_LIBS $X_LIBS"
467         AC_MSG_CHECKING([if GIF output from the png HID is desired])
468         AC_ARG_ENABLE([gif],
469                 [  --disable-gif           Disable support for gif output when the png HID is used [[default=include gif support]]],
470                 [
471                 if test "X$enable_gif" != "Xno" ; then
472                         AC_MSG_RESULT([yes])
473                         with_gif=yes
474                 else
475                         AC_MSG_RESULT([no])
476                         with_gif=no
477                 fi
478                 ],
479                 [
480                 AC_MSG_RESULT([yes])
481                 with_gif=yes
482                 ])
483         if test "X$with_gif" = "Xyes" ; then
484                 AC_CHECK_FUNCS(gdImageGif)
485                 if test "$ac_cv_func_gdImageGif" != "yes"; then
486                         AC_MSG_ERROR([Your gd installation does not appear to include gif support.
487 You may need to update your installation of gd or disable
488 gif export with --disable-gif])
489                 fi
490         fi
492         AC_MSG_CHECKING([if JPEG output from the png HID is desired])
493         AC_ARG_ENABLE([jpeg],
494                 [  --disable-jpeg          Disable support for JPEG output when the png HID is used [[default=include JPEG support]]],
495                 [
496                 if test "X$enable_jpeg" != "Xno" ; then
497                         AC_MSG_RESULT([yes])
498                         with_jpeg=yes
499                 else
500                         AC_MSG_RESULT([no])
501                         with_jpeg=no
502                 fi
503                 ],
504                 [
505                 AC_MSG_RESULT([yes])
506                 with_jpeg=yes
507                 ])
508         if test "X$with_jpeg" = "Xyes" ; then
509                 AC_CHECK_FUNCS(gdImageJpeg)
510                 if test "$ac_cv_func_gdImageJpeg" != "yes"; then
511                         AC_MSG_ERROR([Your gd installation does not appear to include JPEG support.
512 You may need to update your installation of gd or disable
513 JPEG export with --disable-jpeg])
514                 fi
515         fi
518         AC_MSG_CHECKING([if PNG output from the png HID is desired])
519         AC_ARG_ENABLE([png],
520                 [  --disable-png           Disable support for PNG output when the png HID is used [[default=include PNG support]]],
521                 [
522                 if test "X$enable_png" != "Xno" ; then
523                         AC_MSG_RESULT([yes])
524                         with_png=yes
525                 else
526                         AC_MSG_RESULT([no])
527                         with_png=no
528                 fi
529                 ],
530                 [
531                 AC_MSG_RESULT([yes])
532                 with_png=yes
533                 ])
534         if test "X$with_png" = "Xyes" ; then
535                 AC_CHECK_FUNCS(gdImagePng)
536                 if test "$ac_cv_func_gdImagePng" != "yes"; then
537                         AC_MSG_ERROR([Your gd installation does not appear to include PNG support.
538 You may need to update your installation of gd or disable
539 PNG export with --disable-png])
540                 fi
541         fi
542         LIBS="$save_LIBS"
543         ;;
545     esac
546 done
549 AM_CONDITIONAL(PNG, test x$with_png = xyes)
550 AM_CONDITIONAL(GIF, test x$with_gif = xyes)
553 # ------------- dmalloc -------------------
554 dnl dmalloc checks
555 with_dmalloc=no
556 AC_MSG_CHECKING([if dmalloc debugging should be enabled])
557 AC_ARG_ENABLE([dmalloc],
558 [  --enable-dmalloc        Compile and link with dmalloc for malloc debugging [default=no]],
560 if test "X$enable_dmalloc" != "Xno" ; then
561         AC_MSG_RESULT([yes])
562         AC_CHECK_HEADER(dmalloc.h,,
563                 AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
564         AC_CHECK_LIB(dmalloc,main,,
565                 AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]))
566         DMALLOC_LIBS="-ldmalloc"
567         with_dmalloc=yes
568 else
569         AC_MSG_RESULT([no])
570         DMALLOC_LIBS=""
574         AC_MSG_RESULT([no])
575         DMALLOC_LIBS=""
578 # ------------- ElectricFence -------------------
579 dnl ElectricFence checks
580 with_efence=no
581 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
582 AC_ARG_ENABLE([efence],
583 [  --enable-efence         Link with ElectricFence for malloc debugging [default=no]],
585 if test "X$enable_efence" != "Xno" ; then
586         AC_MSG_RESULT([yes])
587         AC_CHECK_LIB(efence,main,,
588                 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
589         with_efence=yes
590 else
591         AC_MSG_RESULT([no])
595 AC_MSG_RESULT([no])
598 CFLAGS="$CFLAGS $X_CFLAGS $DBUS_CFLAGS $GTK_CFLAGS"
599 LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS"
602 # if we have gcc then add -Wall
603 if test "x$GCC" = "xyes"; then
604         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
605                 CFLAGS="$CFLAGS -Wall"
606         fi
610 # font filename
611 FONTFILENAME=${FONTFILENAME:-"default_font"}
612 AC_SUBST(FONTFILENAME)
613 AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
615 # standard autoconf variables
616 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
617 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
618 CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\""
620 # directory for old-style library and for fonts
621 PCBLIBDIR=${datadir}/pcb
622 AC_SUBST(PCBLIBDIR)
623 #AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
624 CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
626 # name for old-style library
627 LIBRARYFILENAME=pcblib
628 AC_SUBST(LIBRARYFILENAME)
629 AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
632 # directory for new library
633 PCBTREEDIR=${datadir}/pcb/newlib
634 PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib
635 PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
636 AC_SUBST(PCBTREEDIR)
637 AC_SUBST(PCBTREEPATH)
638 #AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
639 CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
640 CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\""
642 # Figure out relative paths
643 AC_MSG_CHECKING([for the bindir to pcblibdir relative path])
644 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir])
645 adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S])
646 AC_MSG_RESULT([$bindir_to_pcblibdir])
647 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir])
649 AC_MSG_CHECKING([for the bindir to pcbtreedir relative path])
650 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir])
651 adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S])
652 AC_MSG_RESULT([$bindir_to_pcbtreedir])
653 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir])
656 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
657 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
658 adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S])
659 AC_MSG_RESULT([$bindir_to_execprefix])
660 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
663 BTNMOD=${BTNMOD:-"Mod1"}
664 AC_SUBST(BTNMOD)
666 TOPDIRS=
667 for dir in src lib newlib doc example tools tutorial README_FILES
669    test -d $dir/. && TOPDIRS="$TOPDIRS $dir"
670 done
671 AC_SUBST(TOPDIRS)
673 AC_CONFIG_FILES(Makefile)
674 if test -d $srcdir/README_FILES; then
675    AC_CONFIG_FILES(README_FILES/Makefile)
677 if test -d $srcdir/doc; then
678    AC_CONFIG_FILES(doc/Makefile)
680 if test -d $srcdir/example; then
681    AC_CONFIG_FILES(example/Makefile)
682    AC_CONFIG_FILES(example/libraries/Makefile)
684 if test -d $srcdir/lib; then
685    AC_CONFIG_FILES(lib/CreateLibraryContents.sh)
686    AC_CONFIG_FILES(lib/CreateLibrary.sh)
687    AC_CONFIG_FILES(lib/ListLibraryContents.sh)
688    AC_CONFIG_FILES(lib/Makefile)
689    AC_CONFIG_FILES(lib/QueryLibrary.sh)
690    AC_CONFIG_FILES(lib/m4lib_to_newlib.sh)
691    AC_CONFIG_FILES(lib/qfp-ui)
693 if test -d $srcdir/newlib; then
694    AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile)
695    AC_CONFIG_FILES(newlib/Makefile)
696    AC_CONFIG_FILES(newlib/analog-devices/Makefile)
697    AC_CONFIG_FILES(newlib/burr-brown/Makefile)
698    AC_CONFIG_FILES(newlib/connectors/Makefile)
699    AC_CONFIG_FILES(newlib/crystal/Makefile)
700    AC_CONFIG_FILES(newlib/electro-optics/Makefile)
701    AC_CONFIG_FILES(newlib/headers/Makefile)
702    AC_CONFIG_FILES(newlib/msp430/Makefile)
703    AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile)
704    AC_CONFIG_FILES(newlib/sockets/Makefile)
705    AC_CONFIG_FILES(newlib/tests/Makefile)
707 AC_CONFIG_FILES(src/Makefile)
708 AC_CONFIG_FILES(src/icons/Makefile)
709 if test -d $srcdir/tools; then
710    AC_CONFIG_FILES(tools/Makefile)
712 if test -d $srcdir/tutorial; then
713    AC_CONFIG_FILES(tutorial/Makefile)
716 AC_CONFIG_FILES(win32/Makefile)
718 AC_OUTPUT
720 with_gui=`echo $with_gui`
721 with_printer=`echo $with_printer`
722 with_exporters=`echo $with_exporters | sed 's/,/ /g'`
724 AC_MSG_RESULT([
725 ** Configuration summary for $PACKAGE $VERSION:
727    GUI:                      $with_gui
728    Printer:                  $with_printer
729    Exporters:                $with_exporters
730    Build documentation:      $docs_yesno
731    dmalloc debugging:        $with_dmalloc
732    ElectricFence debugging:  $with_efence
733    CPPFLAGS:                 $CPPFLAGS
734    CFLAGS:                   $CFLAGS
735    LIBS:                     $LIBS