[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature request: allow dots in AC_ARG_WITH
From: |
Bruno Haible |
Subject: |
feature request: allow dots in AC_ARG_WITH |
Date: |
Mon, 13 Nov 2006 14:40:01 +0100 |
User-agent: |
KMail/1.9.1 |
Hi,
This configure.ac file
========================================================================
AC_INIT
AC_ARG_WITH([libglib-2.0-prefix],
[[ --with-libglib-2.0-prefix[=DIR] search for libglib-2.0 in DIR/include and
DIR/lib
--without-libglib-2.0-prefix don't search for libglib-2.0 in includedir
and libdir]],
with_libglib2=$withval
)
AC_OUTPUT
========================================================================
leads to an error at configure time:
$ autoconf
$ ./configure
./configure: line 1614: ${with_libglib_2.0_prefix+set}: bad substitution
configure: creating ./config.status
If I rename the option to --with-libglib-2_0-prefix, it will be hard to
understand for users, because the installed library is really called
libglib-2.0.so.
Here is a suggested change that would allow dots as well.
2006-11-12 Bruno Haible <address@hidden>
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): For --with, --without
options, transliterate also dots to underscores.
(_AC_ENABLE_IF): Transliterate also dots to underscores.
* doc/autoconf.texi (External Software): Document that AC_ARG_WITH's
first argument may also contain dots.
*** doc/autoconf.texi.bak 2006-10-23 06:55:42.000000000 +0200
--- doc/autoconf.texi 2006-11-12 15:45:19.000000000 +0100
***************
*** 15455,15461 ****
@var{action-if-given}. If neither option was given, run shell commands
@var{action-if-not-given}. The name @var{package} indicates another
software package that this program should work with. It should consist
! only of alphanumeric characters and dashes.
The option's argument is available to the shell commands
@var{action-if-given} in the shell variable @code{withval}, which is
--- 15455,15461 ----
@var{action-if-given}. If neither option was given, run shell commands
@var{action-if-not-given}. The name @var{package} indicates another
software package that this program should work with. It should consist
! only of alphanumeric characters, dashes, and dots.
The option's argument is available to the shell commands
@var{action-if-given} in the shell variable @code{withval}, which is
*** lib/autoconf/general.m4.bak 2006-10-23 06:58:54.000000000 +0200
--- lib/autoconf/general.m4 2006-11-12 17:20:18.000000000 +0100
***************
*** 843,859 ****
-with-* | --with-*)
ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
# Reject names that are not valid shell variable names.
! expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid package name: $ac_package])
! ac_package=`echo $ac_package| sed 's/-/_/g'`
eval with_$ac_package=\$ac_optarg ;;
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
! expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid package name: $ac_package])
! ac_package=`echo $ac_package | sed 's/-/_/g'`
eval with_$ac_package=no ;;
--x)
--- 843,859 ----
-with-* | --with-*)
ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
# Reject names that are not valid shell variable names.
! expr "x$ac_package" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid package name: $ac_package])
! [ac_package=`echo $ac_package | sed 's/[-.]/_/g'`]
eval with_$ac_package=\$ac_optarg ;;
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
! expr "x$ac_package" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid package name: $ac_package])
! [ac_package=`echo $ac_package | sed 's/[-.]/_/g'`]
eval with_$ac_package=no ;;
--x)
***************
*** 1361,1367 ****
#
m4_define([_AC_ENABLE_IF],
[# Check whether --$1-$2 was given.
! _AC_ENABLE_IF_ACTION([$1], m4_bpatsubst([$2], -, _), [$3], [$4])[]dnl
])
m4_define([_AC_ENABLE_IF_ACTION],
--- 1361,1367 ----
#
m4_define([_AC_ENABLE_IF],
[# Check whether --$1-$2 was given.
! _AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-.], [__]), [$3], [$4])[]dnl
])
m4_define([_AC_ENABLE_IF_ACTION],
- feature request: allow dots in AC_ARG_WITH,
Bruno Haible <=