Re: [PATCH 1/3] configure.ac: check tv_nsec field in struct stat
On Sun, Dec 21, 2014 at 3:20 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 20 quoted lines
> On Sun, Dec 21, 2014 at 1:53 PM, Reuben Hawkins <reubenhwk@gmail.com> wrote:
>> +AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
>> +[HAVE_ST_MTIM=Yes],
>> +[HAVE_ST_MTIM=No],
>
> In Autoconf, it's customary to use lowercase values (such as "yes"
> rather than "Yes") for these temporary variables. A "no" value is
> usually represented by an empty assignment (HAVE_ST_MTIM=). However,
> AC_CHECK_MEMBER() assigns the test result automatically to a shell
> variable (in this case, named
> ac_cv_member_struct_stat_st_mtim_tv_nsec), so there is no need to
> invent your own (HAVE_ST_MTIM).
>
> So, you can reduce this to:
>
> AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec])
>
> and later check the value with
>
> test x$ac_cv_member_struct_stat_st_mtim_tv_nsec = yes
Apple auto-correction strikes again: s/yes/xyes/