FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 04-02-2011, 06:27 PM
Dan McGee
 
Default diskspace: add the actually used statfs type in ifdefs

On Fri, Apr 1, 2011 at 5:36 PM, Rémy Oudompheng
<remyoudompheng@gmail.com> wrote:
> Some systems, like FreeBSD might define both statfs
> and statvfs: however if statvfs exists whereas getmntinfo()
> uses a statfs struct, the current ifdefs would select the wrong
> line of code.
>
> Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
> ---
> *acinclude.m4 * * * * * *| * *8 ++++++--
> *lib/libalpm/diskspace.c | * *4 ++--
> *2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index 7309d73..1e51e92 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -115,8 +115,12 @@ AC_DEFUN([FS_STATS_TYPE],
> *extern int getmntinfo (struct statfs **, int);
> *]],
> * * * * * [])],
> - * * * *[fs_stats_cv_type="struct statfs"],
> - * * * *[fs_stats_cv_type="struct statvfs"])],
> + * * * *[fs_stats_cv_type="struct statfs"
> + * * * * AC_DEFINE([HAVE_GETMNTINFO_STATFS], 1, [Define if getmntinfo() uses statfs.])
> + * * * *],
> + * * * *[fs_stats_cv_type="struct statvfs"
> + * * * * AC_DEFINE([HAVE_GETMNTINFO_STATVFS], 1, [Define if getmntinfo() uses statvfs.])
> + * * * *])],
> * * * [AC_CHECK_FUNC(getmntent,
> * * * * [fs_stats_cv_type="struct statvfs"])]
> * * )]
> diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
> index 281173a..066107d 100644
> --- a/lib/libalpm/diskspace.c
> +++ b/lib/libalpm/diskspace.c
> @@ -112,9 +112,9 @@ static alpm_list_t *mount_point_list(void)
> * * * * * * * *mp->mount_dir = strdup(fsp->f_mntonname);
> * * * * * * * *mp->mount_dir_len = strlen(mp->mount_dir);
> * * * * * * * *memcpy(&(mp->fsp), fsp, sizeof(FSSTATSTYPE));
> -#if defined HAVE_STRUCT_STATVFS_F_FLAG
> +#if defined(HAVE_GETMNTINFO_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_FLAG)
> * * * * * * * *mp->read_only = fsp->f_flag & ST_RDONLY;
> -#elif defined HAVE_STRUCT_STATFS_F_FLAGS
> +#elif defined(HAVE_GETMNTINFO_STATFS) && defined(HAVE_STRUCT_STATFS_F_FLAGS)
> * * * * * * * *mp->read_only = fsp->f_flags & MNT_RDONLY;
> *#endif

configure.ac:196: warning: AC_CACHE_VAL(fs_stats_cv_type, ...):
suspicious presence of an AC_DEFINE in the second argument, where no
actions should be taken
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
acinclude.m4:105: FS_STATS_TYPE is expanded from...
configure.ac:196: the top level
cd . && /bin/sh /home/dmcgee/projects/pacman-maint/missing --run
automake-1.11 --foreign
configure.ac:196: warning: AC_CACHE_VAL(fs_stats_cv_type, ...):
suspicious presence of an AC_DEFINE in the second argument, where no
actions should be taken
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
acinclude.m4:105: FS_STATS_TYPE is expanded from...
configure.ac:196: the top level
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh
/home/dmcgee/projects/pacman-maint/missing --run autoconf
configure.ac:196: warning: AC_CACHE_VAL(fs_stats_cv_type, ...):
suspicious presence of an AC_DEFINE in the second argument, where no
actions should be taken
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
acinclude.m4:105: FS_STATS_TYPE is expanded from...
configure.ac:196: the top level
 
Old 04-05-2011, 04:39 AM
Dan McGee
 
Default diskspace: add the actually used statfs type in ifdefs

On Mon, Apr 4, 2011 at 6:37 PM, Rémy Oudompheng
<remyoudompheng@gmail.com> wrote:
> Some systems, like FreeBSD might define both statfs
> and statvfs: however if statvfs exists whereas getmntinfo()
> uses a statfs struct, the current ifdefs would select the wrong
> line of code.
>
> Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
> ---
> Rework of a previous patch. autoconf no longer spews errors
> on Linux, but still complains on FreeBSD + autoconf 2.68
> I don't know how to fix that, but the errors also appear
> with current maint branch.

Giving us the errors here might help correct them. We also haven't
made that many changes to configure.ac between master and maint, so
I'm not sure if you're saying master is fine or what. I'm hesitant to
merge this patch just yet since I don't know what we're looking at
problem-wise here.

> Still compiles correctly on ArchLinux and FreeBSD with this
> patch.
>
> On branch 'maint'
>
> *acinclude.m4 * * * * * *| * *7 +++++++
> *lib/libalpm/diskspace.c | * *4 ++--
> *2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index 7309d73..5adb3cc 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -123,6 +123,13 @@ extern int getmntinfo (struct statfs **, int);
> * )
> * AC_DEFINE_UNQUOTED(FSSTATSTYPE, [$fs_stats_cv_type],
> * * [Defined as the filesystem stats type ('statvfs' or 'statfs')])
> + *if test $ac_cv_func_getmntinfo = yes; then
> + * *if test "$fs_stats_cv_type" = "struct statvfs"; then
> + * * *AC_DEFINE([HAVE_GETMNTINFO_STATVFS], 1, [Define if getmntinfo() uses statvfs.])
> + * *else
> + * * *AC_DEFINE([HAVE_GETMNTINFO_STATFS], 1, [Define if getmntinfo() uses statfs.])
> + * *fi
> + *fi
> *])
>
> *dnl Checks for PATH_MAX and defines it if not present
> diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
> index 281173a..066107d 100644
> --- a/lib/libalpm/diskspace.c
> +++ b/lib/libalpm/diskspace.c
> @@ -112,9 +112,9 @@ static alpm_list_t *mount_point_list(void)
> * * * * * * * *mp->mount_dir = strdup(fsp->f_mntonname);
> * * * * * * * *mp->mount_dir_len = strlen(mp->mount_dir);
> * * * * * * * *memcpy(&(mp->fsp), fsp, sizeof(FSSTATSTYPE));
> -#if defined HAVE_STRUCT_STATVFS_F_FLAG
> +#if defined(HAVE_GETMNTINFO_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_FLAG)
> * * * * * * * *mp->read_only = fsp->f_flag & ST_RDONLY;
> -#elif defined HAVE_STRUCT_STATFS_F_FLAGS
> +#elif defined(HAVE_GETMNTINFO_STATFS) && defined(HAVE_STRUCT_STATFS_F_FLAGS)
> * * * * * * * *mp->read_only = fsp->f_flags & MNT_RDONLY;
> *#endif
>
> --
> 1.7.4.2
>
>
>
 
Old 04-05-2011, 06:35 AM
Rémy Oudompheng
 
Default diskspace: add the actually used statfs type in ifdefs

On Mon 04 April 2011 at 23:39 -0500, Dan McGee wrote:
> On Mon, Apr 4, 2011 at 6:37 PM, Rémy Oudompheng
> <remyoudompheng@gmail.com> wrote:
> > Some systems, like FreeBSD might define both statfs
> > and statvfs: however if statvfs exists whereas getmntinfo()
> > uses a statfs struct, the current ifdefs would select the wrong
> > line of code.
> >
> > Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
> > ---
> > Rework of a previous patch. autoconf no longer spews errors
> > on Linux, but still complains on FreeBSD + autoconf 2.68
> > I don't know how to fix that, but the errors also appear
> > with current maint branch.
>
> Giving us the errors here might help correct them. We also haven't
> made that many changes to configure.ac between master and maint, so
> I'm not sure if you're saying master is fine or what. I'm hesitant to
> merge this patch just yet since I don't know what we're looking at
> problem-wise here.

The warnings are:

configure.ac:185: warning: AC_CACHE_VAL(path_max_cv_defined, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
acinclude.m4:129: PATH_MAX_DEFINED is expanded from...
configure.ac:185: the top level
configure.ac:196: warning: AC_CACHE_VAL(fs_stats_cv_type, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
acinclude.m4:105: FS_STATS_TYPE is expanded from...
configure.ac:196: the top level
configure.ac:207: warning: AC_CACHE_VAL(gnu89_inline_cv_cc, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
acinclude.m4:87: GCC_GNU89_INLINE_CC is expanded from...
configure.ac:207: the top level

They happen on the clean maint and master branches, and don't make any
sense to me, but they are not related to this patch anyway. I'm not sure
about what version of m4 is used there, I'll look at that later.

--
Rémy.
 
Old 04-05-2011, 01:41 PM
Dan McGee
 
Default diskspace: add the actually used statfs type in ifdefs

On Tue, Apr 5, 2011 at 1:35 AM, Rémy Oudompheng
<remyoudompheng@gmail.com> wrote:
> On Mon 04 April 2011 at 23:39 -0500, Dan McGee wrote:
>> On Mon, Apr 4, 2011 at 6:37 PM, Rémy Oudompheng
>> <remyoudompheng@gmail.com> wrote:
>> > Some systems, like FreeBSD might define both statfs
>> > and statvfs: however if statvfs exists whereas getmntinfo()
>> > uses a statfs struct, the current ifdefs would select the wrong
>> > line of code.
>> >
>> > Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
>> > ---
>> > Rework of a previous patch. autoconf no longer spews errors
>> > on Linux, but still complains on FreeBSD + autoconf 2.68
>> > I don't know how to fix that, but the errors also appear
>> > with current maint branch.
>>
>> Giving us the errors here might help correct them. We also haven't
>> made that many changes to configure.ac between master and maint, so
>> I'm not sure if you're saying master is fine or what. I'm hesitant to
>> merge this patch just yet since I don't know what we're looking at
>> problem-wise here.
>
> The warnings are:
>
> configure.ac:185: warning: AC_CACHE_VAL(path_max_cv_defined, ...): suspicious cache-id, must contain _cv_ to be cached
> ../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
> ../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
> acinclude.m4:129: PATH_MAX_DEFINED is expanded from...
> configure.ac:185: the top level
> configure.ac:196: warning: AC_CACHE_VAL(fs_stats_cv_type, ...): suspicious cache-id, must contain _cv_ to be cached
> ../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
> ../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
> acinclude.m4:105: FS_STATS_TYPE is expanded from...
> configure.ac:196: the top level
> configure.ac:207: warning: AC_CACHE_VAL(gnu89_inline_cv_cc, ...): suspicious cache-id, must contain _cv_ to be cached
> ../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
> ../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
> acinclude.m4:87: GCC_GNU89_INLINE_CC is expanded from...
> configure.ac:207: the top level
>
> They happen on the clean maint and master branches, and don't make any
> sense to me, but they are not related to this patch anyway. I'm not sure
> about what version of m4 is used there, I'll look at that later.

The autoconf version too? What are the lines in general.m4 that it is
blowing up on? Those have been changed a little bit looking at
autoconf.git history; on Arch we currently have this:

[AS_LITERAL_WORD_IF([$1], [m4_if(m4_index(m4_quote($1), [_cv_]), [-1],
[AC_DIAGNOSE([syntax],
[$0($1, ...): suspicious cache-id, must contain _cv_ to be cached])])])dnl

-Dan
 

Thread Tools




All times are GMT. The time now is 01:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org