From 615b2586b568a93d072167136cab66d38ba48ffc Mon Sep 17 00:00:00 2001 From: Achilleas Mantzios Date: Wed, 29 Nov 2023 11:57:28 +0200 Subject: [PATCH] Update pom.xml for FreeBSD suppost Update pom.xml for FreeBSD suppost, tested with java 11 and java 17 --- pljava-so/pom.xml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pljava-so/pom.xml b/pljava-so/pom.xml index dbd52812e..1995c0264 100644 --- a/pljava-so/pom.xml +++ b/pljava-so/pom.xml @@ -120,6 +120,47 @@ } }, + { + name : "FreeBSD", + + object_extension : ".o", + + probe: function(os_name) { + return os_name.toLowerCase().contains("freebsd"); + }, + + compile : function(cc, files, output_dir, includes, defines, flags) { + includes.add(java_include.resolve("freebsd").toString()); + defines.put("FreeBSD", null); + flags.add("-c"); + if(isDebugEnabled) + flags.add("-g"); + var compileProcess = utils.processBuilder(function(l) { + l.add(cc); + l.addAll(pgxs.formatDefines(defines)); + l.addAll(pgxs.formatIncludes(includes)); + l.addAll(flags); + l.addAll(files); + }); + compileProcess.directory(output_dir.toFile()); + return runCommand(compileProcess); + }, + + link : function(cc, flags, files, target_path) { + if(isDebugEnabled) + flags.add("-g"); + flags.add("-shared-libgcc"); + var linkingProcess = utils.processBuilder(function(l) { + l.add(cc); + l.addAll(flags); + l.addAll(of("-shared", "-o", "lib" + library_name + ".so")); + l.addAll(files); + }); + linkingProcess.directory(target_path.toFile()); + return runCommand(linkingProcess); + } + }, + { name : "Mac OS X",