Skip to content

Commit

Permalink
Moved linuxfs native libraries to sub folder/package
Browse files Browse the repository at this point in the history
  • Loading branch information
eitch committed Jul 30, 2021
1 parent ae21f03 commit 9763aa3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions libraries/pi4j-library-linuxfs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
<include>README.md</include>
<include>lib/armhf/libpi4j-linuxfs.so</include> <!-- include the native 32-bit JNI library as a resource -->
<include>lib/aarch64/libpi4j-linuxfs.so</include> <!-- include the native 64-bit JNI library as a resource -->
<include>lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so</include> <!-- include the native 32-bit JNI library as a resource -->
<include>lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so</include> <!-- include the native 64-bit JNI library as a resource -->
</includes>
</resource>
<resource>
Expand Down Expand Up @@ -75,9 +75,9 @@
<requireFilesExist>
<files>
<!-- include 32-bit (ARMHF) Pi4J LinuxFS JNI Library -->
<file>${project.build.outputDirectory}/lib/armhf/libpi4j-linuxfs.so</file>
<file>${project.build.outputDirectory}/lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so</file>
<!-- include 64-bit (AARCH64) Pi4J LinuxFS JNI Library -->
<file>${project.build.outputDirectory}/lib/aarch64/libpi4j-linuxfs.so</file>
<file>${project.build.outputDirectory}/lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so</file>
</files>
</requireFilesExist>
</rules>
Expand Down Expand Up @@ -135,9 +135,9 @@
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath"/>
<!-- attach 32-bit (ARMHF) Pi4J LinuxFS JNI Library -->
<attachartifact file="${project.build.directory}/lib/armhf/libpi4j-linuxfs.so" classifier="armhf" type="so"/>
<attachartifact file="${project.build.directory}/lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so" classifier="armhf" type="so"/>
<!-- attach 64-bit (AARCH64) Pi4J LinuxFS JNI Library -->
<attachartifact file="${project.build.directory}/lib/aarch64/libpi4j-linuxfs.so" classifier="aarch64" type="so"/>
<attachartifact file="${project.build.directory}/lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so" classifier="aarch64" type="so"/>
</target>
</configuration>
</execution>
Expand Down Expand Up @@ -209,7 +209,7 @@
<classifier>armhf</classifier>
<type>so</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/armhf</outputDirectory>
<outputDirectory>${project.build.directory}/lib/armhf/pi4j-linuxfs</outputDirectory>
<destFileName>libpi4j-linuxfs.so</destFileName>
</artifactItem>

Expand All @@ -223,7 +223,7 @@
<type>so</type>
<classifier>aarch64</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/aarch64</outputDirectory>
<outputDirectory>${project.build.directory}/lib/aarch64/pi4j-linuxfs</outputDirectory>
<destFileName>libpi4j-linuxfs.so</destFileName>
</artifactItem>
</artifactItems>
Expand Down Expand Up @@ -316,13 +316,13 @@

<!-- copy compiled 32-bit (ARMHF) Pi4J LinuxFS JNI Library -->
<copy failonerror="true" includeEmptyDirs="false"
file="${project.build.directory}/build/native/lib/armhf/libpi4j-linuxfs.so"
todir="${project.build.directory}/lib/armhf"/>
file="${project.build.directory}/build/native/lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so"
todir="${project.build.directory}/lib/armhf/pi4j-linuxfs"/>

<!-- copy compiled 64-bit (AARCH64) Pi4J LinuxFS JNI Library -->
<copy failonerror="true" includeEmptyDirs="false"
file="${project.build.directory}/build/native/lib/aarch64/libpi4j-linuxfs.so"
todir="${project.build.directory}/lib/aarch64"/>
file="${project.build.directory}/build/native/lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so"
todir="${project.build.directory}/lib/aarch64/pi4j-linuxfs"/>
</target>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ else if (libpath.equalsIgnoreCase("local")) {
}

// include the CPU architecture in the embedded path
String path = "/lib/" + osArch + "/" + fileName;
String path = "/lib/" + osArch + "/" + libName + "/" + fileName;
logger.debug("Attempting to load library [" + fileName + "] using path: [" + path + "]");
try {
loadLibraryFromClasspath(path);
Expand Down
2 changes: 1 addition & 1 deletion libraries/pi4j-library-linuxfs/src/main/native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ INCLUDE = -I. \
-I/usr/local/include -I/usr/local/include/linux

CFLAGS := $(DEBUG) -Wall $(INCLUDE) -Winline -pipe $(CARGS) -fPIC
LIBS = -L lib/$(ARCH) -lrt
LIBS = -L lib/$(ARCH)/pi4j-linuxfs -lrt

TARGET=libpi4j-linuxfs.so

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ echo "BUILDING: ${ARCH}/libpi4j-linuxfs"
echo "====================================="

# perform compile
mkdir -p lib/${ARCH}
mkdir -p lib/${ARCH}/pi4j-linuxfs
make clean all \
--always-make \
CROSS_PREFIX=${CROSS_PREFIX} \
CC=${CC} \
ARCH=${ARCH} \
TARGET=lib/${ARCH}/libpi4j-linuxfs.so $@
TARGET=lib/${ARCH}/pi4j-linuxfs/libpi4j-linuxfs.so $@

echo
echo "-----------------------------------------------------------------------------"
Expand Down

0 comments on commit 9763aa3

Please sign in to comment.