Adding FreeBSD support. (#76)
authorHukadan <hukadan@protonmail.ch>
Sun, 24 Feb 2019 15:16:08 +0000 (16:16 +0100)
committerOlivier Aubert <contact@olivieraubert.net>
Sun, 24 Feb 2019 15:16:08 +0000 (16:16 +0100)
Makefile
generator/templates/header.py

index fd0d26d..9c61362 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
 GENERATE:=python3 generator/generate.py
 DEV_INCLUDE_DIR=../../include/vlc
-INSTALLED_INCLUDE_DIR=/usr/include/vlc
+
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),FreeBSD)
+    INSTALLED_INCLUDE_DIR=/usr/local/include/vlc
+else
+    INSTALLED_INCLUDE_DIR=/usr/include/vlc
+endif
 
 DEV_PATH=generated/dev
 VERSIONED_PATH=generated/3.0
index 397813c..7af23b8 100755 (executable)
@@ -127,6 +127,12 @@ def find_lib():
             dll = ctypes.CDLL(p)
         except OSError:  # may fail
             dll = ctypes.CDLL('libvlc.so.5')
+    elif sys.platform.startswith('freebsd'):
+        p = find_library('vlc')
+        try:
+            dll = ctypes.CDLL(p)
+        except OSError:  # may fail
+            dll = ctypes.CDLL('libvlc.so.5')
     elif sys.platform.startswith('win'):
         libname = 'libvlc.dll'
         p = find_library(libname)