Subject: print/teTeX workaround for Solaris 9/sparc
To: SUNAGAWA Keiki <>
From: John D. Baker <>
List: tech-pkg
Date: 04/29/2004 04:24:48
Below is a post-configuration workaround which permits print/teTeX-bin
to build and install on SPARC Solaris 9 using lang/gcc3-[c.c++] as the
pkgsrc compilers:

cd ${LOCALBASE}/print/teTeX-bin/
bmake configure
mv work/tetex-src-2.0.2/texk/web2c/Makefile \
--- work/tetex-src-2.0.2/texk/web2c/Makefile.orig	Thu Apr 29 04:02:15 2004
+++ work/tetex-src-2.0.2/texk/web2c/Makefile	Wed Apr 28 22:31:27 2004
@@ -751,5 +751,5 @@
 pdftex: $(pdftex_o) $(pdftexextra_o) $(pdftexlibsdep)
-	$(kpathsea_cxx_link) $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) $(LOADLIBES) -nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm -lgcc -lc -lgcc
+	$(kpathsea_cxx_link) $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) $(LOADLIBES) -nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm -lgcc -lc -lgcc_s
 pdfetex: pdftexd.h $(pdfetex_o) $(pdfetexextra_o) $(pdftexlibsdep)
-	$(kpathsea_cxx_link) $(pdfetex_o) $(pdfetexextra_o) $(pdftexlibs) $(socketlibs) $(LOADLIBES) -nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm -lgcc -lc -lgcc
+	$(kpathsea_cxx_link) $(pdfetex_o) $(pdfetexextra_o) $(pdftexlibs) $(socketlibs) $(LOADLIBES) -nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm -lgcc -lc -lgcc_s
 pktogf: pktogf.o

Specifically, the targets for pdftex and pdfetex link against
libgcc.<suffix> twice, ignoring the dependency (reported by the link step
when it failed) on  So, I changed the second occurrance of
'-lgcc' to '-lgcc_s' and it succeeded.

Ideally, the above modifications need to be regressed back to the pre-
configuration patch phase, but that's a bit beyond me at this time.

Hope this helps someone else who finds themselves in a similar predicament.

John D. Baker, KN5UKS                    NetBSD     Darwin/MacOS X
jdbaker(at)mylinuxisp(dot)com                 OpenBSD            FreeBSD
BSD -- It just sits there and _works_!