pkgsrc/devel/m4

2012/01/22 18:36:16 以降の -current では fpos_t が off_t と同じものでは無くなったので FILE 構造体の中まで操作しているプログラムがコンパイルできなくなる事が予想されていたんだけど GNU m4 で引っかかった(´・ω・`)

pkgsrc へのパッチ

diff --exclude=CVS -uNr m4/patches/patch-configure m4.new/patches/patch-configure
--- m4/patches/patch-configure	1970-01-01 09:00:00.000000000 +0900
+++ m4.new/patches/patch-configure	2012-01-27 23:16:08.000000000 +0900
@@ -0,0 +1,57 @@
+$NetBSD$
+
+--- configure.orig	2011-03-02 02:36:39.000000000 +0900
++++ configure	2012-01-27 22:51:44.000000000 +0900
+@@ -34154,6 +34154,52 @@
+ _ACEOF
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to check FILE._offset type is off_t" >&5
++$as_echo_n "checking whether to check FILE._offset type is off_t... " >&6; }
++if ${M4_cv_file_offset_type_is_off_t+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test "$cross_compiling" = yes; then :
++  M4_cv_file_offset_type_is_off_t='guessing no'
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++FILE *f = fopen ("conftest.tmp", "w+");
++       off_t off = 0;
++       f->_offset = off;
++       fclose (f);
++       return 0;
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_run "$LINENO"; then :
++  M4_cv_file_offset_type_is_off_t=yes
++else
++  M4_cv_file_offset_type_is_off_t=no
++fi
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++  conftest.$ac_objext conftest.beam conftest.$ac_ext
++fi
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4_cv_file_offset_type_is_off_t" >&5
++$as_echo "$M4_cv_file_offset_type_is_off_t" >&6; }
++if test "$M4_cv_file_offset_type_is_off_t" = yes ; then
++  M4_file_offset_type_is_off_t=1
++else
++  M4_file_offset_type_is_off_t=0
++fi
++
++cat >>confdefs.h <<_ACEOF
++#define FILE_OFFSET_TYPE_IS_OFF_T $M4_file_offset_type_is_off_t
++_ACEOF
++
++
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if changeword is wanted" >&5
+ $as_echo_n "checking if changeword is wanted... " >&6; }
diff --exclude=CVS -uNr m4/patches/patch-configure.ac m4.new/patches/patch-configure.ac
--- m4/patches/patch-configure.ac	1970-01-01 09:00:00.000000000 +0900
+++ m4.new/patches/patch-configure.ac	2012-01-27 23:16:13.000000000 +0900
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- configure.ac.orig	2011-02-27 08:42:45.000000000 +0900
++++ configure.ac	2012-01-27 22:50:27.000000000 +0900
+@@ -121,6 +121,26 @@
+ AC_DEFINE_UNQUOTED([RENAME_OPEN_FILE_WORKS], [$M4_rename_open_works],
+   [Define to 1 if a file can be renamed while open, or to 0 if not.])
+ 
++AC_CACHE_CHECK([whether to check FILE._offset type is off_t],
++  [M4_cv_file_offset_type_is_off_t],
++  [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
++      [FILE *f = fopen ("conftest.tmp", "w+");
++       off_t off = 0;
++       f->_offset = off;
++       fclose (f);
++       return 0;])],
++    [M4_cv_file_offset_type_is_off_t=yes],
++    [M4_cv_file_offset_type_is_off_t=no],
++    [M4_cv_file_offset_type_is_off_t='guessing no'])])
++if test "$M4_cv_file_offset_type_is_off_t" = yes ; then
++  M4_file_offset_type_is_off_t=1
++else
++  M4_file_offset_type_is_off_t=0
++fi
++AC_DEFINE_UNQUOTED([FILE_OFFSET_TYPE_IS_OFF_T],
++  [$M4_file_offset_type_is_off_t],
++  [Define to 1 if FILE._offset type is off_t, or to 0 if not.])
++
+ dnl Don't let changeword get in our way, if bootstrapping with a version of
+ dnl m4 that already turned the feature on.
+ m4_ifdef([changeword], [m4_undefine([changeword])])dnl
diff --exclude=CVS -uNr m4/patches/patch-lib-config.hin m4.new/patches/patch-lib-config.hin
--- m4/patches/patch-lib-config.hin	1970-01-01 09:00:00.000000000 +0900
+++ m4.new/patches/patch-lib-config.hin	2012-01-27 23:16:17.000000000 +0900
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- lib/config.hin.orig	2011-03-02 01:57:39.000000000 +0900
++++ lib/config.hin	2012-01-27 23:07:49.000000000 +0900
+@@ -55,6 +55,9 @@
+ /* Define this to 1 if F_DUPFD behavior does not match POSIX */
+ #undef FCNTL_DUPFD_BUGGY
+ 
++/* Define to 1 if FILE._offset type is off_t, or to 0 if not. */
++#undef FILE_OFFSET_TYPE_IS_OFF_T
++
+ /* Define as the bit index in the word where to find bit 0 of the exponent of
+    'float'. */
+ #undef FLT_EXPBIT0_BIT
diff --exclude=CVS -uNr m4/patches/patch-lib-fflush.c m4.new/patches/patch-lib-fflush.c
--- m4/patches/patch-lib-fflush.c	1970-01-01 09:00:00.000000000 +0900
+++ m4.new/patches/patch-lib-fflush.c	2012-01-27 23:16:24.000000000 +0900
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/fflush.c.orig	2011-03-02 01:39:27.000000000 +0900
++++ lib/fflush.c	2012-01-27 23:11:57.000000000 +0900
+@@ -91,7 +91,7 @@
+ update_fpos_cache (FILE *fp, off_t pos)
+ {
+ #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+-# if defined __CYGWIN__
++# if defined __CYGWIN__ || defined FILE_OFFSET_TYPE_IS_OFF_T
+   /* fp_->_offset is typed as an integer.  */
+   fp_->_offset = pos;
+ # else
diff --exclude=CVS -uNr m4/patches/patch-lib-fseek.c m4.new/patches/patch-lib-fseek.c
--- m4/patches/patch-lib-fseek.c	1970-01-01 09:00:00.000000000 +0900
+++ m4.new/patches/patch-lib-fseek.c	2012-01-27 23:16:30.000000000 +0900
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/fseeko.c.orig	2011-03-02 01:39:28.000000000 +0900
++++ lib/fseeko.c	2012-01-27 23:12:08.000000000 +0900
+@@ -109,7 +109,7 @@
+ #if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+       fp->_flags &= ~_IO_EOF_SEEN;
+ #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+-# if defined __CYGWIN__
++# if defined __CYGWIN__ || defined FILE_OFFSET_TYPE_IS_OFF_T
+       /* fp_->_offset is typed as an integer.  */
+       fp_->_offset = pos;
+ # else
広告を非表示にする