Skip to content

Commit

Permalink
Update pom.xml for FreeBSD suppost
Browse files Browse the repository at this point in the history
Update pom.xml for FreeBSD suppost, tested with java 11 and java 17
  • Loading branch information
achix authored and jcflack committed Mar 25, 2024
1 parent c7eea1e commit 459af26
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions pljava-so/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 459af26

Please sign in to comment.