Skip to content

Commit

Permalink
Support native in Ubuntu/Debian/Mint
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos authored and lukasj committed May 3, 2021
1 parent 2fe6c37 commit 832654f
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 36 deletions.
1 change: 1 addition & 0 deletions doc/release/CHANGES.txt
Expand Up @@ -39,6 +39,7 @@ E 473 Several modules are not included in build when JDK11 is used
E 493 javamail.providers file missing from provider jars after 1.6.5
E 505 WriteTimeoutSocket::getFileDescriptor$ support for Conscrypt
E 512 Improve code coverage in logging-mailhandler tests
E 539 Support native in Ubuntu/Debian/Mint


CHANGES IN THE 2.0.0 RELEASE
Expand Down
168 changes: 132 additions & 36 deletions mbox/native/pom.xml
@@ -1,39 +1,135 @@
tensions>
<configuration>
<compilerProvider>generic</compilerProvider>
<compilerExecutable>${compiler.name}</compilerExecutable>
<linkerExecutable>${linker.name}</linkerExecutable>
<compilerStartOptions>
<compilerStartOption>
${compiler.start.options}
</compilerStartOption>
</compilerStartOptions>
<linkerStartOptions>
<linkerStartOption>
${linker.start.options}
</linkerStartOption>
</linkerStartOptions>
<linkerEndOptions>
<linkerEndOption>
${linker.end.options}
</linkerEndOption>
</linkerEndOptions>
<sources>
<source>
<directory>../src/main/cpp</directory>
<includes>
<include>**/*.c</include>
</includes>
</source>
<source>
<directory>../target/native</directory>
<dependencyAnalysisParticipation>
false
</dependencyAnalysisParticipation>
</source>
</sources>
</configuration>
</plugin>
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.sun.mail</groupId>
<artifactId>all</artifactId>
<version>2.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.sun.mail</groupId>
<artifactId>libmbox</artifactId>
<packaging>so</packaging>
<name>Jakarta Mail API mbox native library</name>
<description>Jakarta Mail API mbox native library</description>
<url>https://github.com/eclipse-ee4j/jakartamail</url>

<properties>
<m64>
</m64>
<compiler.name>
c89
</compiler.name>
<compiler.start.options>
${m64} -Xa -xO2 -v -D_REENTRANT -KPIC
-I${env.JAVA_HOME}/include -I${env.JAVA_HOME}/include/solaris
</compiler.start.options>
<linker.name>
c89
</linker.name>
<linker.start.options>
-G ${m64} -KPIC -z text
</linker.start.options>
<linker.arch>
${env.MACH}
</linker.arch>
<linker.libs>${env.JAVA_HOME}/jre/lib/${linker.arch}</linker.libs>
<linker.end.options>
-L${linker.libs} -lmail -ljava -lc
</linker.end.options>
</properties>

<profiles>
<profile>
<!--
Override the settings necessary to build on Linux.
On Ubuntu/Debian/Mint it needs the liblockfile-dev package.
-->
<id>linux</id>
<activation>
<os>
<family>Linux</family>
</os>
</activation>
<properties>
<m64>
-m64
</m64>
<compiler.start.options>
-fpic
-I${env.JAVA_HOME}/include -I${env.JAVA_HOME}/include/linux
</compiler.start.options>
<linker.start.options>
${m64} -shared
</linker.start.options>
<linker.end.options>-L${linker.libs} -llockfile -ljava -lc</linker.end.options>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-11</version>
<extensions>true</extensions>
<configuration>
<compilerProvider>generic</compilerProvider>
<compilerExecutable>${compiler.name}</compilerExecutable>
<linkerExecutable>${linker.name}</linkerExecutable>
<compilerStartOptions>
<compilerStartOption>
${compiler.start.options}
</compilerStartOption>
</compilerStartOptions>
<linkerStartOptions>
<linkerStartOption>
${linker.start.options}
</linkerStartOption>
</linkerStartOptions>
<linkerEndOptions>
<linkerEndOption>
${linker.end.options}
</linkerEndOption>
</linkerEndOptions>
<sources>
<source>
<directory>../src/main/cpp</directory>
<includes>
<include>**/*.c</include>
</includes>
</source>
<source>
<directory>../target/native</directory>
<dependencyAnalysisParticipation>
false
</dependencyAnalysisParticipation>
</source>
</sources>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 832654f

Please sign in to comment.