bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting a default value for an AC_ARG_VAR


From: Reuben Thomas
Subject: Setting a default value for an AC_ARG_VAR
Date: Fri, 14 Dec 2018 14:01:01 +0000

What's the right way to do this? I currently have:

AC_ARG_VAR([WORD_SIZE],
  [value of WORD_SIZE register [default: sizeof(long)]])
if "$ac_cv_env_WORD_SIZE_set" != set; then
  AC_CHECK_SIZEOF([long])
  ac_cv_env_WORD_SIZE_value=SIZEOF_LONG
fi

which seems to work, but I'm conscious that I'm relying on undocumented
variable names (ac_cv_env_*). I can't seem to get the same effect with, for
example:

AC_CHECK_SIZEOF([long])
AC_SUBST([WORD_SIZE], [SIZEOF_LONG])
AC_ARG_VAR([WORD_SIZE],
  [value of WORD_SIZE register [default: sizeof(long)]])

(the AC_SUBST overrides whatever AC_ARG_VAR does, it seems).

-- 
https://rrt.sc3d.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]