Patch from Peter Hartley to allow Cross-compiling to mingw32:

- MinGW doesn't have struct timespec, so udf_time.c doesn't compile
   (changes lib/udf/udf_time.c, configure.ac, config.h.in)

 - The configure test for bitfield ordering uses AC_TRY_RUN and thus
   doesn't work when cross-compiling; use sneakiness to try and
   determine it at compile time, falling back to the existing runtime
   check if the sneakiness doesn't work
   (changes configure.ac; tested on x86_64-linux-gnu and i586-mingw32
   which are bf_lsbf=1, plus sparc64-linux-gnu which is bf_lsbf=0)

 - The configure test for "extern long timezone" needlessly uses
   AC_TRY_RUN when in fact AC_LINK_IFELSE is all we need to know, and
   that latter works when cross-compiling
   (changes configure.ac)

 - MinGW sys/stat.h doesn't have the *GRP or *OTH macros, nor S_IFLNK
   or S_IFSOCK, nor S_ISUID etc
   (changes lib/udf/udf.c and lib/iso9660/xa.c)

 - MinGW doesn't have <sys/wait.h>, so even the header-inclusion bit
   of the Linux driver doesn't compile unless it's moved inside the
   "ifdef HAVE_LINUX_CDROM"
   (changes lib/driver/gnu_linux.c)

 - Because the man pages cd-info.1 etc depend on the binaries themselves
   (for help2man reasons), the configure options --without-cd-info etc
   don't actually stop them being compiled. Fixed by only depending on
   man pages for programs that are actually built, which also stops
   the installation of man pages of programs which aren't themselves
   installed
   (changes src/Makefile.am)
This commit is contained in:
rocky
2008-04-24 07:28:00 +00:00
parent 8deec6fcc9
commit 62d7731703
8 changed files with 104 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: udf.c,v 1.12 2008/04/18 16:02:10 karl Exp $
$Id: udf.c,v 1.13 2008/04/24 07:28:00 rocky Exp $
Copyright (C) 2005, 2008 Rocky Bernstein <rocky@gnu.org>
@@ -63,13 +63,17 @@ udf_get_posix_filemode(const udf_dirent_t *p_udf_dirent)
if (i_perms & FE_PERM_U_WRITE) mode |= S_IWUSR;
if (i_perms & FE_PERM_U_EXEC) mode |= S_IXUSR;
#ifdef S_IRGRP
if (i_perms & FE_PERM_G_READ) mode |= S_IRGRP;
if (i_perms & FE_PERM_G_WRITE) mode |= S_IWGRP;
if (i_perms & FE_PERM_G_EXEC) mode |= S_IXGRP;
#endif
#ifdef S_IROTH
if (i_perms & FE_PERM_O_READ) mode |= S_IROTH;
if (i_perms & FE_PERM_O_WRITE) mode |= S_IWOTH;
if (i_perms & FE_PERM_O_EXEC) mode |= S_IXOTH;
#endif
switch (udf_fe.icb_tag.file_type) {
case ICBTAG_FILE_TYPE_DIRECTORY:
@@ -78,24 +82,30 @@ udf_get_posix_filemode(const udf_dirent_t *p_udf_dirent)
case ICBTAG_FILE_TYPE_REGULAR:
mode |= S_IFREG;
break;
#ifdef S_IFLNK
case ICBTAG_FILE_TYPE_SYMLINK:
mode |= S_IFLNK;
break;
#endif
case ICBTAG_FILE_TYPE_CHAR:
mode |= S_IFCHR;
break;
#ifdef S_IFSOCK
case ICBTAG_FILE_TYPE_SOCKET:
mode |= S_IFSOCK;
break;
#endif
case ICBTAG_FILE_TYPE_BLOCK:
mode |= S_IFBLK;
break;
default: ;
};
#ifdef S_ISUID
if (i_flags & ICBTAG_FLAG_SETUID) mode |= S_ISUID;
if (i_flags & ICBTAG_FLAG_SETGID) mode |= S_ISGID;
if (i_flags & ICBTAG_FLAG_STICKY) mode |= S_ISVTX;
#endif
}
return mode;