From 2dfaa2598640473c195ea6181cb81ea124a22b07 Mon Sep 17 00:00:00 2001 From: Sangwon Ha Date: Wed, 22 Jul 2015 17:48:07 +0900 Subject: [PATCH] Match ABI with Mesa3D Change-Id: I83bc7ffa481df75bbf192359dbb212d52ab1532a --- Makefile | 14 ++++++++------ packaging/libgbm.spec | 40 +++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index f5ec405..a7ffe70 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ SRC_DIR = ./src +SO_NAME = libgbm.so.$(major_ver) +BIN_NAME = $(SO_NAME).$(minor_ver) #CROSS_COMPILE ?= arm-none-linux-gnueabi- TARGET_CC ?= $(CROSS_COMPILE)gcc @@ -22,18 +24,18 @@ GBM_SRCS += \ GBM_OBJS := $(GBM_SRCS:.c=.o) -libgbm.so: $(GBM_OBJS) - $(TARGET_CC) -shared -o $@ $(GBM_OBJS) $(CFLAGS) +$(BIN_NAME): $(GBM_OBJS) + $(TARGET_CC) -shared -Wl,-soname,$(SO_NAME) -o $@ $(GBM_OBJS) $(CFLAGS) backend: @for dir in $(GBM_BACKENDS_DIR) ; do \ $(MAKE) -C $$dir ; \ done .DEFAULT_GOAL = all -all: libgbm.so backend +all: $(BIN_NAME) backend clean: - -rm -f $(GBM_OBJS) libgbm.so + -rm -f $(GBM_OBJS) $(BIN_NAME) @for dir in $(GBM_BACKENDS_DIR) ; do \ $(MAKE) $@ -C $$dir ; \ done @@ -46,7 +48,7 @@ install: all cp $(SRC_DIR)/common.h $(includedir)/gbm/ cp $(SRC_DIR)/gbmint.h $(includedir)/gbm/ cp pkgconfig/gbm.pc $(libdir)/pkgconfig/ - cp libgbm.so $(libdir)/ + cp $(BIN_NAME) $(libdir)/ @for dir in $(GBM_BACKENDS_DIR) ; do \ $(MAKE) $@ -C $$dir ; \ done @@ -58,7 +60,7 @@ uninstall: -rm -f $(includedir)/gbm/common.h -rm -f $(includedir)/gbm/gbmint.h -rm -f $(libdir)/pkgconfig/gbm.pc - -rm -f $(libdir)/libgbm.so + -rm -f $(libdir)/$(BIN_NAME) @for dir in $(GBM_BACKENDS_DIR) ; do \ $(MAKE) $@ -C $$dir ; \ done diff --git a/packaging/libgbm.spec b/packaging/libgbm.spec index 7d285cf..edc2727 100644 --- a/packaging/libgbm.spec +++ b/packaging/libgbm.spec @@ -1,18 +1,19 @@ -Summary: Wayland GBM for TIZEN -Name: libgbm -Version: 1.0.0s -Release: 1 -Group: System/Libraries -License: MIT - -Source0: %{name}.tar.gz - -# Requirements -BuildRequires: autoconf -BuildRequires: libtool -BuildRequires: systemd-devel -BuildRequires: pkgconfig(libudev) -BuildRequires: libdrm-devel +%define MAJOR_VER 1 +%define MINOR_VER 0s + +Summary: Wayland GBM for TIZEN +Name: libgbm +Version: %{MAJOR_VER}.%{MINOR_VER} +Release: 1 +Group: System/Libraries +License: MIT +Source: %{name}-%{version}.tar.gz + +BuildRequires: autoconf +BuildRequires: libtool +BuildRequires: systemd-devel +BuildRequires: pkgconfig(libudev) +BuildRequires: libdrm-devel %description Wayland Generic Buffer Management for TIZEN @@ -30,13 +31,16 @@ Development header files for use with Wayland GBM %build make clean -make libdir=%{_libdir} +make libdir=%{_libdir} major_ver=%{MAJOR_VER} minor_ver=%{MINOR_VER} %install mkdir -p %{buildroot}%{_includedir} mkdir -p %{buildroot}%{_libdir}/pkgconfig -%makeinstall +%makeinstall major_ver=%{MAJOR_VER} minor_ver=%{MINOR_VER} + +ln -sf libgbm.so.%{MAJOR_VER}.%{MINOR_VER} %{buildroot}%{_libdir}/libgbm.so.%{MAJOR_VER} +ln -sf libgbm.so.%{MAJOR_VER} %{buildroot}%{_libdir}/libgbm.so %post -p /sbin/ldconfig @@ -46,6 +50,8 @@ mkdir -p %{buildroot}%{_libdir}/pkgconfig %manifest packaging/libgbm.manifest %defattr(-,root,root,-) %{_libdir}/libgbm.so +%{_libdir}/libgbm.so.%{MAJOR_VER} +%{_libdir}/libgbm.so.%{MAJOR_VER}.%{MINOR_VER} %files devel %defattr(-,root,root,-) -- 2.7.4