]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ntp/sntp/libopts/README
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ntp / sntp / libopts / README
1         THIS TARBALL IS NOT A FULL DISTRIBUTION.
2
3 The contents of this tarball is designed to be incorporated into
4 software packages that utilize the AutoOpts option automation
5 package and are intended to be installed on systems that may not
6 have libopts installed.  It is redistributable under the terms
7 of either the LGPL (see COPYING.lgpl) or under the terms of
8 the advertising clause free BSD license (see COPYING.mbsd).
9
10 Usage Instructions for autoconf/automake/libtoolized projects:
11
12 1. Install the unrolled tarball into your package source tree,
13    copying ``libopts.m4'' to your autoconf macro directory.
14
15    In your bootstrap (pre-configure) script, you can do this:
16
17       rm -rf libopts libopts-*
18       gunzip -c `autoopts-config libsrc` | tar -xvf -
19       mv -f libopts-*.*.* libopts
20       cp -fp libopts/m4/*.m4 m4/.
21
22    I tend to put my configure auxiliary files in "m4".
23    Whatever directory you choose, if it is not ".", then
24    be sure to tell autoconf about it with:
25
26       AC_CONFIG_AUX_DIR(m4)
27
28    This is one macro where you *MUST* remember to *NOT* quote
29    the argument.  If you do, automake will get lost.
30
31 2. Add the following to your ``configure.ac'' file:
32
33       LIBOPTS_CHECK
34
35    or:
36
37       LIBOPTS_CHECK([relative/path/to/libopts])
38
39    This macro will automatically invoke
40
41       AC_CONFIG_FILES( [relative/path/to/libopts/Makefile] )
42
43    The default ``relative/path/to/libopts'' is simply
44    ``libopts''.
45
46 3. Add the following to your top level ``Makefile.am'' file:
47
48       if NEED_LIBOPTS
49          SUBDIRS += $(LIBOPTS_DIR)
50       endif
51
52    where ``<...>'' can be whatever other files or directories
53    you may need.  The SUBDIRS must be properly ordered.
54    *PLEASE NOTE* it is crucial that the SUBDIRS be set under the
55    control of an automake conditional.  To work correctly,
56    automake has to know the range of possible values of SUBDIRS.
57    It's a magical name with magical properties.  ``NEED_LIBOPTS''
58    will be correctly set by the ``LIBOPTS_CHECK'' macro, above.
59
60 4. Add ``$(LIBOPTS_CFLAGS)'' to relevant compiler flags and
61    ``$(LIBOPTS_LDADD)'' to relevant link options whereever
62    you need them in your build tree.
63
64 5. Make sure your object files explicitly depend upon the
65    generated options header file.  e.g.:
66
67      $(prog_OBJECTS) : prog-opts.h
68      prog-opts.h : prog-opts.c
69      prog-opts.c : prog-opts.def
70          autogen prog-opts.def
71
72 6. *OPTIONAL* --
73    If you are creating man pages and texi documentation from
74    the program options, you will need these rules somewhere, too:
75
76      man_MANS = prog.1
77      prog.1 : prog-opts.def
78          autogen -Tagman1.tpl -bprog prog-opts.def
79
80      prog-invoke.texi : prog-opts.def
81          autogen -Taginfo.tpl -bprog-invoke prog-opts.def
82
83 If your package does not utilize the auto* tools, then you
84 will need to hand craft the rules for building the library.
85
86 LICENSING:
87
88 This material is copyright 1993-2007 by Bruce Korb.
89 You are licensed to use this under the terms of either
90 the GNU Lesser General Public License (see: COPYING.lgpl), or,
91 at your option, the modified Berkeley Software Distribution
92 License (see:  COPYING.mbsd).  Both of these files should be
93 included with this tarball.