Skip to content

Commit

Permalink
Update Build environment and include Flags for PIE support
Browse files Browse the repository at this point in the history
  • Loading branch information
0-kaladin committed Dec 22, 2014
1 parent 88bbd40 commit 67c7d29
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 28 deletions.
10 changes: 5 additions & 5 deletions AdAway/build.gradle
Expand Up @@ -10,12 +10,12 @@ dependencies {
}

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
minSdkVersion 9
targetSdkVersion 21
}

/*
Expand Down Expand Up @@ -78,4 +78,4 @@ task renameExecutables(type: Copy) {
}


build.dependsOn renameExecutables
build.dependsOn renameExecutables
2 changes: 1 addition & 1 deletion AdAway/jni/Application.mk
Expand Up @@ -2,7 +2,7 @@
APP_OPTIM := release

# Build target
APP_ABI := armeabi x86 mips
APP_ABI := armeabi
#APP_ABI := armeabi armeabi-v7a x86 mips

# If APP_MODULES is not set, all modules are compiled!
Expand Down
4 changes: 3 additions & 1 deletion AdAway/jni/blank_webserver/Android.mk
Expand Up @@ -6,6 +6,8 @@ include $(CLEAR_VARS)

LOCAL_MODULE := mongoose
LOCAL_SRC_FILES := main.c mongoose.c
LOCAL_CFLAGS += -pie -fPIE
LOCAL_LDFLAGS += -pie -fPIE

include $(BUILD_STATIC_LIBRARY)

Expand All @@ -24,4 +26,4 @@ LOCAL_STATIC_LIBRARIES := mongoose

LOCAL_LDLIBS := -llog

include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)
3 changes: 2 additions & 1 deletion AdAway/jni/blank_webserver/mongoose/Makefile
Expand Up @@ -17,6 +17,7 @@
# -DUSE_LUA - embed Lua in Mongoose (+100kb)

PROG = mongoose
LDFLAGS = -pie -fPIE
CFLAGS = -std=c99 -O2 -W -Wall -pedantic -pthread $(COPT)

# To build with Lua, download and unzip Lua 5.2.1 source code into the
Expand Down Expand Up @@ -79,7 +80,7 @@ all:
# "-Wl,--as-needed" turned on by default in cc command.
# Also, this is turned in many other distros in static linkage builds.
linux:
$(CC) mongoose.c main.c -o $(PROG) -ldl $(CFLAGS)
$(CC) $(LDFLAGS) mongoose.c main.c -o $(PROG) -ldl $(CFLAGS)

mac: bsd
bsd:
Expand Down
3 changes: 2 additions & 1 deletion AdAway/jni/libpcap/Android.mk
Expand Up @@ -18,7 +18,8 @@ LOCAL_SRC_FILES:=\
scanner.c\
version.c

LOCAL_CFLAGS:=-O2 -g
LOCAL_CFLAGS:= -O2 -g -pie -fPIE
LOCAL_LDFLAGS += -pie -fPIE
LOCAL_CFLAGS+=-DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -Dlinux -D__GLIBC__ -D_GNU_SOURCE

LOCAL_MODULE:= libpcap
Expand Down
3 changes: 2 additions & 1 deletion AdAway/jni/tcpdump/Android.mk
Expand Up @@ -119,7 +119,8 @@ LOCAL_SRC_FILES:=\
missing/strlcat.c\
missing/strlcpy.c

LOCAL_CFLAGS := -O2 -g
LOCAL_CFLAGS := -O2 -g -pie -fPIE
LOCAL_LDFLAGS += -pie -fPIE
LOCAL_CFLAGS += -DHAVE_CONFIG_H -D_U_="__attribute__((unused))"

LOCAL_C_INCLUDES += \
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -4,7 +4,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:0.12.1'
classpath 'com.android.tools.build:gradle:1.0.0'
}
}

Expand All @@ -15,6 +15,6 @@ allprojects {
}

task wrapper(type: Wrapper) {
gradleVersion = '1.12'
gradleVersion = '2.2.1'
}

2 changes: 1 addition & 1 deletion gradle/gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
8 changes: 4 additions & 4 deletions libraries/Donations/build.gradle
Expand Up @@ -6,12 +6,12 @@ dependencies {
}

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
minSdkVersion 9
targetSdkVersion 21
}

// Do not abort build if lint finds errors
Expand Down
8 changes: 4 additions & 4 deletions libraries/HtmlTextView/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'android-library'

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
minSdkVersion 9
targetSdkVersion 21
}

// Do not abort build if lint finds errors
Expand Down
8 changes: 4 additions & 4 deletions libraries/RootCommands/build.gradle
Expand Up @@ -4,12 +4,12 @@ dependencies {
}

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
minSdkVersion 9
targetSdkVersion 21
}

// Do not abort build if lint finds errors
Expand Down
4 changes: 2 additions & 2 deletions libraries/actionbarsherlock/build.gradle
Expand Up @@ -5,8 +5,8 @@ dependencies {
}

android {
compileSdkVersion 14
buildToolsVersion "19.1.0"
compileSdkVersion 21
buildToolsVersion "21.1.2"

sourceSets {
main {
Expand Down

0 comments on commit 67c7d29

Please sign in to comment.