mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	remove bash-specific amalgamation code
This commit is contained in:
		| @@ -3,44 +3,30 @@ | |||||||
| set -e | set -e | ||||||
|  |  | ||||||
| mkdir -p amalgamation | mkdir -p amalgamation | ||||||
| OUTPUT_PREFIX=amalgamation/miniz |  | ||||||
|  |  | ||||||
| cat miniz.h > $OUTPUT_PREFIX.h | OUTPUT_PREFIX=_build/amalgamation | ||||||
| cat miniz.c > $OUTPUT_PREFIX.c |  | ||||||
| cat miniz_common.h >> $OUTPUT_PREFIX.h |  | ||||||
| cat miniz_tdef.c >> $OUTPUT_PREFIX.c |  | ||||||
| cat miniz_tdef.h >> $OUTPUT_PREFIX.h |  | ||||||
| cat miniz_tinfl.c >> $OUTPUT_PREFIX.c |  | ||||||
| cat miniz_tinfl.h >> $OUTPUT_PREFIX.h |  | ||||||
| cat miniz_zip.c >> $OUTPUT_PREFIX.c |  | ||||||
| cat miniz_zip.h >> $OUTPUT_PREFIX.h |  | ||||||
|  |  | ||||||
|  | cmake -H. -B_build -DAMALGAMATE_SOURCES=ON -G"Unix Makefiles" | ||||||
| sed -i '0,/#include "miniz.h"/{s/#include "miniz.h"/#include  "miniz.h"/}' $OUTPUT_PREFIX.c |  | ||||||
| for i in miniz miniz_common miniz_tdef miniz_tinfl miniz_zip |  | ||||||
| do |  | ||||||
| 	sed -i "s/#include \"$i.h\"//g" $OUTPUT_PREFIX.h |  | ||||||
| 	sed -i "s/#include \"$i.h\"//g" $OUTPUT_PREFIX.c |  | ||||||
| done |  | ||||||
|  |  | ||||||
| echo "int main() { return 0; }" > main.c | echo "int main() { return 0; }" > main.c | ||||||
| echo "Test compile with GCC..." | echo "Test compile with GCC..." | ||||||
| gcc -pedantic -Wall main.c $OUTPUT_PREFIX.c -o test.out | gcc -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out | ||||||
| echo "Test compile with GCC ANSI..." | echo "Test compile with GCC ANSI..." | ||||||
| gcc -ansi -pedantic -Wall main.c $OUTPUT_PREFIX.c -o test.out | gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out | ||||||
| if command -v clang | if command -v clang | ||||||
| then | then | ||||||
| 		echo "Test compile with clang..." | 		echo "Test compile with clang..." | ||||||
|         clang -Wall -Wpedantic -fsanitize=unsigned-integer-overflow main.c $OUTPUT_PREFIX.c -o test.out |         clang -Wall -Wpedantic -fsanitize=unsigned-integer-overflow -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out | ||||||
| fi | fi | ||||||
| for def in MINIZ_NO_STDIO MINIZ_NO_TIME MINIZ_NO_ARCHIVE_APIS MINIZ_NO_ARCHIVE_WRITING_APIS MINIZ_NO_ZLIB_APIS MINIZ_NO_ZLIB_COMPATIBLE_NAMES MINIZ_NO_MALLOC | for def in MINIZ_NO_STDIO MINIZ_NO_TIME MINIZ_NO_ARCHIVE_APIS MINIZ_NO_ARCHIVE_WRITING_APIS MINIZ_NO_ZLIB_APIS MINIZ_NO_ZLIB_COMPATIBLE_NAMES MINIZ_NO_MALLOC | ||||||
| do | do | ||||||
| 	echo "Test compile with GCC and define $def..." | 	echo "Test compile with GCC and define $def..." | ||||||
| 	gcc -ansi -pedantic -Wall main.c $OUTPUT_PREFIX.c -o test.out -D${def} | 	gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out -D${def} | ||||||
| done | done | ||||||
| rm test.out | rm test.out | ||||||
| rm main.c | rm main.c | ||||||
|  |  | ||||||
|  | cp $OUTPUT_PREFIX/miniz.* amalgamation/ | ||||||
| cp ChangeLog.md amalgamation/ | cp ChangeLog.md amalgamation/ | ||||||
| cp LICENSE amalgamation/ | cp LICENSE amalgamation/ | ||||||
| cp readme.md amalgamation/ | cp readme.md amalgamation/ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user