Skip to content

Commit

Permalink
fix build of native library for linux/jdk11
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Jan 17, 2021
1 parent 4b4b44b commit 7cf16f1
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -3,4 +3,4 @@ target/
nbproject/private/
.m2/
webrev
src/main/java/javax/mail/Version\.java
mbox/.ccls-cache/
2 changes: 1 addition & 1 deletion javadoc/pom.xml
Expand Up @@ -132,7 +132,7 @@
<group title="Implementation-specific Packages" packages="com.sun.mail.*"/>

<fileset dir="${project.build.directory}/javadoc-sources/jakarta.mail">
<include name="jakarta/mail/**"/>
<include name="jakarta/mail/**/*.java"/>
</fileset>
<fileset dir="${project.build.directory}/javadoc-sources/jakarta.mail"
includes="
Expand Down
210 changes: 36 additions & 174 deletions mbox/native/pom.xml
@@ -1,177 +1,39 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Copyright (c) 1997, 2020 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.0-RC4</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.end.options>
-L${env.JAVA_HOME}/jre/lib/${linker.arch} -lmail -ljava -lc
</linker.end.options>
</properties>

<profiles>
<profile>
<!--
Override the settings necessary to build with JDK 1.8.
-->
<id>1.8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<m64>
-m64
</m64>
<linker.arch>
amd64
</linker.arch>
</properties>
</profile>
<profile>
<!--
Override the settings necessary to build on Linux.
-->
<id>linux</id>
<activation>
<os>
<family>Linux</family>
</os>
</activation>
<properties>
<m64>
-m64
</m64>
<linker.arch>
${env.MACH}
</linker.arch>
<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${env.JAVA_HOME}/jre/lib/${linker.arch} -ljava -lc
</linker.end.options>
<linker.arch>
amd64
</linker.arch>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-7</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/javah</directory>
<dependencyAnalysisParticipation>
false
</dependencyAnalysisParticipation>
</source>
</sources>
</configuration>
<executions>
<execution>
<id>javah</id>
<phase>generate-sources</phase>
<goals>
<goal>javah</goal>
</goals>
<configuration>
<classNames>
<className>
com.sun.mail.mbox.UNIXFile
</className>
<className>
com.sun.mail.mbox.UNIXInbox
</className>
</classNames>
</configuration>
</execution>
</executions>
</plugin>
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>
</plugins>
</build>

Expand Down
20 changes: 20 additions & 0 deletions mbox/pom.xml
Expand Up @@ -44,6 +44,26 @@
</findbugs.exclude>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>base-compile-7</id>
<configuration>
<skipMain>false</skipMain>
<compilerArgs>
<arg>-h</arg>
<arg>${project.build.directory}/native</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.sun.mail</groupId>
Expand Down

0 comments on commit 7cf16f1

Please sign in to comment.