]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Chuck Wilson's fixes for Cygwin and MinGW builds.
authorTim Kientzle <kientzle@gmail.com>
Tue, 1 Sep 2009 01:35:56 +0000 (21:35 -0400)
committerTim Kientzle <kientzle@gmail.com>
Tue, 1 Sep 2009 01:35:56 +0000 (21:35 -0400)
SVN-Revision: 1412

CMakeLists.txt
Makefile.am
configure.ac
cpio/cpio_platform.h
tar/tree.c

index af16dd533bdb15bb4111bebb4d8761be1ee3f59f..4576016677083ff24bf75b4c8ba90bcfcd8801da 100644 (file)
@@ -367,6 +367,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE)
 CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR)
 CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP)
 CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR)
+CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S)
 CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR)
 CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK)
 CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM)
index 43e6b968b571a9b230f7c72ca6ecbada9122e928..6c55da8e644c901d7203fa64ddb18c60633faad1 100644 (file)
@@ -456,7 +456,7 @@ tar/test/list.h: Makefile
 
 if BUILD_BSDTAR
 bsdtar_test_programs= bsdtar_test
-bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test
+bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar$(EXEEXT) BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test
 else
 bsdtar_test_programs=
 bsdtar_TESTS_ENVIRONMENT=
@@ -567,7 +567,7 @@ cpio/test/list.h: Makefile
 
 if BUILD_BSDCPIO
 bsdcpio_test_programs= bsdcpio_test
-bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
+bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio$(EXEEXT) BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
 else
 bsdcpio_test_programs=
 bsdcpio_TESTS_ENVIRONMENT=
index 60ae3d2a0b68af79d8787178a193fe4c4de6eb20..6cd2da1e3751246b8d8edf2602519d3eb0840fae 100644 (file)
@@ -342,7 +342,7 @@ AC_CHECK_FUNCS([fstat ftruncate futimes geteuid getpid])
 AC_CHECK_FUNCS([lchflags lchmod lchown link lstat])
 AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod])
 AC_CHECK_FUNCS([nl_langinfo pipe poll readlink select setenv setlocale])
-AC_CHECK_FUNCS([strchr strdup strerror strrchr symlink timegm])
+AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm])
 AC_CHECK_FUNCS([tzset unsetenv utime utimes vfork])
 AC_CHECK_FUNCS([wcrtomb wcscpy wcslen wctomb wmemcmp wmemcpy])
 # detects cygwin-1.7, as opposed to older versions
index 880dc9611e126f4df86b89a51f775b8ac5f5241e..3106fe3c60dce9050c8dcd11cfe4bb5dba36e9ba 100644 (file)
  * and format string here must be compatible with one another and
  * large enough for any file.
  */
-#if HAVE_UINTMAX_T
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define        CPIO_FILESIZE_TYPE      __int64
+#define        CPIO_FILESIZE_PRINTF    "%I64u"
+#elif HAVE_UINTMAX_T
 #define        CPIO_FILESIZE_TYPE      uintmax_t
 #define        CPIO_FILESIZE_PRINTF    "%ju"
-#else
-#if HAVE_UNSIGNED_LONG_LONG
+#elif HAVE_UNSIGNED_LONG_LONG
 #define        CPIO_FILESIZE_TYPE      unsigned long long
 #define        CPIO_FILESIZE_PRINTF    "%llu"
 #else
 #define        CPIO_FILESIZE_TYPE      unsigned long
 #define        CPIO_FILESIZE_PRINTF    "%lu"
 #endif
-#endif
+
 
 /* How to mark functions that don't return. */
 #if defined(__GNUC__) && (__GNUC__ > 2 || \
index 5d7a1be2711d487dfc8d25a304e982602216bc55..3fb1e84738b9db2b11ba8e1c36be05348c310cd8 100644 (file)
@@ -125,7 +125,7 @@ struct tree_entry {
 struct tree {
        struct tree_entry       *stack;
        struct tree_entry       *current;
-#ifdef HAVE_WINDOWS_H
+#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
        HANDLE d;
 #define INVALID_DIR_HANDLE INVALID_HANDLE_VALUE
        WIN32_FIND_DATA _findData;
@@ -261,7 +261,7 @@ tree_append(struct tree *t, const char *name, size_t name_length)
                *p++ = DIRSEP;
                t->path_length ++;
        }
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if HAVE_STRNCPY_S
        strncpy_s(p, t->buff_length - (p - t->buff), name, name_length);
 #else
        strncpy(p, name, name_length);
@@ -639,7 +639,7 @@ tree_current_lstat(struct tree *t)
 int
 tree_current_is_dir(struct tree *t)
 {
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(__CYGWIN__)
        if (t->findData)
                return (t->findData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
        if (tree_current_file_information(t))
@@ -682,7 +682,7 @@ tree_current_is_dir(struct tree *t)
 int
 tree_current_is_physical_dir(struct tree *t)
 {
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(__CYGWIN__)
        if (tree_current_is_physical_link(t))
                return (0);
        return (tree_current_is_dir(t));
@@ -719,7 +719,7 @@ tree_current_is_physical_dir(struct tree *t)
 int
 tree_current_is_physical_link(struct tree *t)
 {
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(__CYGWIN__)
        if (t->findData)
                return ((t->findData->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
                                && (t->findData->dwReserved0 == IO_REPARSE_TAG_SYMLINK));