From b81753a57c8c454746a1e1b34d37b17bd7f0ab19 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 4 Dec 2023 14:56:26 +0300 Subject: [PATCH 1/2] Allow build type and target directories to be specified by the user. This allows to integrate the building scripts into downstream packaging infrastructure. Specifically, library directory names may differ across various Linux distributions and need to be customizable by the packaging scripts. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 669ac9f6d6..56af9b9826 100644 --- a/Makefile +++ b/Makefile @@ -19,14 +19,14 @@ LINK_LOCAL_DIR=-L. LINK_LIB=-l$(1) CFLAGS_OPT=-O3 CFLAGS_DEBUG=-g -BUILDTYPE=Release +BUILDTYPE?=Release V=Yes -PREFIX=/usr/local +PREFIX?=/usr/local SHARED=-shared OBJ=o DESTDIR= -LIBDIR_NAME=lib -SHAREDLIB_DIR=$(PREFIX)/lib +LIBDIR_NAME?=lib +SHAREDLIB_DIR?=$(PREFIX)/lib PROJECT_NAME=openh264 MODULE_NAME=gmpopenh264 GMP_API_BRANCH=Firefox114_2 From c5707dd4b784919d75dc4971265567d765fbf581 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 4 Dec 2023 14:59:20 +0300 Subject: [PATCH 2/2] Fix pkgconfig generation to use variables instead of hardcoded paths. This fixes libdir in the generated .pc file in case if the custom library directory specified by the user is different frrom the default. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 56af9b9826..59d0898664 100644 --- a/Makefile +++ b/Makefile @@ -298,10 +298,10 @@ endif endif $(PROJECT_NAME).pc: $(PROJECT_NAME).pc.in - @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(PREFIX)/lib;' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;;' -e 's;@LIBS_PRIVATE@;$(STATIC_LDFLAGS);' < $< > $@ + @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(PREFIX)/$(LIBDIR_NAME);' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;;' -e 's;@LIBS_PRIVATE@;$(STATIC_LDFLAGS);' < $< > $@ $(PROJECT_NAME)-static.pc: $(PROJECT_NAME).pc.in - @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(PREFIX)/lib;' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;$(STATIC_LDFLAGS);' -e 's;@LIBS_PRIVATE@;;' < $< > $@ + @sed -e 's;@prefix@;$(PREFIX);' -e 's;@libdir@;$(PREFIX)/$(LIBDIR_NAME);' -e 's;@VERSION@;$(FULL_VERSION);' -e 's;@LIBS@;$(STATIC_LDFLAGS);' -e 's;@LIBS_PRIVATE@;;' < $< > $@ install-headers: mkdir -p $(DESTDIR)$(PREFIX)/include/wels