From 4a913590d91f67eb4f145230d30f33bbffc6c8c9 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 30 Apr 2023 05:47:16 +0300 Subject: [PATCH] [gbinder] Require glib 2.32 --- Makefile | 2 ++ rpm/libgbinder.spec | 5 ++++- src/gbinder_ipc.c | 3 +-- src/gbinder_local_object.c | 4 +--- src/gbinder_proxy_object.c | 4 +--- src/gbinder_remote_object.c | 4 +--- src/gbinder_servicemanager.c | 4 +--- src/gbinder_servicemanager_aidl.c | 4 +--- test/binder-call/Makefile | 2 ++ test/common/Makefile | 2 ++ unit/common/Makefile | 2 ++ 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 9b46ceb..c28abc2 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,8 @@ CC ?= $(CROSS_COMPILE)gcc STRIP ?= strip LD = $(CC) WARNINGS = -Wall -Wstrict-aliasing -Wunused-result +DEFINES += -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 \ + -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED INCLUDES += -I$(INCLUDE_DIR) BASE_FLAGS = -fPIC FULL_CFLAGS = $(BASE_FLAGS) $(CFLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) \ diff --git a/rpm/libgbinder.spec b/rpm/libgbinder.spec index bbc0cd5..41282ed 100644 --- a/rpm/libgbinder.spec +++ b/rpm/libgbinder.spec @@ -7,9 +7,10 @@ License: BSD URL: https://github.com/mer-hybris/libgbinder Source: %{name}-%{version}.tar.bz2 +%define glib_version 2.32 %define libglibutil_version 1.0.52 -BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(glib-2.0) >= %{glib_version} BuildRequires: pkgconfig(libglibutil) >= %{libglibutil_version} BuildRequires: pkgconfig BuildRequires: bison @@ -19,6 +20,7 @@ BuildRequires: flex BuildRequires: pkgconfig(rpm) %define license_support %(pkg-config --exists 'rpm >= 4.11'; echo $?) +Requires: glib2 >= %{glib_version} Requires: libglibutil >= %{libglibutil_version} Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -29,6 +31,7 @@ C interfaces for Android binder %package devel Summary: Development library for %{name} Requires: %{name} = %{version} +Requires: pkgconfig(glib-2.0) >= %{glib_version} %description devel This package contains the development library for %{name}. diff --git a/src/gbinder_ipc.c b/src/gbinder_ipc.c index a2ce667..365dceb 100644 --- a/src/gbinder_ipc.c +++ b/src/gbinder_ipc.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2018-2022 Jolla Ltd. - * Copyright (C) 2018-2022 Slava Monich + * Copyright (C) 2018-2023 Slava Monich * * You may use this file under the terms of BSD license as follows: * @@ -30,7 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#define GLIB_DISABLE_DEPRECATION_WARNINGS #define _GNU_SOURCE /* pthread_*_np */ #include "gbinder_ipc.h" diff --git a/src/gbinder_local_object.c b/src/gbinder_local_object.c index 4be1338..5c17ffc 100644 --- a/src/gbinder_local_object.c +++ b/src/gbinder_local_object.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2018-2022 Jolla Ltd. - * Copyright (C) 2018-2022 Slava Monich + * Copyright (C) 2018-2023 Slava Monich * * You may use this file under the terms of BSD license as follows: * @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#define GLIB_DISABLE_DEPRECATION_WARNINGS - #include "gbinder_driver.h" #include "gbinder_ipc.h" #include "gbinder_buffer_p.h" diff --git a/src/gbinder_proxy_object.c b/src/gbinder_proxy_object.c index eab449e..337cca0 100644 --- a/src/gbinder_proxy_object.c +++ b/src/gbinder_proxy_object.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2021-2022 Jolla Ltd. - * Copyright (C) 2021-2022 Slava Monich + * Copyright (C) 2021-2023 Slava Monich * * You may use this file under the terms of BSD license as follows: * @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#define GLIB_DISABLE_DEPRECATION_WARNINGS - #include "gbinder_proxy_object.h" #include "gbinder_local_object_p.h" #include "gbinder_local_request.h" diff --git a/src/gbinder_remote_object.c b/src/gbinder_remote_object.c index 042cc76..2e04052 100644 --- a/src/gbinder_remote_object.c +++ b/src/gbinder_remote_object.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2018-2022 Jolla Ltd. - * Copyright (C) 2018-2022 Slava Monich + * Copyright (C) 2018-2023 Slava Monich * * You may use this file under the terms of BSD license as follows: * @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#define GLIB_DISABLE_DEPRECATION_WARNINGS - #include "gbinder_driver.h" #include "gbinder_ipc.h" #include "gbinder_remote_object_p.h" diff --git a/src/gbinder_servicemanager.c b/src/gbinder_servicemanager.c index 0acc52b..f463764 100644 --- a/src/gbinder_servicemanager.c +++ b/src/gbinder_servicemanager.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2018-2022 Jolla Ltd. - * Copyright (C) 2018-2022 Slava Monich + * Copyright (C) 2018-2023 Slava Monich * * You may use this file under the terms of BSD license as follows: * @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#define GLIB_DISABLE_DEPRECATION_WARNINGS - #include "gbinder_servicemanager_p.h" #include "gbinder_client_p.h" #include "gbinder_config.h" diff --git a/src/gbinder_servicemanager_aidl.c b/src/gbinder_servicemanager_aidl.c index c5f88f2..e82d18a 100644 --- a/src/gbinder_servicemanager_aidl.c +++ b/src/gbinder_servicemanager_aidl.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2018-2021 Jolla Ltd. - * Copyright (C) 2018-2021 Slava Monich + * Copyright (C) 2018-2023 Slava Monich * * You may use this file under the terms of BSD license as follows: * @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#define GLIB_DISABLE_DEPRECATION_WARNINGS - #include "gbinder_servicemanager_aidl.h" #include "gbinder_servicepoll.h" #include "gbinder_eventloop_p.h" diff --git a/test/binder-call/Makefile b/test/binder-call/Makefile index 26581de..6de915f 100644 --- a/test/binder-call/Makefile +++ b/test/binder-call/Makefile @@ -48,6 +48,8 @@ RELEASE_BUILD_DIR = $(BUILD_DIR)/release CC ?= $(CROSS_COMPILE)gcc LD = $(CC) WARNINGS = -Wall +DEFINES += -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 \ + -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED INCLUDES = -I$(LIB_DIR)/include -I$(GEN_DIR) -I$(SRC_DIR) CFLAGS += -fPIC $(DEFINES) $(WARNINGS) $(INCLUDES) -MMD -MP \ $(shell pkg-config --cflags $(PKGS)) diff --git a/test/common/Makefile b/test/common/Makefile index 8deaeb0..90b8922 100644 --- a/test/common/Makefile +++ b/test/common/Makefile @@ -46,6 +46,8 @@ RELEASE_BUILD_DIR = $(BUILD_DIR)/release CC ?= $(CROSS_COMPILE)gcc LD = $(CC) WARNINGS = -Wall +DEFINES += -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 \ + -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED INCLUDES = -I$(LIB_DIR)/include CFLAGS += -fPIC $(DEFINES) $(WARNINGS) $(INCLUDES) -MMD -MP \ $(shell pkg-config --cflags $(PKGS)) diff --git a/unit/common/Makefile b/unit/common/Makefile index de1dde8..cd473df 100644 --- a/unit/common/Makefile +++ b/unit/common/Makefile @@ -69,6 +69,8 @@ COVERAGE_BUILD_DIR = $(BUILD_DIR)/coverage CC ?= $(CROSS_COMPILE)gcc LD = $(CC) WARNINGS += -Wall -Wno-deprecated-declarations +DEFINES += -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 \ + -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED INCLUDES += -I$(COMMON_DIR) -I$(LIB_DIR)/src -I$(LIB_DIR)/include BASE_FLAGS = -fPIC BASE_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS)