Hi!

I don't have a DragonFly box myself, but apparently m4-1.4.11 doesn't
compile on it.

One of the main DragonFly developers provided a patch, see
http://leaf.dragonflybsd.org/mailarchive/users/2008-04/msg00044.html

The patch is a patch against pkgsrc, I'll attach the resulting "real"
patch against m4 to this mail.

Cheers,
 Thomas
Index: distinfo
===================================================================
RCS file: /archive/NetBSD-CVS/pkgsrc/devel/m4/distinfo,v
retrieving revision 1.22
diff -u -r1.22 distinfo
--- distinfo    13 Apr 2008 00:51:59 -0000      1.22
+++ distinfo    15 Apr 2008 03:28:34 -0000
@@ -4,3 +4,4 @@
 RMD160 (m4-1.4.11.tar.gz) = 3689d9681cf9d2effbf87a3202cea68a75ebcec2
 Size (m4-1.4.11.tar.gz) = 1168840 bytes
 SHA1 (patch-aa) = 31aed81ffd1ea40d688ff89786fa72d95a13d422
+MD5 (patch-ab) = 5090ca54f4a35aeaa2db5ddd65493615
Index: patches/patch-ab
===================================================================
RCS file: patches/patch-ab
diff -N patches/patch-ab
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-ab    15 Apr 2008 03:30:33 -0000
@@ -0,0 +1,51 @@
+--- lib/freadahead.c.orig      2008-03-10 19:11:22 -0700
++++ lib/freadahead.c   2008-04-14 17:38:46 -0700
+@@ -78,6 +78,8 @@
+        + (fp->_Mode & 0x4000 /* _MBYTE */
+           ? (fp->_Back + sizeof (fp->_Back)) - fp->_Rback
+           : 0);
++#elif defined __DragonFly__       /* DragonFly */
++  return __sreadahead(fp);
+ #else
+  #error "Please port gnulib freadahead.c to your platform! Look at the 
definition of fflush, fread, ungetc on your system, then report this to 
bug-gnulib."
+ #endif
+Only in /usr/obj/pkgsrc/devel/m4/work/m4-1.4.11/lib: freadahead.o
+diff -u -r ./freading.c /usr/obj/pkgsrc/devel/m4/work/m4-1.4.11/lib/freading.c
+--- lib/freading.c.orig        2007-11-10 15:24:02 -0800
++++ lib/freading.c     2008-04-14 17:41:47 -0700
+@@ -42,6 +42,8 @@
+ #elif defined __QNX__               /* QNX */
+   return ((fp->_Mode & 0x2 /* _MOPENW */) == 0
+         || (fp->_Mode & 0x1000 /* _MREAD */) != 0);
++#elif defined __DragonFly__       /* DragonFly */
++  return ((((struct __FILE_public *)fp)->_flags & __SRD) != 0);
+ #else
+  #error "Please port gnulib freading.c to your platform!"
+ #endif
+--- lib/fseeko.c.orig  2007-12-17 21:18:34 -0800
++++ lib/fseeko.c       2008-04-14 20:27:44 -0700
+@@ -23,6 +23,18 @@
+ /* Get off_t and lseek.  */
+ #include <unistd.h>
+ 
++#ifdef __DragonFly__
++
++#undef fseeko
++
++int
++rpl_fseeko (FILE *fp, off_t offset, int whence)
++{
++      return(fseeko(fp, offset, whence));
++}
++
++#else
++
+ #undef fseeko
+ #if !HAVE_FSEEKO
+ # undef fseek
+@@ -121,3 +133,5 @@
+   else
+     return fseeko (fp, offset, whence);
+ }
++
++#endif
--- lib/freadahead.c.orig       2008-03-10 19:11:22 -0700
+++ lib/freadahead.c    2008-04-14 17:38:46 -0700
@@ -78,6 +78,8 @@
         + (fp->_Mode & 0x4000 /* _MBYTE */
            ? (fp->_Back + sizeof (fp->_Back)) - fp->_Rback
            : 0);
+#elif defined __DragonFly__        /* DragonFly */
+  return __sreadahead(fp);
 #else
  #error "Please port gnulib freadahead.c to your platform! Look at the 
definition of fflush, fread, ungetc on your system, then report this to 
bug-gnulib."
 #endif
Only in /usr/obj/pkgsrc/devel/m4/work/m4-1.4.11/lib: freadahead.o
diff -u -r ./freading.c /usr/obj/pkgsrc/devel/m4/work/m4-1.4.11/lib/freading.c
--- lib/freading.c.orig 2007-11-10 15:24:02 -0800
+++ lib/freading.c      2008-04-14 17:41:47 -0700
@@ -42,6 +42,8 @@
 #elif defined __QNX__               /* QNX */
   return ((fp->_Mode & 0x2 /* _MOPENW */) == 0
          || (fp->_Mode & 0x1000 /* _MREAD */) != 0);
+#elif defined __DragonFly__        /* DragonFly */
+  return ((((struct __FILE_public *)fp)->_flags & __SRD) != 0);
 #else
  #error "Please port gnulib freading.c to your platform!"
 #endif
--- lib/fseeko.c.orig   2007-12-17 21:18:34 -0800
+++ lib/fseeko.c        2008-04-14 20:27:44 -0700
@@ -23,6 +23,18 @@
 /* Get off_t and lseek.  */
 #include <unistd.h>
 
+#ifdef __DragonFly__
+
+#undef fseeko
+
+int
+rpl_fseeko (FILE *fp, off_t offset, int whence)
+{
+       return(fseeko(fp, offset, whence));
+}
+
+#else
+
 #undef fseeko
 #if !HAVE_FSEEKO
 # undef fseek
@@ -121,3 +133,5 @@
   else
     return fseeko (fp, offset, whence);
 }
+
+#endif

Reply via email to