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