Typo
[linux_from_scratch_hints.git] / OLD / X11+KDEguide.txt
blob2bd03c0f3b511f4760ad26c7963633edb99e51c7
1 TITLE:          How to get the most from KDE
2 LFS VERSION:    2.4
3 AUTHOR:         Sergey Ostrovsky <sostrovsky@snip.net>
5 SYNOPSIS:
6         Simply, how to get from a plain vanilla LFS system to a fully working KDE2 environment.
8 HINT:
9 How to get most from KDE - or rather how I did it
10 -------------------------------------------------
11 ver 1.02
13 09/16/2000
15 1. Preface
16    I would call it now 'How to get most from KDE - how I did it'.
17    Gerard Beekmans - author, maintainer, fire keeper, etc. of LFS
18    said that would be a good idea to write some notes about X - stuff.
19    What you are reading now is probably not what he meant.
20    No wonder - I'm usually busy writing programs, not novels.
21    The rule that I used to choose which packages are needed is simple -
22    For each package ( starting from X ) I checked if there are additional
23    tools this one can make use of.
24    This rule is just an instance of "freedom of choice".
25    So if you think different, I just hope that you can still find something
26    useful in this writing.
27    Order of packages installation is important. In general, every package depends
28    on package(s) previously installed.
30    Enjoy yourself!
32    Sergey Ostrovsky
33    sostrovsky@snip.net
35    09/15/2000
37 2. Packages to download
39    zlib-1.1.3.tar.gz
40         ftp://ftp.uu.net/graphics/png/src
42    libpng-1.0.8.tar.gz
43         ftp://ftp.uu.net/graphics/png/src
45    jpegsrc.v6b.tar.gz
46         ftp://ftp.uu.net/graphics/jpeg/
48    lcms-1.06.tar.gz
49         http://www.abaforum.es/martim/lcms.htm
51    libmng-0.9.2.tar.gz
52         http://www.libmng.com
53    doctools-1.2.tgz
54    X401src-1.tgz
55    X401src-2.tgz
56    X401src-3.tgz
57         ftp://ftp.xfree86.org/pub/XFree86/4.0.1/source/
59    xpm-3.4k
60         ftp://avahi.inria.fr/pub/xpm
62    tiff-v3.5.5.tar.gz
63         ftp://ftp.onshore.com/pub/libtiff/
65    qt-x11-2.2.0.tar.gz
66         http://www.trolltech.com
68    kdesupport-1.94.tar.bz2
69    kdelibs-1.94.tar.bz2
70    kdebase-1.94.tar.bz2
71    kdeutils-1.94.tar.bz2
72    kdegraphics-1.94.tar.bz2
73    kdemultimedia-1.94.tar.bz2
74    kdenetwork-1.94.tar.bz2
75    kdeadmin-1.94.tar.bz2
76    kdepim-1.94.tar.bz2
77    koffice-1.94.tar.bz2
78    kdegames-1.94.tar.bz2
79    kdetoys-1.94.tar.bz2
80         http://www.kde.org
82 3. Installation.
83    For each package I assume you have it unpacked somewhere
84    and this somewhere is your current directory.
85    Also, it is worth nothing that -mcpu=i586 and -march=i586
86    should be changed according to your preferences.
87    If you see -O2 optimization level - it's mine.
88    If you see -O3 that means the package's developer approved
89    this, and it isn't gonna hurt.
90    Neither does it hurt to run ldconfig after installing a package.
91    As Mr.Almesberger said, "You can't run lilo too often ...".
93 3.1 zlib
94 --------
95      Zlib is the library used for compression.
96    In particular, it used by X. Actually, X by default installs the
97    version of zlib, which is a) just static; and b) old.
99 3.1.1
100    In Makefile.in find target rule
101         $(SHAREDLIB).$(VER):
102    In the two lines following former you'll see
103    $(OBJS). In these two lines insert $(OBJA) after each occurence
104    of $(OBJS), so it'll look like
105         $(OBJS) $(OBJA)
107 3.1.2
108    Subdirectory ./contrib has bunch of directories,
109    each for particular processor architecture, i.e.asm586, and so on.
110    There are Assembler source files for time-critical functions.
111    Run
113         cp -v contrib/< dir for your processor architecture >/match.S ./
115 3.1.3
116    Run
118         CFLAGS="-O3 -DASMV -mcpu=i586 -march=i586"      \
119         ./configure                                     \
120         --prefix=/usr                                   \
121         --shared
123         OBJA=match.o make -e
125         make install
127         cp -va zlib.3 /usr/share/man/man3
129 3.2 libpng
130 ----------
131     Portable network graphics support. Used by KDE
133 3.2.1
134    Copy the right makefile to the package's toplevel directory :
136         cp -va scripts/makefile.linux Makefile
138 3.2.2
139    In this Makefile correct :
141         prefix=/usr
143         ZLIBLIB=/usr/lib
145         ZLIBINC=/usr/include
147    Add to CFLAGS
149         -mcpu=i586 -march=i586
151 3.2.3 Run
153         make test
155         make install
157         cp -va libpng.3 libpngpf.3 /usr/share/man/man3
159         cp -va png.5 /usr/share/man/man5
161 3.3 libjpeg
162 -----------
163    Jpeg graphics format support. Used by KDE.
165 3.3.1
166    Run
167         CFLAGS="-O3 -mcpu=i586 -march=i586"     \
168         ./configure                             \
169         --prefix=/usr                           \
170         --enable-shared                         \
171         --enable-maxmem=100
173         make
175         mandir=/usr/share/man/man1 make -e install
177 3.4 lcms
178 -------
180 3.4.1
181    Run
183         CFLAGS="-O2 -mcpu=i586 -march=i586"             \
184         ./configure                                     \
185         --prefix=/usr
187         make
189         make install
191 3.4.2
192    Find in /usr/include/lcms/lcms.h
193    defines of PACKAGE and VERSION an embrace it with
194    #ifndef / #endif, so
195                                  #ifndef PACKAGE
196    #define PACKAGE <blah>   -->  #define PACKAGE <blah>
197                                  #endif
199                                  #ifndef VERSION
200    #define VERSION <blah>   -->  #define VERSION <blah>
201                                  #endif
203    This done in order to remove conflicts with libmng ( follows ).
205 3.5 libmng
206 ----------
207 3.5.1
208    In configure.in find the piece of script :
210   AC_CHECK_HEADER(lcms.h,
211     AC_CHECK_LIB(lcms, cmsCreateRGBProfile, [
212       LIBS="$LIBS -llcms"
213       AC_DEFINE(MNG_INCLUDE_LCMS)], [
214       test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
215       AC_MSG_WARN(lcms library not found)]),
216     test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
217     AC_MSG_WARN(lcms header not found))])
219   and replace it with
221     AC_CHECK_LIB(lcms, cmsCreateRGBProfile, [
222       LIBS="$LIBS -llcms"
223       AC_DEFINE(MNG_FULL_CMS)], [
224       test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
225       AC_MSG_WARN(lcms library not found)])])
227   Yes, this is a hack. I avoid checking if lcms.h exists and is a valid
228   C/C++ header. The thing is, cpp ( which AC_CHECK_HEADER uses for this
229   test ) returns non-zero on this header, and I don't care why.
230   Have plenty of fixin' crap at full-time job.
232 3.5.2
233    Run
234         autoconf
236         CFLAGS="-O2 -mcpu=i586 -march=i586"             \
237         ./configure                                     \
238         --prefix=/usr                                   \
239         --with-zlib=/usr                                \
240         --with-lcms=/usr                                \
241         --with-jpeg=/usr
243         make
245         make install
247 5.6 doctools
248 ------------
250 5.6.1
251   Edit jade/Makefile
253   Find:
255 #LIBDIRS=$(SP_LIBDIRS) $(JADE_LIBDIRS)
256 LIBDIRS=$(SP_LIBDIRS)
257 #PROGDIRS=$(SP_PROGDIRS) $(JADE_PROGDIRS)
258 PROGDIRS=$(SP_PROGDIRS)
260   Change to :
262 LIBDIRS=$(SP_LIBDIRS) $(JADE_LIBDIRS)
263 #LIBDIRS=$(SP_LIBDIRS)
264 PROGDIRS=$(SP_PROGDIRS) $(JADE_PROGDIRS)
265 #PROGDIRS=$(SP_PROGDIRS)
267   Although full doctools package is included, only part of it
268   gets compiled and installed - just to support X11-supplied docs.
269   The full package is a good thing itself. KDE stuff makes use of it.
271   DO NOT run autoconf or automake ! This Makefile heavily patched, while Makefile.in
272   is virgin.
274 5.6.2
275   Run ( from top - level package directory, as I said at the beginning )
277   make
279   make install
281 5.6.3
282   In the script /usr/local/bin/sgmlfmt change the first line
284   #!/usr/local/bin/perl
286   to :
288   #!/usr/bin/perl
290   or whatever place your perl lives.
292 5.7 XFree86-4.01 ( finally ... )
293 --------------------------------
294   This section has to do with X installation only.
295   After successful ( I wish you so ) installation you should configure X.
296   README ( or something like ) which comes with X explains this very well.
297   NOTE : I have plain vanilla Matrox Millenium 4M card 1996 vintage.
298   Configuration files that you'll deal with have quite a few definitions
299   for new fancy cards. If you are lucky owner of these, you are on your own.
301 5.7.1
302    cp config/cf/xf86site.def config/cf/host.def
304    in the file config/cf/host.def uncomment and define following symbols :
306 /*        Here touch only -mcpu=i586 -march=i586 !  S.O.  */
308 #define DefaultGcc2i386Opt      -O2 -fno-strict-aliasing -fno-strength-reduce   \
309                                 -pipe -mcpu=i586 -march=i586
311 /* This is not in the file ! Type it yourself.
312    And please, do it. This is not about -Wall which,
313    as you know, makes no impact to the mode the compiler
314    works in. If not set here, the default options will be used,
315    which is probably not what you want.  S.O.
318 #define DefaultCCOptions  -Wall
320 /*      No questions, I hope. S.O. */
322 #define TermcapLibrary          -lncurses
324 /*      You'll see the list of drivers bundled into distribution.
325         Pick just your(s). Otherwise might have a headache with
326         compiling stuff which is actually useless for you. S.O.
329 #define XF86CardDrivers         <your driver(s)>
331 #define InstallXinitConfig      YES
332 #define InstallXdmConfig        YES
333 #define InstallFSConfig         YES
335 #define HasSgmlFmt              YES
337 /* This is not in the file ! Type yourself. S.O. */
338 #define BuildAllDocs            YES
340 #define BuildSpecsDocs          YES
341 #define SpecsDocDirs            Xext Xv xterm
344 /* This is not in the file ! Type yourself. S.O. */
345 #define HasZlib YES
347 5.7.2
348    in the file config/cf/site.def
350    Find definition of InstallXserverSetUID and replace with :
352 #ifdef  InstallXserverSetUID
353 #undef  InstallXserverSetUID
354 #endif
355 #define InstallXserverSetUID    YES
357    Insert definition of ManDirectoryRoot :
359 #ifdef  ManDirectoryRoot
360 #undef  ManDirectoryRoot
361 #endif
362 #define ManDirectoryRoot        /usr/share/man
364    Find definition of ProjectRoot and replace ( if needed ) with :
366 #ifndef ProjectRoot
367 #define ProjectRoot /usr/X11R6
368 #endif
370 5.7.3
371    in the file config/cf/Imake.rules
372    find definition of InstallHtmlManPageAliases macro and replace
373    it with:
375 #ifndef InstallHtmlManPageAliases
376 #if BuildHtmlManPages
377 #define InstallHtmlManPageAliases(file,aliases,suffix)                  @@\
378 install.man:: file.suffix.html                                          @@\
379         @(SUF=`expr file.suffix.html \: '.*\.\(.\).*\.'`; \             @@\
380         for i in aliases; do (set -x; \                                 @@\
381           RemoveFile($(DESTDIR)$(DOCHTMLDIR)/$$i.$$SUF.html); \         @@\
382           (cd $(DESTDIR)$(DOCHTMLDIR); \                                @@\
383             $(LN) file.$$SUF.html $$i.$$SUF.html)); \                   @@\
384         done)
385 #else
386 #define InstallHtmlManPageAliases(file,aliases,suffix) /**/
387 #endif
388 #endif
390   Yes, this is broken links' fix I posted earlier.
392 5.7.4
393   Run
395   make World
397   make install
399   make install.man
401   Insert in /etc/ld.so.conf
403         /usr/X11R6/lib
405   and run ldconfig
407 5.7.5
408   HINTS. ( it's better later than never ... )
409   Now your X is present in the system. It is installed in traditional
410   place, so configuration scripts from any decent X-aware package
411   will find it immediately. Some application that you already have
412   are X-capable ( if configured and compiled with X ). Vim, for instance.
413   Thus, if you wish to recompile X-aware package, it is right time to do this.
414   In addition, KDE installation scripts check if your system has already
415   some traditional X-apps. If so, they will be insert to the system menu.
416   It's nice.
417   Configuration scripts from some packages find and use X automatically,
418   others should be explicitely told to do so ( often using --with-x option ).
419   Check yourself.
420   IF YOU EVER WILL REINSTALL X11-4.01 ( re - "make install" ) in-place,
421   first remove /usr/include/GL softlink. or your install
422   will be aborted prematurely.
424 5.8 xpm
425 -------
427 5.8.1
428   Run
429         xmkmf -a
431         make
433         make install
435         make install.man
437 5.9 tiff
438 --------
440 5.9.1
441   Make the following changes in ./configure :
443         DIR_BIN=/usr/bin
445         DIR_LIB=/usr/lib
447         DIR_INC=/usr/include
449         DIR_JPEGLIB=/usr/lib
451         DIR_GZLIB=/usr/lib
453         JPEG=yes
455         ZIP=yes
457         DIR_HTML=/usr/share/doc/tiff
459         HTML=yes
461         DIR_MAN=/usr/share/man
463         GCOPTS="-O2 -mcpu=i586 -march=i586"
465    In DSO section find *-linux*) case
466    and correct the appropriate _if_ operator
467    from :
468         if [ -r /lib/libc.so.6 || -r /lib/libc.so.5 ]; then
469    to :
470         if [ \( -r /lib/libc.so.6 \) -o \( -r /lib/libc.so.5 \) ]; then
472 5.9.2
473   Run
474         ./configure
476         make
478         make install
480         cd /usr/lib
482         mv libtiff.so.3.5. libtiff.so.3.5.5
484         ln -s libtiff.so.3.5.5 libtiff.so
486 5.10 Qt
487 -------
489 5.10.1
490    cd /opt
491    tar -xzpvf qt-2.2.0.tar.gz
492    ln -s qt-2.2.0 qt
493    cd qt
495 5.10.2
496    Read INSTALL file and do exactly as it says about shell variables.
497    Additionally insert /opt/qt/lib line to your /etc/ld.so.conf. Won't hurt.
499 5.10.3
500    After re-logging in
502    cd /opt/qt
504    ./configure
505    -gif                 \
506    -thread              \
507    -system-zlib         \
508    -system-libpng       \
509    -system-libmng       \
510    -system-jpeg         \
511    -L/usr/X11R6/lib             /* Yes, I know what you want to say. It
512                                 ( -L<...> ) doesn't hurt. Don't want - don't put */
513    make
515    ldconfig
517 5.10.4
518   If you will want to have Qt Designer KDE-extentions installed, rebuild Qt after
519   installing KDE suite one more time ( 5.10.3 ), just add
520   the option -kde to that ./configure command line.
522 5.11 KDE2-beta4
523 ---------------
525 5.11.1
526   Run
528   cd /lib
530   ln -s libshadow.so.0.0.0 libshadow.so
532   There was a discussion about "rightness" of doing so.
533   I am not going to start it over again here. Don't want - don't do.
534   Then when compiling kdebase ( below ) omit --with-shadow.
536 5.11.2
537  There is nothing special about building KDE. It would be boring to write
538  how to install each of 12 packages. Instead, I'll insert the script I used
539  for this.
542 #! /bin/bash
543 date > ~/_kde-1.94.buildtime
544 echo -e "\n" >> ~/_kde-1.94.buildtime
545 cd /usr/src
546 ldconfig
547 mount /mnt/Helena
548 #=================================================================
549 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdesupport-1.94.tar.bz2
550 cd kdesupport-1.94
551 ./configure --prefix=/opt/kde --with-audiofile --with-aps i586-chechaco-linux \
552 2>&1 | tee ~/_kdesupport-1.94_config_.log
553 make \
554 2>&1 | tee ~/_kdesupport-1.94_make_.log
555 make install \
556 2>&1 | tee ~/_kdesupport-1.94_make_install_.log
557 cd ..
558 ldconfig
559 rm -r kdesupport-1.94
560 #=================================================================
561 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdelibs-1.94.tar.bz2
562 cd kdelibs-1.94
563 ./configure --prefix=/opt/kde i586-chechaco-linux \
564 2>&1 | tee ~/_kdelibs-1.94_config_.log
565 make \
566 2>&1 | tee ~/_kdelibs-1.94_make_.log
567 make install \
568 2>&1 | tee ~/_kdelibs-1.94_make_install_.log
569 cd ..
570 ldconfig
571 rm -r kdelibs-1.94
572 #=================================================================
573 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdebase-1.94.tar.bz2
574 cd kdebase-1.94
575 ./configure --prefix=/opt/kde --with-shadow i586-chechaco-linux \
576 2>&1 | tee ~/_kdebase-1.94_config_.log
577 make \
578 2>&1 | tee ~/_kdebase-1.94_make_.log
579 make install \
580 2>&1 | tee ~/_kdebase-1.94_make_install_.log
581 cd ..
582 ldconfig
583 rm -r kdebase-1.94
584 #=================================================================
585 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdeutils-1.94.tar.bz2
586 cd kdeutils-1.94
587 ./configure --prefix=/opt/kde i586-chechaco-linux \
588 2>&1 | tee ~/_kdeutils-1.94_config_.log
589 make \
590 2>&1 | tee ~/_kdeutils-1.94_make_.log
591 make install \
592 2>&1 | tee ~/_kdeutils-1.94_make_install_.log
593 cd ..
594 ldconfig
595 rm -r kdeutils-1.94
596 #=================================================================
597 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdegraphics-1.94.tar.bz2
598 cd kdegraphics-1.94
599 ./configure --prefix=/opt/kde i586-chechaco-linux \
600 2>&1 | tee ~/_kdegraphics-1.94_config_.log
601 make \
602 2>&1 | tee ~/_kdegraphics-1.94_make_.log
603 make install \
604 2>&1 | tee ~/_kdegraphics-1.94_make_install_.log
605 cd ..
606 ldconfig
607 rm -r kdegraphics-1.94
608 #=================================================================
609 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdemultimedia-1.94.tar.bz2
610 cd kdemultimedia-1.94
611 ./configure --prefix=/opt/kde i586-chechaco-linux \
612 2>&1 | tee ~/_kdemultimedia-1.94_config_.log
613 make \
614 2>&1 | tee ~/_kdemultimedia-1.94_make_.log
615 make install \
616 2>&1 | tee ~/_kdemultimedia-1.94_make_install_.log
617 cd ..
618 ldconfig
619 rm -r kdemultimedia-1.94
620 #=================================================================
621 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdenetwork-1.94.tar.bz2
622 cd kdenetwork-1.94
623 ./configure --prefix=/opt/kde i586-chechaco-linux \
624 2>&1 | tee ~/_kdenetwork-1.94_config_.log
625 make \
626 2>&1 | tee ~/_kdenetwork-1.94_make_.log
627 make install \
628 2>&1 | tee ~/_kdenetwork-1.94_make_install_.log
629 cd ..
630 ldconfig
631 rm -r kdenetwork-1.94
632 #=================================================================
633 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdeadmin-1.94.tar.bz2
634 cd kdeadmin-1.94
635 ./configure --prefix=/opt/kde i586-chechaco-linux \
636 2>&1 | tee ~/_kdeadmin-1.94_config_.log
637 make \
638 2>&1 | tee ~/_kdeadmin-1.94_make_.log
639 make install \
640 2>&1 | tee ~/_kdeadmin-1.94_make_install_.log
641 cd ..
642 ldconfig
643 rm -r kdeadmin-1.94
644 #=================================================================
645 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdepim-1.94.tar.bz2
646 cd kdepim-1.94
647 ./configure --prefix=/opt/kde i586-chechaco-linux \
648 2>&1 | tee ~/_kdepim-1.94_config_.log
649 make \
650 2>&1 | tee ~/_kdepim-1.94_make_.log
651 make install \
652 2>&1 | tee ~/_kdepim-1.94_make_install_.log
653 cd ..
654 ldconfig
655 rm -r kdepim-1.94
656 #=================================================================
657 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/koffice-1.94.tar.bz2
658 cd koffice-1.94
659 ./configure --prefix=/opt/kde i586-chechaco-linux \
660 2>&1 | tee ~/_koffice-1.94_config_.log
661 make \
662 2>&1 | tee ~/_koffice-1.94_make_.log
663 make install \
664 2>&1 | tee ~/_koffice-1.94_make_install_.log
665 cd ..
666 ldconfig
667 rm -r koffice-1.94
668 #=================================================================
669 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdegames-1.94.tar.bz2
670 cd kdegames-1.94
671 ./configure --prefix=/opt/kde i586-chechaco-linux \
672 2>&1 | tee ~/_kdegames-1.94_config_.log
673 make \
674 2>&1 | tee ~/_kdegames-1.94_make_.log
675 make install \
676 2>&1 | tee ~/_kdegames-1.94_make_install_.log
677 cd ..
678 ldconfig
679 rm -r kdegames-1.94
680 #=================================================================
681 tar -xypvf /mnt/Helena/ZipArchives/4/KDE/kdetoys-1.94.tar.bz2
682 cd kdetoys-1.94
683 ./configure --prefix=/opt/kde i586-chechaco-linux \
684 2>&1 | tee ~/_kdetoys-1.94_config_.log
685 make \
686 2>&1 | tee ~/_kdetoys-1.94_make_.log
687 make install \
688 2>&1 | tee ~/_kdetoys-1.94_make_install_.log
689 cd ..
690 ldconfig
691 rm -r kdetoys-1.94
692 #=================================================================
693 umount /mnt/Helena
694 date >> ~/_kde-1.94.buildtime
695 #=================================================================