self-check-configure-help.sh 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. #! /bin/sh
  2. # Copyright (C) 2011-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Sanity check on the function used by the automake testsuite to
  17. # analyze output of "configure --help".
  18. . test-init.sh
  19. # FIXME: this test is a good candidate for a conversion to TAP.
  20. # Prefer real-world data. This is from the help screen of the
  21. # configure script from GNU coreutils, with small adaptations.
  22. cat > help <<'END'
  23. 'configure' configures GNU coreutils 8.14a to adapt to many kinds of systems.
  24. Usage: ./configure [OPTION]... [VAR=VALUE]...
  25. To assign environment variables (e.g., CC, CFLAGS...), specify them as
  26. VAR=VALUE. See below for descriptions of some of the useful variables.
  27. Defaults for the options are specified in brackets.
  28. Configuration:
  29. -h, --help display this help and exit
  30. --help=short display options specific to this package
  31. --help=recursive display the short help of all the included packages
  32. -V, --version display version information and exit
  33. -q, --quiet, --silent do not print 'checking ...' messages
  34. --cache-file=FILE cache test results in FILE [disabled]
  35. -C, --config-cache alias for '--cache-file=config.cache'
  36. -n, --no-create do not create output files
  37. --srcdir=DIR find the sources in DIR [configure dir or '..']
  38. Installation directories:
  39. --prefix=PREFIX install architecture-independent files in PREFIX
  40. [/usr/local]
  41. --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
  42. [PREFIX]
  43. By default, 'make install' will install all the files in
  44. '/usr/local/bin', '/usr/local/lib' etc. You can specify
  45. an installation prefix other than '/usr/local' using '--prefix',
  46. for instance '--prefix=$HOME'.
  47. For better control, use the options below.
  48. Fine tuning of the installation directories:
  49. --bindir=DIR user executables [EPREFIX/bin]
  50. --sbindir=DIR system admin executables [EPREFIX/sbin]
  51. --libexecdir=DIR program executables [EPREFIX/libexec]
  52. --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
  53. --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
  54. --localstatedir=DIR modifiable single-machine data [PREFIX/var]
  55. --libdir=DIR object code libraries [EPREFIX/lib]
  56. --includedir=DIR C header files [PREFIX/include]
  57. --oldincludedir=DIR C header files for non-gcc [/usr/include]
  58. --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
  59. --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
  60. --infodir=DIR info documentation [DATAROOTDIR/info]
  61. --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
  62. --mandir=DIR man documentation [DATAROOTDIR/man]
  63. --docdir=DIR documentation root [DATAROOTDIR/doc/coreutils]
  64. --htmldir=DIR html documentation [DOCDIR]
  65. --dvidir=DIR dvi documentation [DOCDIR]
  66. --pdfdir=DIR pdf documentation [DOCDIR]
  67. --psdir=DIR ps documentation [DOCDIR]
  68. Program names:
  69. --program-prefix=PREFIX prepend PREFIX to installed program names
  70. --program-suffix=SUFFIX append SUFFIX to installed program names
  71. --program-transform-name=PROGRAM run sed PROGRAM on installed program names
  72. System types:
  73. --build=BUILD configure for building on BUILD [guessed]
  74. --host=HOST cross-compile to build programs to run on HOST [BUILD]
  75. Optional Features:
  76. --disable-option-checking ignore unrecognized --enable/--with options
  77. --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
  78. --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
  79. --enable-silent-rules less verbose build output (undo: 'make V=1')
  80. --disable-silent-rules verbose build output (undo: 'make V=0')
  81. --disable-dependency-tracking speeds up one-time build
  82. --enable-dependency-tracking do not reject slow dependency extractors
  83. --disable-largefile omit support for large files
  84. --enable-threads={posix|solaris|pth|win32}
  85. specify multithreading API
  86. --disable-threads build without multithread safety
  87. --disable-acl do not support ACLs
  88. --disable-assert turn off assertions
  89. --disable-rpath do not hardcode runtime library paths
  90. --disable-xattr do not support extended attributes
  91. --disable-libcap disable libcap support
  92. --enable-gcc-warnings turn on lots of GCC warnings (for developers)
  93. --enable-install-program=PROG_LIST
  94. install the programs in PROG_LIST (comma-separated,
  95. default: none)
  96. --enable-no-install-program=PROG_LIST
  97. do NOT install the programs in PROG_LIST
  98. (comma-separated, default: arch,hostname,su)
  99. --disable-nls do not use Native Language Support
  100. Optional Packages:
  101. --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
  102. --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
  103. --with-gnu-ld assume the C compiler uses GNU ld default=no
  104. --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
  105. --without-libiconv-prefix don't search for libiconv in includedir and libdir
  106. --with-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib
  107. --without-libpth-prefix don't search for libpth in includedir and libdir
  108. --without-included-regex
  109. don't compile regex; this is the default on systems
  110. with recent-enough versions of the GNU C Library
  111. (use with caution on other systems).
  112. --without-selinux do not use SELinux, even on systems with SELinux
  113. --with-packager String identifying the packager of this software
  114. --with-packager-version Packager-specific version information
  115. --with-packager-bug-reports
  116. Packager info for bug reports (URL/e-mail/...)
  117. --with-tty-group[=NAME]
  118. group used by system for TTYs, "tty" when not
  119. specified (default: do not rely on any group used
  120. for TTYs)
  121. --without-gmp do not use the GNU MP library for arbitrary
  122. precision calculation (default: use it if available)
  123. --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
  124. --without-libintl-prefix don't search for libintl in includedir and libdir
  125. Some influential environment variables:
  126. CC C compiler command
  127. CFLAGS C compiler flags
  128. LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
  129. nonstandard directory <lib dir>
  130. LIBS libraries to pass to the linker, e.g. -l<library>
  131. CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
  132. you have headers in a nonstandard directory <include dir>
  133. CPP C preprocessor
  134. YACC The "Yet Another C Compiler" implementation to use. Defaults to
  135. 'bison -y'. Values other than 'bison -y' will most likely break
  136. on most systems.
  137. YFLAGS YFLAGS contains the list arguments that will be passed by
  138. default to Bison. This script will default YFLAGS to the empty
  139. string to avoid a default value of '-d' given by some make
  140. applications.
  141. DEFAULT_POSIX2_VERSION
  142. POSIX version to default to; see 'config.hin'.
  143. Use these variables to override the choices made by 'configure' or to help
  144. it to find libraries and programs with nonstandard names/locations.
  145. Report bugs to <bug-automake@gnu.org>.
  146. General help using GNU software: <http://www.gnu.org/gethelp/>.
  147. END
  148. compare_extracted_help ()
  149. {
  150. cat > exp || exit 99
  151. extract_configure_help "$1" help > got || exit 1
  152. cat exp
  153. cat got
  154. diff exp got || exit 1
  155. }
  156. compare_extracted_help --disable-libcap <<'END'
  157. --disable-libcap disable libcap support
  158. END
  159. compare_extracted_help --disable-nls <<'END'
  160. --disable-nls do not use Native Language Support
  161. END
  162. compare_extracted_help --disable-option-checking <<'END'
  163. --disable-option-checking ignore unrecognized --enable/--with options
  164. END
  165. compare_extracted_help --build= <<'END'
  166. --build=BUILD configure for building on BUILD [guessed]
  167. END
  168. compare_extracted_help --host= <<'END'
  169. --host=HOST cross-compile to build programs to run on HOST [BUILD]
  170. END
  171. compare_extracted_help '--with-libintl-prefix[=]' <<'END'
  172. --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
  173. END
  174. compare_extracted_help --without-included-regex <<'END'
  175. --without-included-regex
  176. don't compile regex; this is the default on systems
  177. with recent-enough versions of the GNU C Library
  178. (use with caution on other systems).
  179. END
  180. compare_extracted_help --enable-threads= <<'END'
  181. --enable-threads={posix|solaris|pth|win32}
  182. specify multithreading API
  183. END
  184. compare_extracted_help '--with-tty-group[=]' <<'END'
  185. --with-tty-group[=NAME]
  186. group used by system for TTYs, "tty" when not
  187. specified (default: do not rely on any group used
  188. for TTYs)
  189. END
  190. compare_extracted_help '--prefix=' <<'END'
  191. --prefix=PREFIX install architecture-independent files in PREFIX
  192. [/usr/local]
  193. END
  194. compare_extracted_help '--exec-prefix=' <<'END'
  195. --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
  196. [PREFIX]
  197. END
  198. compare_extracted_help CC <<'END'
  199. CC C compiler command
  200. END
  201. compare_extracted_help CPP <<'END'
  202. CPP C preprocessor
  203. END
  204. compare_extracted_help CPPFLAGS <<'END'
  205. CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
  206. you have headers in a nonstandard directory <include dir>
  207. END
  208. compare_extracted_help YACC <<'END'
  209. YACC The "Yet Another C Compiler" implementation to use. Defaults to
  210. 'bison -y'. Values other than 'bison -y' will most likely break
  211. on most systems.
  212. END
  213. compare_extracted_help DEFAULT_POSIX2_VERSION <<'END'
  214. DEFAULT_POSIX2_VERSION
  215. POSIX version to default to; see 'config.hin'.
  216. END
  217. for o in \
  218. '--nonesuch' \
  219. '--nonesuch=' \
  220. '--nonesuch[=]' \
  221. '--disable-nls=' \
  222. '--disable-nls[=]' \
  223. '--without-included-regex=' \
  224. '--without-included-regex[=]' \
  225. '--prefix' \
  226. '--prefix[=]' \
  227. '--build' \
  228. '--build[=]' \
  229. '--with-tty-group' \
  230. '--with-tty-group=' \
  231. 'NO_SUCH_VAR' \
  232. 'NOSUCHVAR' \
  233. ; do
  234. compare_extracted_help "$o" </dev/null
  235. done
  236. :