-
Notifications
You must be signed in to change notification settings - Fork 24
/
pom.xml
188 lines (178 loc) · 7.9 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- This module is responsible for building the final usrsctp native library: that is the one that will
be loaded via System.loadLibrary(...) in the java code. The library is placed in the 'target' output
directory and will be named "libjnisctp.jnilib". Note that when building the jar, it uses the libs in
the prebuilt lib directory (src/main/resources/lib/), so if you want to use the jnilib you just built, you'll
need to copy it into the right place (correct platfomr subdir) in that prebuilt lib directory -->
<parent>
<groupId>org.jitsi</groupId>
<artifactId>jniwrapper</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>jniwrapper-native</artifactId>
<name>usrsctp JNI wrapper (native code)</name>
<profiles>
<profile>
<!-- We only want to depend on the usrsctp source and recompile the native lib if it's been explicitly
requested to be rebuilt, otherwise we can build the jar from the prebuilt libs in
src/main/resources/lib. TODO: we should also do this automatically if 'buildSctp' was passed, but
I believe multiple activation values are interpreted as "AND", so we'd need to define another profile
which would add the same things if buildSctp was defined. -->
<id>rebuild</id>
<activation>
<property>
<name>buildNativeWrapper</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>usrsctp</artifactId>
<version>${project.version}</version>
<!-- This id matches the one we used in javalibs.xml for the usrsctp. It's where we packaged up
the usrsctp libs and includes -->
<classifier>libs</classifier>
<type>zip</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-9</version>
<extensions>true</extensions>
<executions>
<execution>
<id>java-compile</id>
<phase>compile</phase>
<goals>
<goal>javah</goal>
<goal>compile</goal>
<goal>link</goal>
</goals>
</execution>
</executions>
<configuration>
<compilerProvider>generic</compilerProvider>
<compilerStartOptions>
<compilerStartOption>
-g -fPIC -std=c99 -O2 -Wall -Itarget/native/javah
</compilerStartOption>
</compilerStartOptions>
<javahClassNames>
<javahClassName>org.jitsi_modified.sctp4j.SctpJni</javahClassName>
</javahClassNames>
<javahOS>${os}</javahOS>
<sources>
<source>
<directory>src</directory>
<fileNames>
<fileName>org_jitsi_modified_sctp4j_SctpJni.c</fileName>
</fileNames>
</source>
<source>
<directory>
${project.build.directory}/usrsctp-${project.version}/include
</directory>
</source>
</sources>
<linkerStartOptions>
<linkerStartOption>${linkStartOpts}</linkerStartOption>
</linkerStartOptions>
<linkerEndOptions>
<linkerEndOption>${linkEndOpts}</linkerEndOption>
</linkerEndOptions>
<linkerFinalName>libjnisctp-${os}-${os.arch}</linkerFinalName>
<linkerFinalNameExt>${libextension}</linkerFinalNameExt>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>mac</id>
<activation>
<os>
<family>mac</family>
</os>
<property>
<name>buildNativeWrapper</name>
</property>
</activation>
<properties>
<compiler>gcc</compiler>
<os>darwin</os>
<libextension>jnilib</libextension>
<linkStartOpts>
-shared
-L${project.build.directory}/usrsctp-${project.version}/lib
target/usrsctp-1.0-SNAPSHOT/lib/libusrsctp.a
-lpthread
</linkStartOpts>
<linkEndOpts></linkEndOpts>
</properties>
</profile>
<profile>
<id>linux</id>
<activation>
<os>
<family>unix</family>
<name>Linux</name>
</os>
<property>
<name>buildNativeWrapper</name>
</property>
</activation>
<properties>
<compiler>gcc</compiler>
<os>linux</os>
<libextension>so</libextension>
<linkStartOpts>
-L${project.build.directory}/usrsctp-${project.version}/lib
-shared
</linkStartOpts>
<linkEndOpts>
-Wl,-Bstatic
-lusrsctp
-Wl,-Bdynamic
-lpthread
</linkEndOpts>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jniwrapper-java</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- Unpack header files and libraries for build -->
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeTypes>zip</includeTypes>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>