home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-src.tgz / tar.out / contrib / unixtex / kpathsea / INSTALL < prev    next >
Encoding:
Text File  |  1996-09-28  |  16.6 KB  |  411 lines

  1. Contents:
  2.  
  3. Installation
  4.   Default paths
  5.   Common problems
  6.     Unable to find files
  7.     Slow path searching
  8.     `XtInherit'
  9.     `wchar_t'
  10.     `ShellWidgetClass'
  11.     Pointer combination warnings
  12.   Shared library
  13.   Reporting bugs
  14.  
  15.  
  16. Installation
  17. ************
  18.  
  19.   Here are the basic steps for configuration and installation:
  20.  
  21.   1. Edit the file `make/paths.make' if you want to make changes to the
  22.      installation directories or paths that will have effect across
  23.      different runs of `configure'.  Alternatively, override the Make
  24.      variables on the command line when you run Make.
  25.  
  26.      Exception: to reliably change the top-level `prefix', you must give
  27.      `configure' the option `-prefix=PREFIX', instead of changing the
  28.      value in `paths.make'.
  29.  
  30.   2. Edit `kpathsea/texmf.cnf.in' to change the local paths to match
  31.      your local setup.  *Note Default paths: (kpathsea)Default paths,
  32.      for more details on changing the paths. A copy is in
  33.      `kpathsea/INSTALL'.  See `kpathsea/HIER' for an explanation of the
  34.      default setup.
  35.  
  36.      If the paths do not match where the files actually are, the
  37.      programs will probably start up Very, Very, Slowly, and/or not be
  38.      able to find the fonts or other input files.
  39.  
  40.   3. `sh configure' (in the top-level directory).  This makes
  41.      system-dependent `#define's' in `*/c-auto.h' (from the
  42.      corresponding `c-auto.h.in') and creates a `Makefile' (from the
  43.      corresponding `Makefile.in', by doing `@VAR@' and `ac_include'
  44.      substitutions).
  45.  
  46.      Perhaps the most common desire is to compile with optimization
  47.      instead of or as well as debugging.  You can change the options
  48.      passed to the compiler by changing `CFLAGS', either for
  49.      `configure' or `make'.  For example:
  50.  
  51.           prompt$ env CFLAGS="-g -O" configure
  52.           prompt$ make
  53.      or
  54.           prompt$ configure
  55.           prompt$ make CFLAGS="-g -O"
  56.  
  57.      *Note Running `configure' scripts: (autoconf)Invoking configure,
  58.      for detailed `configure' options.  (A copy is in
  59.      `kpathsea/CONFIGURE'.)
  60.  
  61.   4. `make' (still in the top-level directory). Barring configuration
  62.      and compiler bugs, this will compile all the programs.  *Note
  63.      Common problems: (kpathsea)Common problems, for system-dependent
  64.      problems (this section is also in `kpathsea/INSTALL').
  65.  
  66.      This also creates the `texmf.cnf' and `paths.h' files that define
  67.      the default search paths.
  68.  
  69.   5. `make install'. This installs the library, header files, and
  70.      documentation. Or `make install-data' to just install the
  71.      architecture-independent files. Or `make install-exec' to just
  72.      install the (binary) archive library file.
  73.  
  74.      Since I only distribute Kpathsea as part of another package, you
  75.      will probably be doing the above in a top-level directory that
  76.      contains a `Makefile', `kpathsea', and the other package.  But you
  77.      can do the installation in `kpathsea' itself, if you only want to
  78.      install the library, not the other package.
  79.  
  80.   6. The first time you install any manual in Info, you have to add a
  81.      line (you choose where) to the `dir' file in your `$(infodir)'
  82.      directory.  A sample line to add is given near the top of the
  83.      Texinfo source files (`kpathsea/kpathsea.texi' and
  84.      `dvipsk/dvips.texi').
  85.  
  86.   7. `make distclean'.  This removes all files created by the build.
  87.  
  88.  
  89.   *Note Filename database::, for a description of an
  90. externally-generated database that can help speed searches.
  91.  
  92.   *Note Debugging::, for runtime debugging support that may help track
  93. down problems.
  94.  
  95.   Do not attempt to use any version of Kpathsea with any program except
  96. the version that the program came with, unless you are a glutton for
  97. punishment.
  98.  
  99. Default paths
  100. =============
  101.  
  102.   To summarize the chain of events that go into defining the default
  103. paths:
  104.  
  105.   1. `configure' creates a `Makefile' from each `Makefile.in'.
  106.  
  107.   2. When Make runs in the `kpathsea' directory, it creates a file
  108.      `texmf.sed' that substitutes the Make value of `$(var)' for a
  109.      string `@var@'. The variables in question are the one that define
  110.      the installation directories.
  111.  
  112.   3. `texmf.sed' (and a little extra magic--see `kpathsea/Makefile') is
  113.      applied to `texmf.cnf.in' to generate `texmf.cnf'. This is the
  114.      file that will eventually be installed and used by the programs to
  115.      look up programs.
  116.  
  117.   4. The definitions in `texmf.cnf' are changed into the form of C
  118.      `#define''s, producing `paths.h'. These values will be the
  119.      compile-time defaults; they are not used unless no `texmf.cnf' file
  120.      can be found at runtime.
  121.  
  122.      (That's a partial lie: the compile-time defaults are what extra
  123.      `:''s in `texmf.cnf' expand into; but the paths as distributed
  124.      have no extra `:''s, and there's no particular reason for them to.)
  125.  
  126.  
  127.   The purpose of this elaborate sequence is to avoid having the same
  128. information in more than one place. If you change the installation
  129. directories or top-level prefix before running `configure', those
  130. changes will propagate through the whole sequence. If you change the
  131. default paths in `texmf.cnf.in', those changes are propagated to the
  132. compile-time defaults.
  133.  
  134.   Alternatively, you can ignore the whole mess and edit `texmf.cnf'
  135. after it is installed. Maybe even copying it into place beforehand so
  136. you can complete the installation, if TeX or Metafont is having trouble
  137. finding their input files.
  138.  
  139.   Unfortunately, editing `Makefile.in' *does not work* in one common
  140. case--changing the `prefix' or `exec_prefix' variables. For these, you
  141. must use the `-prefix' or `-exec-prefix' options to `configure'.  *Note
  142. Running `configure' scripts: (autoconf)Running configure Scripts.
  143. (That's another partial lie: editing does work, as long as a program
  144. named `tex' is not in your `PATH'.)
  145.  
  146.   *Note TeX directory structure: TeX directory structure, for a
  147. description of some ways to arrange the TeX library files, and some
  148. features of the distributed paths that may not be obvious.  The file
  149. `kpathsea/HIER' is a copy of that section.
  150.  
  151.   The Make definitions are all repeated in several `Makefile''s; but
  152. changing the top-level `Makefile' should suffice, as it passes down all
  153. the variable definitions, thus overriding the submakes. (The
  154. definitions are repeated so you can potentially run Make in the
  155. subdirectories.)
  156.  
  157. Common problems
  158. ===============
  159.  
  160.   Some common problems with compilation, linking, or execution are
  161. described below.
  162.  
  163. Unable to find files
  164. --------------------
  165.  
  166.   If a program complains it cannot find fonts (or other input files),
  167. any of several things might be wrong:
  168.  
  169.    * You don't have the fonts (or whatever) installed. Nothing will
  170.      automatically generate TFM files or TeX and Metafont sources for
  171.      you (by default). *Note Obtaining Web2c: (web2c)Obtaining Web2c.
  172.  
  173.      You can, however, configure TeX and Metafont to run a script to
  174.      generate these input files, if you have (or write) such scripts.
  175.      *Note `MakeTeX'... invocation: (web2c)MakeTeX... invocation.
  176.  
  177.    * You have (perhaps unknowingly) told Kpathsea to use search paths
  178.      that don't reflect where the files actually are. One common cause
  179.      is having environment variables set, thus overriding what you
  180.      carefully set in `texmf.cnf'. *Note TeX environment variables: TeX
  181.      environment variables.
  182.  
  183.    * Your files reside in a directory that is only pointed to via a
  184.      symbolic link, in a leaf directory.
  185.  
  186.      Unfortunately, Kpathsea's subdirectory searching has a (congenital)
  187.      deficiency: If a directory D being searched for subdirectories
  188.      contains plain files and symbolic links to other directories, but
  189.      no true subdirectories, D will be considered a leaf directory,
  190.      i.e., the symbolic links will not be followed.  *Note Subdirectory
  191.      expansion::, for an explanation of why this happens.
  192.  
  193.      You can work around this problem by creating an empty dummy
  194.      subdirectory in D. Then D will no longer be a leaf, and the
  195.      symlinks will be followed.
  196.  
  197.      The directory immediately followed by the `//' in the path
  198.      specification, however, is always searched for subdirectories,
  199.      even if it is a leaf.  This is since presumably you would not have
  200.      asked for the directory to be searched for subdirectories if you
  201.      didn't want it to be.
  202.  
  203.    * There is a bug in the library. *Note Reporting bugs::.
  204.  
  205.   In any case, you may find the debugging options helpful in determining
  206. precisely where the fonts (or whatever) are being looked for. See the
  207. program's documentation for its debugging options, and also *note
  208. Debugging::..
  209.  
  210. Slow path searching
  211. -------------------
  212.  
  213.   If your program takes an excessively long time to find fonts or other
  214. input files, but does eventually succeed, here are some possible
  215. culprits:
  216.  
  217.    * Most likely, you just have a lot of directories to search, and that
  218.      takes a noticeable time. The solution is to create and maintain a
  219.      separate `ls-R' file that lists all the files in your main TeX
  220.      hierarchy. *Note Filename database::.  (Kpathsea always uses `ls-R'
  221.      if it's present; there's no need to recompile or reinstall any of
  222.      the programs.)
  223.  
  224.    * Your recursively-searched directories (e.g.,
  225.      `/usr/local/lib/tex/fonts//'), contain a mixture of files and
  226.      directories. This prevents Kpathsea from using a useful
  227.      optimization (*note Subdirectory expansion::.).
  228.  
  229.      It is best to have only directories (and perhaps a `README') in the
  230.      upper levels of the directory structure, and it's very important
  231.      to have *only* files, and no subdirectories, in the directories
  232.      where the dozens of TFM, PK, or whatever files reside.
  233.  
  234.    * Finally, one simple-to-fix (but unlikely) cause: If you recursively
  235.      search `$HOME' or `~', and you are running as `root', you will
  236.      search every directory on the system.  This typically takes quite
  237.      some time!
  238.  
  239.   In any case, you may find the debugging options helpful in determining
  240. precisely when the disk or network is being pounded. *Note Debugging::,
  241. and also see the program's documentation.
  242.  
  243. `XtInherit'
  244. -----------
  245.  
  246.   On DEC OSF/1 1.x systems, the loader has a bug that manifests itself
  247. in the following error (all on one line, but for the sake of the paper
  248. width it's broken here):
  249.  
  250.      xdvik/xdvi: /sbin/loader: Fatal Error: search_for_undefineds:
  251.           symbol _XtInherit should not have any relocation entry
  252.  
  253. According to Michael Rickabaugh `<mjr@quarry.enet.dec.com>':
  254.  
  255.      This is a bug fixed in DEC OSF/1 2.0.
  256.      
  257.      If you know how, installing `/sbin/loader' from a 2.0 system onto a
  258.      1.3 system will work.  Make sure that `/usr' is *not* mounted
  259.      when you do this.  (If you forget about umounting `/usr', it is
  260.      possible most of your filesystems will become corrupted.)
  261.      
  262.      Otherwise, I suggest getting a hold of a 2.0 CD and running
  263.      `/usr/sbin/installupdate'.
  264.  
  265.   Alternatively, you may be able to use the freely available X11
  266. libraries that come with the MIT distribution (on `ftp.x.org', for
  267. example).
  268.  
  269.   Linking statically, perhaps only with some of the X libraries, may
  270. also work.  (if you find the definitive workaround, please let me know.)
  271.  
  272. `wchar_t'
  273. ---------
  274.  
  275.   The upshot of all the following is that if you get error messages
  276. regarding `wchar_t', try defining `NO_FOIL_X_WCHAR_T' (for Web2c) or
  277. `FOIL_X_WCHAR_T' (for everything else).
  278.  
  279.   `wchar_t' has caused infinite trouble. None of my code ever uses
  280. `wchar_t'; all I want to do is include X header files and various
  281. system header files, possibly compiling with GCC. This seems an
  282. impossible task!
  283.  
  284.   The X11 header `<Xlib.h>' and GCC's `<stddef.h>' have conflicting
  285. definitions for wchar_t.
  286.  
  287.   The particulars: `<X11/Xlib.h>' from MIT X11R5 defines `wchar_t' if
  288. `X_WCHAR' is defined, which is defined if `X_NOT_STDC_ENV' is defined,
  289. and we define *that* if `STDC_HEADERS' is not defined (`configure'
  290. decides if STDC_HEADERS gets defined).  But when compiling with gcc on
  291. SunOS 4.1.x, `STDC_HEADERS' is not defined (`string.h' doesn't declare
  292. the `mem'* functions), so we do get X's `wchar_t'--and we also get
  293. gcc's `wchar_t' from its `<stddef.h>'.  Conflict.
  294.  
  295.   On the other hand, SunOS 4.1.1 with some other X configurations
  296. actually needs GCC to define `wchar_t', and fails otherwise.
  297.  
  298.   My current theory is to define `wchar_t' to a nonsense symbol before
  299. the X include files are read; that way its definition (if any) will be
  300. ignored by other system include files.  Going along with that, define
  301. `X_WCHAR' to tell X not to use `<stddef.h>', that we've already
  302. included, but instead to make its own definition.
  303.  
  304.   But this is not the end of the story. The X11 include files
  305. distributed with DG/UX 5.4.2 for the Aviion have been modified to
  306. include `<_int_wchar_t.h>' if `X_WCHAR', so our `#define' will not have
  307. any typedef to change--but the uses of `wchar_t' in the X include files
  308. will be changed to reference this undefined symbol. So there's nothing
  309. to foil in this case. I don't know how to detect this automatically, so
  310. it's up to you to define `NO_FOIL_X_WCHAR_T' yourself.
  311.  
  312. `ShellWidgetClass'
  313. ------------------
  314.  
  315.   This section is adapted from question 47 from the
  316. `comp.sys.sun.admin' FAQ.
  317.  
  318.   If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x,
  319. you may get undefined symbols `_get_wmShellWidgetClass' and
  320. `_get_applicationShellWidgetClass'. This problem does not arise with
  321. the standard MIT libraries under SunOS.
  322.  
  323.   The cause is bugs in the `Xmu' shared library as shipped from Sun.
  324. There are several fixes:
  325.  
  326.    * Get the Openwindows patches that apply to this problem.
  327.  
  328.    * Statically link the `Xmu' library into the executable.
  329.  
  330.    * Avoid using `Xmu' at all. For this last, if you are compiling
  331.      Metafont, *note Online Metafont graphics: (Web2c)Online Metafont
  332.      graphics.. If you are compiling Xdvi, see the `-DNOTOOL' option in
  333.      `xdvik/INSTALL'.
  334.  
  335.    * Ignore the errors. The binary runs fine regardless.
  336.  
  337.   Here is the information for getting the two patches:
  338.  
  339.      Patch ID: 100512-02
  340.      Bug ID's: 1086793, 1086912, 1074766
  341.      Description: 4.1.x OpenWindows 3.0 `libXt' jumbo patch
  342.      
  343.      Patch ID: 100573-03
  344.      Bug ID: 1087332
  345.      Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared
  346.      `libXmu'.
  347.  
  348.   The way to statically link with `libXmu' depends on whether you are
  349. using a Sun compiler (e.g., `cc') or `gcc'. If the format, alter the
  350. `x_libs' make variable to include
  351.  
  352.      -Bstatic -lXmu -Bdynamic
  353.  
  354.   If you are using `gcc', include `-static' in `LDFLAGS'; this will
  355. link all libraries statically. If you want to link only `Xmu'
  356. statically and everything else dynamically, you have to do it by hand:
  357. run `gcc -v', grab the `ld' line, and add the `-B''s given above around
  358. `-lXmu'.
  359.  
  360.   The reason is that gcc moves all linker options to the front of the
  361. `ld' command line.  So you can't specify different options for
  362. different libraries.  When I reported this to the GCC maintainers, the
  363. reply was that they would happily merge in the changes, but they didn't
  364. want to take the time to do it themselves.
  365.  
  366. Pointer combination warnings
  367. ----------------------------
  368.  
  369.   When compiling with old C compilers, you may get some warnings about
  370. "illegal pointer combinations".  These are spurious; just ignore them.
  371. I decline to clutter up the source with casts to get rid of them.
  372.  
  373.   In general, if you have trouble with a system C compiler, I advise
  374. trying the GNU C compiler. (And vice versa, unfortunately; but in that
  375. case I also recommend reporting a bug to the GCC bug list.)
  376.  
  377. Shared library
  378. ==============
  379.  
  380.   You can compile Kpathsea as a shared library.  The advantage in doing
  381. this is that the different executables can then share the code,
  382. decreasing memory usage.  (The other advantage in general of shared
  383. libraries is that it's possible to update the library and programs
  384. independently.  But since the Kpathsea interface is not and can not be
  385. frozen, that doesn't apply here.)
  386.  
  387.   Under Solaris, use `-K pic -xstrconst' if you compile with a Sun
  388. compiler, `-fpic' if you use GCC.  Also add `-L$(LIBDIR) -R$(LIBDIR)'
  389. to `LDFLAGS' when you link the binaries, so that the library can be
  390. found, and users do not have set `LD_LIBRARY_PATH'.
  391.  
  392.   (If you know how to make Kpathsea shared on other systems, please
  393. send a message to the bug address in the next section.)
  394.  
  395. Reporting bugs
  396. ==============
  397.  
  398.   If you encounter problems, please report them to `tex-k@cs.umb.edu'.
  399. Include the version number of the library, the system you are using, and
  400. enough information to reproduce the bug in your report.  To get on this
  401. mailing list yourself, email `tex-k-request@cs.umb.edu' with a message
  402. whose body contains a line
  403.      subscribe YOU@YOUR.PREFERRED.ADDRESS
  404.  
  405.   To avoid wasted effort and time (both mine and yours), I strongly
  406. advise applying the principles given in the GNU C manual (*note
  407. Reporting Bugs: (gcc)Bugs.) to your bug reports.
  408.  
  409.   Please also report bugs in this documentation--not only factual
  410. errors, but unclear explanations, typos, wrong fonts, ...
  411.