After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 521045 - glib f_fstypename miscellany
glib f_fstypename miscellany
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-03-07 18:10 UTC by paul
Modified: 2008-03-20 11:44 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
unified diff of what i babbled in the previous comments (836 bytes, patch)
2008-03-20 04:23 UTC, paul
none Details | Review

Description paul 2008-03-07 18:10:30 UTC
as darwin too has f_fstypename, but without sys/mount.h, the test results in

conftest.c: In function `main':
conftest.c:115: error: storage size of `ac_aggr' isn't known
conftest.c:115: warning: unused variable `ac_aggr'
conftest.c:115: error: storage size of `ac_aggr' isn't known
Comment 1 paul 2008-03-13 20:35:14 UTC
it was added in

http://svn.gnome.org/viewvc/glib/trunk/configure.in?r1=6691&r2=6694

but as far as i can tell, adding #includes in AC_CHECK_MEMBERS is the 4th argument

so it needs to be 

AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct statfs.f_fstypename],,, [#include <sys/types.h>
Comment 2 paul 2008-03-13 20:43:00 UTC
retitled

and glocalfile.c needs changed, as what autoconf spits out as the define is not what is expected there

Index: gio/glocalfile.c
===================================================================
--- gio/glocalfile.c    (revision 6701)
+++ gio/glocalfile.c    (working copy)
@@ -1001,7 +1001,7 @@
 #endif
     }
 #ifdef USE_STATFS
-#if defined(HAVE_STRUCT_STATFS_FS_TYPENAME)
+#if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
   fstype = g_strdup(statfs_buffer.f_fstypename);
 #else
   fstype = get_fs_type (statfs_buffer.f_type);
Comment 3 Alexander Larsson 2008-03-14 10:38:26 UTC
I've gotten patches and stuff for this from other parties.
Can you verify that current trunk works for you?
Comment 4 paul 2008-03-14 21:30:25 UTC
not yet

checking for struct statfs.f_fstypename... no

configure:33120: checking for struct statfs.f_fstypename
configure:33148: gcc -c -arch ppc  -g -Wall -Wno-long-double   -pipe -no-cpp-precomp -Dsocklen_t=int -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_3                 -I/opt/local/include           conftest.c >&5
conftest.c: In function `main':
conftest.c:115: error: storage size of `ac_aggr' isn't known
conftest.c:115: warning: unused variable `ac_aggr'
conftest.c:115: error: storage size of `ac_aggr' isn't known
configure:33154: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "glib"
| #define PACKAGE_TARNAME "glib"
| #define PACKAGE_VERSION "2.17.0"
| #define PACKAGE_STRING "glib 2.17.0"
| #define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=glib"
| #define GLIB_MAJOR_VERSION 2
| #define GLIB_MINOR_VERSION 17
| #define GLIB_MICRO_VERSION 0
| #define GLIB_INTERFACE_AGE 0
| #define GLIB_BINARY_AGE 1700
| #define HAVE_CARBON 1
| #define NEED_ICONV_CACHE 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_LC_MESSAGES 1
| #define HAVE_BIND_TEXTDOMAIN_CODESET 1
| #define HAVE_GETTEXT 1
| #define HAVE_DCGETTEXT 1
| #define ENABLE_NLS 1
| #define GETTEXT_PACKAGE "glib20"
| #define GLIB_LOCALE_DIR "/opt/local/share/locale"
| #define USE_LIBICONV_GNU 1
| #define STDC_HEADERS 1
| #define HAVE_VPRINTF 1
| #define HAVE_STDLIB_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_GETPAGESIZE 1
| #define HAVE_MMAP 1
| #define HAVE_ALLOCA 1
| #define HAVE_VALLOC 1
| #define HAVE_ATEXIT 1
| #define HAVE_TIMEGM 1
| #define HAVE_GMTIME_R 1
| #define SIZEOF_CHAR 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_LONG 4
| #define SIZEOF_INT 4
| #define SIZEOF_VOID_P 4
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF___INT64 0
| #define HAVE_LONG_LONG_FORMAT 1
| #define SANE_MALLOC_PROTOS 1
| #define G_HAVE___INLINE 1
| #define G_HAVE___INLINE__ 1
| #define G_HAVE_INLINE 1
| #define HAVE_DOWHILE_MACROS 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_DIRENT_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_PWD_H 1
| #define HAVE_GRP_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMES_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_SCHED_H 1
| #define HAVE_SYS_MOUNT_H 1
| #define HAVE_SYS_SYSCTL_H 1
| #define HAVE_FSTAB_H 1
| #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
| #define HAVE_STRUCT_STAT_ST_BLOCKS 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| static struct statfs ac_aggr;
| if (ac_aggr.f_fstypename)
| return 0;
|   ;
|   return 0;
| }

the change in comment #1 gets the required files included so it works
Comment 5 paul 2008-03-14 21:43:52 UTC
and now the #ifdef HAVE_MOUNT_H needs to be HAVE_SYS_MOUNT_H
Comment 6 paul 2008-03-14 21:45:25 UTC
same for HAVE_PARAM_H/HAVE_SYS_PARAM_H
sorry for the bug spam
Comment 7 paul 2008-03-20 04:23:38 UTC
Created attachment 107658 [details] [review]
unified diff of what i babbled in the previous comments
Comment 8 Alexander Larsson 2008-03-20 11:44:57 UTC
commited.