Browse Source

Fix missing include paths of ltm and tfm

Default include paths of ltm and tfm have changed.
Try to get include paths from pkg-config.

Signed-off-by: Steffen Jaeckel <[email protected]>
Steffen Jaeckel 2 years ago
parent
commit
8076d86366
1 changed files with 8 additions and 2 deletions
  1. 8 2
      makefile_include.mk

+ 8 - 2
makefile_include.mk

@@ -55,10 +55,10 @@ endif
 
 
 ifndef EXTRALIBS
 ifndef EXTRALIBS
 ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),)
 ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),)
-EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs)
+EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config --libs libtommath)
 else
 else
 ifneq ($(shell echo $(CFLAGS) | grep USE_TFM),)
 ifneq ($(shell echo $(CFLAGS) | grep USE_TFM),)
-EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config tomsfastmath --libs)
+EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config --libs tomsfastmath)
 endif
 endif
 endif
 endif
 endif
 endif
@@ -76,6 +76,12 @@ endef
 # by giving them as a parameter to make:
 # by giving them as a parameter to make:
 #  make CFLAGS="-I./src/headers/ -DLTC_SOURCE ..." ...
 #  make CFLAGS="-I./src/headers/ -DLTC_SOURCE ..." ...
 #
 #
+ifneq ($(shell echo $(CFLAGS) | grep LTM_DESC),)
+LTC_CFLAGS+=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config --cflags-only-I libtommath)
+endif
+ifneq ($(shell echo $(CFLAGS) | grep TFM_DESC),)
+LTC_CFLAGS+=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config --cflags-only-I tomsfastmath)
+endif
 LTC_CFLAGS += -I./src/headers/ -DLTC_SOURCE -Wall -Wsign-compare -Wshadow
 LTC_CFLAGS += -I./src/headers/ -DLTC_SOURCE -Wall -Wsign-compare -Wshadow
 
 
 ifdef OLD_GCC
 ifdef OLD_GCC