Use AS_HELP_STRING to generate configure help strings

Originally committed to SVN as r6070.
This commit is contained in:
Thomas Goyne 2011-12-22 21:20:24 +00:00
parent 8f24931e3a
commit 7161b74be0
1 changed files with 75 additions and 64 deletions

View File

@ -146,22 +146,25 @@ AC_SUBST(AEGISUB_COMMAND)
# Handle location of desktop files: http://freedesktop.org/wiki/Specifications/desktop-entry-spec
AC_ARG_WITH(desktop-dir, [ --with-desktop-dir=PATH desktop file locations
(default: PREFIX/share/applications)])
if ! test -z "$with_desktop_dir" ; then
P_DESKTOP=$with_desktop_dir
else
AC_ARG_WITH(desktop-dir,
AS_HELP_STRING([--with-desktop-dir=PATH],[desktop file locations [PREFIX/share/applications]]))
if test -z "$with_desktop_dir"; then
P_DESKTOP="$datarootdir/applications"
else
P_DESKTOP=$with_desktop_dir
fi
AC_SUBST(P_DESKTOP)
# Handle location of icons: http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
AC_ARG_WITH(icon-dir, [ --with-icon-dir=PATH icon locations (default: PREFIX/share/icons)])
if ! test -z "$with_icon_dir" ; then
P_ICON=$with_icon_dir
else
AC_ARG_WITH(icon-dir,
AS_HELP_STRING([--with-icon-dir=PATH],[icon locations [PREFIX/share/icons]]))
if test -z "$with_icon_dir"; then
P_ICON="$datarootdir/icons"
else
P_ICON=$with_icon_dir
fi
AC_SUBST(P_ICON)
@ -177,8 +180,10 @@ fi
AC_DEFINE_UNQUOTED([INSTALL_PREFIX], ["$prefix"], [Default install prefix, or --prefix.])
# Build credit
AC_ARG_WITH(build-credit, [ --with-build-credit=NAME
Build credit shown in the program title.], [use_build_credit="yes"])
AC_ARG_WITH(build-credit,
AS_HELP_STRING([--with-build-credit=NAME],[Build credit shown in the program title.]),
[use_build_credit="yes"])
AC_MSG_CHECKING([whether BUILD_CREDIT has been set])
if test "$use_build_credit" = "yes"; then
if test "$with_build_credit" = "yes" || test -z "$with_build_credit"; then
@ -283,7 +288,7 @@ fi
# Check compiler flags
######################
AC_ARG_ENABLE(compiler-flags, [ --disable-compiler-flags
Disable *all* additional compiler flags. (default=no)])
Disable *all* additional compiler flags. [no]])
if test "$enable_compiler_flags" != "no"; then
AC_C_FLAG([-Wall])
@ -392,8 +397,8 @@ PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version,
########
## iconv
########
AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv (default: CPPFLAGS)])
AC_ARG_VAR([ICONV_LDFLAGS], [LDFLAGS to use for iconv (default: LDFLAGS -liconv)])
AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv [CPPFLAGS]])
AC_ARG_VAR([ICONV_LDFLAGS], [LDFLAGS to use for iconv [LDFLAGS -liconv]])
if test -z "$ICONV_LDFLAGS"; then
if test "$build_linux" = "yes"; then
@ -449,10 +454,12 @@ fi
#######
## ALSA
#######
AC_ARG_WITH(alsa, [ --without-alsa build without ALSA audio provider. (default: auto)], alsa_disabled="(disabled)")
AC_ARG_WITH(alsa,
AS_HELP_STRING([--without-alsa],[build without ALSA audio provider [auto]]),
alsa_disabled="(disabled)")
AC_ARG_VAR([ALSA_CFLAGS], [CFLAGS to use for ALSA (default: CPPFLAGS)])
AC_ARG_VAR([ALSA_LDFLAGS], [LDFLAGS to use for ALSA (default: -lasound -lrt)])
AC_ARG_VAR([ALSA_CFLAGS], [CFLAGS to use for ALSA [CPPFLAGS]])
AC_ARG_VAR([ALSA_LDFLAGS], [LDFLAGS to use for ALSA [-lasound -lrt]])
if test -z "$ALSA_LDFLAGS"; then
ALSA_LDFLAGS="-lasound -lrt";
@ -480,9 +487,10 @@ AC_SUBST(ALSA_LDFLAGS)
############
## PortAudio
############
AC_ARG_WITH(portaudio,
AS_HELP_STRING([--without-portaudio],[build without PortAudio v19 audio provider [auto]]),
portaudio_disabled="(disabled)")
AC_ARG_WITH(portaudio,[ --without-portaudio build without PortAudio v19 audio provider.
(default: auto)], pulseaudio_disabled="(disabled)")
if test "$with_portaudio" != "no"; then
PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= portaudio_required_version, [with_portaudio="yes"], [with_portaudio="no"])
fi
@ -498,9 +506,10 @@ AC_SUBST(with_portaudio)
#############
## PulseAudio
#############
AC_ARG_WITH(pulseaudio,
AS_HELP_STRING([--without-pulseaudio],[build without PulseAudio audio provider [auto]]),
pulseaudio_disabled="(disabled)")
AC_ARG_WITH(pulseaudio,[ --without-pulseaudio build without PulseAudio audio provider.
(default: auto)], pulseaudio_disabled="(disabled)")
if test "$with_pulseaudio" != "no"; then
PKG_CHECK_MODULES(LIBPULSE, libpulse >= pulseaudio_required_version, [with_pulseaudio="yes"], [with_pulseaudio="no"])
fi
@ -516,8 +525,9 @@ AC_SUBST(with_pulseaudio)
#########
## OpenAL
#########
AC_ARG_WITH(openal,[ --without-openal build without OpenAL audio provider.
(default: auto)], openal_disabled="(disabled)")
AC_ARG_WITH(openal,
AS_HELP_STRING([--without-openal],[build without OpenAL audio provider [auto]]),
openal_disabled="(disabled)")
if test "$build_darwin" = "yes"; then
OPENAL_LIBS="-framework OpenAL"
@ -563,8 +573,10 @@ AC_SUBST(with_openal)
######
## OSS
######
AC_ARG_WITH(oss,[ --without-oss build without OSS audio provider.
(default: auto)], oss_disabled="(disabled)")
AC_ARG_WITH(oss,
AS_HELP_STRING([--without-oss],[build without OSS audio provider [auto]]),
oss_disabled="(disabled)")
if test "$with_oss" != "no"; then
if test -f "/etc/oss.conf"; then
. /etc/oss.conf
@ -584,7 +596,9 @@ AC_SUBST(with_oss)
###################
# FFTW
###################
AC_ARG_WITH(fftw,[ --without-fftw build without fftw support (default: auto)], fftw_disabled="(disabled)")
AC_ARG_WITH(fftw,
AS_HELP_STRING([--without-fftw],[build without fftw support [auto]]),
fftw_disabled="(disabled)")
if test "$with_fftw" != "no"; then
PKG_CHECK_MODULES(FFTW3, fftw3 >= fftw_required_version, [with_fftw="yes"], [with_fftw="no"])
@ -598,7 +612,9 @@ AC_SUBST(with_fftw)
#########################
# Video / Audio Providers
#########################
AC_ARG_WITH(ffms,[ --without-ffms build without ffms2 A/V provider. (default: auto)], ffms_disabled="(disabled)")
AC_ARG_WITH(ffms,
AS_HELP_STRING([--without-ffms],[build without ffms2 A/V provider [auto]]),
ffms_disabled="(disabled)")
if test "$with_ffms" != "no"; then
PKG_CHECK_MODULES(FFMS, ffms2 >= ffms_required_version, [with_ffms="yes"], [with_ffms="no"])
@ -612,7 +628,9 @@ AC_SUBST(with_ffms)
###################
# Subtitle Provider
###################
AC_ARG_WITH(libass,[ --without-libass build without libass support (default: auto)], libass_disabled="(disabled)")
AC_ARG_WITH(libass,
AS_HELP_STRING([--without-libass],[build without libass support [auto]]),
libass_disabled="(disabled)")
if test "$with_libass" != "no"; then
PKG_CHECK_MODULES(LIBASS, libass >= libass_required_version, [with_libass="yes"], [with_libass="no"])
@ -627,7 +645,9 @@ AC_SUBST(with_libass)
###########
## Hunspell
###########
AC_ARG_WITH(hunspell, [ --without-hunspell build without hunspell support (default: auto)], hunspell_disabled="(disabled)")
AC_ARG_WITH(hunspell,
AS_HELP_STRING([--without-hunspell],[build without hunspell support [auto]]),
hunspell_disabled="(disabled)")
if test "$with_hunspell" != "no"; then
PKG_CHECK_MODULES(HUNSPELL, hunspell >= 1.2.0, [with_hunspell="yes"], [with_hunspell="no"])
@ -642,13 +662,13 @@ AC_SUBST(with_hunspell)
############
# Automation
############
AC_ARG_WITH(lua,
[ --without-lua build without lua 5.1 (auto4)], [lua51_disabled="(disabled)"])
AS_HELP_STRING([--without-lua],[build without lua 5.1 (auto4)]),
[lua51_disabled="(disabled)"])
AC_ARG_VAR([LUA_CFLAGS], [CFLAGS to use for LUA 5.1 (default: autodetect)])
AC_ARG_VAR([LUA_LDFLAGS], [LDFLAGS to use for LUA 5.1 (default: autodetect)])
AC_ARG_VAR([LUA_LIBDIR], [Location of LUA 5.1 library. (default: none)])
AC_ARG_VAR([LUA_CFLAGS], [CFLAGS to use for LUA 5.1 [autodetect]])
AC_ARG_VAR([LUA_LDFLAGS], [LDFLAGS to use for LUA 5.1 [autodetect]])
AC_ARG_VAR([LUA_LIBDIR], [Location of LUA 5.1 library. [none]])
if test -z "$LUA_CFLAGS"; then
AGI_FIND_HEADER([LUA], [lua.hpp], [/usr/include/lua5.1 /usr/include/lua51 /usr/local/include/lua51 /usr/local/include/lua5.1 /usr/include /usr/local/include])
@ -698,8 +718,8 @@ if test "$have_wxconfig" = "no"; then
AC_MSG_FAILURE([wxWidgets detection failed, please set --with-wx* or add the libraries to your LDFLAGS, CXX/CFLAGS.])
fi
AC_ARG_ENABLE(slow-wx-checks, [ --disable-slow-wx-checks
Disable slow-running checks for wx components.])
AC_ARG_ENABLE(slow-wx-checks,
AS_HELP_STRING([--disable-slow-wx-checks],[Disable slow-running checks for wx components.]))
if test "$enable_slow_wx_checks" != "no"; then
AC_AGI_LINK([wxWidgets OpenGL support], [wxopengl], [wx/glcanvas.h], [$GL_CFLAGS $WX_CFLAGS], [$GL_LIBS $WX_LIBS],[
@ -730,9 +750,8 @@ fi
# Precompiled Header Support
# Only works with gcc!
############################
AC_MSG_CHECKING([whether to use precompiled headers])
AC_ARG_ENABLE(gcc-prec, [ --disable-gcc-prec disable GCC precompiled headers])
AC_ARG_ENABLE(gcc-prec, AS_HELP_STRING([--disable-gcc-prec],[disable GCC precompiled headers]))
if test "$enable_gcc_prec" != "no"; then
enable_gcc_prec="yes"
AC_MSG_RESULT([yes])
@ -748,10 +767,10 @@ AC_SUBST(enable_gcc_prec)
# If you want it earlier add it to your CXXFLAGS.
######################################################
AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable-debug (default: -g)])
AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable-debug [-g]])
AC_MSG_CHECKING([whether to turn on debugging])
AC_ARG_ENABLE(debug, [ --enable-debug enable debugging (default=no)])
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debugging [no]]))
if test "$enable_debug" = "yes"; then
if test -z "$DEBUG_FLAGS"; then
DEBUG_FLAGS="-g";
@ -777,10 +796,9 @@ if test "$enable_debug" = "yes"; then
fi
AC_SUBST(PACKAGE_DEBUG)
AC_MSG_CHECKING([whether to use exception handling in debug mode])
AC_ARG_ENABLE(debug-exceptions, [ --enable-debug-exceptions
enable exception handling in debug mode (default=no)])
AC_ARG_ENABLE(debug-exceptions, AS_HELP_STRING([--enable-debug-exceptions],[enable exception handling in debug mode [no]]))
if test "$enable_debug_exceptions" = "yes"; then
AC_DEFINE(WITH_EXCEPTIONS, 1, [Enable exception handling in debug mode. (--enable-debug) This is always enabled when debug mode is off.])
AC_MSG_RESULT([yes])
@ -788,15 +806,13 @@ else
AC_MSG_RESULT([no])
fi
###########
# Profiling
###########
AC_ARG_VAR([PROFILE_FLAGS], [Profile flag(s) to use with --enable-profile (default: -pg)])
AC_ARG_VAR([PROFILE_FLAGS], [Profile flag(s) to use with --enable-profile [-pg]])
AC_MSG_CHECKING([whether to turn on profiling])
AC_ARG_ENABLE(profile, [ --enable-profile enable profiling (default=no)])
AC_ARG_ENABLE(profile, AS_HELP_STRING([--enable-profile],[enable profiling [no]]))
if test "$enable_profile" = "yes"; then
if test -z "$PROFILE_FLAGS"; then
PROFILE_FLAGS="-pg";
@ -812,12 +828,11 @@ fi
######
# gcov
######
AC_ARG_VAR([GCOV_CFLAGS], [gcov cflag(s) to use with --enable-gcov (default: -ftest-coverage -fprofile-arcs)])
AC_ARG_VAR([GCOV_LDFLAGS], [gcov ldflag(s) to use with --enable-gcov (default: -lgcov)])
AC_ARG_VAR([GCOV_CFLAGS], [gcov cflag(s) to use with --enable-gcov [-ftest-coverage -fprofile-arcs]])
AC_ARG_VAR([GCOV_LDFLAGS], [gcov ldflag(s) to use with --enable-gcov [-lgcov]])
AC_MSG_CHECKING([whether to turn on gcov])
AC_ARG_ENABLE(gcov, [ --enable-gcov enable gcov (default=no)])
AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[enable gcov [no]]))
if test "$enable_gcov" = "yes"; then
if test -z "$GCOV_CFLAGS"; then
@ -841,11 +856,10 @@ fi
################
# Electric Fence
################
AC_ARG_VAR([EFENCE_LDFLAGS], [Electric Fence ldflag(s) to use with --enable-profile (default: -lefence)])
AC_ARG_VAR([EFENCE_LDFLAGS], [Electric Fence ldflag(s) to use with --enable-profile [-lefence]])
AC_MSG_CHECKING([whether to turn on Electric Fence])
AC_ARG_ENABLE(efence, [ --enable-efence enable Electric Fence (default=no)])
AC_ARG_ENABLE(efence, AS_HELP_STRING([--enable-efence],[enable Electric Fence [no]]))
if test "$enable_efence" = "yes"; then
if test -z "$EFENCE_LDFLAGS"; then
EFENCE_LDFLAGS="-lefence";
@ -860,12 +874,11 @@ AC_SUBST(EFENCE_LDFLAGS)
##########
# ccmalloc
##########
AC_ARG_VAR([CCMALLOC_LIBS], [ccmalloc libs(s) to use with --enable-ccmalloc (default: $prefix/lib/ccmalloc-c++.o)])
AC_ARG_VAR([CCMALLOC_LDFLAGS], [ccmalloc ldflag(s) to use with --enable-ccmalloc (default: -lccmalloc)])
AC_ARG_VAR([CCMALLOC_LIBS], [ccmalloc libs(s) to use with --enable-ccmalloc [$prefix/lib/ccmalloc-c++.o]])
AC_ARG_VAR([CCMALLOC_LDFLAGS], [ccmalloc ldflag(s) to use with --enable-ccmalloc [-lccmalloc]])
AC_MSG_CHECKING([whether to turn on ccmalloc])
AC_ARG_ENABLE(ccmalloc, [ --enable-ccmalloc enable ccmalloc (default=no)])
AC_ARG_ENABLE(ccmalloc, AS_HELP_STRING([--enable-ccmalloc],[enable ccmalloc [no]]))
if test "$enable_ccmalloc" = "yes"; then
if test -z "$CCMALLOC_LIBS"; then
CCMALLOC_LIBS="$prefix/lib/ccmalloc-c++.o";
@ -891,7 +904,7 @@ fi
# ccache
########
AC_MSG_CHECKING([whether to enable ccache])
AC_ARG_ENABLE(ccache, [ --enable-ccache enable ccache (default=no)])
AC_ARG_ENABLE(ccache, AS_HELP_STRING([--enable-ccache],[enable ccache [no]]))
if test "$enable_ccache" = "yes"; then
AC_MSG_RESULT([yes])
else
@ -922,10 +935,9 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
# * This is done at the end to preserve sanity rather than littering
# it above.
####################################################################
AC_ARG_WITH(player-audio, [ --with-player-audio=(alsa|openal|portaudio|pulseaudio)
Default Audio Player (default: Linux/ALSA,
Darwin/OpenAL, 1:*/OSS, 2:*/PortAudio.])
AC_ARG_WITH(player-audio,
AS_HELP_STRING([--with-player-audio=(alsa|openal|portaudio|pulseaudio)],
[Default Audio Player [Linux/ALSA, Darwin/OpenAL, 1:*/OSS, 2:*/PortAudio]]))
# Default audio player.
if ! test -z "$with_player_audio"; then
@ -951,7 +963,6 @@ if test -z "$default_player_audio"; then
default_player_audio="NONE"
fi
###############
# Misc settings
###############