configure.ac: Remove CC_OR_CXX_FLAGS substitution from configure.ac
[geda-pcb/pcjc2.git] / configure.ac
blob6694f575133df56a62148d1eaa87915b6d69ddd8
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([pcb], [1.99z])
4 AC_CONFIG_SRCDIR([src/draw.c])
5 AC_PREREQ([2.60])
6 AM_INIT_AUTOMAKE([1.9])
7 AC_GNU_SOURCE
8 AM_CONFIG_HEADER([config.h])
10 ##########################################################################
12 # Try to figure out if we are building from git sources.
13 # If we are then unless building of the documentation has
14 # been disabled then just require the user have all the right
15 # tools.  Users building from a tarball won't need latex, makeinfo,
16 # etc. but if you're already downloading development sources, then
17 # it is not unreasonable to require development tools.  What motivated
18 # this is that using maintainer mode proved to cause regular confusion.
20 pcb_sources="tarball"
21 AC_MSG_CHECKING([if you are building from a git checkout])
22 pcb_git_version=no
23 if test -f $srcdir/.gitignore ; then
24         pcb_git_version=yes
25         AC_MSG_RESULT([yes])
26         pcb_sources="GIT"
27 else
28         AC_MSG_RESULT([no])
30 AM_CONDITIONAL(GIT_VERSION, test x$pcb_git_version = xyes)
32 AC_MSG_CHECKING([if you are building from a anoncvs checkout])
33 pcb_cvs_version=no
34 if test -f $srcdir/CVS/Root ; then
35         pcb_cvs_version=yes
36         AC_MSG_RESULT([yes])
37         pcb_sources="CVS"
38 else
39         AC_MSG_RESULT([no])
41 AM_CONDITIONAL(CVS_VERSION, test x$pcb_cvs_version = xyes)
42 AM_CONDITIONAL(GIT_OR_CVS_VERSION, test x$pcb_git_version = xyes -o x$pcb_cvs_version = xyes)
45 ##########################################################################
47 # See if we are supposed to build the docs
50 docs_yesno=yes
51 AC_MSG_CHECKING([if the documentation should be built])
52 AC_ARG_ENABLE([doc],
53 [  --enable-doc            Build and install the documentation [[default=yes]]],
55 if test "X$enable_doc" = "Xno" ; then
56         DOC=""
57         AC_MSG_RESULT([no])
58         docs_yesno=no
59 else
60         DOC=doc
61         AC_MSG_RESULT([yes])
62         docs_yesno=yes
66 DOC=doc
67 AC_MSG_RESULT([yes])
68 docs_yesno=yes
70 AC_SUBST(DOC)
73 AC_MSG_CHECKING([if maintainer mode is required])
74 if test "$docs_yesno" = "yes" -a "$pcb_git_version" = "yes" ; then
75         AC_MSG_RESULT([yes -- the documentation build is enabled and your sources are from git])
76         enable_maintainer_mode=yes
77 else
78         AC_MSG_RESULT([no])
81 AM_MAINTAINER_MODE
84 dnl determine host type
85 AC_CANONICAL_HOST
86 AC_MSG_CHECKING(for windows)
87 PCB_PATH_DELIMETER=":"
88 PCB_DIR_SEPARATOR_S="/"
89 PCB_DIR_SEPARATOR_C='/'
90 case $host in
91         *-*-mingw* )
92                 WIN32=yes
93                 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
94                 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS}"
95                 ;;
97         * )
98                 WIN32=no
99                 ;;
100 esac
102 AC_MSG_RESULT($WIN32)
103 AC_SUBST(WIN32)
104 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
105 if test "x$WIN32" = "xyes" ; then
106         PCB_PATH_DELIMETER=";"
107         PCB_DIR_SEPARATOR_S="\\\\"
108         PCB_DIR_SEPARATOR_C='\\'
111 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char])
112 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string])
113 AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string])
116 dnl Checks for programs.
117 AC_PROG_CC
118 AC_PROG_CXX
120 if test "x$WIN32" = "xyes" ; then
121         AC_CHECK_TOOL(WINDRES, windres, [no])
122         if test "$WINDRES" = "no" ; then
123                 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
124         fi
127 # i18n
128 GETTEXT_PACKAGE=$PACKAGE
129 AH_TEMPLATE([GETTEXT_PACKAGE], [Name of this program's gettext domain])
130 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"])
131 AC_SUBST(GETTEXT_PACKAGE)
133 AM_GNU_GETTEXT_VERSION([0.14])
134 AM_GNU_GETTEXT
135 IT_PROG_INTLTOOL([0.35.0])
137 AC_C_INLINE
138 AC_PROG_CC_STDC
139 AM_PROG_CC_C_O
140 AC_PROG_CPP
141 AC_PROG_AWK
142 AC_PROG_MKDIR_P
144 AM_PROG_LEX
145 AC_PATH_PROG(LEX_PATH, $LEX, [notfound])
146 if test "$LEX_PATH" = "notfound" ; then
147         AC_MSG_ERROR([Couldn't find a usable lex program.
148 Please install flex which is available from
149 ftp://ftp.gnu.org/pub/non-gnu/flex/
154 AC_PROG_YACC
155 AC_PATH_PROG(YACC_PATH, $YACC, [notfound])
156 if test "$YACC_PATH" = "notfound" ; then
157         AC_MSG_ERROR([Couldn't find a usable yacc program.
158 Please install bison which is available from
159 ftp://ftp.gnu.org/pub/gnu/bison/
163 AC_PROG_INSTALL
164 AC_PROG_RANLIB
167 # Used for building the icons
169 AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound)
170 AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound)
171 AC_PATH_PROG(CONVERT, convert, notfound)
173 ##########################################################################
176 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
177    AC_PATH_PROG(MKINFO, makeinfo, no)
178    if test "X$MKINFO" != "Xno"; then
179       AC_MSG_CHECKING([for GNU makeinfo version >= 4.6])
180       v=`$MKINFO --version | grep "GNU texinfo"`
181       if test $? -ne 0; then
182          AC_MSG_RESULT([non-GNU])
183          MKINFO="no"
184       fi
185    fi
186    if test "X$MKINFO" != "Xno"; then
187       vmajor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
188       vminor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
189       AC_MSG_RESULT([$vmajor.$vminor])
190       if test "$vmajor" -lt 4 \
191               || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then
192          MKINFO=no
193       fi
194    fi
195    if test "X$MKINFO" = "Xno"; then
196       AC_MSG_ERROR([You have requested a build
197 of the documentation.  For this to work, you must have version 4.6 or newer of
198 the GNU texinfo package.  You seem to have
202 Please update to a newer version of texinfo or disable building of
203 the documentation with --disable-doc
205    fi
207    AC_PATH_PROG(TEXI2DVI, texi2dvi, no)
208    if test "X$TEXI2DVI" = "Xno"; then
209       AC_MSG_ERROR([You have requested a build
210 of the documentation.  For this to work, you must have the texi2dvi program
211 installed.  Alternatively, you can disable building the documentation with
212 --disable-doc.])
213    fi
216         AC_PATH_PROG(PERL, perl, notfound)
217         if test "X$PERL" = "Xnotfound"; then
218                         AC_MSG_ERROR([You have requested a build
219 of the documentation.  For this to work, you must have perl installed.
220 Alternatively, you can disable building the documentation with
221 --disable-doc.
223         fi
226    AC_PATH_PROG([KPSEWHICH], [kpsewhich], [no])
227    if test "X$KPSEWHICH" = "Xno"; then
228       AC_MSG_ERROR([You have requested a build
229 of the documentation.  For this to work, you must have a functional install of
230 TeX and LaTeX.  kpsewhich is part of TeX.
231 Alternatively, you can disable building the documentation with
232 --disable-doc.])
233    fi
235    AC_MSG_CHECKING([If your TeX installation contains epsf.tex])
236    f=`$KPSEWHICH epsf.tex`
237    if test $? -eq 0 ; then
238         AC_MSG_RESULT([yes ($f)])
239    else
240         AC_MSG_RESULT([no])
241         AC_MSG_ERROR([You have requested a build
242 of the documentation.  For this to work, you must have a functional install of
243 TeX and LaTeX that includes epsf.tex.  On some linux distributions this is
244 part of the texlive-generic-recommended package.
245 Alternatively, you can disable building the documentation with
246 --disable-doc.])
247    fi
251 ##########################################################################
255 # FIXME:  for now, only try to add -rdynamic if we're using gcc.  We really
256 # need to figure out what the correct test is here.  In the mean time, this
257 # should let things build with SunPRO again.
258 if test "x$GCC" = "xyes"; then
259 AC_MSG_CHECKING([If the compiler accepts -rdynamic])
260 old_LDFLAGS="$LDFLAGS"
261 LDFLAGS="$LDFLAGS -rdynamic"
262 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
263         [AC_MSG_RESULT([yes])],
264         [LDFLAGS="$old_LDFLAGS"
265         AC_MSG_RESULT([no])
266         ])
269 # ------------- HID config -------------------
271 hid_guis=""
272 hid_printers=""
273 hid_exporters=""
274 hid_always=""
276 for hid in `cd $srcdir/src/hid; echo *`; do
277     F=$srcdir/src/hid/$hid/hid.conf
278     if test -f $F 
279     then
280     echo checking $F
281         . $F
282         case $type in
283           gui ) hid_guis="$hid_guis $hid" ;;
284           printer ) hid_printers="$hid_printers $hid" ;;
285           export ) hid_exporters="$hid_exporters $hid" ;;
286           always ) hid_always="$hid_always $hid" ;;
287         esac
288     fi
289 done
291 AC_MSG_CHECKING([for which gui to use])
292 AC_ARG_WITH([gui],
293 [  --with-gui=            Specify the GUI to use: batch gtk lesstif [[default=gtk]]],
295 [with_gui=gtk]
297 AC_MSG_RESULT([$with_gui])
298 case " $hid_guis no none " in
299      *\ $with_gui\ * ) HIDLIST="$with_gui" ;;
300      * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;;
301 esac
303 if test x"$with_gui" = x"none" -o x"$with_gui" = x"no"
304 then
305     HIDLIST=
308 AC_MSG_CHECKING([whether to enable toporouter])
309 AC_ARG_ENABLE([toporouter],
310  [AS_HELP_STRING([--enable-toporouter], [build toporouter [default=yes]]) ]
312 AS_CASE(["x$enable_toporouter"],[xyes | xno],,
313  [enable_toporouter=yes
316 AC_MSG_RESULT([$enable_toporouter])
317 AM_CONDITIONAL([WITH_TOPOROUTER], test $enable_toporouter != no)
319 AC_MSG_CHECKING([whether to enable toporouter output])
320 AC_ARG_ENABLE([toporouter-output],
321  [AS_HELP_STRING([--enable-toporouter-output], [enable toporouter graphical output [default=no]]) ]
323 AS_CASE(["z$enable_toporouter_output"],[zyes | zno],,
324  [enable_toporouter_output=no]
326 AC_MSG_RESULT([$enable_toporouter_output])
327 AS_CASE([$enable_toporouter_output],[yes],
329   topo_output_enabled=1
330  ],
332   topo_output_enabled=0
335 AC_DEFINE_UNQUOTED([TOPO_OUTPUT_ENABLED], [$topo_output_enabled],
336  [Define to 1 to enable toporouter graphical output]
339 PKG_PROG_PKG_CONFIG()
341 if test "x$enable_toporouter_output" = "xyes"; then
342    PKG_CHECK_MODULES(CAIRO, cairo,,
343                      [AC_MSG_ERROR([Cannot find cairo, needed by the toporouter
344 Please review the following errors:
345 $CAIRO_PKG_ERRORS])]
346    )
349 AC_MSG_CHECKING([for whether to use DBUS])
350 AC_ARG_ENABLE([dbus],
351 [  --enable-dbus           Enable DBUS IPC],
352 [],[
353         case " $with_gui " in
354                 *\ gtk\ *)     enable_dbus=yes ;;
355                 *\ lesstif\ *) enable_dbus=yes ;;
356                 * )            enable_dbus=no ;;
357         esac
360 AC_MSG_RESULT([$enable_dbus])
361 AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes)
363 if test "x$enable_dbus" = "xyes"; then
364         case " $with_gui " in
365                 *\ gtk\ *) ;;
366                 *\ lesstif\ *) ;;
367                 * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID.
368 Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.])
369         esac
370         
371         PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61,
372                 [saved_LIBS="$LIBS"
373                  LIBS="$LIBS $DBUS_LIBS"
374                  AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
375                  LIBS="$saved_LIBS" ],
376                 [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure
377 Please review the following errors:
378 $DBUS_PKG_ERRORS])]
379         )
380         DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
381         
382         AC_DEFINE([HAVE_DBUS], 1,
383                 [Define to 1 if DBUS IPC is to be compiled in])
388 AC_MSG_CHECKING([for whether to use GL drawing])
389 AC_ARG_ENABLE([gl],
390 [  --enable-gl           Enable GL drawing (with GTK HID)],
391 [],[
392         case " $with_gui " in
393                 *\ gtk\ *) enable_gl=yes;;
394                 * ) enable_gl=no;;
395         esac
397 AC_MSG_RESULT([$enable_gl])
398 AM_CONDITIONAL(USE_GL, test x$enable_gl = xyes)
400 if test "x$enable_gl" = "xyes"; then
401         case " $with_gui " in
402                 *\ gtk\ *) ;;
403                 * ) AC_MSG_ERROR([GL drawing enabled but only works with the GTK HID.
404 Either do not use --enable-gl or enable the gtk HID.])
405         ;;
406         esac
408         AX_CHECK_GL
409         AS_IF([test X$no_gl = Xyes],
410               [AC_MSG_FAILURE([OpenGL is required.])])
412         AX_CHECK_GLU
413         AS_IF([test X$no_glu = Xyes],
414               [AC_MSG_FAILURE([The OpenGL GLU library is required.])])
416         AC_DEFINE([ENABLE_GL], 1,
417                 [Define to 1 if GL support is to be compiled in])
420 AC_MSG_CHECKING([for which printer to use])
421 AC_ARG_WITH([printer],
422 [  --with-printer=        Specify the printer: lpr [[default=lpr]]],
423 [],[with_printer=lpr])
424 AC_MSG_RESULT([$with_printer])
425 case " $hid_printers " in
426      *\ $with_printer\ * )
427          HIDLIST="$HIDLIST $with_printer"
428          ;;
429      * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;;
430 esac
432 AC_MSG_CHECKING([for which exporters to use])
433 AC_ARG_WITH([exporters],
434 [  --with-exporters=       Enable export devices: bom gerber gcode nelma png ps [[default=bom gerber gcode nelma png ps]]],
435 [],[with_exporters=$hid_exporters])
436 AC_MSG_RESULT([$with_exporters])
437 for e in `echo $with_exporters | sed 's/,/ /g'`; do
438     case " $hid_exporters " in
439       *\ $e\ * )
440          HIDLIST="$HIDLIST $e"
441          ;;
442       * ) AC_MSG_ERROR([$e is not a valid exporter]) ;;
443     esac
444 done
446 if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then
447         case " ${HIDLIST} " in
448                 *\ png\ *)
449                         AC_MSG_ERROR([you have requested the png HID but turned off all output
450 formats!  If you do not want gif/jpeg/png output, use --with-exporters to list
451 which exporters you want and do not list png there.])
452                         ;;
454                 *)
455                         ;;
456         esac
459 for hid in $HIDLIST; do
460     F=$srcdir/src/hid/$hid/hid.conf
461     if test -f $F ; then
462         echo checking $hid dependencies
463         deps=
464         . $F
465         for dep in $deps; do
466             if test "X`echo $HIDLIST | grep $dep`" = "X"; then
467                 AC_MSG_ERROR([you have requested the $hid HID but not the $dep HID, which it depends on])
468             fi
469         done
470    fi
471 done
473 for e in $HIDLIST; do
474     HIDLIBS="$HIDLIBS lib$e.a"
475 done
477 AC_SUBST(HIDLIST)
478 AC_SUBST(HIDLIBS)
480 # ------------- end HID config -------------------
482 ######################################################################
484 # desktop integration
487 AC_PATH_PROG(SETENV, env, [])
488 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE_BIN, gtk-update-icon-path, [true])
490 # Change default location for XDG files (MIME and Icons)
491 AC_ARG_WITH(xdgdatadir, [  --with-xdgdatadir=path  Change where the theme icons 
492 and mime registrations are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
494 # Change default location for KDE data files (KDE MIME registrations)
495 AC_ARG_WITH(kdedatadir, [  --with-kdedatadir=path  Change where the KDE mime reg
496 istrations are installed [[DATADIR]]], [opt_kdedatadir=$withval])
498 if test x$opt_xdgdatadir = x; then
499         # path was not specified with --with-xdgdatadir
500         XDGDATADIR='${datadir}'
501 else
502         # path WAS specified with --with-xdgdatadir
503         XDGDATADIR="$opt_xdgdatadir"
505 AC_SUBST(XDGDATADIR)
507 if test x$opt_kdedatadir = x; then
508         # path was not specified with --with-kdedatadir
509         KDEDATADIR='${datadir}'
510 else
511         # path WAS specified with --with-kdedatadir
512         KDEDATADIR="$opt_kdedatadir"
514 AC_SUBST(KDEDATADIR)
516 AC_ARG_ENABLE(update-desktop-database,
517         AC_HELP_STRING([--disable-update-desktop-database],
518         [do not update desktop database after installation]),,
519         enable_update_desktop_database=yes)
521 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
523 if test x$enable_update_desktop_database = xyes ; then
524         AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
525         if test $UPDATE_DESKTOP_DATABASE = no; then
526         AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
527         fi
530 AC_ARG_ENABLE(update-mime-database,
531         AC_HELP_STRING([--disable-update-mime-database],
532         [do not update mime database after installation]),,
533         enable_update_mime_database=yes)
535 AM_CONDITIONAL(ENABLE_UPDATE_MIME_DATABASE, test x$enable_update_mime_database = xyes)
537 if test x$enable_update_mime_database = xyes ; then
538         AC_PATH_PROG(UPDATE_MIME_DATABASE, [update-mime-database], no)
539         if test $UPDATE_MIME_DATABASE = no; then
540         AC_MSG_ERROR([Cannot find update-mime-database, make sure it is installed and in your PATH, or configure with --disable-update-mime-database])
541         fi
545 ######################################################################
547 AC_PATH_PROGS(M4, gm4 m4, [none])
548 if test "X$M4" = "Xnone" ; then
549         AC_MSG_ERROR([Did not find a m4 executible.  You need to make sure
550         that m4 is installed on your system and that m4 is in your path])
552 AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug])
553 pcb_m4_r=`echo "eval(-2/2)" | $M4`
554 if test "$pcb_m4_r" != "-1" ; then
555         AC_MSG_RESULT([yes])
556         AC_MSG_ERROR([It appears that $M4 has a bug involving division
557 with negative numbers.  In particular it just returned the result that
558 -2/2 = $pcb_m4_r instead of -1.  This is a known bug in GNU m4-1.4.9.  Please
559 install a non-broken m4.])
560 else
561         AC_MSG_RESULT([no])
565 AC_PATH_PROGS(WISH, wish wish85 wish8.5 wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
566 if test "X$WISH" = "Xnone" ; then
567         AC_MSG_ERROR([Did not find the wish executible.  You need to make sure
568         that tcl is installed on your system and that wish is in your path])
571 AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
572 GNUM4=$M4
573 AC_SUBST(GNUM4)
574 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
576 AC_PATH_PROG(PDFLATEX, pdflatex, notfound)
577 AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound)
579 AC_PATH_PROG(TEXI2DVI, texi2dvi, notfound)
580 AM_CONDITIONAL(MISSING_TEXI2DVI, test x$TEXI2DVI = xnotfound)
582 AC_PATH_PROG(PS2PDF, ps2pdf, notfound)
583 AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound)
585 # used to build some of the getting started guide
586 AC_PATH_PROG(GSCHEM, gschem, notfound)
587 AM_CONDITIONAL(MISSING_GSCHEM, test x$GSCHEM = xnotfound)
589 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
590         if test "$PDFLATEX" = "notfound" -o "$TEXI2DVI" = "notfound" -o "$PS2PDF" = "notfound" ; then
591                 AC_MSG_ERROR([It appears that you are building from a source tree obtained
592 via git but you do not have the required tools installed to build the documentation.  Here
593 is a list of tools and the detected values:
594 PDFLATEX:  $PDFLATEX
595 TEXI2DVI:  $TEXI2DVI
596 PS2PDF:    $PS2PDF
597 GSCHEM:    $GSCHEM
599 Either make sure these tools are installed or disable building and installing the documentation
600 by using the --disable-doc configure option.
602         fi
605 ############################################################################
607 # These checks are for tools used by the testsuite.  It will not be fatal
608 # if these are missing because this is primarily for developer use.  It is
609 # possible that we might add some --enable flag in the future that forces
610 # full tools for development work.
612 # Check for ImageMagick tools used by the testsuite
613 AC_PATH_PROG(IM_ANIMATE, animate, notfound)
614 AC_PATH_PROG(IM_COMPARE, compare, notfound)
615 AC_PATH_PROG(IM_COMPOSITE, composite, notfound)
616 AC_PATH_PROG(IM_CONVERT, convert, notfound)
617 AC_PATH_PROG(IM_DISPLAY, display, notfound)
618 AC_PATH_PROG(IM_MONTAGE, montage, notfound)
619 missing_magick=""
620 test "${IM_ANIMATE}" != "notfound" || missing_magick="${missing_magick} animate"
621 test "${IM_COMPARE}" != "notfound" || missing_magick="${missing_magick} compare"
622 test "${IM_COMPOSITE}" != "notfound" || missing_magick="${missing_magick} composite"
623 test "${IM_CONVERT}" != "notfound" || missing_magick="${missing_magick} convert"
624 test "${IM_DISPLAY}" != "notfound" || missing_magick="${missing_magick} display"
625 test "${IM_MONTAGE}" != "notfound" || missing_magick="${missing_magick} montage"
627 AC_MSG_CHECKING([if all ImageMagick tools needed for the testsuite were found])
628 if test "X${missing_magick}" != "X" ; then
629     AC_MSG_RESULT([no.  The testsuite will be disabled because the following
630 tools from the ImageMagick suite were not found:
631 ${missing_magick}
632 No loss in pcb functionality should be experienced, you just will not
633 be able to run the full regression testsuite.
635     have_magick=no
636 else
637     AC_MSG_RESULT([yes])
638     have_magick=yes
641 have_test_tools=yes
643 test $have_magick = yes || have_test_tools=no
645 # the RS274-X export HID is partially checked by looking at the result with
646 # gerbv
647 AC_PATH_PROG(GERBV, gerbv, notfound)
648 test $GERBV != notfound || have_test_tools=no
651 AM_CONDITIONAL(HAVE_TEST_TOOLS, test x$have_test_tools = xyes)
652 AC_MSG_CHECKING([if all the requried testsuite tools were found])
653 if test x$have_test_tools = xyes ; then
654         AC_MSG_RESULT([yes])
655 else
656         AC_MSG_RESULT([no -- the testsuite will be disabled])
661 ############################################################################
664 dnl Checks for libraries.
665 AC_CHECK_LIB(m, sqrt)
666 AC_CHECK_LIB(dl, dlopen)
667 AC_CHECK_LIB(xnet, gethostbyname)
668 AC_CHECK_LIB(fl, yywrap)
669 AC_CHECK_FUNCS(strerror)
670 AC_CHECK_FUNCS(regcomp re_comp)
671 AC_CHECK_FUNCS(logf expf rint)
672 AC_CHECK_FUNCS(vsnprintf)
673 AC_CHECK_FUNCS(getpwuid getcwd)
674 AC_CHECK_FUNCS(rand random)
675 AC_CHECK_FUNCS(stat)
677 AC_CHECK_FUNCS(mkdtemp)
679 # normally used for all file i/o
680 AC_CHECK_FUNCS(popen)
682 # for lrealpath.c
683 AC_CHECK_FUNCS(realpath canonicalize_file_name)
684 libiberty_NEED_DECLARATION(canonicalize_file_name)
686 # for pcb_spawnvp in action.c on Windows
687 AC_CHECK_FUNCS(_spawnvp)
689 AC_HEADER_STDC
690 AC_CHECK_HEADERS(limits.h locale.h string.h sys/types.h regex.h pwd.h)
691 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h sys/wait.h)
692 AC_CHECK_HEADERS(dlfcn.h)
694 if test "x${WIN32}" = "xyes" ; then
695         AC_CHECK_HEADERS(windows.h)
697 # Search for glib
698 PKG_CHECK_MODULES(GLIB, glib-2.0, ,
699                 [AC_MSG_RESULT([Note: cannot find glib-2.0.
700 You may want to review the following errors:
701 $GLIB_PKG_ERRORS])]
704 for e in $HIDLIST; do
705     case $e in
706       lesstif )
707         AC_PATH_XTRA
708         save_CPPFLAGS="$CPPFLAGS"
709         CPPFLAGS="$X_CFLAGS"
710         AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
711         AC_CHECK_LIB(ICE, main, , , $X_LIBS)
712         AC_CHECK_LIB(SM, main, , , $X_LIBS)
713         AC_CHECK_LIB(Xext, main, , , $X_LIBS)
714         AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
715         AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
716         AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
717         AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS)
718         CPPFLAGS="$save_CPPFLAGS"
719         case $ac_cv_lib_Xm_XmCreateMainWindow in
720           no )
721             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
722             ;;
723           * ) ;;
724         esac
725         AC_CHECK_HEADERS(Xm/Xm.h)
726         case $ac_cv_header_Xm_Xm_h in
727           no )
728             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
729             ;;
730           * ) ;;
731         esac
732         ;;
734       gtk )
735         # Check for pkg-config
736         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
737         if test "$PKG_CONFIG" = "no"; then
738                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
739         fi
741         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0, ,
742                 [AC_MSG_ERROR([Cannot find gtk+ >= 2.18.0, install it and rerun ./configure
743 Please review the following errors:
744 $GTK_PKG_ERRORS])]
745         )
746         GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
747         GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
749         if test "x$enable_gl" = "xyes"; then
750                 # Check for GtkGLExt
751                 PKG_CHECK_MODULES(GTKGLEXT, gtkglext-1.0 >= 1.0.0, , [AC_MSG_ERROR([
752 *** Required version of gtkglext is not installed - please install first ***
753 Please review the following errors:
754 $GTKGLEXT_PKG_ERRORS])]
755                 )
756         GTKGLEXT_VER=`$PKG_CONFIG gtkglext-1.0 --modversion`
757         fi
759         ;;
761       gcode|nelma|png )
762         # Check for gdlib-config for gd (www.boutell.com/gd)
763         AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no)
764         if test "$GDLIB_CONFIG" = "no"; then
765                 AC_MSG_RESULT([Cannot find gdlib-config.
766 Make sure it is installed and in your PATH.
767 gdlib-config is part of the GD library available from www.boutell.com/gd.
768 This is needed for the png HID.  I will look for libgd anyway and maybe
769 you will get lucky.
771                 if test "$WIN32" != "yes" ; then
772                         AC_CHECK_LIB(gd,main,,
773                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lgd could not be found]]))
774                 else 
775                         AC_CHECK_LIB(bgd,main,,
776                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lbgd could not be found]]))
777                 fi
778         else
779                 if test "$WIN32" = "yes" ; then
780                         GD=bgd
781                 else
782                         GD=gd
783                 fi
784                 AC_MSG_CHECKING([for libgd cflags])
785                 GD_CFLAGS="`$GDLIB_CONFIG --cflags`"
786                 AC_MSG_RESULT([$GD_CFLAGS])
787                 AC_MSG_CHECKING([for libgd libs])
788                 GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}"
789                 AC_MSG_RESULT([$GD_LIBS])
790         fi
791    
792         # since some linux systems evidently install gdlib-config but fail to
793         # install the headers (nice), check for the header too and fail if it
794         # is not there.
795         save_CPPFLAGS="$CPPFLAGS"
796         CPPFLAGS="$CPPFLAGS $GD_CFLAGS"
797         AC_CHECK_HEADERS(gd.h)
798         CPPFLASS="$save_CPPFLAGS"
799         case $ac_cv_header_gd_h in
800              no )
801                 AC_MSG_ERROR([
802 You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd.
803 This is needed for the nelma and/or png HID.
805                 ;;
806              * ) ;;
807         esac
808         
809         # Some versions of gd (prior to the expiration of the
810         # patent related to gif compression) do not support
811         # gif output.  Check for that here.
812         save_LIBS="$LIBS"
813         LIBS="$save_LIBS $GD_LIBS $X_LIBS"
815         AC_MSG_CHECKING([if GIF output from the png HID is desired])
816         AC_ARG_ENABLE([gif],
817                 [  --disable-gif           Disable support for gif output when the png HID is used [[default=include gif support]]],
818                 [
819                 if test "X$enable_gif" != "Xno" ; then
820                         AC_MSG_RESULT([yes])
821                         with_gif=yes
822                 else
823                         AC_MSG_RESULT([no])
824                         with_gif=no
825                 fi
826                 ],
827                 [
828                 AC_MSG_RESULT([yes])
829                 with_gif=yes
830                 ])
831         if test "X$with_gif" = "Xyes" ; then
832                 AC_CHECK_FUNCS(gdImageGif)
833                 if test "$ac_cv_func_gdImageGif" != "yes"; then
834                         AC_MSG_ERROR([Your gd installation does not appear to include gif support.
835 You may need to update your installation of gd or disable
836 gif export with --disable-gif])
837                 fi
838         fi
840         AC_MSG_CHECKING([if JPEG output from the png HID is desired])
841         AC_ARG_ENABLE([jpeg],
842                 [  --disable-jpeg          Disable support for JPEG output when the png HID is used [[default=include JPEG support]]],
843                 [
844                 if test "X$enable_jpeg" != "Xno" ; then
845                         AC_MSG_RESULT([yes])
846                         with_jpeg=yes
847                 else
848                         AC_MSG_RESULT([no])
849                         with_jpeg=no
850                 fi
851                 ],
852                 [
853                 AC_MSG_RESULT([yes])
854                 with_jpeg=yes
855                 ])
856         if test "X$with_jpeg" = "Xyes" ; then
857                 AC_CHECK_FUNCS(gdImageJpeg)
858                 if test "$ac_cv_func_gdImageJpeg" != "yes"; then
859                         AC_MSG_ERROR([Your gd installation does not appear to include JPEG support.
860 You may need to update your installation of gd or disable
861 JPEG export with --disable-jpeg])
862                 fi
863         fi
866         AC_MSG_CHECKING([if PNG output from the png HID is desired])
867         AC_ARG_ENABLE([png],
868                 [  --disable-png           Disable support for PNG output when the png HID is used [[default=include PNG support]]],
869                 [
870                 if test "X$enable_png" != "Xno" ; then
871                         AC_MSG_RESULT([yes])
872                         with_png=yes
873                 else
874                         AC_MSG_RESULT([no])
875                         with_png=no
876                 fi
877                 ],
878                 [
879                 AC_MSG_RESULT([yes])
880                 with_png=yes
881                 ])
882         if test "X$with_png" = "Xyes" ; then
883                 AC_CHECK_FUNCS(gdImagePng)
884                 if test "$ac_cv_func_gdImagePng" != "yes"; then
885                         AC_MSG_ERROR([Your gd installation does not appear to include PNG support.
886 You may need to update your installation of gd or disable
887 PNG export with --disable-png])
888                 fi
889         fi
890         LIBS="$save_LIBS"
891         ;;
893     esac
894 done
897 AM_CONDITIONAL(PNG, test x$with_png = xyes)
898 AM_CONDITIONAL(GIF, test x$with_gif = xyes)
900 # ------------- check if png previews should be built for pcblib-newlib
901 AC_MSG_CHECKING([if the m4lib to newlib export should create png previews])
902 AC_ARG_ENABLE(
903         [m4lib-png],
904         [  --enable-m4lib-png      Enable creating png previews for the m4 library],
905         [],[enable_m4lib_png=no])
906 AC_MSG_RESULT([$enable_m4lib_png])
907 AM_CONDITIONAL(PNG_PREVIEW, test x$enable_m4lib_png = xyes)
910 # Run away.... more ugly stuff here.  By default we don't actually build
911 # pcblib-newlib from pcblib unless we are building from cvs or git sources.
912 # The reason is it takes a while and requires the png HID.  The problem is,
913 # what if someone wants to use --enable-m4lib-png but the tarball was built
914 # without the previews.  Or, what if someone does not want the PNG previews
915 # but the person building the tarball included them.  Ugh!  So what the following
916 # code attempts to do is detect that mismatch situation.  Note that we only
917 # want to kick this code in when *not* building from git or cvs sources.
918 build_pcblib_newlib=no
919 if test "$pcb_sources" = "tarball" ; then
920         AC_MSG_CHECKING([If pcblib-newlib was built with png previews])
921         stamp=$srcdir/lib/pcblib-newlib.stamp
922         if test ! -f ${stamp} ; then
923                 AC_MSG_RESULT([unknown, missing ${stamp}])
924                 build_pcblib_newlib=yes
925         else
926                 if test "`cat ${stamp}`" = "png-preview=yes" ; then
927                         AC_MSG_RESULT([yes])
928                         # lib exists and built with preview.
929                         # if we don't want the preview, than rebuild
930                         if test x$enable_m4lib_png != xyes ; then
931                                 build_pcblib_newlib=yes
932                         fi
933                 else
934                         AC_MSG_RESULT([no])
935                         # lib exists and built without preview.
936                         # if we want the preview, than rebuild
937                         if test x$enable_m4lib_png = xyes ; then
938                                 build_pcblib_newlib=yes
939                         fi
940                 fi
941         fi
942 else
943         build_pcblib_newlib=yes
945 AC_MSG_CHECKING([If pcblib-newlib needs to be rebuilt])
946 AC_MSG_RESULT([$build_pcblib_newlib])
947 AM_CONDITIONAL(BUILD_PCBLIB_NEWLIB, test x$build_pcblib_newlib = xyes)
949 if test "X$cross_compiling" = "Xyes" ; then
950         # we are cross compiling so we will need a build host binary for pcb
951         AC_PATH_PROG(PCB, [pcb], [notfound])
952 else
953         PCB="\${top_builddir}/src/pcb"
955 AC_SUBST(PCB)
957 # now make see how essential it was that we have a pcb executable for the build
958 # host
959 if test "X$pcb_git_version" = "Xyes" ; then
960         if test "X$docs_yesno" = "Xyes" -o "X$enable_m4lib_png" = "Xyes" ; then
961                 if test "$PCB" = "notfound" ; then
962                         AC_MSG_ERROR([You have selected a build with m4lib png
963 previews enabled and/or with building the documentation enabled but you also
964 appear to be cross-compiling.  For this to work, you must have a pcb installed that
965 can run on this machine (the build machine) because it is needed for generating
966 library footprint png previews as well as some of the figures in the documentation.
967 If you wish to skip building the documentation and the footprint previews then add
968 --disable-doc --disable-m4lib-png
969 This will allow your cross build to work.])
970                 fi
971         fi
974 # ------------- Xrender -------------------
975 have_xrender=no
976 AC_CHECK_LIB(Xrender,XRenderQueryExtension,have_xrender=yes,have_xrender=no,$X_LIBS)
978 AC_ARG_ENABLE([xrender],
979 [  --disable-xrender       Compile and link with Xrender [default=yes]])
980 case "$have_xrender:$enable_xrender" in
981    no:* ) ;;
982    *:no ) ;;
983    * )
984      X_LIBS="-lXrender $X_LIBS"
985      AC_DEFINE([HAVE_XRENDER], 1,
986                 [Define to 1 if Xrender is available])
987      ;;
988 esac
990 # ------------- Xinerama -------------------
991 have_xinerama=no
992 AC_CHECK_LIB(Xinerama,XineramaQueryExtension,have_xinerama=yes,have_xinerama=no,$X_LIBS)
994 AC_ARG_ENABLE([xinerama],
995 [  --disable-xinerama       Compile and link with Xinerama [default=yes]])
996 case "$have_xinerama:$enable_xinerama" in
997    no:* ) ;;
998    *:no ) ;;
999    * )
1000      X_LIBS="-lXinerama $X_LIBS"
1001      AC_DEFINE([HAVE_XINERAMA], 1,
1002                 [Define to 1 if Xinerama is available])
1003      ;;
1004 esac
1006 # ------------- dmalloc -------------------
1007 dnl dmalloc checks
1008 with_dmalloc=no
1009 AC_MSG_CHECKING([if dmalloc debugging should be enabled])
1010 AC_ARG_ENABLE([dmalloc],
1011 [  --enable-dmalloc        Compile and link with dmalloc for malloc debugging [default=no]],
1013 if test "X$enable_dmalloc" != "Xno" ; then
1014         AC_MSG_RESULT([yes])
1015         AC_CHECK_HEADER(dmalloc.h,,
1016                 AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
1017         AC_CHECK_LIB(dmalloc,main,,
1018                 AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]))
1019         DMALLOC_LIBS="-ldmalloc"
1020         with_dmalloc=yes
1021 else
1022         AC_MSG_RESULT([no])
1023         DMALLOC_LIBS=""
1027         AC_MSG_RESULT([no])
1028         DMALLOC_LIBS=""
1031 # ------------- ElectricFence -------------------
1032 dnl ElectricFence checks
1033 with_efence=no
1034 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
1035 AC_ARG_ENABLE([efence],
1036 [  --enable-efence         Link with ElectricFence for malloc debugging [default=no]],
1038 if test "X$enable_efence" != "Xno" ; then
1039         AC_MSG_RESULT([yes])
1040         AC_CHECK_LIB(efence,main,,
1041                 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
1042         with_efence=yes
1043 else
1044         AC_MSG_RESULT([no])
1048 AC_MSG_RESULT([no])
1051 # ------------- Enable Debug code -------------------
1052 AC_MSG_CHECKING([for whether to enable debugging code])
1053 AC_ARG_ENABLE([debug],
1054 [  --enable-debug          Enable debugging code],
1055 [],[enable_debug=no])
1057 AC_MSG_RESULT([$enable_debug])
1058 AM_CONDITIONAL(DEBUG_BUILD, test x$enable_debug = xyes)
1060 # ------------- mkdir required for win32 compatibility ------------
1061 # WIN32 mkdir takes only one argument, POSIX takes two.
1062 # #include "misc.h" where mkdir is required.
1063 m4_include([m4/m4_ax_func_mkdir.m4])
1064 AX_FUNC_MKDIR
1066 # ------------- Type used for "Coord" type -------------------
1068 AC_CHECK_HEADERS(stdint.h)
1069 AC_ARG_ENABLE([coord64],
1070 [  --enable-coord64        Force 64-bit coordinate types],
1071 [],[enable_coord64=no])
1072 AC_ARG_ENABLE([coord32],
1073 [  --enable-coord32        Force 32-bit coordinate types],
1074 [],[enable_coord32=no])
1076 COORDTYPE="long"
1078 echo "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h"
1079 case "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" in
1080   yes:no:yes )
1081     COORD_TYPE="int32_t"
1082     COORD_MAX="INT32_MAX"
1083     ;;
1084   no:yes:yes )
1085     COORD_TYPE="int64_t"
1086     COORD_MAX="INT64_MAX"
1087     ;;
1088   yes:no:no  )
1089     COORD_TYPE="int"
1090     COORD_MAX="INT_MAX"
1091     ;;
1092   no:yes:no  )
1093     COORD_TYPE="long long"
1094     COORD_MAX="LLONG_MAX"
1095     ;;
1096   yes:yes:*  )
1097     AC_MSG_ERROR("*** cannot require both 32 and 64 bit coordinates")
1098     ;;
1099   *:*:*    )
1100     COORD_TYPE="long"
1101     COORD_MAX="LONG_MAX"
1102     ;;
1103 esac
1104 AC_DEFINE_UNQUOTED([COORD_TYPE],[$COORD_TYPE],
1105   [C type for Coordinates])
1106 AC_DEFINE_UNQUOTED([COORD_MAX],[$COORD_MAX],
1107   [Maximum value of coordinate type])
1109 # ------------- Complete set of CPPFLAGS and LIBS -------------------
1111 CPPFLAGS="$CPPFLAGS $X_CFLAGS $DBUS_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS $GD_CFLAGS $CAIRO_CFLAGS $GTKGLEXT_CFLAGS $GLU_CFLAGS $GL_CFLAGS"
1112 LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GLIB_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS $INTLLIBS $CAIRO_LIBS $GTKGLEXT_LIBS $GLU_LIBS $GL_LIBS"
1115 # if we have gcc then add -Wall
1116 if test "x$GCC" = "xyes"; then
1117         # see about adding some extra checks if the compiler takes them
1118         for flag in -Wall ; do
1119                 case " ${CFLAGS} " in
1120                         *\ ${flag}\ *)
1121                                 # flag is already present
1122                                 ;;
1123                         *)
1124                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1125                                 ac_save_CFLAGS="$CFLAGS"
1126                                 CFLAGS="$CFLAGS ${flag}"
1127                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1128                                         [AC_MSG_RESULT([yes])],
1129                                         [AC_MSG_RESULT([no])
1130                                          CFLAGS="$ac_save_CFLAGS"
1131                                         ]
1132                                 )
1133                                 ;;
1134                 esac
1135         done
1138 CXXFLAGS="$CFLAGS"
1140 # Now add C-specific flags
1141 if test "x$GCC" = "xyes"; then
1142         # see about adding some extra checks if the compiler takes them
1143         for flag in -Wdeclaration-after-statement ; do
1144                 case " ${CFLAGS} " in
1145                         *\ ${flag}\ *)
1146                                 # flag is already present
1147                                 ;;
1148                         *)
1149                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1150                                 ac_save_CFLAGS="$CFLAGS"
1151                                 CFLAGS="$CFLAGS ${flag}"
1152                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1153                                         [AC_MSG_RESULT([yes])],
1154                                         [AC_MSG_RESULT([no])
1155                                          CFLAGS="$ac_save_CFLAGS"
1156                                         ]
1157                                 )
1158                                 ;;
1159                 esac
1160         done
1163 # See if we are building gcc with C++.
1164 AC_ARG_ENABLE(build-with-cxx,
1165 [  --enable-build-with-cxx build with C++ compiler instead of C compiler],
1166 ENABLE_BUILD_WITH_CXX=$enableval,
1167 ENABLE_BUILD_WITH_CXX=no)
1169 case "$ENABLE_BUILD_WITH_CXX" in
1170   yes)
1171     CC_OR_CXX="$CXX"
1172     ;;
1173   no)
1174     CC_OR_CXX="$CC"
1175     ;;
1176 esac
1177 AC_SUBST(CC_OR_CXX)
1179 # font filename
1180 FONTFILENAME=${FONTFILENAME:-"default_font"}
1181 AC_SUBST(FONTFILENAME)
1182 AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
1184 # standard autoconf variables
1185 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
1186 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
1187 CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\""
1189 # directory for old-style library and for fonts
1190 PCBLIBDIR=${datadir}/pcb
1191 AC_SUBST(PCBLIBDIR)
1192 #AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
1193 CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
1195 # name for old-style library
1196 LIBRARYFILENAME=pcblib
1197 AC_SUBST(LIBRARYFILENAME)
1198 AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
1201 # directory for new library
1202 PCBTREEDIR=${datadir}/pcb/newlib
1203 PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib
1204 PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
1205 AC_SUBST(PCBTREEDIR)
1206 AC_SUBST(PCBTREEPATH)
1207 #AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
1208 CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
1209 CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\""
1211 # Figure out relative paths
1212 AC_MSG_CHECKING([for the bindir to pcblibdir relative path])
1213 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir])
1214 adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S])
1215 AC_MSG_RESULT([$bindir_to_pcblibdir])
1216 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir])
1218 AC_MSG_CHECKING([for the bindir to pcbtreedir relative path])
1219 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir])
1220 adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S])
1221 AC_MSG_RESULT([$bindir_to_pcbtreedir])
1222 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir])
1225 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
1226 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
1227 adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S])
1228 AC_MSG_RESULT([$bindir_to_execprefix])
1229 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
1232 BTNMOD=${BTNMOD:-"Mod1"}
1233 AC_SUBST(BTNMOD)
1235 TOPDIRS=
1236 for dir in src lib newlib doc example tools tutorial README_FILES
1238    test -d $dir/. && TOPDIRS="$TOPDIRS $dir"
1239 done
1240 AC_SUBST(TOPDIRS)
1242 AC_CONFIG_FILES(Makefile data/Makefile intl/Makefile po/Makefile.in)
1244 if test -d $srcdir/README_FILES; then
1245    AC_CONFIG_FILES(README_FILES/Makefile)
1247 if test -d $srcdir/doc; then
1248    AC_CONFIG_FILES(doc/Makefile)
1250 if test -d $srcdir/doc/gs; then
1251    AC_CONFIG_FILES(doc/gs/Makefile)
1252    AC_CONFIG_FILES(doc/gs/gafrc)
1253    AC_CONFIG_FILES(doc/gs/gschemrc)
1255 if test -d $srcdir/example; then
1256    AC_CONFIG_FILES(example/Makefile)
1257    AC_CONFIG_FILES(example/libraries/Makefile)
1259 if test -d $srcdir/lib; then
1260    AC_CONFIG_FILES(lib/CreateLibraryContents.sh)
1261    AC_CONFIG_FILES(lib/CreateLibrary.sh)
1262    AC_CONFIG_FILES(lib/ListLibraryContents.sh)
1263    AC_CONFIG_FILES(lib/Makefile)
1264    AC_CONFIG_FILES(lib/QueryLibrary.sh)
1265    AC_CONFIG_FILES(lib/qfp-ui)
1267 if test -d $srcdir/newlib; then
1268    AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile)
1269    AC_CONFIG_FILES(newlib/Makefile)
1270    AC_CONFIG_FILES(newlib/connectors/Makefile)
1271    AC_CONFIG_FILES(newlib/crystal/Makefile)
1272    AC_CONFIG_FILES(newlib/electro-optics/Makefile)
1273    AC_CONFIG_FILES(newlib/headers/Makefile)
1274    AC_CONFIG_FILES(newlib/keystone/Makefile)
1275    AC_CONFIG_FILES(newlib/msp430/Makefile)
1276    AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile)
1277    AC_CONFIG_FILES(newlib/sockets/Makefile)
1278    AC_CONFIG_FILES(newlib/tests/Makefile)
1280 AC_CONFIG_FILES(src/Makefile)
1281 AC_CONFIG_FILES(src/icons/Makefile)
1282 if test -d $srcdir/tools; then
1283    AC_CONFIG_FILES(tools/Makefile)
1285 if test -d $srcdir/tutorial; then
1286    AC_CONFIG_FILES(tutorial/Makefile)
1289 dnl testsuite
1290 AC_CONFIG_FILES(tests/inputs/Makefile)
1291 AC_CONFIG_FILES(tests/golden/Makefile)
1292 AC_CONFIG_FILES(tests/golden/hid_bom1/Makefile)
1293 AC_CONFIG_FILES(tests/golden/hid_bom2/Makefile)
1294 AC_CONFIG_FILES(tests/golden/hid_bom3/Makefile)
1295 AC_CONFIG_FILES(tests/golden/hid_bom4/Makefile)
1296 AC_CONFIG_FILES(tests/golden/hid_gcode1/Makefile)
1297 AC_CONFIG_FILES(tests/golden/hid_gcode2/Makefile)
1298 AC_CONFIG_FILES(tests/golden/hid_gcode3/Makefile)
1299 AC_CONFIG_FILES(tests/golden/hid_gcode4/Makefile)
1300 AC_CONFIG_FILES(tests/golden/hid_gcode5/Makefile)
1301 AC_CONFIG_FILES(tests/golden/hid_gcode6/Makefile)
1302 AC_CONFIG_FILES(tests/golden/hid_gcode7/Makefile)
1303 AC_CONFIG_FILES(tests/golden/hid_gcode8/Makefile)
1304 AC_CONFIG_FILES(tests/golden/hid_gcode9/Makefile)
1305 AC_CONFIG_FILES(tests/golden/hid_gcode10/Makefile)
1306 AC_CONFIG_FILES(tests/golden/hid_gcode11/Makefile)
1307 AC_CONFIG_FILES(tests/golden/hid_gerber1/Makefile)
1308 AC_CONFIG_FILES(tests/golden/hid_gerber2/Makefile)
1309 AC_CONFIG_FILES(tests/golden/hid_gerber3/Makefile)
1310 AC_CONFIG_FILES(tests/golden/hid_png1/Makefile)
1311 AC_CONFIG_FILES(tests/golden/hid_png2/Makefile)
1312 AC_CONFIG_FILES(tests/golden/hid_png3/Makefile)
1313 AC_CONFIG_FILES(tests/Makefile)
1315 dnl GTS 0.7.6 - http://gts.sourceforge.net/
1316 AC_CONFIG_FILES(gts/Makefile)
1318 dnl win32 build scripts
1319 AC_CONFIG_FILES(w32/Makefile)
1321 AC_OUTPUT
1323 with_gui=`echo $with_gui`
1324 with_printer=`echo $with_printer`
1325 with_exporters=`echo $with_exporters | sed 's/,/ /g'`
1327 expandedXDGDATADIR=`eval "echo $XDGDATADIR"`
1328 expandedKDEDATADIR=`eval "echo $KDEDATADIR"`
1330 AC_MSG_RESULT([
1331 ** Configuration summary for $PACKAGE $VERSION:
1333    GUI:                      $with_gui
1334    Printer:                  $with_printer
1335    Exporters:                $with_exporters
1336    Coordinate type:          $COORD_TYPE
1337    Source tree distribution: $pcb_sources
1338    Build documentation:      $docs_yesno
1339    Build toporouter:         $enable_toporouter
1340    Enable toporouter output: $enable_toporouter_output
1341    xdg data directory:       $expandedXDGDATADIR
1342    KDE data directory:       $expandedKDEDATADIR
1343    dmalloc debugging:        $with_dmalloc
1344    ElectricFence debugging:  $with_efence
1346    Cross Compiling:          $cross_compiling
1347    CC:                       $CC
1348    CXX:                      $CXX
1349    CPPFLAGS:                 $CPPFLAGS
1350    CFLAGS:                   $CFLAGS
1351    CXXFLAGS:                 $CXXFLAGS
1352    LIBS:                     $LIBS
1353    PCB:                      $PCB