Revert "Remove GTS sources in favour of the libgts package."
[geda-pcb/pcjc2.git] / configure.ac
bloba815f1bd1c33b98b1bc9ac0a13907b044ac320da
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 AC_CONFIG_HEADERS([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 dnl determine host type
74 AC_CANONICAL_HOST
75 AC_MSG_CHECKING(for windows)
76 PCB_PATH_DELIMETER=":"
77 PCB_DIR_SEPARATOR_S="/"
78 PCB_DIR_SEPARATOR_C='/'
79 case $host in
80         *-*-mingw* )
81                 WIN32=yes
82                 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
83                 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS}"
84                 ;;
86         * )
87                 WIN32=no
88                 ;;
89 esac
91 AC_MSG_RESULT($WIN32)
92 AC_SUBST(WIN32)
93 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
94 if test "x$WIN32" = "xyes" ; then
95         PCB_PATH_DELIMETER=";"
96         PCB_DIR_SEPARATOR_S="\\\\"
97         PCB_DIR_SEPARATOR_C='\\'
100 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char])
101 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string])
102 AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string])
105 dnl Checks for programs.
106 AC_PROG_CC
107 AC_PROG_CXX
109 if test "x$WIN32" = "xyes" ; then
110         AC_CHECK_TOOL(WINDRES, windres, [no])
111         if test "$WINDRES" = "no" ; then
112                 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
113         fi
116 # i18n
117 GETTEXT_PACKAGE=$PACKAGE
118 AH_TEMPLATE([GETTEXT_PACKAGE], [Name of this program's gettext domain])
119 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"])
120 AC_SUBST(GETTEXT_PACKAGE)
122 AM_GNU_GETTEXT_VERSION([0.14])
123 AM_GNU_GETTEXT
124 IT_PROG_INTLTOOL([0.35.0])
126 AC_C_INLINE
127 AC_PROG_CC_STDC
128 AC_PROG_CC_C99
129 AM_PROG_CC_C_O
130 AC_PROG_CPP
132 AC_MSG_CHECKING([that C compiler supports C99])
133 if test "X$ac_cv_prog_cc_c99" = "Xno"; then
134   AC_MSG_RESULT([no])
135   AC_MSG_ERROR([A C99-compliant compiler is requred])
136 else
137   AC_MSG_RESULT([yes])
140 AC_PROG_AWK
141 AC_PROG_MKDIR_P
143 AM_PROG_LEX
144 AC_PATH_PROG(LEX_PATH, $LEX, [notfound])
145 if test "$LEX_PATH" = "notfound" ; then
146         AC_MSG_ERROR([Couldn't find a usable lex program.
147 Please install flex which is available from
148 ftp://ftp.gnu.org/pub/non-gnu/flex/
153 AC_PROG_YACC
154 AC_PATH_PROG(YACC_PATH, $YACC, [notfound])
155 if test "$YACC_PATH" = "notfound" ; then
156         AC_MSG_ERROR([Couldn't find a usable yacc program.
157 Please install bison which is available from
158 ftp://ftp.gnu.org/pub/gnu/bison/
162 AC_PROG_INSTALL
163 AC_PROG_RANLIB
166 # Used for building the icons
168 AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound)
169 AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound)
170 AC_PATH_PROG(CONVERT, convert, notfound)
172 ##########################################################################
175 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
176    AC_PATH_PROG(MKINFO, makeinfo, no)
177    if test "X$MKINFO" != "Xno"; then
178       AC_MSG_CHECKING([for GNU makeinfo version >= 4.6])
179       v=`$MKINFO --version | grep "GNU texinfo"`
180       if test $? -ne 0; then
181          AC_MSG_RESULT([non-GNU])
182          MKINFO="no"
183       fi
184    fi
185    if test "X$MKINFO" != "Xno"; then
186       vmajor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
187       vminor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
188       AC_MSG_RESULT([$vmajor.$vminor])
189       if test "$vmajor" -lt 4 \
190               || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then
191          MKINFO=no
192       fi
193    fi
194    if test "X$MKINFO" = "Xno"; then
195       AC_MSG_ERROR([You have requested a build
196 of the documentation.  For this to work, you must have version 4.6 or newer of
197 the GNU texinfo package.  You seem to have
201 Please update to a newer version of texinfo or disable building of
202 the documentation with --disable-doc
204    fi
206    AC_PATH_PROG(TEXI2DVI, texi2dvi, no)
207    if test "X$TEXI2DVI" = "Xno"; then
208       AC_MSG_ERROR([You have requested a build
209 of the documentation.  For this to work, you must have the texi2dvi program
210 installed.  Alternatively, you can disable building the documentation with
211 --disable-doc.])
212    fi
215         AC_PATH_PROG(PERL, perl, notfound)
216         if test "X$PERL" = "Xnotfound"; then
217                         AC_MSG_ERROR([You have requested a build
218 of the documentation.  For this to work, you must have perl installed.
219 Alternatively, you can disable building the documentation with
220 --disable-doc.
222         fi
225    AC_PATH_PROG([KPSEWHICH], [kpsewhich], [no])
226    if test "X$KPSEWHICH" = "Xno"; then
227       AC_MSG_ERROR([You have requested a build
228 of the documentation.  For this to work, you must have a functional install of
229 TeX and LaTeX.  kpsewhich is part of TeX.
230 Alternatively, you can disable building the documentation with
231 --disable-doc.])
232    fi
234    AC_MSG_CHECKING([If your TeX installation contains epsf.tex])
235    f=`$KPSEWHICH epsf.tex`
236    if test $? -eq 0 ; then
237         AC_MSG_RESULT([yes ($f)])
238    else
239         AC_MSG_RESULT([no])
240         AC_MSG_ERROR([You have requested a build
241 of the documentation.  For this to work, you must have a functional install of
242 TeX and LaTeX that includes epsf.tex.  On some linux distributions this is
243 part of the texlive-generic-recommended package.
244 Alternatively, you can disable building the documentation with
245 --disable-doc.])
246    fi
250 ##########################################################################
254 # FIXME:  for now, only try to add -rdynamic if we're using gcc.  We really
255 # need to figure out what the correct test is here.  In the mean time, this
256 # should let things build with SunPRO again.
257 if test "x$GCC" = "xyes"; then
258 AC_MSG_CHECKING([If the compiler accepts -rdynamic])
259 old_LDFLAGS="$LDFLAGS"
260 LDFLAGS="$LDFLAGS -rdynamic"
261 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
262         [AC_MSG_RESULT([yes])],
263         [LDFLAGS="$old_LDFLAGS"
264         AC_MSG_RESULT([no])
265         ])
268 # ------------- HID config -------------------
270 hid_guis=""
271 hid_printers=""
272 hid_exporters=""
273 hid_always=""
275 for hid in `cd $srcdir/src/hid; echo *`; do
276     F=$srcdir/src/hid/$hid/hid.conf
277     if test -f $F 
278     then
279     echo checking $F
280         . $F
281         case $type in
282           gui ) hid_guis="$hid_guis $hid" ;;
283           printer ) hid_printers="$hid_printers $hid" ;;
284           export ) hid_exporters="$hid_exporters $hid" ;;
285           always ) hid_always="$hid_always $hid" ;;
286         esac
287     fi
288 done
290 AC_MSG_CHECKING([for which gui to use])
291 AC_ARG_WITH([gui],
292 [  --with-gui=            Specify the GUI to use: batch gtk lesstif [[default=gtk]]],
294 [with_gui=gtk]
296 AC_MSG_RESULT([$with_gui])
297 case " $hid_guis no none " in
298      *\ $with_gui\ * ) HIDLIST="$with_gui" ;;
299      * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;;
300 esac
302 if test x"$with_gui" = x"none" -o x"$with_gui" = x"no"
303 then
304     HIDLIST=
307 AC_MSG_CHECKING([whether to enable toporouter])
308 AC_ARG_ENABLE([toporouter],
309  [AS_HELP_STRING([--enable-toporouter], [build toporouter [default=yes]]) ]
311 AS_CASE(["x$enable_toporouter"],[xyes | xno],,
312  [enable_toporouter=yes
315 AC_MSG_RESULT([$enable_toporouter])
316 AM_CONDITIONAL([WITH_TOPOROUTER], test $enable_toporouter != no)
318 AC_MSG_CHECKING([whether to enable toporouter output])
319 AC_ARG_ENABLE([toporouter-output],
320  [AS_HELP_STRING([--enable-toporouter-output], [enable toporouter graphical output [default=no]]) ]
322 AS_CASE(["z$enable_toporouter_output"],[zyes | zno],,
323  [enable_toporouter_output=no]
325 AC_MSG_RESULT([$enable_toporouter_output])
326 AS_CASE([$enable_toporouter_output],[yes],
328   topo_output_enabled=1
329  ],
331   topo_output_enabled=0
334 AC_DEFINE_UNQUOTED([TOPO_OUTPUT_ENABLED], [$topo_output_enabled],
335  [Define to 1 to enable toporouter graphical output]
338 PKG_PROG_PKG_CONFIG()
340 if test "x$enable_toporouter_output" = "xyes"; then
341    PKG_CHECK_MODULES(CAIRO, cairo,,
342                      [AC_MSG_ERROR([Cannot find cairo, needed by the toporouter
343 Please review the following errors:
344 $CAIRO_PKG_ERRORS])]
345    )
348 AC_MSG_CHECKING([for whether to use DBUS])
349 AC_ARG_ENABLE([dbus],
350 [  --enable-dbus           Enable DBUS IPC],
351 [],[
352         case " $with_gui " in
353                 *\ gtk\ *)     enable_dbus=yes ;;
354                 *\ lesstif\ *) enable_dbus=yes ;;
355                 * )            enable_dbus=no ;;
356         esac
359 AC_MSG_RESULT([$enable_dbus])
360 AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes)
362 if test "x$enable_dbus" = "xyes"; then
363         case " $with_gui " in
364                 *\ gtk\ *) ;;
365                 *\ lesstif\ *) ;;
366                 * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID.
367 Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.])
368         esac
369         
370         PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61,
371                 [saved_LIBS="$LIBS"
372                  LIBS="$LIBS $DBUS_LIBS"
373                  AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
374                  LIBS="$saved_LIBS" ],
375                 [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure
376 Please review the following errors:
377 $DBUS_PKG_ERRORS])]
378         )
379         DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
380         
381         AC_DEFINE([HAVE_DBUS], 1,
382                 [Define to 1 if DBUS IPC is to be compiled in])
387 AC_MSG_CHECKING([for whether to use GL drawing])
388 AC_ARG_ENABLE([gl],
389 [  --enable-gl           Enable GL drawing (with GTK HID)],
390 [],[
391         case " $with_gui " in
392                 *\ gtk\ *) enable_gl=yes;;
393                 * ) enable_gl=no;;
394         esac
396 AC_MSG_RESULT([$enable_gl])
397 AM_CONDITIONAL(USE_GL, test x$enable_gl = xyes)
399 if test "x$enable_gl" = "xyes"; then
400         case " $with_gui " in
401                 *\ gtk\ *) ;;
402                 * ) AC_MSG_ERROR([GL drawing enabled but only works with the GTK HID.
403 Either do not use --enable-gl or enable the gtk HID.])
404         ;;
405         esac
407         AX_CHECK_GL
408         AS_IF([test X$no_gl = Xyes],
409               [AC_MSG_FAILURE([OpenGL is required.])])
411         AX_CHECK_GLU
412         AS_IF([test X$no_glu = Xyes],
413               [AC_MSG_FAILURE([The OpenGL GLU library is required.])])
415         AC_DEFINE([ENABLE_GL], 1,
416                 [Define to 1 if GL support is to be compiled in])
419 AC_MSG_CHECKING([for which printer to use])
420 AC_ARG_WITH([printer],
421 [  --with-printer=        Specify the printer: lpr [[default=lpr]]],
422 [],[with_printer=lpr])
423 AC_MSG_RESULT([$with_printer])
424 case " $hid_printers " in
425      *\ $with_printer\ * )
426          HIDLIST="$HIDLIST $with_printer"
427          ;;
428      * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;;
429 esac
431 AC_MSG_CHECKING([for which exporters to use])
432 AC_ARG_WITH([exporters],
433 [  --with-exporters=       Enable export devices: bom gerber gcode nelma png ps ipcd356 [[default=bom gerber gcode nelma png ps ipcd356]]],
434 [],[with_exporters=$hid_exporters])
435 AC_MSG_RESULT([$with_exporters])
436 for e in `echo $with_exporters | sed 's/,/ /g'`; do
437     case " $hid_exporters " in
438       *\ $e\ * )
439          HIDLIST="$HIDLIST $e"
440          ;;
441       * ) AC_MSG_ERROR([$e is not a valid exporter]) ;;
442     esac
443 done
445 if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then
446         case " ${HIDLIST} " in
447                 *\ png\ *)
448                         AC_MSG_ERROR([you have requested the png HID but turned off all output
449 formats!  If you do not want gif/jpeg/png output, use --with-exporters to list
450 which exporters you want and do not list png there.])
451                         ;;
453                 *)
454                         ;;
455         esac
458 for hid in $HIDLIST; do
459     F=$srcdir/src/hid/$hid/hid.conf
460     if test -f $F ; then
461         echo checking $hid dependencies
462         deps=
463         . $F
464         for dep in $deps; do
465             if test "X`echo $HIDLIST | grep $dep`" = "X"; then
466                 AC_MSG_ERROR([you have requested the $hid HID but not the $dep HID, which it depends on])
467             fi
468         done
469    fi
470 done
472 for e in $HIDLIST; do
473     HIDLIBS="$HIDLIBS lib$e.a"
474 done
476 AC_SUBST(HIDLIST)
477 AC_SUBST(HIDLIBS)
479 # ------------- end HID config -------------------
481 ######################################################################
483 # desktop integration
486 AC_PATH_PROG(SETENV, env, [])
487 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE_BIN, gtk-update-icon-path, [true])
489 # Change default location for XDG files (MIME and Icons)
490 AC_ARG_WITH(xdgdatadir, [  --with-xdgdatadir=path  Change where the theme icons 
491 and mime registrations are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
493 # Change default location for KDE data files (KDE MIME registrations)
494 AC_ARG_WITH(kdedatadir, [  --with-kdedatadir=path  Change where the KDE mime reg
495 istrations are installed [[DATADIR]]], [opt_kdedatadir=$withval])
497 if test x$opt_xdgdatadir = x; then
498         # path was not specified with --with-xdgdatadir
499         XDGDATADIR='${datadir}'
500 else
501         # path WAS specified with --with-xdgdatadir
502         XDGDATADIR="$opt_xdgdatadir"
504 AC_SUBST(XDGDATADIR)
506 if test x$opt_kdedatadir = x; then
507         # path was not specified with --with-kdedatadir
508         KDEDATADIR='${datadir}'
509 else
510         # path WAS specified with --with-kdedatadir
511         KDEDATADIR="$opt_kdedatadir"
513 AC_SUBST(KDEDATADIR)
515 AC_ARG_ENABLE(update-desktop-database,
516         AC_HELP_STRING([--disable-update-desktop-database],
517         [do not update desktop database after installation]),,
518         enable_update_desktop_database=yes)
520 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
522 if test x$enable_update_desktop_database = xyes ; then
523         AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
524         if test $UPDATE_DESKTOP_DATABASE = no; then
525         AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
526         fi
529 AC_ARG_ENABLE(update-mime-database,
530         AC_HELP_STRING([--disable-update-mime-database],
531         [do not update mime database after installation]),,
532         enable_update_mime_database=yes)
534 AM_CONDITIONAL(ENABLE_UPDATE_MIME_DATABASE, test x$enable_update_mime_database = xyes)
536 if test x$enable_update_mime_database = xyes ; then
537         AC_PATH_PROG(UPDATE_MIME_DATABASE, [update-mime-database], no)
538         if test $UPDATE_MIME_DATABASE = no; then
539         AC_MSG_ERROR([Cannot find update-mime-database, make sure it is installed and in your PATH, or configure with --disable-update-mime-database])
540         fi
544 ######################################################################
546 AC_PATH_PROGS(M4, gm4 m4, [none])
547 if test "X$M4" = "Xnone" ; then
548         AC_MSG_ERROR([Did not find a m4 executible.  You need to make sure
549         that m4 is installed on your system and that m4 is in your path])
551 AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug])
552 pcb_m4_r=`echo "eval(-2/2)" | $M4`
553 if test "$pcb_m4_r" != "-1" ; then
554         AC_MSG_RESULT([yes])
555         AC_MSG_ERROR([It appears that $M4 has a bug involving division
556 with negative numbers.  In particular it just returned the result that
557 -2/2 = $pcb_m4_r instead of -1.  This is a known bug in GNU m4-1.4.9.  Please
558 install a non-broken m4.])
559 else
560         AC_MSG_RESULT([no])
564 AC_PATH_PROGS(WISH, wish wish85 wish8.5 wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
565 if test "X$WISH" = "Xnone" ; then
566         AC_MSG_ERROR([Did not find the wish executible.  You need to make sure
567         that tcl is installed on your system and that wish is in your path])
570 AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
571 GNUM4=$M4
572 AC_SUBST(GNUM4)
573 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
575 AC_PATH_PROG(PDFLATEX, pdflatex, notfound)
576 AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound)
578 AC_PATH_PROG(TEXI2DVI, texi2dvi, notfound)
579 AM_CONDITIONAL(MISSING_TEXI2DVI, test x$TEXI2DVI = xnotfound)
581 AC_PATH_PROG(PS2PDF, ps2pdf, notfound)
582 AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound)
584 # used to build some of the getting started guide
585 AC_PATH_PROG(GSCHEM, gschem, notfound)
586 AM_CONDITIONAL(MISSING_GSCHEM, test x$GSCHEM = xnotfound)
588 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
589         if test "$PDFLATEX" = "notfound" -o "$TEXI2DVI" = "notfound" -o "$PS2PDF" = "notfound" ; then
590                 AC_MSG_ERROR([It appears that you are building from a source tree obtained
591 via git but you do not have the required tools installed to build the documentation.  Here
592 is a list of tools and the detected values:
593 PDFLATEX:  $PDFLATEX
594 TEXI2DVI:  $TEXI2DVI
595 PS2PDF:    $PS2PDF
596 GSCHEM:    $GSCHEM
598 Either make sure these tools are installed or disable building and installing the documentation
599 by using the --disable-doc configure option.
601         fi
604 ############################################################################
606 # These checks are for tools used by the testsuite.  It will not be fatal
607 # if these are missing because this is primarily for developer use.  It is
608 # possible that we might add some --enable flag in the future that forces
609 # full tools for development work.
611 # Check for ImageMagick tools used by the testsuite
612 AC_PATH_PROG(IM_ANIMATE, animate, notfound)
613 AC_PATH_PROG(IM_COMPARE, compare, notfound)
614 AC_PATH_PROG(IM_COMPOSITE, composite, notfound)
615 AC_PATH_PROG(IM_CONVERT, convert, notfound)
616 AC_PATH_PROG(IM_DISPLAY, display, notfound)
617 AC_PATH_PROG(IM_MONTAGE, montage, notfound)
618 missing_magick=""
619 test "${IM_ANIMATE}" != "notfound" || missing_magick="${missing_magick} animate"
620 test "${IM_COMPARE}" != "notfound" || missing_magick="${missing_magick} compare"
621 test "${IM_COMPOSITE}" != "notfound" || missing_magick="${missing_magick} composite"
622 test "${IM_CONVERT}" != "notfound" || missing_magick="${missing_magick} convert"
623 test "${IM_DISPLAY}" != "notfound" || missing_magick="${missing_magick} display"
624 test "${IM_MONTAGE}" != "notfound" || missing_magick="${missing_magick} montage"
626 AC_MSG_CHECKING([if all ImageMagick tools needed for the testsuite were found])
627 if test "X${missing_magick}" != "X" ; then
628     AC_MSG_RESULT([no.  The testsuite will be disabled because the following
629 tools from the ImageMagick suite were not found:
630 ${missing_magick}
631 No loss in pcb functionality should be experienced, you just will not
632 be able to run the full regression testsuite.
634     have_magick=no
635 else
636     AC_MSG_RESULT([yes])
637     have_magick=yes
640 have_test_tools=yes
642 test $have_magick = yes || have_test_tools=no
644 # the RS274-X export HID is partially checked by looking at the result with
645 # gerbv
646 AC_PATH_PROG(GERBV, gerbv, notfound)
647 test $GERBV != notfound || have_test_tools=no
650 AM_CONDITIONAL(HAVE_TEST_TOOLS, test x$have_test_tools = xyes)
651 AC_MSG_CHECKING([if all the required testsuite tools were found])
652 if test x$have_test_tools = xyes ; then
653         AC_MSG_RESULT([yes])
654 else
655         AC_MSG_RESULT([no -- the testsuite will be disabled])
660 ############################################################################
663 dnl Checks for libraries.
664 AC_CHECK_LIB(m, sqrt)
665 AC_CHECK_LIB(dl, dlopen)
666 AC_CHECK_LIB(xnet, gethostbyname)
667 AC_CHECK_LIB(fl, yywrap)
668 AC_CHECK_FUNCS(strerror)
669 AC_CHECK_FUNCS(regcomp re_comp)
670 AC_CHECK_FUNCS(logf expf rint)
671 AC_CHECK_FUNCS(vsnprintf)
672 AC_CHECK_FUNCS(getpwuid getcwd)
673 AC_CHECK_FUNCS(rand random)
674 AC_CHECK_FUNCS(stat)
676 AC_CHECK_FUNCS(mkdtemp)
678 # normally used for all file i/o
679 AC_CHECK_FUNCS(popen)
681 # for lrealpath.c
682 AC_CHECK_FUNCS(realpath canonicalize_file_name)
683 libiberty_NEED_DECLARATION(canonicalize_file_name)
685 # for pcb_spawnvp in action.c on Windows
686 AC_CHECK_FUNCS(_spawnvp)
688 AC_HEADER_STDC
689 AC_CHECK_HEADERS(limits.h locale.h string.h sys/types.h regex.h pwd.h)
690 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h sys/wait.h)
691 AC_CHECK_HEADERS(dlfcn.h)
693 if test "x${WIN32}" = "xyes" ; then
694         AC_CHECK_HEADERS(windows.h)
696 # Search for glib
697 PKG_CHECK_MODULES(GLIB, glib-2.0, ,
698                 [AC_MSG_RESULT([Note: cannot find glib-2.0.
699 You may want to review the following errors:
700 $GLIB_PKG_ERRORS])]
703 need_gdlib=no
704 with_gif=no
705 with_png=no
706 with_jpeg=no
708 for e in $HIDLIST; do
709     case $e in
710       lesstif )
711         AC_PATH_XTRA
712         save_CPPFLAGS="$CPPFLAGS"
713         CPPFLAGS="$X_CFLAGS"
714         AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
715         AC_CHECK_LIB(ICE, main, , , $X_LIBS)
716         AC_CHECK_LIB(SM, main, , , $X_LIBS)
717         AC_CHECK_LIB(Xext, main, , , $X_LIBS)
718         AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
719         AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
720         AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
721         AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS)
722         CPPFLAGS="$save_CPPFLAGS"
723         case $ac_cv_lib_Xm_XmCreateMainWindow in
724           no )
725             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
726             ;;
727           * ) ;;
728         esac
729         AC_CHECK_HEADERS(Xm/Xm.h)
730         case $ac_cv_header_Xm_Xm_h in
731           no )
732             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
733             ;;
734           * ) ;;
735         esac
736         ;;
738       gtk )
739         # Check for pkg-config
740         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
741         if test "$PKG_CONFIG" = "no"; then
742                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
743         fi
745         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0, ,
746                 [AC_MSG_ERROR([Cannot find gtk+ >= 2.18.0, install it and rerun ./configure
747 Please review the following errors:
748 $GTK_PKG_ERRORS])]
749         )
750         GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
751         GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
753         if test "x$enable_gl" = "xyes"; then
754                 # Check for GtkGLExt
755                 PKG_CHECK_MODULES(GTKGLEXT, gtkglext-1.0 >= 1.0.0, , [AC_MSG_ERROR([
756 *** Required version of gtkglext is not installed - please install first ***
757 Please review the following errors:
758 $GTKGLEXT_PKG_ERRORS])]
759                 )
760         GTKGLEXT_VER=`$PKG_CONFIG gtkglext-1.0 --modversion`
761         fi
763         ;;
765       png)
766         need_gdlib=yes
767         AC_MSG_CHECKING([if GIF output from the png HID is desired])
768         AC_ARG_ENABLE([gif],
769                 [  --disable-gif           Disable support for gif output when the png HID is used [[default=include gif support]]],
770                 [
771                 if test "X$enable_gif" != "Xno" ; then
772                         AC_MSG_RESULT([yes])
773                         with_gif=yes
774                 else
775                         AC_MSG_RESULT([no])
776                 fi
777                 ],
778                 [
779                 AC_MSG_RESULT([yes])
780                 with_gif=yes
781                 ])
783         AC_MSG_CHECKING([if JPEG output from the png HID is desired])
784         AC_ARG_ENABLE([jpeg],
785                 [  --disable-jpeg          Disable support for JPEG output when the png HID is used [[default=include JPEG support]]],
786                 [
787                 if test "X$enable_jpeg" != "Xno" ; then
788                         AC_MSG_RESULT([yes])
789                         with_jpeg=yes
790                 else
791                         AC_MSG_RESULT([no])
792                 fi
793                 ],
794                 [
795                 AC_MSG_RESULT([yes])
796                 with_jpeg=yes
797                 ])
799         AC_MSG_CHECKING([if PNG output from the png HID is desired])
800         AC_ARG_ENABLE([png],
801                 [  --disable-png           Disable support for PNG output when the png HID is used [[default=include PNG support]]],
802                 [
803                 if test "X$enable_png" != "Xno" ; then
804                         AC_MSG_RESULT([yes])
805                         with_png=yes
806                 else
807                         AC_MSG_RESULT([no])
808                 fi
809                 ],
810                 [
811                 AC_MSG_RESULT([yes])
812                 with_png=yes
813                 ])
814         ;;
816       gcode|nelma)
817         need_gdlib=yes
818         with_png=yes
819         ;;
821     esac
822 done
824 if test "$need_gdlib" = "yes"; then
825         # Check for gdlib-config for gd (www.boutell.com/gd)
826         AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no)
827         if test "$GDLIB_CONFIG" = "no"; then
828                 AC_MSG_RESULT([Cannot find gdlib-config.
829 Make sure it is installed and in your PATH.
830 gdlib-config is part of the GD library available from www.boutell.com/gd.
831 This is needed for the png HID.  I will look for libgd anyway and maybe
832 you will get lucky.
834                 if test "$WIN32" != "yes" ; then
835                         AC_CHECK_LIB(gd,main,,
836                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lgd could not be found]]))
837                 else 
838                         AC_CHECK_LIB(bgd,main,,
839                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lbgd could not be found]]))
840                 fi
841         else
842                 if test "$WIN32" = "yes" ; then
843                         GD=bgd
844                 else
845                         GD=gd
846                 fi
847                 AC_MSG_CHECKING([for libgd cflags])
848                 GD_CFLAGS="`$GDLIB_CONFIG --cflags`"
849                 AC_MSG_RESULT([$GD_CFLAGS])
850                 AC_MSG_CHECKING([for libgd libs])
851                 GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}"
852                 AC_MSG_RESULT([$GD_LIBS])
853         fi
854    
855         # since some linux systems evidently install gdlib-config but fail to
856         # install the headers (nice), check for the header too and fail if it
857         # is not there.
858         save_CPPFLAGS="$CPPFLAGS"
859         CPPFLAGS="$CPPFLAGS $GD_CFLAGS"
860         AC_CHECK_HEADERS(gd.h)
861         CPPFLASS="$save_CPPFLAGS"
862         case $ac_cv_header_gd_h in
863              no )
864                 AC_MSG_ERROR([
865 You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd.
866 This is needed for the nelma and/or png HID.
868                 ;;
869              * ) ;;
870         esac
871         
872         # Some versions of gd (prior to the expiration of the
873         # patent related to gif compression) do not support
874         # gif output.  Check for that here.
875         save_LIBS="$LIBS"
876         LIBS="$save_LIBS $GD_LIBS $X_LIBS"
878         if test "X$with_gif" = "Xyes" ; then
879                 AC_CHECK_FUNCS(gdImageGif)
880                 if test "$ac_cv_func_gdImageGif" != "yes"; then
881                         AC_MSG_ERROR([Your gd installation does not appear to include gif support.
882 You may need to update your installation of gd or disable
883 gif export with --disable-gif])
884                 fi
885         fi
887         if test "X$with_jpeg" = "Xyes" ; then
888                 AC_CHECK_FUNCS(gdImageJpeg)
889                 if test "$ac_cv_func_gdImageJpeg" != "yes"; then
890                         AC_MSG_ERROR([Your gd installation does not appear to include JPEG support.
891 You may need to update your installation of gd or disable
892 JPEG export with --disable-jpeg])
893                 fi
894         fi
896         if test "X$with_png" = "Xyes" ; then
897                 AC_CHECK_FUNCS(gdImagePng)
898                 if test "$ac_cv_func_gdImagePng" != "yes"; then
899                         AC_MSG_ERROR([Your gd installation does not appear to include PNG support.
900 You may need to update your installation of gd or disable
901 PNG export with --disable-png])
902                 fi
903         fi
904         LIBS="$save_LIBS"
907 AM_CONDITIONAL(PNG, test x$with_png = xyes)
908 AM_CONDITIONAL(GIF, test x$with_gif = xyes)
910 # ------------- check if png previews should be built for pcblib-newlib
911 AC_MSG_CHECKING([if the m4lib to newlib export should create png previews])
912 AC_ARG_ENABLE(
913         [m4lib-png],
914         [  --enable-m4lib-png      Enable creating png previews for the m4 library],
915         [],[enable_m4lib_png=no])
916 AC_MSG_RESULT([$enable_m4lib_png])
917 AM_CONDITIONAL(PNG_PREVIEW, test x$enable_m4lib_png = xyes)
920 # Run away.... more ugly stuff here.  By default we don't actually build
921 # pcblib-newlib from pcblib unless we are building from cvs or git sources.
922 # The reason is it takes a while and requires the png HID.  The problem is,
923 # what if someone wants to use --enable-m4lib-png but the tarball was built
924 # without the previews.  Or, what if someone does not want the PNG previews
925 # but the person building the tarball included them.  Ugh!  So what the following
926 # code attempts to do is detect that mismatch situation.  Note that we only
927 # want to kick this code in when *not* building from git or cvs sources.
928 build_pcblib_newlib=no
929 if test "$pcb_sources" = "tarball" ; then
930         AC_MSG_CHECKING([If pcblib-newlib was built with png previews])
931         stamp=$srcdir/lib/pcblib-newlib.stamp
932         if test ! -f ${stamp} ; then
933                 AC_MSG_RESULT([unknown, missing ${stamp}])
934                 build_pcblib_newlib=yes
935         else
936                 if test "`cat ${stamp}`" = "png-preview=yes" ; then
937                         AC_MSG_RESULT([yes])
938                         # lib exists and built with preview.
939                         # if we don't want the preview, than rebuild
940                         if test x$enable_m4lib_png != xyes ; then
941                                 build_pcblib_newlib=yes
942                         fi
943                 else
944                         AC_MSG_RESULT([no])
945                         # lib exists and built without preview.
946                         # if we want the preview, than rebuild
947                         if test x$enable_m4lib_png = xyes ; then
948                                 build_pcblib_newlib=yes
949                         fi
950                 fi
951         fi
952 else
953         build_pcblib_newlib=yes
955 AC_MSG_CHECKING([If pcblib-newlib needs to be rebuilt])
956 AC_MSG_RESULT([$build_pcblib_newlib])
957 AM_CONDITIONAL(BUILD_PCBLIB_NEWLIB, test x$build_pcblib_newlib = xyes)
959 if test "X$cross_compiling" = "Xyes" ; then
960         # we are cross compiling so we will need a build host binary for pcb
961         AC_PATH_PROG(PCB, [pcb], [notfound])
962 else
963         PCB="\${top_builddir}/src/pcb"
965 AC_SUBST(PCB)
967 # now make see how essential it was that we have a pcb executable for the build
968 # host
969 if test "X$pcb_git_version" = "Xyes" ; then
970         if test "X$docs_yesno" = "Xyes" -o "X$enable_m4lib_png" = "Xyes" ; then
971                 if test "$PCB" = "notfound" ; then
972                         AC_MSG_ERROR([You have selected a build with m4lib png
973 previews enabled and/or with building the documentation enabled but you also
974 appear to be cross-compiling.  For this to work, you must have a pcb installed that
975 can run on this machine (the build machine) because it is needed for generating
976 library footprint png previews as well as some of the figures in the documentation.
977 If you wish to skip building the documentation and the footprint previews then add
978 --disable-doc --disable-m4lib-png
979 This will allow your cross build to work.])
980                 fi
981         fi
984 # ------------- Xrender -------------------
985 have_xrender=no
986 AC_CHECK_LIB(Xrender,XRenderQueryExtension,have_xrender=yes,have_xrender=no,$X_LIBS)
988 AC_ARG_ENABLE([xrender],
989 [  --disable-xrender       Compile and link with Xrender [default=yes]])
990 case "$have_xrender:$enable_xrender" in
991    no:* ) ;;
992    *:no ) ;;
993    * )
994      X_LIBS="-lXrender $X_LIBS"
995      AC_DEFINE([HAVE_XRENDER], 1,
996                 [Define to 1 if Xrender is available])
997      ;;
998 esac
1000 # ------------- Xinerama -------------------
1001 have_xinerama=no
1002 AC_CHECK_LIB(Xinerama,XineramaQueryExtension,have_xinerama=yes,have_xinerama=no,$X_LIBS)
1004 AC_ARG_ENABLE([xinerama],
1005 [  --disable-xinerama       Compile and link with Xinerama [default=yes]])
1006 case "$have_xinerama:$enable_xinerama" in
1007    no:* ) ;;
1008    *:no ) ;;
1009    * )
1010      X_LIBS="-lXinerama $X_LIBS"
1011      AC_DEFINE([HAVE_XINERAMA], 1,
1012                 [Define to 1 if Xinerama is available])
1013      ;;
1014 esac
1016 # ------------- dmalloc -------------------
1017 dnl dmalloc checks
1018 with_dmalloc=no
1019 AC_MSG_CHECKING([if dmalloc debugging should be enabled])
1020 AC_ARG_ENABLE([dmalloc],
1021 [  --enable-dmalloc        Compile and link with dmalloc for malloc debugging [default=no]],
1023 if test "X$enable_dmalloc" != "Xno" ; then
1024         AC_MSG_RESULT([yes])
1025         AC_CHECK_HEADER(dmalloc.h,,
1026                 AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
1027         AC_CHECK_LIB(dmalloc,main,,
1028                 AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]))
1029         DMALLOC_LIBS="-ldmalloc"
1030         with_dmalloc=yes
1031 else
1032         AC_MSG_RESULT([no])
1033         DMALLOC_LIBS=""
1037         AC_MSG_RESULT([no])
1038         DMALLOC_LIBS=""
1041 # ------------- ElectricFence -------------------
1042 dnl ElectricFence checks
1043 with_efence=no
1044 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
1045 AC_ARG_ENABLE([efence],
1046 [  --enable-efence         Link with ElectricFence for malloc debugging [default=no]],
1048 if test "X$enable_efence" != "Xno" ; then
1049         AC_MSG_RESULT([yes])
1050         AC_CHECK_LIB(efence,main,,
1051                 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
1052         with_efence=yes
1053 else
1054         AC_MSG_RESULT([no])
1058 AC_MSG_RESULT([no])
1061 # ------------- Enable Debug code -------------------
1062 AC_MSG_CHECKING([for whether to enable debugging code])
1063 AC_ARG_ENABLE([debug],
1064 [  --enable-debug          Enable debugging code],
1065 [],[enable_debug=no])
1067 AC_MSG_RESULT([$enable_debug])
1068 AM_CONDITIONAL(DEBUG_BUILD, test x$enable_debug = xyes)
1070 # ------------- mkdir required for win32 compatibility ------------
1071 # WIN32 mkdir takes only one argument, POSIX takes two.
1072 # #include "misc.h" where mkdir is required.
1073 m4_include([m4/m4_ax_func_mkdir.m4])
1074 AX_FUNC_MKDIR
1076 # ------------- Type used for "Coord" type -------------------
1078 AC_CHECK_HEADERS(stdint.h)
1079 AC_ARG_ENABLE([coord64],
1080 [  --enable-coord64        Force 64-bit coordinate types],
1081 [],[enable_coord64=no])
1082 AC_ARG_ENABLE([coord32],
1083 [  --enable-coord32        Force 32-bit coordinate types],
1084 [],[enable_coord32=no])
1086 COORDTYPE="long"
1088 echo "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h"
1089 case "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" in
1090   yes:no:yes )
1091     COORD_TYPE="int32_t"
1092     COORD_MAX="INT32_MAX"
1093     ;;
1094   no:yes:yes )
1095     COORD_TYPE="int64_t"
1096     COORD_MAX="INT64_MAX"
1097     ;;
1098   yes:no:no  )
1099     COORD_TYPE="int"
1100     COORD_MAX="INT_MAX"
1101     ;;
1102   no:yes:no  )
1103     COORD_TYPE="long long"
1104     COORD_MAX="LLONG_MAX"
1105     ;;
1106   yes:yes:*  )
1107     AC_MSG_ERROR("*** cannot require both 32 and 64 bit coordinates")
1108     ;;
1109   *:*:*    )
1110     COORD_TYPE="long"
1111     COORD_MAX="LONG_MAX"
1112     ;;
1113 esac
1114 AC_DEFINE_UNQUOTED([COORD_TYPE],[$COORD_TYPE],
1115   [C type for Coordinates])
1116 AC_DEFINE_UNQUOTED([COORD_MAX],[$COORD_MAX],
1117   [Maximum value of coordinate type])
1119 # ------------- Complete set of CPPFLAGS and LIBS -------------------
1121 CPPFLAGS="$CPPFLAGS $X_CFLAGS $DBUS_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS $GD_CFLAGS $CAIRO_CFLAGS $GTKGLEXT_CFLAGS $GLU_CFLAGS $GL_CFLAGS"
1122 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"
1125 # if we have gcc then add -Wall
1126 if test "x$GCC" = "xyes"; then
1127         # see about adding some extra checks if the compiler takes them
1128         for flag in -Wall ; do
1129                 case " ${CFLAGS} " in
1130                         *\ ${flag}\ *)
1131                                 # flag is already present
1132                                 ;;
1133                         *)
1134                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1135                                 ac_save_CFLAGS="$CFLAGS"
1136                                 CFLAGS="$CFLAGS ${flag}"
1137                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1138                                         [AC_MSG_RESULT([yes])],
1139                                         [AC_MSG_RESULT([no])
1140                                          CFLAGS="$ac_save_CFLAGS"
1141                                         ]
1142                                 )
1143                                 ;;
1144                 esac
1145         done
1148 CXXFLAGS="$CFLAGS"
1150 # Now add C-specific flags
1151 if test "x$GCC" = "xyes"; then
1152         # see about adding some extra checks if the compiler takes them
1153         for flag in -Wdeclaration-after-statement ; do
1154                 case " ${CFLAGS} " in
1155                         *\ ${flag}\ *)
1156                                 # flag is already present
1157                                 ;;
1158                         *)
1159                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1160                                 ac_save_CFLAGS="$CFLAGS"
1161                                 CFLAGS="$CFLAGS ${flag}"
1162                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1163                                         [AC_MSG_RESULT([yes])],
1164                                         [AC_MSG_RESULT([no])
1165                                          CFLAGS="$ac_save_CFLAGS"
1166                                         ]
1167                                 )
1168                                 ;;
1169                 esac
1170         done
1173 # See if we are building gcc with C++.
1174 AC_ARG_ENABLE(build-with-cxx,
1175 [  --enable-build-with-cxx build with C++ compiler instead of C compiler],
1176 ENABLE_BUILD_WITH_CXX=$enableval,
1177 ENABLE_BUILD_WITH_CXX=no)
1179 case "$ENABLE_BUILD_WITH_CXX" in
1180   yes)
1181     CC_OR_CXX="$CXX"
1182     ;;
1183   no)
1184     CC_OR_CXX="$CC"
1185     ;;
1186 esac
1187 AC_SUBST(CC_OR_CXX)
1189 # font filename
1190 FONTFILENAME=${FONTFILENAME:-"default_font"}
1191 AC_SUBST(FONTFILENAME)
1192 AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
1194 # standard autoconf variables
1195 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
1196 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
1197 CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\""
1199 # directory for old-style library and for fonts
1200 PCBLIBDIR=${datadir}/pcb
1201 AC_SUBST(PCBLIBDIR)
1202 #AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
1203 CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
1205 # name for old-style library
1206 LIBRARYFILENAME=pcblib
1207 AC_SUBST(LIBRARYFILENAME)
1208 AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
1211 # directory for new library
1212 PCBTREEDIR=${datadir}/pcb/newlib
1213 PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib
1214 PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
1215 AC_SUBST(PCBTREEDIR)
1216 AC_SUBST(PCBTREEPATH)
1217 #AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
1218 CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
1219 CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\""
1221 # Figure out relative paths
1222 AC_MSG_CHECKING([for the bindir to pcblibdir relative path])
1223 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir])
1224 adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S])
1225 AC_MSG_RESULT([$bindir_to_pcblibdir])
1226 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir])
1228 AC_MSG_CHECKING([for the bindir to pcbtreedir relative path])
1229 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir])
1230 adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S])
1231 AC_MSG_RESULT([$bindir_to_pcbtreedir])
1232 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir])
1235 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
1236 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
1237 adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S])
1238 AC_MSG_RESULT([$bindir_to_execprefix])
1239 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
1242 BTNMOD=${BTNMOD:-"Mod1"}
1243 AC_SUBST(BTNMOD)
1245 TOPDIRS=
1246 for dir in src lib newlib doc example tools tutorial README_FILES
1248    test -d $dir/. && TOPDIRS="$TOPDIRS $dir"
1249 done
1250 AC_SUBST(TOPDIRS)
1252 AC_CONFIG_FILES(Makefile data/Makefile intl/Makefile po/Makefile.in)
1254 if test -d $srcdir/README_FILES; then
1255    AC_CONFIG_FILES(README_FILES/Makefile)
1257 if test -d $srcdir/doc; then
1258    AC_CONFIG_FILES(doc/Makefile)
1260 if test -d $srcdir/doc/gs; then
1261    AC_CONFIG_FILES(doc/gs/Makefile)
1262    AC_CONFIG_FILES(doc/gs/gafrc)
1263    AC_CONFIG_FILES(doc/gs/gschemrc)
1265 if test -d $srcdir/example; then
1266    AC_CONFIG_FILES(example/Makefile)
1267    AC_CONFIG_FILES(example/libraries/Makefile)
1269 if test -d $srcdir/lib; then
1270    AC_CONFIG_FILES(lib/CreateLibraryContents.sh)
1271    AC_CONFIG_FILES(lib/CreateLibrary.sh)
1272    AC_CONFIG_FILES(lib/ListLibraryContents.sh)
1273    AC_CONFIG_FILES(lib/Makefile)
1274    AC_CONFIG_FILES(lib/QueryLibrary.sh)
1275    AC_CONFIG_FILES(lib/qfp-ui)
1277 if test -d $srcdir/newlib; then
1278    AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile)
1279    AC_CONFIG_FILES(newlib/Makefile)
1280    AC_CONFIG_FILES(newlib/connectors/Makefile)
1281    AC_CONFIG_FILES(newlib/crystal/Makefile)
1282    AC_CONFIG_FILES(newlib/electro-optics/Makefile)
1283    AC_CONFIG_FILES(newlib/headers/Makefile)
1284    AC_CONFIG_FILES(newlib/keystone/Makefile)
1285    AC_CONFIG_FILES(newlib/msp430/Makefile)
1286    AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile)
1287    AC_CONFIG_FILES(newlib/sockets/Makefile)
1288    AC_CONFIG_FILES(newlib/tests/Makefile)
1290 AC_CONFIG_FILES(src/Makefile)
1291 AC_CONFIG_FILES(src/icons/Makefile)
1292 if test -d $srcdir/tools; then
1293    AC_CONFIG_FILES(tools/Makefile)
1295 if test -d $srcdir/tutorial; then
1296    AC_CONFIG_FILES(tutorial/Makefile)
1299 dnl testsuite
1300 AC_CONFIG_FILES(tests/Makefile)
1302 dnl GTS 0.7.6 - http://gts.sourceforge.net/
1303 AC_CONFIG_FILES(gts/Makefile)
1305 dnl win32 build scripts
1306 AC_CONFIG_FILES(w32/Makefile)
1308 AC_OUTPUT
1310 with_gui=`echo $with_gui`
1311 with_printer=`echo $with_printer`
1312 with_exporters=`echo $with_exporters | sed 's/,/ /g'`
1314 expandedXDGDATADIR=`eval "echo $XDGDATADIR"`
1315 expandedKDEDATADIR=`eval "echo $KDEDATADIR"`
1317 AC_MSG_RESULT([
1318 ** Configuration summary for $PACKAGE $VERSION:
1320    Cross Compiling:          $cross_compiling
1321    CC:                       $CC
1322    CXX:                      $CXX
1323    CPPFLAGS:                 $CPPFLAGS
1324    CFLAGS:                   $CFLAGS
1325    CXXFLAGS:                 $CXXFLAGS
1326    LIBS:                     $LIBS
1327    PCB:                      $PCB
1329    GUI:                      $with_gui
1330    Printer:                  $with_printer
1331    Exporters:                $with_exporters
1332    Coordinate type:          $COORD_TYPE
1333    Source tree distribution: $pcb_sources
1334    Build documentation:      $docs_yesno
1335    Build toporouter:         $enable_toporouter
1336    Enable toporouter output: $enable_toporouter_output
1337    xdg data directory:       $expandedXDGDATADIR
1338    KDE data directory:       $expandedKDEDATADIR
1339    dmalloc debugging:        $with_dmalloc
1340    ElectricFence debugging:  $with_efence
1341    Regression tests enabled: $have_test_tools