Package: mc
Version: 1:4.6.1-2
Severity: wishlist
Tags: patch

Hello,

when building 'mc' on ppc64/unstable, I get the following error:

In file included from /usr/include/asm/types.h:8,
                 from /usr/include/asm-ppc64/elf.h:4,
                 from /usr/include/asm/elf.h:8,
                 from /usr/include/asm-ppc64/sigcontext.h:12,
                 from /usr/include/asm/sigcontext.h:8,
                 from /usr/include/bits/sigcontext.h:28,
                 from /usr/include/signal.h:333,
                 from tcputil.c:22:
/usr/include/asm-ppc64/types.h:19: error: two or more data types in declaration 
specifiers
make[5]: *** [tcputil.o] Error 1
make[5]: Leaving directory `/mc-4.6.1/vfs'

With the attached patch 'mc' can be compiled on ppc64.

The patch replaces the occurrences of the linux kernel specific type
'umode_t' by 'mode_t' and drops the problematic 'AC_CHECK_TYPE(umode_t, int)' 
type check/definition from configure.ac and configure.

Regards
Andreas Jochens

diff -urN ../tmp-orig/mc-4.6.1/src/achown.c ./src/achown.c
--- ../tmp-orig/mc-4.6.1/src/achown.c   2005-07-23 16:52:02.000000000 +0000
+++ ./src/achown.c      2006-03-25 18:52:50.000000000 +0000
@@ -84,7 +84,7 @@
 static int x_toggle;
 static char ch_flags[11];
 static const char ch_perm[] = "rwx";
-static umode_t ch_cmode;
+static mode_t ch_cmode;
 static struct stat *sf_stat;
 static int need_update;
 static int end_chown;
@@ -143,9 +143,9 @@
     }
 }
 
-static umode_t get_perm (char *s, int base)
+static mode_t get_perm (char *s, int base)
 {
-    umode_t m;
+    mode_t m;
 
     m = 0;
     m |= (s [0] == '-') ? 0 :
@@ -160,9 +160,9 @@
     return m;
 }
 
-static umode_t get_mode (void)
+static mode_t get_mode (void)
 {
-    umode_t m;
+    mode_t m;
 
     m = ch_cmode ^ (ch_cmode & 0777);
     m |= get_perm (ch_flags, 6);
diff -urN ../tmp-orig/mc-4.6.1/src/file.c ./src/file.c
--- ../tmp-orig/mc-4.6.1/src/file.c     2005-05-27 14:19:18.000000000 +0000
+++ ./src/file.c        2006-03-25 18:52:50.000000000 +0000
@@ -97,7 +97,7 @@
     dev_t dev;
     ino_t ino;
     short linkcount;
-    umode_t st_mode;
+    mode_t st_mode;
     char name[1];
 };
 
diff -urN ../tmp-orig/mc-4.6.1/configure.ac ./configure.ac
--- ../tmp-orig/mc-4.6.1/configure.ac   2005-07-23 16:52:49.000000000 +0000
+++ ./configure.ac      2006-03-25 18:52:50.000000000 +0000
@@ -210,7 +210,6 @@
 dnl 
 
 AC_TYPE_MODE_T
-AC_CHECK_TYPE(umode_t, int)
 AC_CHECK_TYPE(off_t, long)
 AC_TYPE_PID_T
 AC_TYPE_UID_T
diff -urN ../tmp-orig/mc-4.6.1/configure ./configure
--- ../tmp-orig/mc-4.6.1/configure      2005-07-23 16:53:09.000000000 +0000
+++ ./configure 2006-03-25 18:52:42.000000000 +0000
@@ -13667,72 +13667,6 @@
 
 fi
 
-echo "$as_me:$LINENO: checking for umode_t" >&5
-echo $ECHO_N "checking for umode_t... $ECHO_C" >&6
-if test "${ac_cv_type_umode_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((umode_t *) 0)
-  return 0;
-if (sizeof (umode_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_umode_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_umode_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_umode_t" >&5
-echo "${ECHO_T}$ac_cv_type_umode_t" >&6
-if test $ac_cv_type_umode_t = yes; then
-  :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define umode_t int
-_ACEOF
-
-fi
-
 echo "$as_me:$LINENO: checking for off_t" >&5
 echo $ECHO_N "checking for off_t... $ECHO_C" >&6
 if test "${ac_cv_type_off_t+set}" = set; then


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to