README 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. THIS TARBALL IS NOT A FULL DISTRIBUTION.
  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:
  19. AC_CONFIG_AUX_DIR(m4)
  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 configure.ac file. See LIBOPTS_CHECK: below for details.
  24. 3. Add the following to your top level ``Makefile.am'' file:
  25. if NEED_LIBOPTS
  26. SUBDIRS += $(LIBOPTS_DIR)
  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.
  54. LIBOPTS_CHECK:
  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
  61. LIBOPTS_CFLAGS, LIBOPTS_LDADD, and LIBOPTS_DIR for use in
  62. Makefile.am 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 configure.ac
  69. files in a package make use of a single libopts tearoff. In that
  70. case, only one of the configure.ac files should build libopts and
  71. others should simply use it. Consider this package arrangment:
  72. all-tools/
  73. configure.ac
  74. common-tools/
  75. configure.ac
  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 configure.ac files link against the common-tools/libopts
  80. tearoff, when not using the system's libopts. The top-level
  81. configure.ac uses LIBOPTS_CHECK_NOBUILD([common-tools/libopts]),
  82. while common-tools/configure.ac uses LIBOPTS_CHECK. The difference
  83. is LIBOPTS_CHECK_NOBUILD will never build the libopts tearoff,
  84. leaving that to the subpackage configure.ac'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).
  88. LICENSING:
  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.