pkgsrc-Bugs archive

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

pkg/38639: Patches to allow glib2 to build on IRIX



>Number:         38639
>Category:       pkg
>Synopsis:       Patches to allow glib2 to build on IRIX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 12 16:10:00 +0000 2008
>Originator:     Stuart Shelton
>Release:        pkgsrc latest from CVS
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30; IRIX 6.5.30; MIPSpro Compilers: Version 7.4.4m
>Description:

At the moment, glib2 fails to build on IRIX: the gio tests fail to build, and 
glocalfile tries to use the wrong vfs calls for IRIX.  The latter is fixed with 
the patch below, but the former I've only worked around by not building the gio 
tests.

Additionally, FAM support was being disabled on IRIX (FAM's native platform) 
because FAM has to be linked against libC on IRIX.

The patches are:


Remove gio tests

--- /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/Makefile.dist     
2008-05-12 13:14:17.166860040 +0100
+++ /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/Makefile  2008-05-12 
13:14:33.022595880 +0100
@@ -165,7 +165,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re
   distclean-recursive maintainer-clean-recursive
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = xdgmime inotify . fam tests
+DIST_SUBDIRS = xdgmime inotify . fam
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = ${SHELL} /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/missing --run 
aclocal-1.10
 ALLOCA = 
@@ -377,7 +377,7 @@ EXTRA_DIST = gio-marshal.list gio.symbol
        pltcheck.sh $(NULL)
 TEST_PROGS = 
 NULL = 
-SUBDIRS = $(am__append_1) $(am__append_2) . $(am__append_4) tests
+SUBDIRS = $(am__append_1) $(am__append_2) . $(am__append_4)
 #noinst_DATA = gio-2.0.lib
 ##TESTS = abicheck.sh pltcheck.sh
 AM_CPPFLAGS = \


Fix FAM

--- /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/configure.dist        
2008-05-12 12:57:03.329489680 +0100
+++ /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/configure     2008-05-12 
12:58:21.904929920 +0100
@@ -38044,7 +38044,7 @@ if test "${ac_cv_lib_fam_FAMOpen+set}" =
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfam  $LIBS"
+LIBS="-lfam -lC $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38251,7 +38251,7 @@ if test "${ac_cv_lib_fam_FAMNoExists+set
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfam  $LIBS"
+LIBS="-lfam -lC $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38314,7 +38314,7 @@ _ACEOF
 
 fi
 
-     FAM_LIBS="-lfam"
+     FAM_LIBS="-lfam -lC"
      fam_support=yes
 else
   { echo "$as_me:$LINENO: WARNING: *** FAM support will not be built (header 
files not found) ***" >&5


Use correct VFS API

--- /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/glocalfile.c.dist 
2008-04-17 16:59:20.192031960 +0100
+++ /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/glocalfile.c      
2008-04-17 17:47:52.824708520 +0100
@@ -57,6 +57,9 @@
    /* on solaris, statfs doesn't even have the
       f_bavail field */
 #  define USE_STATVFS
+# elif defined(__sgi)
+   /* on IRIX, also, statfs lacks f_bavail */
+#  define USE_STATVFS
 # else
   /* at least on linux, statfs is the actual syscall */
 #  define USE_STATFS
@@ -1004,8 +1007,12 @@ g_local_file_query_filesystem_info (GFil
 #if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
   fstype = g_strdup(statfs_buffer.f_fstypename);
 #else
+#ifdef __sgi
+  fstype = get_fs_type (statfs_buffer.f_fstyp);
+#else
   fstype = get_fs_type (statfs_buffer.f_type);
 #endif
+#endif
   if (fstype &&
       g_file_attribute_matcher_matches (attribute_matcher,
                                        G_FILE_ATTRIBUTE_FILESYSTEM_TYPE))

>How-To-Repeat:

Building gio/tests results in:

gmake[4]: Entering directory 
`/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/tests'
source='live-g-file.c' object='live-g-file.o' libtool=no \
        DEPDIR=.deps depmode=sgi /usr/bsd/bin/bash ../../depcomp \
        cc -DHAVE_CONFIG_H -I. -I../.. -g -I../.. -I../../glib -I../../gmodule 
-I../../gobject -I../../gio -DG_DISABLE_CAST_CHECKS  -I/usr/bsd/include 
-D__inline__=inline -DPREFIX="\"/usr/bsd\"" -DPKGLOCALEDIR="\"share\"" 
-DPKG_SYSCONFDIR="\"/usr/bsd/etc\"" -I/usr/include  -D_REENTRANT  -c99 -O2 -n32 
-mips4 -r14000 -apo -float_const -use_readonly_const 
-TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON 
-OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON 
-LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 
1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/include -I/usr/include -c 
live-g-file.c
cc WARNING:  -g conflicts with -O; changing to -O0; if you want -O, use -g3
cc WARNING:  -g conflicts with -apo, so ignoring -apo; if you want -apo, use -g3
cc-1018 cc: ERROR File = live-g-file.c, Line = 105
  An unmatched left parentheses "(" appears in an expression.

  #define log(msg...) if (verbose)  g_print (msg)
                 ^

cc-1055 cc: ERROR File = live-g-file.c, Line = 175
  A macro invocation has too many arguments.

         (char *) test_data);
         ^

(lots more errors)

cc-1029 cc: ERROR File = live-g-file.c, Line = 1002
  An expression is expected at this point.

              log ("      result = %d, error = %s\n", res, error->message);
              ^

46 errors detected in the compilation of "live-g-file.c".
gmake[4]: *** [live-g-file.o] Error 2
gmake[4]: Leaving directory 
`/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/tests'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3'
gmake: *** [all] Error 2
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/src/devel/glib2
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/devel/glib2

>Fix:

The problem gio/tests problem is a fairly simple varadic macros issue... but I 
can't work out the syntax to accept both a single or multiple parameters :(

It'll be something like:

#define log(msg) if (verbose) g_print (msg)

or

#define log(msg, ...) if (verbose) g_print (msg, ...)

This doesn't work either:

#define log(...) if (verbose) g_print (...)


(Note that the patch to configure is likely IRIX-specific... I'm not sure of 
the best way to conditionally include -lC on IRIX only.  Possibly a patch to 
the pkgsrc Makefile?)



Home | Main Index | Thread Index | Old Index