From patchwork Mon Oct 21 09:36:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1180432 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="N0h9dUKT"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xWkk73mBz9sCJ for ; Mon, 21 Oct 2019 20:37:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9ONgXjm+adtcw+gFhzA2+G9HjJ3VtqwjEnWa1nB32EQ=; b=N0h9dUKTc4xx+A h1KJVUlRuGf9mRI1hupCcx5K3iGKAe4xrkcVHnGh/TxzuHWabEhIGtqEzaIQmH8WoqLUR+t7C70KU vsueuS1+DT0liBpZcNC4qxpSPABXpJM/NbNzE/+WgYVOgK/rTkmuiKd3bkErcW9bw43sQOsPkL7ow RR/+KHfosrvEawCLRJ5PX9PUwh3uTVDdb1+d7MuJ+YAnROi35Rug91kpXHcv0F8LRNV4427yvw7mF J68BIdkmKfiYycwvJppIbE7MaZwGnpdpgnD9Gna23o2E9SszPZVAYZxaw/reRcVoY/yknCuQSYR2y Pm5o8YbuurwziqRcYjpw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMU7c-00067y-1n; Mon, 21 Oct 2019 09:37:04 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMU7O-0005tL-QU for openwrt-devel@lists.openwrt.org; Mon, 21 Oct 2019 09:36:52 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id B62CB35DB; Mon, 21 Oct 2019 11:36:45 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 91b1d8eb; Mon, 21 Oct 2019 11:36:35 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Mon, 21 Oct 2019 11:36:39 +0200 Message-Id: <20191021093642.3118-2-ynezz@true.cz> In-Reply-To: <20191021093642.3118-1-ynezz@true.cz> References: <20191021093642.3118-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191021_023651_015239_099B908C X-CRM114-Status: UNSURE ( 7.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH libnl-tiny 2/5] convert into CMake project X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Aligning it with other C based projects. Signed-off-by: Petr Štetiar --- CMakeLists.txt | 38 ++++++++++++++++++++++++++++++++++++++ Makefile | 17 ----------------- libnl-tiny.pc | 10 ---------- libnl-tiny.pc.in | 10 ++++++++++ 4 files changed, 48 insertions(+), 27 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 Makefile delete mode 100644 libnl-tiny.pc create mode 100644 libnl-tiny.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000000..4924586e893c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,38 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) + +PROJECT(libnl-tiny C) +INCLUDE(GNUInstallDirs) + +INCLUDE_DIRECTORIES(include) + +ADD_DEFINITIONS(-Wall -Werror) + +ADD_LIBRARY(nl-tiny SHARED + attr.c + cache.c + cache_mngt.c + error.c + genl.c + genl_ctrl.c + genl_family.c + genl_mngt.c + handlers.c + msg.c + nl.c + object.c + socket.c + unl.c +) + +CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/libnl-tiny.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/libnl-tiny.pc" + @ONLY +) + +INSTALL(TARGETS nl-tiny LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +INSTALL( + DIRECTORY ${CMAKE_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libnl-tiny + FILES_MATCHING PATTERN "*.h" +) diff --git a/Makefile b/Makefile deleted file mode 100644 index 6f37160a8c35..000000000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -CC=gcc -WFLAGS=-Wall -CFLAGS=-O2 -INCLUDES=-Iinclude - -LIBNAME=libnl-tiny.so - -all: $(LIBNAME) - -%.o: %.c - $(CC) $(WFLAGS) -c -o $@ $(INCLUDES) $(CFLAGS) $< - -LIBNL_OBJ=nl.o handlers.o msg.o attr.o cache.o cache_mngt.o object.o socket.o error.o -GENL_OBJ=genl.o genl_family.o genl_ctrl.o genl_mngt.o unl.o - -$(LIBNAME): $(LIBNL_OBJ) $(GENL_OBJ) - $(CC) $(CFLAGS) -Wl,-Bsymbolic-functions -shared -o $@ $^ diff --git a/libnl-tiny.pc b/libnl-tiny.pc deleted file mode 100644 index af79cd301e23..000000000000 --- a/libnl-tiny.pc +++ /dev/null @@ -1,10 +0,0 @@ -prefix=/usr -exec_prefix=/usr -libdir=${exec_prefix}/lib -includedir=${prefix}/include/libnl-tiny - -Name: libnl-tiny -Description: Convenience library for netlink sockets -Version: 2.0 -Libs: -L${libdir} -lnl-tiny -Cflags: -I${includedir} diff --git a/libnl-tiny.pc.in b/libnl-tiny.pc.in new file mode 100644 index 000000000000..691ba8261b28 --- /dev/null +++ b/libnl-tiny.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/libnl-tiny + +Name: libnl-tiny +Description: Convenience library for netlink sockets +Version: 2.0 +Libs: -L${libdir} -lnl-tiny +Cflags: -I${includedir}