Skip to content

Commit

Permalink
update zlib source
Browse files Browse the repository at this point in the history
update makefiles
update tag
update version
  • Loading branch information
munjeni committed Aug 20, 2022
1 parent ecf469c commit fa1e5c9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ LOCAL_CFLAGS += -Iexpat \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-DHAVE_EXPAT_CONFIG_H \
-UWIN32_LEAN_AND_MEAN
-UWIN32_LEAN_AND_MEAN \
-DXML_POOR_ENTROPY

include $(BUILD_STATIC_LIBRARY)

Expand Down
22 changes: 11 additions & 11 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ifeq ($(OS),Darwin)
CFLAGS+= -I/usr/local/Cellar/libusb/1.0.23/include/libusb-1.0
LIBS+=-lusb-1.0
endif
CROSS_CFLAGS=${CFLAGS} -I include -I zlib-1.2.11 -L zlib-1.2.11 -I expat-2.2.9/lib -L expat-2.2.9/lib/.libs
CROSS_CFLAGS=${CFLAGS} -I include -I zlib-1.2.12 -L zlib-1.2.12 -I expat-2.2.9/lib -L expat-2.2.9/lib/.libs

.PHONY: default
default: newflasher
Expand All @@ -36,9 +36,9 @@ cross: newflasher.exe newflasher.x64 newflasher.i386 newflasher.arm32 newflasher
.PHONY: libs
libs:
@mkdir -p include
@test -d zlib-1.2.11 && echo "" || wget https://zlib.net/zlib-1.2.11.tar.gz
@test -d zlib-1.2.11 && echo "" || tar xzf zlib-1.2.11.tar.gz
@rm -rf zlib-1.2.11.tar.gz
@test -d zlib-1.2.12 && echo "" || wget https://zlib.net/zlib-1.2.12.tar.gz
@test -d zlib-1.2.12 && echo "" || tar xzf zlib-1.2.12.tar.gz
@rm -rf zlib-1.2.12.tar.gz
@test -d expat-2.2.9 && echo "" || wget https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.gz
@test -d expat-2.2.9 && echo "" || tar xzf expat-2.2.9.tar.gz
@rm -rf expat-2.2.9.tar.gz
Expand All @@ -47,7 +47,7 @@ newflasher: newflasher.c version.h
${CC} ${CFLAGS} $< -o $@ -lz -lexpat ${LIBS}

newflasher.exe: libs newflasher.c version.h
@cd zlib-1.2.11 && CC=${CCWIN} ./configure --static && make clean && make
@cd zlib-1.2.12 && CC=${CCWIN} ./configure --static && make clean && make
@cd expat-2.2.9 && CC="${CCWIN} -fPIC" ./configure --enable-static --disable-shared --host=i686-w64-mingw32 && make clean && make
@test -f include/GordonGate.h && echo "" || wget https://github.com/Androxyde/Flashtool/blob/master/drivers/GordonGate/Sony_Mobile_Software_Update_Drivers_x64_Setup.msi?raw=true -O GordonGate
@test -f include/GordonGate.h && echo "" || xxd --include GordonGate > include/GordonGate.h
Expand All @@ -58,25 +58,25 @@ newflasher.exe: libs newflasher.c version.h
${CCWINSTRIP} newflasher.exe

newflasher.x64: libs newflasher.c version.h
@cd zlib-1.2.11 && CC=gcc ./configure --static && make clean && make
@cd zlib-1.2.12 && CC=gcc ./configure --static && make clean && make
@cd expat-2.2.9 && CC="gcc -fPIC" ./configure --enable-static --disable-shared && make clean && make
${CC} ${CROSS_CFLAGS} -static newflasher.c -o newflasher.x64 -lz -lexpat
${STRIP} newflasher.x64

newflasher.i386: libs newflasher.c version.h
@cd zlib-1.2.11 && CC="gcc -m32" ./configure --static && make clean && make
@cd zlib-1.2.12 && CC="gcc -m32" ./configure --static && make clean && make
@cd expat-2.2.9 && CC="gcc -m32 -fPIC" ./configure --enable-static --disable-shared && make clean && make
${CC} ${CROSS_CFLAGS} -m32 -static newflasher.c -o newflasher.i386 -lz -lexpat
${STRIP} newflasher.i386

newflasher.arm32: libs newflasher.c version.h
@cd zlib-1.2.11 && CC=${ARMCC} ./configure --static && make clean && make
@cd zlib-1.2.12 && CC=${ARMCC} ./configure --static && make clean && make
@cd expat-2.2.9 && CC="${ARMCC} -fPIC" ./configure --enable-static --disable-shared --host=arm-linux-gnueabi && make clean && make
${ARMCC} ${CROSS_CFLAGS} -static newflasher.c -o newflasher.arm32 -lz -lexpat
${ARMSTRIP} newflasher.arm32

newflasher.arm64: libs newflasher.c version.h
@cd zlib-1.2.11 && CC=${ARMCC64} ./configure --static && make clean && make
@cd zlib-1.2.12 && CC=${ARMCC64} ./configure --static && make clean && make
@cd expat-2.2.9 && CC="${ARMCC64} -fPIC" ./configure --enable-static --disable-shared --host=aarch64-linux-gnu && make clean && make
${ARMCC64} ${CROSS_CFLAGS} -static newflasher.c -o newflasher.arm64 -lz -lexpat
${ARMSTRIP64} newflasher.arm64
Expand All @@ -100,10 +100,10 @@ install: newflasher newflasher.1.gz

.PHONY: clean
clean:
rm -rf *.gz *.o *.rc *.res obj libs zlib expat zlib-1.2.11 expat-2.2.9 include
rm -rf *.gz *.o *.rc *.res obj libs zlib expat zlib-1.2.12 expat-2.2.9 include

.PHONY: distclean
distclean:
rm -rf *.gz *.o *.rc *.res obj libs zlib expat newflasher.exe newflasher.x64 newflasher.i386
rm -rf newflasher.arm32 newflasher.arm64 newflasher.arm64_pie newflasher
rm -rf zlib-1.2.11 expat-2.2.9 include
rm -rf zlib-1.2.12 expat-2.2.9 include
2 changes: 1 addition & 1 deletion newflasher.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static unsigned int battery_level = 0;
int is_big_endian(void)
{
union {
uint32_t i;
unsigned int i;
char c[4];
} e = { 0x01000000 };

Expand Down
2 changes: 1 addition & 1 deletion newflasher.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# published by the Open Source Initiative.


%define pkg_version 52
%define pkg_version 55
Name: newflasher
Version: %{pkg_version}
Release: 1
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION 54
#define VERSION 55

0 comments on commit fa1e5c9

Please sign in to comment.