diff options
Diffstat (limited to 'devel/android-tools-fastboot/files')
5 files changed, 38 insertions, 126 deletions
diff --git a/devel/android-tools-fastboot/files/Makefile b/devel/android-tools-fastboot/files/Makefile index abe2d3ceb38a..38bf8e6ecffb 100644 --- a/devel/android-tools-fastboot/files/Makefile +++ b/devel/android-tools-fastboot/files/Makefile @@ -34,25 +34,11 @@ SRCS+= stringprintf.cpp SRCS+= strings.cpp # required by fastboot -.PATH: ${.CURDIR}/../ext4_utils -SRCS+= allocate.c -SRCS+= contents.c -SRCS+= crc16.c -SRCS+= ext4_sb.c -SRCS+= ext4_utils.c -SRCS+= ext4fixup.c -SRCS+= extent.c -SRCS+= indirect.c -SRCS+= make_ext4fs.c -SRCS+= sha1.c -SRCS+= wipe.c - -# required by fastboot .PATH: ${.CURDIR}/../libcutils SRCS+= android_get_control_file.cpp SRCS+= ../libcutils/sockets.cpp -SRCS+= socket_inaddr_any_server_unix.c -SRCS+= socket_network_client_unix.c +SRCS+= socket_inaddr_any_server_unix.cpp +SRCS+= socket_network_client_unix.cpp SRCS+= sockets_unix.cpp CPPFLAGS.sockets.cpp+= -o ${.TARGET} # XXX pre-r279980 @@ -70,19 +56,7 @@ SRCS+= logprint.c SRCS+= stderr_write.c SRCS+= test_utils.cpp -# required by ext4_utils -.PATH: ${.CURDIR}/../libselinux/src -SRCS+= callbacks.c -SRCS+= check_context.c -SRCS+= freecon.c -SRCS+= init.c -SRCS+= label.c -SRCS+= label_android_property.c -SRCS+= label_file.c -SRCS+= label_support.c -CPPFLAGS.label_file.c+= -D_WITH_GETLINE - -# required by fastboot and ext4_utils +# required by fastboot .PATH: ${.CURDIR}/../libsparse SRCS+= backed_block.c SRCS+= output_file.c @@ -109,15 +83,11 @@ CPPFLAGS+= -DFAKE_LOG_DEVICE=1 CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -I${.CURDIR}/../include CPPFLAGS+= -I${.CURDIR}/../adb -CPPFLAGS+= -I${.CURDIR}/../mkbootimg +CPPFLAGS+= -I${.CURDIR}/../mkbootimg/include/bootimg CPPFLAGS+= -I${.CURDIR}/../base/include -CPPFLAGS+= -I${.CURDIR}/../ext4_utils/include -CPPFLAGS+= -I${.CURDIR}/../f2fs_utils -CPPFLAGS+= -I${.CURDIR}/../libselinux/include CPPFLAGS+= -I${.CURDIR}/../libsparse/include CPPFLAGS+= -I${.CURDIR}/../libziparchive/include CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} -CPPFLAGS+= $$(${PKG_CONFIG} libpcre --cflags 2>/dev/null) CPPFLAGS+= $$(${PKG_CONFIG} libusb-1.0 --cflags 2>/dev/null) CXXFLAGS+= -D__STDC_LIMIT_MACROS # DragonFly CXXFLAGS+= -std=gnu++11 @@ -127,10 +97,9 @@ CFLAGS+= ${CPPFLAGS} CXXFLAGS+= ${CPPFLAGS} .endif -LDADD+= $$(${PKG_CONFIG} libpcre --libs 2>/dev/null || echo -lpcre) LDADD+= $$(${PKG_CONFIG} libusb-1.0 --libs 2>/dev/null || echo -lusb) LDADD+= -lz \-lpthread -DPADD+= ${LIBPCRE} ${LIBPTHREAD} ${LIBUSB} ${LIBZ} +DPADD+= ${LIBPTHREAD} ${LIBUSB} ${LIBZ} PKG_CONFIG?= pkg-config diff --git a/devel/android-tools-fastboot/files/patch-base_logging.cpp b/devel/android-tools-fastboot/files/patch-base_logging.cpp index 10b83f259680..634f03f3ad0b 100644 --- a/devel/android-tools-fastboot/files/patch-base_logging.cpp +++ b/devel/android-tools-fastboot/files/patch-base_logging.cpp @@ -28,7 +28,7 @@ +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> -+#else ++#else // OpenBSD, Solaris +#include <stdint.h> #endif @@ -39,11 +39,11 @@ return GetCurrentThreadId(); +#elif defined(__DragonFly__) + return lwp_gettid(); -+#elif defined(__NetBSD__) -+ return _lwp_self(); +#elif defined(__FreeBSD__) + return pthread_getthreadid_np(); -+#else ++#elif defined(__NetBSD__) ++ return _lwp_self(); ++#else // OpenBSD, Solaris + return (intptr_t) pthread_self(); #endif } diff --git a/devel/android-tools-fastboot/files/patch-ext4__utils_ext4__utils.c b/devel/android-tools-fastboot/files/patch-ext4__utils_ext4__utils.c deleted file mode 100644 index 842ee8d8a484..000000000000 --- a/devel/android-tools-fastboot/files/patch-ext4__utils_ext4__utils.c +++ /dev/null @@ -1,56 +0,0 @@ ---- ext4_utils/ext4_utils.c.orig 2012-12-18 23:27:26 UTC -+++ ext4_utils/ext4_utils.c -@@ -36,8 +36,16 @@ - - #if defined(__linux__) - #include <linux/fs.h> --#elif defined(__APPLE__) && defined(__MACH__) -+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \ -+ || (defined(__APPLE__) && defined(__MACH__)) - #include <sys/disk.h> -+#elif defined(__sun) -+#include <sys/dkio.h> -+#elif defined(__Bitrig__) || defined(__NetBSD__) || defined(__OpenBSD__) -+#include <sys/disklabel.h> -+#include <sys/dkio.h> -+#elif defined(__DragonFly__) -+#include <sys/diskslice.h> - #endif - - #include "ext4.h" -@@ -53,6 +61,8 @@ struct sparse_file *ext4_sparse_file; - jmp_buf setjmp_env; - - /* Definition from RFC-4122 */ -+/* XXX <sys/uuid.h> defines slightly different |struct uuid| */ -+#define uuid ext4_uuid - struct uuid { - u32 time_low; - u16 time_mid; -@@ -383,10 +391,24 @@ static u64 get_block_device_size(int fd) - u64 size = 0; - int ret; - --#if defined(__linux__) -+#if defined(BLKGETSIZE64) - ret = ioctl(fd, BLKGETSIZE64, &size); --#elif defined(__APPLE__) && defined(__MACH__) -+#elif defined(DKIOCGETBLOCKCOUNT) - ret = ioctl(fd, DKIOCGETBLOCKCOUNT, &size); -+#elif defined(DIOCGMEDIASIZE) -+ ret = ioctl(fd, DIOCGMEDIASIZE, &size); -+#elif defined(DKIOCGMEDIAINFO) -+ struct dk_minfo minfo; -+ ret = ioctl(fd, DKIOCGMEDIAINFO, &minfo); -+ size = minfo.dki_lbsize * minfo.dki_capacity; -+#elif defined(DIOCGDINFO) -+ struct disklabel dl; -+ ret = ioctl(fd, DIOCGDINFO, &dl); -+ size = dl.d_secsize * dl.d_nsectors * dl.d_ntracks * dl.d_ncylinders; -+#elif defined(DIOCGPART) -+ struct partinfo pi; -+ ret = ioctl(fd, DIOCGPART, &pi); -+ size = pi.media_size; - #else - close(fd); - return 0; diff --git a/devel/android-tools-fastboot/files/patch-libselinux_src_init.c b/devel/android-tools-fastboot/files/patch-libselinux_src_init.c deleted file mode 100644 index 1e7faa69287c..000000000000 --- a/devel/android-tools-fastboot/files/patch-libselinux_src_init.c +++ /dev/null @@ -1,30 +0,0 @@ ---- libselinux/src/init.c.orig 2015-06-15 21:40:06 UTC -+++ libselinux/src/init.c -@@ -7,10 +7,7 @@ - #include <stdio.h> - #include <dlfcn.h> - --#ifdef DARWIN --#include <sys/param.h> --#include <sys/mount.h> --#else -+#if defined(__linux__) - #include <sys/vfs.h> - #endif - -@@ -26,6 +23,7 @@ int selinux_page_size = 0; - - static void init_selinuxmnt(void) - { -+#if defined(__linux__) - char buf[BUFSIZ], *p; - FILE *fp=NULL; - struct statfs sfbuf; -@@ -94,6 +92,7 @@ static void init_selinuxmnt(void) - if (fp) - fclose(fp); - return; -+#endif - } - - void fini_selinuxmnt(void) diff --git a/devel/android-tools-fastboot/files/patch-libziparchive_zip__archive.cc b/devel/android-tools-fastboot/files/patch-libziparchive_zip__archive.cc new file mode 100644 index 000000000000..805366a5ea15 --- /dev/null +++ b/devel/android-tools-fastboot/files/patch-libziparchive_zip__archive.cc @@ -0,0 +1,29 @@ +--- libziparchive/zip_archive.cc.orig 2018-06-21 00:58:42 UTC ++++ libziparchive/zip_archive.cc +@@ -47,6 +47,17 @@ + #include "zip_archive_common.h" + #include "zip_archive_private.h" + ++#if !defined(_WIN32) ++#if __cplusplus >= 201703 || (defined(_LIBCPP_VERSION) && __has_include(<string_view>)) ++#include <string_view> ++#elif __cplusplus >= 201402 ++#include <experimental/string_view> ++namespace std { ++using std::experimental::string_view; ++} ++#endif // __cplusplus >= 201703 ++#endif // !defined(_WIN32) ++ + using android::base::get_unaligned; + + // Used to turn on crc checks - verify that the content CRC matches the values +@@ -100,7 +111,7 @@ static uint32_t RoundUpPower2(uint32_t val) { + } + + static uint32_t ComputeHash(const ZipString& name) { +-#if !defined(_WIN32) ++#if __cplusplus >= 201402 && !defined(_WIN32) + return std::hash<std::string_view>{}( + std::string_view(reinterpret_cast<const char*>(name.name), name.name_length)); + #else |