Commit 5545515b authored by Ophélie Gagnard's avatar Ophélie Gagnard

installation/metadata-collect-agent/Makefile:

- Add an option to statically link to attempt to link statically against the libraries.
- Add a todo list.
parent 7dad3883
#TODO:
# + clean the code
# - comments
# - useless "if" for lcrypto and lfmt
# + use a more standard way to ask for static building (./configure ?)
# + use a more standard and simple way to change the shebang of parse_link_errors.py (./configure ?)
#INCLUDE_PYTHON=-I$(shell python3 -c "import sysconfig; print(sysconfig.get_path('include'))")
ifneq ($(PYTHON_PATH),) # this is for buildouts
#INCLUDE_PYTHON=-I$(shell python3 -c "import sysconfig; print(sysconfig.get_path('include'))")
......@@ -35,11 +42,18 @@ endif
#LIBRARY_DIRS = $(LIBRARY_FMTLIB) $(LIBRARY_OPENSSL)
#RUNPATHS = $(RUNPATH_FMTLIB) $(RUNPATH_OPENSSL)
INCLUDE_DIRS = $(INCLUDE_PYTHON) $(INCLUDE_FMTLIB) $(INCLUDE_OPENSSL) -I$(ZLIB_PATH)/include
LIBRARY_DIRS = $(LIBRARY_FMTLIB) $(LIBRARY_OPENSSL) -L $(ZLIB_PATH)/lib
RUNPATHS = $(RUNPATH_FMTLIB) $(RUNPATH_OPENSSL) -Wl,-rpath,$(ZLIB_PATH)/lib
LDLIBS += -lz -ldl
INCLUDE_DIRS = $(INCLUDE_PYTHON) $(INCLUDE_FMTLIB) $(INCLUDE_OPENSSL)
LIBRARY_DIRS = $(LIBRARY_FMTLIB) $(LIBRARY_OPENSSL)
RUNPATHS = $(RUNPATH_FMTLIB) $(RUNPATH_OPENSSL)
ifneq ($(LINK_STATIC),)
# next line might be optional
INCLUDE_DIRS += -I$(ZLIB_PATH)/include
LIBRARY_DIRS += -L$(ZLIB_PATH)/lib
RUNPATHS += -Wl,-rpath,$(ZLIB_PATH)/lib
LDLIBS += -lz -ldl
LDFLAGS += -static
endif
# use of LD_LIBRARY_PATH is strongly discouraged
# # see for instance https://www.eyrie.org/~eagle/notes/rpath.html
......@@ -51,7 +65,7 @@ LDLIBS += -lz -ldl
CPPFLAGS = -pthread -Wformat -Werror=format-security
#-Wall -Wextra -Werror -Wno-unused-parameter
#LDFLAGS += -Wl,--unresolved-symbols=ignore-all
LDFLAGS = -static $(LIBRARY_DIRS) $(RUNPATHS)
LDFLAGS += $(LIBRARY_DIRS) $(RUNPATHS)
EXT_SUFFIX := $(shell python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
EXT = $(EXE)$(EXT_SUFFIX)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment