Permalink
Browse files

added scripts to use NewPascal's gcc cross-compilers

to build on Windows our own patched sqlite3.c amalgation file for FPC static linking
  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Jan 25, 2018
1 parent 789c275 commit a5352309f41d8ef70561d819e57732ac0aaf43e3
View
@@ -9,6 +9,6 @@ cd ../fpc-linux64
rm sqlite3-64.o
gcc -c ../SQLite3/sqlite3.c -o sqlite3-64.o -O1 -ldl -lpthread -lc -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_JSON1 -DWIN64 -DNDEBUG -D_WINDOWS -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DTHREADSAFE=1 -DTEMP_STORE=1 -DSQLITE_MAX_EXPR_DEPTH=0
gcc -c ../SQLite3/sqlite3.c -o sqlite3-64.o -O1 -ldl -lpthread -lc -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_FTS3 -DNDEBUG -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DTHREADSAFE=1 -DTEMP_STORE=1
echo "Done !"
View
@@ -1,7 +1,7 @@
@rem Use MINGW64 to compile sqlite3.c amalgation file for FPC compatibility
set mingwvers=5.2.0
set mingw=c:\progs\mingw\x86_64-%mingwvers%-posix-seh-rt_v4-rev0\mingw64
set mingwvers=7.0.0
set mingw=c:\progs\msys64\mingw64
set path=%path%;%mingw%\bin
@@ -22,10 +22,10 @@ del sqlite3-64.o
attrib -r ..\SQLite3\exe\sqlite3-64.dll
del ..\SQLite3\exe\sqlite3-64.dll
gcc -O2 -shared -DSQLITE_MMAP_READWRITE -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_JSON1 -DWIN64 -DNDEBUG -D_WINDOWS -D_USRDLL -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DTHREADSAFE=1 -DTEMP_STORE=1 -m64 -I. ..\SQLite3\amalgamation\sqlite3.c -o ..\SQLite3\exe\sqlite3-64.dll -Wl,--out-implib,libsqlite3-64.a
gcc -O2 -shared -DSQLITE_MMAP_READWRITE -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_JSON1 -DWIN64 -DNDEBUG -D_WINDOWS -D_USRDLL -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_THREADSAFE=1 -DTEMP_STORE=1 -m64 -I. ..\SQLite3\amalgamation\sqlite3.c -o ..\SQLite3\exe\sqlite3-64.dll -Wl,--out-implib,libsqlite3-64.a
@rem here we use -O1 since -O2 triggers unexpected GPF :(
gcc -c -O1 -static -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_JSON1 -DWIN64 -DNDEBUG -D_WINDOWS -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DTHREADSAFE=1 -DTEMP_STORE=1 -DSQLITE_MAX_EXPR_DEPTH=0 -fno-stack-check -fno-stack-protector -mno-stack-arg-probe -m64 -I. ..\SQLite3\sqlite3.c -o sqlite3-64.o
gcc -c -O1 -static -DSQLITE_ENABLE_FTS3 -DWIN64 -DNDEBUG -D_WINDOWS -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DSQLITE_TEMP_STORE=1 -fno-stack-check -fno-stack-protector -mno-stack-arg-probe -m64 -I. ..\SQLite3\sqlite3.c -o sqlite3-64.o
attrib +r sqlite3-64.o
attrib +r ..\SQLite3\exe\sqlite3-64.dll
View
@@ -1,7 +1,8 @@
@rem Use MINGW to compile our version of sqlite3.c amalgation file for FPC compatibility
set mingwvers=5.2.0
set mingw=c:\progs\mingw\i686-%mingwvers%-posix-dwarf-rt_v4-rev0\mingw32
ret set mingw=c:\progs\mingw\i686-%mingwvers%-posix-dwarf-rt_v4-rev0\mingw32
set mingw=c:\progs\msys64\mingw32
set path=%path%;%mingw%\bin
View
@@ -0,0 +1,34 @@
@rem Use NewPascal cross-compiler to compile our own patched sqlite3.c amalgation file
@rem for FPC static linking info fpc-darwin32/sqlite3.o
set np=c:\np
set bin=%np%\cross\bin\x86-darwin
set sdk=%np%\cross\lib\x86-darwin\MacOSX10.11.sdk\usr
set lib=%sdk%\lib
set dlls=%np%\fpcbootstrap\git\mingw32\bin
set gcc=%bin%\i386-apple-darwin15-clang.exe
set path=%path%;%dlls%;%bin%
set inc=-I%bin%\include\clang\4.0.1\include -I%sdk%\include
@rem echo path
@rem need to create the destination folder only once
mkdir ..\fpc-darwin32
@rem need to copy these files only once
copy %lib%\libgcc.a ..\fpc-darwin32
cd ..\fpc-darwin32
attrib -r sqlite3.o
del sqlite3.o
@rem here we use -O1 since -O2 triggers unexpected GPF :(
%gcc% -c -O1 -m32 -target i386-apple-darwin15 -DSQLITE_ENABLE_FTS3 -DNDEBUG -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DSQLITE_TEMP_STORE=1 %inc% -I. ..\SQLite3\sqlite3.c -o sqlite3.o
%bin%\i386-apple-darwin15-libtool.exe -static sqlite3.o -o libsqlite3.a
attrib +r sqlite3.o
pause
View
@@ -0,0 +1,34 @@
@rem Use NewPascal cross-compiler to compile our own patched sqlite3.c amalgation file
@rem for FPC static linking info fpc-darwin64/sqlite3.o
set np=c:\np
set bin=%np%\cross\bin\x86-darwin
set sdk=%np%\cross\lib\x86-darwin\MacOSX10.11.sdk\usr
set lib=%sdk%\lib
set dlls=%np%\fpcbootstrap\git\mingw32\bin
set gcc=%bin%\x86_64-apple-darwin15-clang.exe
set path=%path%;%dlls%;%bin%
set inc=-I%bin%\include\clang\4.0.1\include -I%sdk%\include
@rem echo path
@rem need to create the destination folder only once
mkdir ..\fpc-darwin64
@rem need to copy these files only once
copy %lib%\libgcc.a ..\fpc-darwin64
cd ..\fpc-darwin64
attrib -r sqlite3.o
del sqlite3.o
@rem here we use -O1 since -O2 triggers unexpected GPF :(
%gcc% -c -O1 -m64 -target x86_64-apple-darwin15 -DSQLITE_ENABLE_FTS3 -DNDEBUG -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DSQLITE_TEMP_STORE=1 %inc% -I. ..\SQLite3\sqlite3.c -o sqlite3.o
%bin%\x86_64-apple-darwin15-libtool.exe -static sqlite3.o -o libsqlite3.a
attrib +r sqlite3.o
pause
View
@@ -0,0 +1,31 @@
@rem Use NewPascal cross-compiler to compile our own patched sqlite3.c amalgation file
@rem for FPC static linking info fpc-linux32/sqlite3.o
set np=c:\np
set bin=%np%\cross\bin\i386-linux
set lib=%np%\cross\lib\i386-linux
set dlls=%np%\fpcbootstrap\git\mingw32\bin
set gcc=%bin%\i386-linux-gcc.exe
set path=%path%;%dlls%;%bin%
@rem echo path
@rem need to create the destination folder only once
mkdir ..\fpc-linux32
@rem need to copy these files only once
copy %lib%\libgcc.a ..\fpc-linux32
cd ..\fpc-linux32
attrib -r sqlite3.o
del sqlite3.o
@rem here we use -O1 since -O2 triggers unexpected GPF :(
%gcc% -c -O1 -static -DSQLITE_ENABLE_FTS3 -DNDEBUG -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DSQLITE_TEMP_STORE=1 -I. ..\SQLite3\sqlite3.c -o sqlite3.o
rem -ldl -lpthread -lc
attrib +r sqlite3.o
pause
View
@@ -0,0 +1,31 @@
@rem Use NewPascal cross-compiler to compile our own patched sqlite3.c amalgation file
@rem for FPC static linking info fpc-linux64/sqlite3-64.o
set np=c:\np
set bin=%np%\cross\bin\x86_64-linux
set lib=%np%\cross\lib\x86_64-linux
set dlls=%np%\fpcbootstrap\git\mingw32\bin
set gcc=%bin%\x86_64-linux-gcc.exe
set path=%path%;%dlls%;%bin%
@rem echo path
@rem need to create the destination folder only once
mkdir ..\fpc-linux64
@rem need to copy these files only once
copy %lib%\libgcc.a ..\fpc-linux64
cd ..\fpc-linux64
attrib -r sqlite3-64.o
del sqlite3-64.o
@rem here we use -O1 since -O2 triggers unexpected GPF :(
%gcc% -c -O1 -static -DSQLITE_ENABLE_FTS3 -DNDEBUG -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DSQLITE_TEMP_STORE=1 -m64 -I. ..\SQLite3\sqlite3.c -o sqlite3-64.o
rem -ldl -lpthread -lc
attrib +r sqlite3-64.o
pause
View
@@ -0,0 +1,31 @@
@rem Use NewPascal cross-compiler to compile our own patched sqlite3.c amalgation file
@rem for FPC static linking info fpc-linuxarm/sqlite3.o
set np=c:\np
set bin=%np%\cross\bin\arm-linux
set lib=%np%\cross\lib\arm-linux
set dlls=%np%\fpcbootstrap\git\mingw32\bin
set gcc=%bin%\arm-linux-gnueabihf-gcc.exe
set path=%path%;%dlls%;%bin%
@rem echo path
@rem need to create the destination folder only once
mkdir ..\fpc-linuxarm
@rem need to copy these files only once
copy %lib%\libgcc.a ..\fpc-linuxarm
cd ..\fpc-linuxarm
attrib -r sqlite3.o
del sqlite3.o
@rem here we use -O1 since -O2 triggers unexpected GPF :(
%gcc% -c -O1 -static -DSQLITE_ENABLE_FTS3 -DNDEBUG -DNO_TCL -D_CRT_SECURE_NO_DEPRECATE -DSQLITE_TEMP_STORE=1 -D__ARM_PCS_VFP -v -mfloat-abi=hard -U_HAVE_MINGW_H -U_HAVE__MINGW_H -I%bin%\include -I. ..\SQLite3\sqlite3.c -o sqlite3.o
rem -ldl -lpthread -lc
attrib +r sqlite3.o
pause
View
@@ -5,8 +5,8 @@ attrib -r sqlite3.obj
del sqlite3fts3.obj
del sqlite3.obj
set bcc=\dev\bccXE7
rem set bcc=d:\dev\bcc101
rem set bcc=\dev\bccXE7
set bcc=d:\dev\bcc
%bcc%\bin\bcc32 -6 -O2 -c -d -DSQLITE_ENABLE_FTS3 -u- sqlite3.c
copy sqlite3.obj sqlite3fts3.obj
View
@@ -1 +1 @@
'1.18.4166'
'1.18.4167'

0 comments on commit a535230

Please sign in to comment.