1
0
mirror of https://github.com/pocoproject/poco.git synced 2025-04-25 17:28:13 +02:00

Build Data/PostgreSQL

This commit is contained in:
zosrothko 2018-05-12 14:19:39 +02:00
parent ea2de435ea
commit e9db9bddb1
3 changed files with 76 additions and 96 deletions

@ -7,41 +7,39 @@ model {
if (buildType == buildTypes.debug) { if (buildType == buildTypes.debug) {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
libName = 'libintl.lib' libName = 'libintl.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
staticLibraryFile = new File("$postgres32Home/lib/$libName") staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
libName = 'libintl.lib' libName = 'libintl.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
staticLibraryFile = new File("$postgres64Home/lib/$libName") staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
libName = 'libintl.lib'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
libName = 'libintl.a' libName = 'libintl.lib'
staticLibraryFile = new File("$postgres32LinuxLib/$libName") headers.srcDir(new File("$postgres64LinuxInc/include"))
staticLibraryFile = new File("$postgres64LinuxLib/$libName")
} }
} else } else
if (buildType == buildTypes.release) { if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
libName = 'libintl.lib' libName = 'libintl.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
staticLibraryFile = new File("$postgres32Home/lib/$libName") staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
libName = 'libintl.lib' libName = 'libintl.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
staticLibraryFile = new File("$postgres64Home/lib/$libName") staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
libName = 'libintl.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
libName = 'libintl.a' libName = 'libintl.lib'
staticLibraryFile = new File("$postgres32LinuxLib/$libName") headers.srcDir(new File("$postgres64LinuxInc/include"))
staticLibraryFile = new File("$postgres64LinuxLib/$libName")
} }
} }
} }
@ -51,57 +49,51 @@ model {
if (buildType == buildTypes.debug) { if (buildType == buildTypes.debug) {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
dllName = 'libintl-8.dll' dllName = 'libintl-8.dll'
linkName = 'libintl.lib' linkName = 'libintl.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
sharedLibraryFile = new File("$postgres32Home/bin/$dllName") sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
dllName = 'libintl-8.dll' dllName = 'libintl-8.dll'
linkName = 'libintl.lib' linkName = 'libintl.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
sharedLibraryFile = new File("$postgres64Home/bin/$dllName") sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
dllName = 'libintl-8.so' dllName = 'libintl-8.so'
linkName = 'libintl.a' linkName = 'libintl.a'
headers.srcDir "$postgres32LinuxInc" headers.srcDir(new File("$postgres64LinuxInc/include"))
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName") sharedLibraryFile = new File("$postgres64LinuxLib/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64LinuxLib/$linkName")
} }
} else } else
if (buildType == buildTypes.release) { if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
dllName = 'libintl-8.dll' dllName = 'libintl-8.dll'
linkName = 'libintl.lib' linkName = 'libintl.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
sharedLibraryFile = new File("$postgres32Home/bin/$dllName") sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
dllName = 'libintl-8.dll' dllName = 'libintl-8.dll'
linkName = 'libintl.lib' linkName = 'libintl.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
sharedLibraryFile = new File("$postgres64Home/bin/$dllName") sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libintl-8.so'
linkName = 'libintl.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
dllName = 'libintl-8.so' dllName = 'libintl-8.so'
linkName = 'libintl.a' linkName = 'libintl.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName") headers.srcDir(new File("$postgres64LinuxInc/include"))
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName") sharedLibraryFile = new File("$postgres64LinuxLib/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64LinuxLib/$linkName")
} }
} }
} }
@ -112,39 +104,39 @@ model {
if (buildType == buildTypes.debug) { if (buildType == buildTypes.debug) {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
libName = 'iconv.lib' libName = 'iconv.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
staticLibraryFile = new File("$postgres32Home/lib/$libName") staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
libName = 'iconv.lib' libName = 'iconv.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
staticLibraryFile = new File("$postgres64Home/lib/$libName") staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
libName = 'iconv.a'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
libName = 'iconv.a' libName = 'iconv.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName") headers.srcDir(new File("$postgres64LinuxInc/include"))
staticLibraryFile = new File("$postgres64LinuxLib/$libName")
} }
} else } else
if (buildType == buildTypes.release) { if (buildType == buildTypes.release) {
libName = 'iconv.lib'
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
headers.srcDir "$postgres32Home/include" libName = 'iconv.lib'
headers.srcDir(new File("$postgres32Home/include"))
staticLibraryFile = new File("$postgres32Home/lib/$libName") staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
headers.srcDir "$postgres64Home/include" libName = 'iconv.lib'
headers.srcDir(new File("$postgres64Home/include"))
staticLibraryFile = new File("$postgres64Home/lib/$libName") staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
libName = 'iconv.a' libName = 'iconv.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName") headers.srcDir(new File("$postgres64LinuxInc/include"))
staticLibraryFile = new File("$postgres64LinuxLib/$libName")
} }
} }
} }
@ -155,54 +147,50 @@ model {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
dllName = 'libiconv-2.dll' dllName = 'libiconv-2.dll'
linkName = 'iconv.lib' linkName = 'iconv.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
sharedLibraryFile = new File("$postgres32Home/bin/$dllName") sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
dllName = 'libiconv-2.dll' dllName = 'libiconv-2.dll'
linkName = 'iconv.lib' linkName = 'iconv.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
sharedLibraryFile = new File("$postgres64Home/bin/$dllName") sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libiconv-2.so'
linkName = 'iconv.a'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
dllName = 'libiconv-2.so' dllName = 'libiconv-2.so'
linkName = 'iconv.a' linkName = 'iconv.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName") headers.srcDir(new File("$postgres64LinuxInc/include"))
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName") sharedLibraryFile = new File("$postgres64LinuxLib/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64LinuxLib/$linkName")
} }
} else } else
if (buildType == buildTypes.release) { if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
dllName = 'libiconv-2.dll' dllName = 'libiconv-2.dll'
linkName = 'iconv.lib' linkName = 'iconv.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
sharedLibraryFile = new File("$postgres32Home/bin/$dllName") sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
dllName = 'libiconv-2.dll' dllName = 'libiconv-2.dll'
linkName = 'iconv.lib' linkName = 'iconv.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
sharedLibraryFile = new File("$postgres64Home/bin/$dllName") sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libiconv-2.so'
linkName = 'iconv.a'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
dllName = 'libiconv-2.so' dllName = 'libiconv-2.so'
linkName = 'iconv.a' linkName = 'iconv.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName") headers.srcDir(new File("$postgres64LinuxInc/include"))
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName") sharedLibraryFile = new File("$postgres64LinuxLib/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64LinuxLib/$linkName")
} }
} }
} }
@ -211,41 +199,41 @@ model {
binaries.withType(StaticLibraryBinary) { binaries.withType(StaticLibraryBinary) {
def libName = "foobar" def libName = "foobar"
if (buildType == buildTypes.debug) { if (buildType == buildTypes.debug) {
libName = 'libpq.lib'
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
headers.srcDir "$postgres32Home/include" libName = 'libpq.lib'
headers.srcDir(new File("$postgres32Home/include"))
staticLibraryFile = new File("$postgres32Home/lib/$libName") staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
headers.srcDir "$postgres64Home/include" libName = 'libpq.lib'
headers.srcDir(new File("$postgres64Home/include"))
staticLibraryFile = new File("$postgres64Home/lib/$libName") staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
libName = 'libpq.a' libName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc" headers.srcDir(new File("$postgres64LinuxInc/include") )
staticLibraryFile = new File("$postgres32LinuxLib/lib/$libName") staticLibraryFile = new File("$postgres32LinuxLib/$libName")
} }
} else } else
if (buildType == buildTypes.release) { if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
libName = 'libpq.lib' libName = 'libpq.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
staticLibraryFile = new File("$postgres32Home/lib/$libName") staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
libName = 'libpq.lib' libName = 'libpq.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
staticLibraryFile = new File("$postgres64Home/lib/$libName") staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
libName = 'libpq.a' libName = 'libpq.a'
staticLibraryFile = new File("$postgres32LinuxLib/lib/$libName") headers.srcDir(new File("$postgres64LinuxInc/include"))
staticLibraryFile = new File("$postgres32LinuxLib/$libName")
} }
} }
} }
@ -256,58 +244,50 @@ model {
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
dllName = 'libpq.dll' dllName = 'libpq.dll'
linkName = 'libpq.lib' linkName = 'libpq.lib'
headers.srcDir "$postgres32Home/include" headers.srcDir(new File("$postgres32Home/include"))
sharedLibraryFile = new File("$postgres32Home/lib/$dllName") sharedLibraryFile = new File("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
dllName = 'libpq.dll' dllName = 'libpq.dll'
linkName = 'libpq.lib' linkName = 'libpq.lib'
headers.srcDir "$postgres64Home/include" headers.srcDir(new File("$postgres64Home/include"))
sharedLibraryFile = new File("$postgres64Home/lib/$dllName") sharedLibraryFile = new File("$postgres64Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libpq.dll'
linkName = 'libpq.lib'
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = new File("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
dllName = 'libpq.so' dllName = 'libpq.so'
linkName = 'libpq.a' linkName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc" headers.srcDir( new File("$postgres64LinuxInc/include") )
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName") sharedLibraryFile = new File("$postgres64LinuxLib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64LinuxLib/$linkName")
} }
} else } else
if (buildType == buildTypes.release) { if (buildType == buildTypes.release) {
dllName = 'libpq.dll'
linkName = 'libpq.lib'
if (targetPlatform.name == 'win32') { if (targetPlatform.name == 'win32') {
headers.srcDir "$postgres32Home/include" dllName = 'libpq.dll'
linkName = 'libpq.lib'
headers.srcDir(new File("$postgres32Home/include"))
sharedLibraryFile = new File("$postgres32Home/lib/$dllName") sharedLibraryFile = new File("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else } else
if (targetPlatform.name == 'win64') { if (targetPlatform.name == 'win64') {
headers.srcDir "$postgres64Home/include" dllName = 'libpq.dll'
linkName = 'libpq.lib'
headers.srcDir(new File("$postgres64Home/include"))
sharedLibraryFile = new File("$postgres64Home/lib/$dllName") sharedLibraryFile = new File("$postgres64Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.macOsX) { if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libpq.so'
linkName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc"
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
} else } else
if (targetPlatform.operatingSystem.linux) { if (targetPlatform.operatingSystem.linux) {
dllName = 'libpq.so' dllName = 'libpq.so'
linkName = 'libpq.a' linkName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc" headers.srcDir(new File("$postgres64LinuxInc/include"))
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName") sharedLibraryFile = new File("$postgres64LinuxLib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName") sharedLibraryLinkFile = new File("$postgres64LinuxLib/$linkName")
} }
} }
} }

@ -60,8 +60,8 @@ mysql32LinuxInc = /usr/local
mysql64LinuxLib = mysql64LinuxLib =
mysql64LinuxInc = /usr/local mysql64LinuxInc = /usr/local
postgres32LinuxLib = postgres32LinuxLib = /usr/lib/x86-linux-gnu/
postgres32LinuxInc = /usr/local postgres32LinuxInc = /usr/local/postgresql/
postgres64LinuxLib = /usr/lib/x86_64-linux-gnu/ postgres64LinuxLib = /usr/lib/x86_64-linux-gnu/
postgres64LinuxInc = /usr/include/postgresql/ postgres64LinuxInc = /usr/include/postgresql/

@ -17,7 +17,7 @@ include ':Data'
include ':Data:ODBC' include ':Data:ODBC'
include ':Data:SQLite' include ':Data:SQLite'
//include ':Data:MySQL' //include ':Data:MySQL'
include ':Data:PosgreSQL' include ':Data:PostgreSQL'
include ':Zip' include ':Zip'
include ':PageCompiler' include ':PageCompiler'
include ':PageCompiler:File2Page' include ':PageCompiler:File2Page'