diff --git a/.travis.yml b/.travis.yml index 2d5d74f2..cfc61f24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,5 @@ language: c -compiler: - - gcc - - clang - # - tcc - dist: - trusty # - precise @@ -31,9 +26,27 @@ addons: &addons # - tcc # - tcc:i386 -#matrix: -# include: -# - compiler: gcc +matrix: + include: + - os: linux + compiler: gcc + compiler: clang + script: + - if [ -n "$COVERITY_SCAN_TOKEN" ]; then exit 0; fi + - ./autogen.sh $TESTS + - ./configure $TESTS + - make + - if [ -n "$TESTS" ]; then ./udffsck/travis-tests.sh $TESTLEVEL; fi + - os: osx + compiler: clang + script: + - if [ -n "$COVERITY_SCAN_TOKEN" ]; then exit 0; fi + - ./autogen.sh $TESTS + - ./configure $TESTS + - cd libudffs && make + - cd ../udffsck && make + allow_failures: + - os: osx # env: # - secure: "rH+rQS0W+0U3C/W/uRqJ8E5A3KrlbWaDRpZtdT1/SO0kEMnmuG2b0UvoadcIKOEXNHnQeZ3kPQbG2Wjfo/D6up0mXGZLXAvaJZozagxdfF2QPHSpvj2NDRLM71+UaKK/ksq3auPq+o3Y74FZOc4oBr7kPpr01H0pK8/2lljxS2daINRgFfcsaRhKNshtvHBn/KLgbwa5vEB/jadKBKM+mgAYE1sFv8P3yZ3+MzxygpurJ6enU6/9JITF5QgB11ybivYCbqoEf+IhzxgsmELz0zgL+PCVzTvrrNzpCT1UZJ35vWht5Yf7/AmK3sI/rMJm7TYswFKAc7NUbn80oIw6opp7sW1oFqMEHnHNLMNSljg8BwUrbH+y6+yV7sRfG6djCTYUYGYY9ZC2Ef4r3s3ZrRwHuBujZx/DOnFj0nd0AuvETNPkMWD1996bvSQ+WkfZ4JdW335/G61GdQv7kMTutWLKrlDquqxKM1AsoP1d99vCBzpEfRKyZjDUUSmnjdvZ/QgIDidGzH3vYFO81N39HjgKZlxH+oCuoX2ak3A6BrOT7t6mgEXnGM4H9vWhoKb7hseadBsR7YnbFSRmF2FDihEoIJ/BCPykGSZWzxTF94zC3WURI1C3HL0sAHGg3M620FgFj3M4Xkf0CPsmdsjwsnZg6TgVkYwAaKKP0HI2MFs=" # addons: @@ -48,6 +61,10 @@ addons: &addons # branch_pattern: master before_script: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install automake libtool; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade cmake wget; fi - cd .. - mkdir cmocka - cd cmocka diff --git a/README.md b/README.md index f3bed68a..2fa20f77 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -[![Build Status](https://travis-ci.org/argorain/udftools.svg?branch=master)](https://travis-ci.org/argorain/udftools) +[![Build Status](https://travis-ci.org/gmerlino/udftools.svg?branch=master)](https://travis-ci.org/gmerlino/udftools) Linux tools for UDF filesystems and DVD/CD-R(W) drives diff --git a/configure.ac b/configure.ac index 1f479b2f..0d90f85f 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,12 @@ AC_SYS_LARGEFILE dnl Checks for library functions. AC_SUBST(LTLIBOBJS) +dnl Enable Darwin extensions (AC_USE_SYSTEM_EXTENSIONS does not enable +dnl them in 2.63) +AC_CANONICAL_HOST +AS_CASE([$host_os], + [darwin*], [CPPFLAGS="${CPPFLAGS} -D_DARWIN_C_SOURCE"]) + AC_CONFIG_FILES(Makefile libudffs/Makefile mkudffs/Makefile cdrwtool/Makefile pktsetup/Makefile udffsck/Makefile wrudf/Makefile doc/Makefile) AC_ARG_ENABLE(debug, @@ -38,6 +44,7 @@ esac], [debug=false]) AM_CONDITIONAL(DEBUG, test x"$debug" = x"true") +AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin") AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], diff --git a/include/bswap.h b/include/bswap.h index 00627faf..bf6d1718 100644 --- a/include/bswap.h +++ b/include/bswap.h @@ -28,6 +28,9 @@ #include #include +#if defined(HAVE_MACHINE_ENDIAN_H) +#include +#endif #ifdef HAVE_SYS_ISA_DEFS_H #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 @@ -42,6 +45,18 @@ #endif #endif +/* macOS */ +#ifdef __APPLE__ +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#define __BIG_ENDIAN BIG_ENDIAN +#define __BYTE_ORDER BYTE_ORDER +#if __BYTE_ORDER == BIG_ENDIAN +#define __BIG_ENDIAN_BITFIELD +#elif __BYTE_ORDER == LITTLE_ENDIAN +#define __LITTLE_ENDIAN_BITFIELD +#endif +#endif /* __APPLE__ */ + #define constant_swab16(x) \ ((uint16_t)((((uint16_t)(x) & 0x00FFU) << 8) | \ (((uint16_t)(x) & 0xFF00U) >> 8))) diff --git a/libudffs/extent.c b/libudffs/extent.c index dea05a49..8b211aa8 100644 --- a/libudffs/extent.c +++ b/libudffs/extent.c @@ -27,7 +27,9 @@ #include "config.h" -#include +#ifndef __clang__ +# include +#endif #include #include #include diff --git a/udffsck/Makefile.am b/udffsck/Makefile.am index a7bfa6cc..83a8abb4 100644 --- a/udffsck/Makefile.am +++ b/udffsck/Makefile.am @@ -3,6 +3,10 @@ sbin_PROGRAMS = udffsck udffsck_LDADD = $(top_builddir)/libudffs/libudffs.la udffsck_SOURCES = main.c utils.c utils.h udffsck.c udffsck.h options.c options.h log.c log.h ../include/ecma_167.h ../include/osta_udf.h ../mkudffs/mkudffs.h ../mkudffs/defaults.h ../mkudffs/file.h ../libudffs/crc.c ../include/libudffs.h ../include/udf_endian.h +if HAVE_DARWIN +SET_FEATURES = -D_DARWIN_C_SOURCE +endif + AM_CFLAGS = -I$(top_srcdir)/include AM_LDFLAGS = -lm -ldl #-Wl,--no-as-needed diff --git a/udffsck/main.c b/udffsck/main.c index 5f7a6807..446ed264 100644 --- a/udffsck/main.c +++ b/udffsck/main.c @@ -34,10 +34,19 @@ #include #include #include +#ifdef __APPLE__ +//#include +#include +#else #include #include +#endif #include +#ifdef __APPLE__ +#include +#else #include +#endif #include #include diff --git a/udffsck/options.c b/udffsck/options.c index fe2b6019..d1655b5c 100644 --- a/udffsck/options.c +++ b/udffsck/options.c @@ -20,7 +20,9 @@ #include #include -#include +#ifndef __clang__ +# include +#endif #include "libudffs.h" #include "options.h"