Skip to content

Commit

Permalink
add support to build/use libpbf2geojson on OpenBSD (fixes geometalab#280
Browse files Browse the repository at this point in the history
)
  • Loading branch information
landryb committed Mar 11, 2020
1 parent a31ae86 commit 5b23ac0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ endif
ifeq ($(detected_OS),Linux)
CXXFLAGS += -fPIC
endif
ifeq ($(detected_OS),OpenBSD)
CXX = c++
endif
ifeq ($(detected_OS),Darwin)
CXXFLAGS += -fPIC
CXX = clang++
Expand Down Expand Up @@ -38,3 +41,6 @@ linux:
osx:
$(CXX) -m64 $(CXXFLAGS) -o ./ext-libs/pbf2geojson/pbf2geojson_osx_x86_64.so ./ext-libs/pbf2geojson/pbf2geojson.cpp
$(CXX) -m32 $(CXXFLAGS) -o ./ext-libs/pbf2geojson/pbf2geojson_osx_i686.so ./ext-libs/pbf2geojson/pbf2geojson.cpp

openbsd:
$(CXX) -fPIC -std=c++11 -I/usr/local/include -s -Os -Ofast -O3 --shared -o ./ext-libs/pbf2geojson/pbf2geojson_openbsd_x86_64.so ./ext-libs/pbf2geojson/pbf2geojson.cpp
2 changes: 2 additions & 0 deletions plugin/util/mp_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def _get_lib_path():
lib = "pbf2geojson_windows_{}.dll".format(bitness_string)
elif sys.platform.startswith("darwin"):
lib = "pbf2geojson_osx_{}.so".format(bitness_string)
elif sys.platform.startswith("openbsd"):
lib = "pbf2geojson_openbsd_{}.so".format(bitness_string)
if lib:
temp_dir = get_temp_dir("native")
lib_path = os.path.join(os.path.abspath(get_plugin_directory()), "ext-libs", "pbf2geojson", lib)
Expand Down

0 comments on commit 5b23ac0

Please sign in to comment.