by Jon Schneider on Easter Monday 2007

This is how I built pcb on OS X 10.4 (Tiger) on my G4 iBook at the beginning of April 2007 from CVS sources. The result seems to at least kind of work but I haven't had time to test it properly. Nor have I even noticed any other tools that accompany pcb.

I'm assuming you're happy fiddling with command lines, scripts, fink, X11 and swinging a sledge hammer at configure. Remember this isn't the correct way to do it and I have made no attempt to go back and make a cleaner job of it.

By using the "future" command along with ldd (actually otool -L) and dpkg -S I was able to find out exactly what fink packages I would need.

future warning: dependency will change several times once created but selecting the version 37 minutes from now.
gd2-shlibs: /sw/lib/libgd.2.dylib
gtk+2-shlibs: /sw/lib/libgtk-x11-2.0.0.dylib
gtk+2-shlibs: /sw/lib/libgdk-x11-2.0.0.dylib
glib2-shlibs: /sw/lib/libglib-2.0.0.dylib
glib2-shlibs: /sw/lib/libgmodule-2.0.0.dylib
pango1-xft2-shlibs: /sw/lib/libpango-1.0.0.dylib
glib2-shlibs: /sw/lib/libgobject-2.0.0.dylib
gtk+2-shlibs: /sw/lib/libgdk_pixbuf-2.0.0.dylib
So you'll want to install gtk+2, gtk2+2-dev, glib2 etc, the -dev packages getting you the headers.

I configured like this

LDFLAGS=-L/sw/lib CPPFLAGS='-I/sw/include -I/sw/include/glib-2.0 -I/sw/include/pango-1.0 -I/sw/include/atk-1.0' PKG_CONFIG_PATH=/sw/lib/pkgconfig ./configure --prefix=somewhere

but with modified configure script to cope with the lack of gtk pkg-config .pc file and possibly something else I have now forgotten.

A couple of symlinks to get headers found.

/sw/include/glib-2.0/glibconfig.h -> ../../lib/glib-2.0/include/glibconfig.h
/sw/include/gtk-2.0/gdkconfig.h -> ../../lib/gtk-2.0/include/gdkconfig.h
Annoyingly the missing headers above did not cause the make to stop. I don't know whether this is a makefile problem or quirk of this version of gcc.

Both the included yacc and bison choke on res_parse.y at line 42. At the time I did't know whether it was unnecessarily using a feature in the newer version of bison or what but being bone idle I simply thieved the corresponding .c and .h files from the February release of pcb. If only the name_prefix thing is there a reason not to simply use the -p option of yacc/bison instead ?

I then modified the failing link command line a bit to the following.

gcc -DNDEBUG -g -O2 -I/sw/include/gtk-2.0 -Wall -L/sw/lib -o pcb action.o autoplace.o autoroute.o buffer.o change.o clip.o command.o compat.o copy.o create.o crosshair.o data.o djopt.o draw.o drill.o error.o file.o find.o flags.o fontmode.o heap.o insert.o intersect.o line.o lrealpath.o main.o mirror.o misc.o move.o mtspace.o mymem.o netlist.o parse_l.o parse_y.o polygon.o polygon1.o puller.o print.o rats.o remove.o report.o res_parse.o res_lex.o rotate.o rtree.o rubberband.o search.o select.o set.o strflags.o thermal.o undo.o vector.o vendor.o hid/common/actions.o hid/common/flags.o hid/common/hidinit.o hid/common/hidnogui.o hid/common/extents.o libgtk.a liblpr.a libbom.a libgerber.a libpng.a libps.a -lgd -lfl -ldl -lm -lgtk-x11-2.0 -lgdk-x11-2.0 -lglib-2.0 -lgmodule-2.0 -lpango-1.0 -lgobject-2.0 -lgdk_pixbuf-2.0

It's entirely possible one or two of those libraries are extraneous.

otool -L (OS X's ldd) of pcb says this

/sw/lib/libgd.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.8)
/sw/lib/libgtk-x11-2.0.0.dylib (compatibility version 401.0.0, current version 401.9.0)
/sw/lib/libgdk-x11-2.0.0.dylib (compatibility version 401.0.0, current version 401.9.0)
/sw/lib/libglib-2.0.0.dylib (compatibility version 601.0.0, current version 601.6.0)
/sw/lib/libgmodule-2.0.0.dylib (compatibility version 601.0.0, current version 601.6.0)
/sw/lib/libpango-1.0.0.dylib (compatibility version 601.0.0, current version 601.0.0)
/sw/lib/libgobject-2.0.0.dylib (compatibility version 601.0.0, current version 601.6.0)
/sw/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 401.0.0, current version 401.9.0)
and pcb seems to work as far as I can tell with only the tiniest effort.