fix build on mac and older ubuntu

pull/41/head
cfig 5 years ago
parent 3111fc1eba
commit af5ddbc934
No known key found for this signature in database
GPG Key ID: B104C307F0FDABB7

@ -8,7 +8,7 @@ This tool focuses on editing Android boot.img(also recovery.img, and vbmeta.img)
## 1. Prerequisite
#### 1.1 Host OS requirement:
Linux or Mac development env. To get the most of the toolkit, following packages are also needed: python, jdk 8+, zlib1g-dev, cpio, device-tree-compiler.
![Linux](doc/linux24.png) or ![Mac](doc/apple24.png) development env. To get the most of the toolkit, following packages are also needed: python, jdk 8+, zlib1g-dev, cpio, device-tree-compiler.
#### 1.2 Target Android requirement:
@ -34,6 +34,10 @@ Clone this repo with minimal depth:
git clone https://github.com/cfig/Android_boot_image_editor.git --depth=1
or clone it from mirror:
git clone https://gitee.com/cfig/Android_boot_image_editor.git --depth=1
Put your boot.img to current directory, then start gradle 'unpack' task:
cp <original_boot_image> boot.img

@ -22,7 +22,11 @@
* SOFTWARE.
*/
#if defined(__APPLE__) && defined(__MACH__)
#include <machine/endian.h>
#else
#include <endian.h>
#endif
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

@ -12,3 +12,7 @@ application {
tasks.withType(LinkExecutable::class.java).configureEach {
linkerArgs.add("-lz")
}
tasks.withType(CppCompile::class.java).configureEach {
compilerArgs.add("-std=c++17")
}

@ -12,3 +12,7 @@ extensions.configure<CppLibrary> {
privateHeaders.from(file("src/main/headers"))
publicHeaders.from(file("src/main/public"))
}
tasks.withType(CppCompile::class.java).configureEach {
compilerArgs.add("-std=c++17")
}

@ -12,3 +12,7 @@ application {
tasks.withType(LinkExecutable::class.java).configureEach {
linkerArgs.add("-lz")
}
tasks.withType(CppCompile::class.java).configureEach {
compilerArgs.add("-std=c++17")
}

@ -15,3 +15,7 @@ tasks.withType(LinkExecutable::class.java).configureEach {
tasks.register<CppCompile>("hello") {
}
tasks.withType(CppCompile::class.java).configureEach {
compilerArgs.add("-std=c++17")
}

@ -12,3 +12,7 @@ application {
tasks.withType(LinkExecutable::class.java).configureEach {
linkerArgs.add("-lz")
}
tasks.withType(CppCompile::class.java).configureEach {
compilerArgs.add("-std=c++17")
}

@ -1,10 +1,10 @@
apply plugin: 'cpp'
apply plugin: 'c'
apply plugin: 'cpp'
apply plugin: 'c'
model {
buildTypes {
release
}
}
components {
mkbootfs(NativeExecutableSpec) {
@ -12,7 +12,7 @@ model {
cppCompiler.define "__ANDROID_VNDK__"
//cppCompiler.define 'CFIG_NO_FIX_STAT'
cppCompiler.args << "-Wno-write-strings"
}
}
}
}
}
}
}

@ -1,10 +1,10 @@
apply plugin: 'cpp'
apply plugin: 'c'
apply plugin: 'cpp'
apply plugin: 'c'
model {
buildTypes {
release
}
}
components {
mkbootfs(NativeExecutableSpec) {
@ -12,8 +12,8 @@ model {
//cppCompiler.define "ANDROID"
//cppCompiler.define "ANDROID", "__ANDROID_VNDK__"
//cppCompiler.define 'CFIG_NO_FIX_STAT'
cppCompiler.args << '-std=c++17' << "-Wno-write-strings"
}
}
}
cppCompiler.args << "-std=c++17" << "-Wno-write-strings"
}
}
}
}

@ -79,7 +79,7 @@ static inline int ftruncate64(int fd, off64_t length) {
#ifndef TEMP_FAILURE_RETRY
/* Used to retry syscalls that can return EINTR. */
#define TEMP_FAILURE_RETRY(exp) ({ \
typeof (exp) _rc; \
decltype (exp) _rc; \
do { \
_rc = (exp); \
} while (_rc == -1 && errno == EINTR); \

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,50 @@
#! /bin/sh
# speed up with mirrors within the biggest LAN
git apply - <<EOF
diff --git a/aosp/boot_signer/build.gradle.kts b/aosp/boot_signer/build.gradle.kts
index 0472c6e..788257d 100644
--- a/aosp/boot_signer/build.gradle.kts
+++ b/aosp/boot_signer/build.gradle.kts
@@ -5,7 +5,8 @@ plugins {
}
repositories {
- jcenter()
+ maven { url = uri("http://maven.aliyun.com/nexus/content/groups/public/") }
+ maven { url = uri("http://maven.aliyun.com/nexus/content/repositories/jcenter") }
}
dependencies {
diff --git a/bbootimg/build.gradle.kts b/bbootimg/build.gradle.kts
index 3362dd7..9906c00 100644
--- a/bbootimg/build.gradle.kts
+++ b/bbootimg/build.gradle.kts
@@ -6,7 +6,8 @@ plugins {
}
repositories {
- jcenter()
+ maven { url = uri("http://maven.aliyun.com/nexus/content/groups/public/") }
+ maven { url = uri("http://maven.aliyun.com/nexus/content/repositories/jcenter") }
}
dependencies {
diff --git a/build.gradle.kts b/build.gradle.kts
index bf076be..973c84a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,7 +14,8 @@ if (parseGradleVersion(gradle.gradleVersion) < 5) {
buildscript {
repositories {
- jcenter()
+ maven { url = uri("http://maven.aliyun.com/nexus/content/groups/public/") }
+ maven { url = uri("http://maven.aliyun.com/nexus/content/repositories/jcenter") }
}
dependencies {
classpath("org.apache.commons:commons-exec:1.3")
EOF
Loading…
Cancel
Save