Skip to content

Commit 13e7a01

Browse files
committed
add support for building on FreeBSD
1 parent a500880 commit 13e7a01

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ H3-Java provides bindings to the H3 library, which is written in C. The built ar
5656
| Linux | x64, x86, ARM64, ARMv5, ARMv7, MIPS, MIPSEL, PPC64LE, s390x
5757
| Windows | x64, x86
5858
| Darwin (Mac OSX) | x64
59+
| FreeBSD | x64
5960
| Android | ARM, ARM64
6061

6162
You may be able to build H3-Java locally if you need to use an operating system or architecture not listed above.
@@ -76,6 +77,14 @@ mvn package
7677

7778
Additional information on how the build process works is available in the [build process documentaiton](docs/library-build.md).
7879

80+
## Building on FreeBSD
81+
82+
```sh
83+
# To install build dependencies
84+
sudo pkg install openjdk11 maven33 cmake
85+
# Ensure /usr/local/openjdk11/bin is on your path
86+
```
87+
7988
## Javadocs
8089

8190
To build Javadocs documentation:

src/main/c/h3-java/build-h3.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ case "$(uname -sm)" in
9494
"Linux i786") LIBRARY_DIR=linux-x86 ;;
9595
"Linux i886") LIBRARY_DIR=linux-x86 ;;
9696
"Darwin x86_64") LIBRARY_DIR=darwin-x64 ;;
97+
"FreeBSD amd64") LIBRARY_DIR=freebsd-x64 ;;
9798
# TODO: Detect others
9899
*) LIBRARY_DIR="" ;;
99100
esac

src/main/java/com/uber/h3core/H3CoreLoader.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public static NativeMethods loadSystemNatives() {
146146
public enum OperatingSystem {
147147
ANDROID(".so"),
148148
DARWIN(".dylib"),
149+
FREEBSD(".so"),
149150
WINDOWS(".dll"),
150151
LINUX(".so");
151152

@@ -188,6 +189,8 @@ static final OperatingSystem detectOs(String javaVendor, String osName) {
188189
return OperatingSystem.DARWIN;
189190
} else if (javaOs.contains("win")) {
190191
return OperatingSystem.WINDOWS;
192+
} else if (javaOs.contains("freebsd")) {
193+
return OperatingSystem.FREEBSD;
191194
} else {
192195
// Only other supported platform
193196
return OperatingSystem.LINUX;

0 commit comments

Comments
 (0)