Commit d8dab379 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 b560fb57
ifneq ($(PYTHON_PATH),) # this is for buildouts ifneq ($(PYTHON_PATH),) # this is for buildouts
INCLUDE_PYTHON=-I$(shell $(PYTHON_PATH)/bin/python3 -c "from sysconfig import get_paths; print(get_paths()['include'])") INCLUDE_PYTHON=-I$(shell python3 -c "import sysconfig; print(sysconfig.get_path('include'))")
#INCLUDE_PYTHON=-I$(shell $(PYTHON_PATH)/bin/python3 -c "from sysconfig import get_paths; print(get_paths()['include'])")
endif endif
ifeq ($(INCLUDE_PYTHON),) # default behavior to get python includes path ifeq ($(INCLUDE_PYTHON),) # default behavior to get python includes path
INCLUDE_PYTHON = $(shell pkg-config --cflags python3 | cut -f 1 -d " ") INCLUDE_PYTHON = $(shell pkg-config --cflags python3 | cut -f 1 -d " ")
...@@ -17,7 +18,7 @@ endif ...@@ -17,7 +18,7 @@ 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 = -L$(OPENSSL_PATH)/lib
RUNPATH_FMTLIB = -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
...@@ -27,6 +28,10 @@ INCLUDE_DIRS = $(INCLUDE_PYTHON) $(INCLUDE_FMTLIB) $(INCLUDE_OPENSSL) ...@@ -27,6 +28,10 @@ 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
LD_LIBRARY_PATH := $(LIBRARY_FMTLIB)
LD_LIBRARY_PATH := $(LIBRARY_OPENSSLOPENSSL)
#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)
...@@ -39,10 +44,10 @@ EXT = $(EXE)$(EXT_SUFFIX) ...@@ -39,10 +44,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) main.cpp -o main 2> logs/link_errors -g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) $(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) main.cpp fake_python.o -o metadata-collect-agent g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) $(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