2. The contents of this tarball is designed to be incorporated into
  3. software packages that utilize the AutoOpts option automation package
  4. and are intended to be installed on systems that may not have libopts
  5. installed. It is redistributable under the terms of either the LGPL
  6. (see COPYING.lgpl) or under the terms of the advertising clause free BSD
  7. license (see COPYING.mbsd).
  8. Usage Instructions for autoconf/automake/libtoolized projects:
  9. 1. Install the unrolled tarball into your package source tree,
  10. copying ``libopts.m4'' to your autoconf macro directory.
  11. In your bootstrap (pre-configure) script, you can do this:
  12. rm -rf libopts libopts-*
  13. gunzip -c `autoopts-config libsrc` | tar -xvf -
  14. mv -f libopts-*.*.* libopts
  15. cp -fp libopts/m4/*.m4 m4/.
  16. I tend to put my configure auxiliary files in "m4".
  17. Whatever directory you choose, if it is not ".", then
  18. be sure to tell autoconf about it with:
  20. This is one macro where you *MUST* remember to *NOT* quote
  21. the argument. If you do, automake will get lost.
  22. 2. Add an invocation of either LIBOPTS_CHECK or LIBOPTS_CHECK_NOBUILD
  23. to your file. See LIBOPTS_CHECK: below for details.
  24. 3. Add the following to your top level ``'' file:
  27. endif
  28. where ``<...>'' can be whatever other files or directories you may
  29. need. The SUBDIRS must be properly ordered. *PLEASE NOTE* it is
  30. crucial that the SUBDIRS be set under the control of an automake
  31. conditional. To work correctly, automake has to know the range of
  32. possible values of SUBDIRS. It's a magical name with magical
  33. properties. ``NEED_LIBOPTS'' will be correctly set by the
  34. ``LIBOPTS_CHECK'' macro, above.
  35. 4. Add ``$(LIBOPTS_CFLAGS)'' to relevant compiler flags and
  36. ``$(LIBOPTS_LDADD)'' to relevant link options whereever
  37. you need them in your build tree.
  38. 5. Make sure your object files explicitly depend upon the
  39. generated options header file. e.g.:
  40. $(prog_OBJECTS) : prog-opts.h
  41. prog-opts.h : prog-opts.c
  42. prog-opts.c : prog-opts.def
  43. autogen prog-opts.def
  44. 6. *OPTIONAL* --
  45. If you are creating man pages and texi documentation from
  46. the program options, you will need these rules somewhere, too:
  47. man_MANS = prog.1
  48. prog.1 : prog-opts.def
  49. autogen -Tagman-cmd.tpl -bprog prog-opts.def
  50. invoke-prog.texi : prog-opts.def
  51. autogen -Tagtexi-cmd.tpl prog-opts.def
  52. If your package does not utilize the auto* tools, then you
  53. will need to hand craft the rules for building the library.
  55. The arguments to both macro are a relative path to the directory with
  56. the libopts source code. It is optional and defaults to "libopts".
  57. These macros work as follows:
  58. 1. LIBOPTS_CHECK([libopts/rel/path/optional])
  59. Adds two command-line options to the generated configure script,
  60. --enable-local-libopts and --disable-libopts-install. AC_SUBST's
  62. files. Adds Automake conditional NEED_LIBOPTS which
  63. will be true when the local copy of libopts should be built. Uses
  64. AC_CONFIG_FILES([$libopts-dir/Makefile]) to cause the local libopts
  65. into the package build. If the optional relative path to libopts is
  66. not provided, it defaults to simply "libopts".
  67. 2. LIBOPTS_CHECK_NOBUILD([libopts/rel/path/optional])
  68. This variant of LIBOPTS_CHECK is useful when multiple
  69. files in a package make use of a single libopts tearoff. In that
  70. case, only one of the files should build libopts and
  71. others should simply use it. Consider this package arrangment:
  72. all-tools/
  74. common-tools/
  76. libopts/
  77. The parent package all-tools contains a subpackage common-tools
  78. which can be torn off and used independently. Programs configured
  79. by both files link against the common-tools/libopts
  80. tearoff, when not using the system's libopts. The top-level
  81. uses LIBOPTS_CHECK_NOBUILD([common-tools/libopts]),
  82. while common-tools/ uses LIBOPTS_CHECK. The difference
  83. is LIBOPTS_CHECK_NOBUILD will never build the libopts tearoff,
  84. leaving that to the subpackage's LIBOPTS_CHECK.
  85. Specifically, LIBOPTS_CHECK_NOBUILD always results in the
  86. NEED_LIBOPTS Automake conditional being false, and does not invoke
  87. AC_CONFIG_FILES(path-to-libopts/Makefile).
  89. This material is Copyright (C) 1992-2015 by Bruce Korb. You are
  90. licensed to use this under the terms of either the GNU Lesser General
  91. Public License (see: COPYING.lgpl), or, at your option, the modified
  92. Berkeley Software Distribution License (see: COPYING.mbsd). Both of
  93. these files should be included with this tarball.