mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-19 00:56:35 +02:00
Implemented a basic Python scripting engine, optional compilation.
This commit is contained in:
@ -18,4 +18,4 @@ else ifneq ($(MAKECMDGOALS), clean)
|
||||
$(warning WARNING -- Toxic will be compiled without audio support)
|
||||
$(warning WARNING -- You need these libraries for audio support)
|
||||
$(warning WARNING -- $(MISSING_AUDIO_LIBS))
|
||||
endif
|
||||
endif
|
||||
|
@ -40,6 +40,12 @@ ifneq ($(QR_PNG), disabled)
|
||||
-include $(CHECKS_DIR)/qr_png.mk
|
||||
endif
|
||||
|
||||
# Check if we want build Python scripting support
|
||||
PYTHON = $(shell if [ -z "$(DISABLE_PYTHON)" ] || [ "$(DISABLE_PYTHON)" = "0" ] ; then echo enabled ; else echo disabled ; fi)
|
||||
ifneq ($(PYTHON), disabled)
|
||||
-include $(CHECKS_DIR)/python.mk
|
||||
endif
|
||||
|
||||
# Check if we can build Toxic
|
||||
CHECK_LIBS = $(shell $(PKG_CONFIG) --exists $(LIBS) || echo -n "error")
|
||||
ifneq ($(CHECK_LIBS), error)
|
||||
|
20
cfg/checks/python.mk
Normal file
20
cfg/checks/python.mk
Normal file
@ -0,0 +1,20 @@
|
||||
# Variables for Python scripting support
|
||||
PYTHON_LIBS = python3
|
||||
PYTHON_CFLAGS = -DPYTHON
|
||||
PYTHON_OBJ = api.o python_api.o
|
||||
|
||||
# Check if we can build Python scripting support
|
||||
CHECK_PYTHON_LIBS = $(shell $(PKG_CONFIG) --exists $(PYTHON_LIBS) || echo -n "error")
|
||||
ifneq ($(CHECK_PYTHON_LIBS), error)
|
||||
# LIBS += $(PYTHON_LIBS)
|
||||
|
||||
# Unwise hacks... You will pay for this.
|
||||
LDFLAGS += $(shell python3-config --ldflags)
|
||||
CFLAGS += $(PYTHON_CFLAGS) $(shell python3-config --cflags)
|
||||
OBJ += $(PYTHON_OBJ)
|
||||
else ifneq ($(MAKECMDGOALS), clean)
|
||||
MISSING_AUDIO_LIBS = $(shell for lib in $(PYTHON_LIBS) ; do if ! $(PKG_CONFIG) --exists $$lib ; then echo $$lib ; fi ; done)
|
||||
$(warning WARNING -- Toxic will be compiled without Python scripting support)
|
||||
$(warning WARNING -- You need these libraries for Python scripting support)
|
||||
$(warning WARNING -- $(MISSING_AUDIO_LIBS))
|
||||
endif
|
@ -15,6 +15,7 @@ help:
|
||||
@echo " DISABLE_SOUND_NOTIFY: Set to \"1\" to force building without sound notification support"
|
||||
@echo " DISABLE_DESKTOP_NOTIFY: Set to \"1\" to force building without desktop notifications support"
|
||||
@echo " DISABLE_QRPNG: Set to \"1\" to force building without QR exported as PNG support"
|
||||
@echo " DISABLE_PYTHON: Set to \"1\" to force building without Python scripting support"
|
||||
@echo " USER_CFLAGS: Add custom flags to default CFLAGS"
|
||||
@echo " USER_LDFLAGS: Add custom flags to default LDFLAGS"
|
||||
@echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")"
|
||||
|
Reference in New Issue
Block a user