Commit 6528ae4a authored by Ophélie Gagnard's avatar Ophélie Gagnard

TEST: installation/metadata-collect-agent/Makefile: Test some solutions to a...

TEST: installation/metadata-collect-agent/Makefile: Test some solutions to a link-time bug in the buildout compilation.
parent e65a3076
...@@ -9,8 +9,8 @@ INCLUDE_PYTHON=-I$(shell python3 -c "import sysconfig; print(sysconfig.get_path( ...@@ -9,8 +9,8 @@ INCLUDE_PYTHON=-I$(shell python3 -c "import sysconfig; print(sysconfig.get_path(
ifneq ($(FMTLIB_PATH),) ifneq ($(FMTLIB_PATH),)
INCLUDE_FMTLIB = -I$(FMTLIB_PATH)/include INCLUDE_FMTLIB = -I$(FMTLIB_PATH)/include
LIBRARY_FMTLIB = -L$(FMTLIB_PATH)/lib LIBRARY_FMTLIB = -lfmt -L$(FMTLIB_PATH)/lib
RUNPATH_FMTLIB = -Wl,-rpath=$(FMTLIB_PATH)/lib RUNPATH_FMTLIB = -Wl,-rpath,$(FMTLIB_PATH)/lib
endif endif
ifeq ($(LIBRARY_FMTLIB),) ifeq ($(LIBRARY_FMTLIB),)
LIBRARY_FMTLIB = -lfmt LIBRARY_FMTLIB = -lfmt
...@@ -18,8 +18,8 @@ endif ...@@ -18,8 +18,8 @@ endif
ifneq ($(OPENSSL_PATH),) ifneq ($(OPENSSL_PATH),)
INCLUDE_OPENSSL = -I$(OPENSSL_PATH)/include INCLUDE_OPENSSL = -I$(OPENSSL_PATH)/include
LIBRARY_OPENSSL = -L$(OPENSSL_PATH)/lib LIBRARY_OPENSSL = -lcrypto -L$(OPENSSL_PATH)/lib
RUNPATH_OPENSSL = -Wl,-rpath=$(OPENSSL_PATH)/lib RUNPATH_OPENSSL = -Wl,-rpath,$(OPENSSL_PATH)/lib
endif endif
ifeq ($(LIBRARY_OPENSSL),) ifeq ($(LIBRARY_OPENSSL),)
LIBRARY_OPENSSL = -lcrypto LIBRARY_OPENSSL = -lcrypto
...@@ -29,15 +29,15 @@ INCLUDE_DIRS = $(INCLUDE_PYTHON) $(INCLUDE_FMTLIB) $(INCLUDE_OPENSSL) ...@@ -29,15 +29,15 @@ INCLUDE_DIRS = $(INCLUDE_PYTHON) $(INCLUDE_FMTLIB) $(INCLUDE_OPENSSL)
LIBRARY_DIRS = $(LIBRARY_FMTLIB) $(LIBRARY_OPENSSL) LIBRARY_DIRS = $(LIBRARY_FMTLIB) $(LIBRARY_OPENSSL)
RUNPATHS = $(RUNPATH_FMTLIB) $(RUNPATH_OPENSSL) RUNPATHS = $(RUNPATH_FMTLIB) $(RUNPATH_OPENSSL)
# tests # use of LD_LIBRARY_PATH is strongly discouraged
LD_LIBRARY_PATH := $(LIBRARY_FMTLIB) # # see for instance https://www.eyrie.org/~eagle/notes/rpath.html
LD_LIBRARY_PATH := $(LIBRARY_OPENSSLOPENSSL) #LD_LIBRARY_PATH = $(LIBRARY_FMTLIB):$(LIBRARY_OPENSSL)
#EXE = main #EXE = main
#CXX = g++ #CXX = g++
#CPPFLAGS = -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) #CPPFLAGS = -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS)
#LDFLAGS += -Wl,--unresolved-symbols=ignore-all #LDFLAGS += -Wl,--unresolved-symbols=ignore-all
LDLIBS = -lcrypto -lfmt #LDLIBS = -lcrypto -lfmt
EXT_SUFFIX := $(shell python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") EXT_SUFFIX := $(shell python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
EXT = $(EXE)$(EXT_SUFFIX) EXT = $(EXE)$(EXT_SUFFIX)
...@@ -45,10 +45,10 @@ EXT = $(EXE)$(EXT_SUFFIX) ...@@ -45,10 +45,10 @@ EXT = $(EXE)$(EXT_SUFFIX)
all: main.cpp#$(EXE) all: main.cpp#$(EXE)
mkdir -p logs mkdir -p logs
# Error expected here, writing a C program using the error messages # Error expected here, writing a C program using the error messages
-g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) $(LIBRARY_DIRS) $(RUNPATHS) main.cpp -o main 2> logs/link_errors -g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) $(LDLIBS) $(LIBRARY_DIRS) $(RUNPATHS) main.cpp -o main 2> logs/link_errors
./parse_link_errors.py < logs/link_errors ./parse_link_errors.py < logs/link_errors
make fake_python.o make fake_python.o
g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) $(LIBRARY_DIRS) $(RUNPATHS) main.cpp fake_python.o -o metadata-collect-agent g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) $(LDLIBS) $(LIBRARY_DIRS) $(RUNPATHS) main.cpp fake_python.o -o metadata-collect-agent
#-ln -f ../../metadata-collect-agent metadata-collect-agent #-ln -f ../../metadata-collect-agent metadata-collect-agent
#-ln -f metadata-collect-agent ../../dracut.module/90metadata-collect/metadata-collect-agent #-ln -f metadata-collect-agent ../../dracut.module/90metadata-collect/metadata-collect-agent
#-ln -f metadata-collect-agent ../../debian.package.unsafe/unsafe-boot-metadata-collect-agent/sbin/metadata-collect-agent #-ln -f metadata-collect-agent ../../debian.package.unsafe/unsafe-boot-metadata-collect-agent/sbin/metadata-collect-agent
......
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