Remove lfs-uefi.txt symlink
[linux_from_scratch_hints.git] / PREVIOUS_FORMAT / xfig.txt
blob6c9d5a3bae0825f07a16a2f2af0f3168d5f8cfa3
1 TITLE:          Xfig and Transfig
3 LFS VERSION:    4.1, but probably anything with gcc >= 2.95.3
5 AUTHOR:         Uli Fahrenberg <uli at math dot auc dot dk>
7 SYNOPSIS:
8         Installing Xfig and Transfig in /usr
10 HINT:
12 Xfig is a powerful drawing program especially useful for schematic drawings,
13 and Transfig is the image format conversion tool that goes with it. Xfig
14 depends on Transfig, but Transfig can be used as a standalone tool, too. This
15 hint covers installation of them both, and we tweak the Imakefiles to make
16 them install in the /usr hierarchy, instead of /usr/X11R6 and /usr/local.
19 SOFTWARE:
21 xfig.3.2.4.full.tar.gz and transfig.3.2.4.tar.gz from
23         http://www.xfig.org/xfigdist/
26 DEPENDENCIES:
28 Xfig needs:
30         png
31         zlib (?)
33 Xfig will utilize:
35         jpeg
36         xpm
37         ghostscript
38         netpbm
40 Transfig needs:
42 Transfig will utilize:
44         png
45         xpm
47 I install Xfig first, but the order most probably doesn't matter. The variable
48 XFIGLIBDIR is used in both programs' Imakefiles and should point to the same
49 directory, so for consistency I declare it first:
51 XFIGLIBDIR=/usr/share/xfig
54 So now for the Xfig installation. If your X is too old and does not contain
55 Xpm, leave out the USEXPM stuff below, or install Xpm separately before (or
56 upgrade your X).
58 mv Imakefile{,.orig}
59 echo MANDIR=/usr/share/man/man1 > Imakefile
60 cat Imakefile.orig | sed "s:XCOMM BINDIR = /usr/bin/X11:BINDIR=/usr/bin:g" \
61     | sed "s:XCOMM MKDIRHIER = /bin/sh /usr/bin/X11/mkdirhier:MKDIRHIER=$(type -p mkdirhier):g" \
62     | sed "s:XCOMM #define USEXPM:#define USEXPM:g" \
63     | sed "s:XFIGLIBDIR = \$(LIBDIR)/xfig:XFIGLIBDIR=$XFIGLIBDIR:g" \
64     | sed "s:XFIGDOCDIR = \$(LIBDIR)/xfig:XFIGDOCDIR=/usr/share/doc/xfig:g" \
65     >> Imakefile
66 xmkmf
67 make
68 make install.all
71 Note: This will install some html and pdf documentation of Xfig, some of
72 it in Japanese. If you want to avoid the japanese stuff, replace the
73 `make install.all' above with
75 make install
76 make install.libs
77 make install.man
78 make install.rhtml
81 Leave out the last one if you're not interested in html documentation at all.
83 If your compilation bails out at SimpleMenu.c, you most probably do not have
84 Xaw3d installed. Don't worry, you don't need Xaw3d (not for Xfig, that is).
85 SimpleMenu.c wants to include some Xaw3d headers, but the original Xaw ones
86 will do fine. Do the following to your Xfig sources and you should be going
87 strong:
89 mv SimpleMenu.c{,.orig}
90 sed 's:#include <X11/Xaw3d/:#include <X11/Xaw/:g' SimpleMenu.c.orig \
91     > SimpleMenu.c
94 Thanks to Ken Moffat for the info. Note that not only will Xfig do fine with
95 Xaw instead of Xaw3d, it even seems to look the same regardless of which
96 headers are used.
99 OK, here we go with transfig. The DDA4 = -DA4 stuff is because I use DIN A4
100 paper, leave it out if you don't. For Xpm see above. The DDEPSFIG and
101 USELATEX2E sed's are useful only if you use LaTeX and partly influenced by my
102 personal tastes. Read the Imakefiles for further info (hint: There's graphicx
103 support too (and if you copy my instructions, you'll get both graphicx and
104 epsfig)).
106 mv Imakefile{,.orig} 
107 echo BINDIR=/usr/bin > Imakefile 
108 echo MANDIR=/usr/share/man/man1 >> Imakefile 
109 cat Imakefile.orig >> Imakefile 
110 mv fig2dev/Imakefile{,.orig} 
111 echo BINDIR=/usr/bin > fig2dev/Imakefile 
112 echo MANDIR=/usr/share/man/man1 >> fig2dev/Imakefile 
113 cat fig2dev/Imakefile.orig | \
114     sed "s:/usr/local/lib/X11/xfig:$XFIGLIBDIR:g" \
115     | sed "s:XCOMM #define USEXPM:#define USEXPM:g" \
116     | sed "s:XCOMM DDA4 = -DA4:DDA4 = -DA4:g" \
117     | sed "s:XCOMM DDEPSFIG = -DEPSFIG:DDEPSFIG = -DEPSFIG:g" \
118     | sed "s:FIG2DEV_LIBDIR = /usr/local/lib/fig2dev:FIG2DEV_LIBDIR=/usr/share/transfig:g" \
119     >> fig2dev/Imakefile 
120 mv transfig/Imakefile{,.orig} 
121 echo BINDIR=/usr/bin > transfig/Imakefile 
122 echo MANDIR=/usr/share/man/man1 >> transfig/Imakefile 
123 cat transfig/Imakefile.orig | \
124     sed "s:XCOMM USELATEX2E = -DLATEX2E:USELATEX2E = -DLATEX2E:g" \
125     >> transfig/Imakefile 
126 xmkmf 
127 make Makefiles 
128 make 
129 make install 
130 make install.man 
133 That's it.