From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 12 Jun 2024 11:26:48 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sHKFk-004jgc-0A for lore@lore.pengutronix.de; Wed, 12 Jun 2024 11:26:48 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1sHKFh-0004LN-UT; Wed, 12 Jun 2024 11:26:45 +0200 Received: from mail-he1eur04on2057.outbound.protection.outlook.com ([40.107.7.57] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sHFGG-00038Q-Rh for oss-tools@pengutronix.de; Wed, 12 Jun 2024 06:07:02 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PMEA3UlAZbXMjjitExi4qjvEF3oO88pDyE1Bb+UkVo4ZEJFlfTHhbu5ce8HJVBpxhrAXKRbX0wBF/dDMrqIs8wHZPj8d5ClFpmMFYYxaFNmM9dhA3sgrs247zKiKkCU/pBke+Lcpo+U2SSRURLnI0hmuIBK/NPiOr0DyMDJYgv8RWwmLjNbu0g7nTv4/yfV1f4tSrJDUf9S7AXe7y2DFh45fDF3BDDud/TiGV8sOXelsnCe64m/mfHzSu5i5V9fcXVOES+GtSj2PRFzZowyZnTgpFN6ZilWFzEacafkFE/w7eWdYKgYU78Ax8NNeA9+vQ0joD7mia94qP+TKZqACXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qDEbOLTeQdF//zYPR7jI6qCJvWJ+/5j39vsYoD3jfAk=; b=EQO2zr+2ofCNgbBevClI2sFVY6XsCo/1EghR9Db4opWQiop27E1kq42Ata351Li/TFo/HrS3LGY6vmx1nq1rdMx8x8y/qwZd3kSZ54CbFD4FPQ9iOCy/aH5qq4dx4wnkEZaMF5v0xs6BGjjW4Fe+X8FxnXloxu441EOuD9G3wH5PpUTGsJUlap9BTmEDbckrEnHZJhMR9J13QsvJNg7xJNZns8oXcSYwArJqSIlb9jwzoBswwgHAFP0qOCbq6EEQ4ZVnfKq5ezWtw9bPHjQ8A5uoo32wdziVqNJuLZ/TcbWt3iEyb2kSXGUE569ExcxAuqKA3lw4xu+gICx6hiiScw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=pengutronix.de smtp.mailfrom=leica-geosystems.com.cn; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=leica-geosystems.com.cn; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com.cn; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qDEbOLTeQdF//zYPR7jI6qCJvWJ+/5j39vsYoD3jfAk=; b=YIfAXDn9H6TEmtBBnUA6Tfttm91xOtPZW/5C0/zWQzDG7UTShHfAGzpGN7rPACI7zHd304jWkFHBCwarGbf2KCDoAhZeOmHK/14IzVXbqyz7Z9BberxjLhB/rDT+PhNYduyC9PSoejjV+wihDQ6utK1SA5+NCRSyw4mrEDsHhOk= Received: from AM6PR08CA0048.eurprd08.prod.outlook.com (2603:10a6:20b:c0::36) by VE1PR06MB7023.eurprd06.prod.outlook.com (2603:10a6:800:1ac::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Wed, 12 Jun 2024 04:06:57 +0000 Received: from AM2PEPF0001C712.eurprd05.prod.outlook.com (2603:10a6:20b:c0:cafe::79) by AM6PR08CA0048.outlook.office365.com (2603:10a6:20b:c0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Wed, 12 Jun 2024 04:06:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com.cn; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com.cn; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com.cn designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=hexagon.com; pr=C Received: from hexagon.com (193.8.40.94) by AM2PEPF0001C712.mail.protection.outlook.com (10.167.16.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Wed, 12 Jun 2024 04:06:56 +0000 Received: from aherlnxbspsrv01.lgs-net.com ([10.60.34.116]) by hexagon.com with Microsoft SMTPSVC(10.0.17763.1697); Wed, 12 Jun 2024 06:06:56 +0200 From: LI Qingwu To: Qing-wu.Li@leica-geosystems.com.cn, oss-tools@pengutronix.de Date: Wed, 12 Jun 2024 06:06:52 +0200 Message-Id: <20240612040654.2472120-1-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 12 Jun 2024 04:06:56.0307 (UTC) FILETIME=[F7140830:01DABC7D] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C712:EE_|VE1PR06MB7023:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ae7dc12a-53ce-4928-fb64-08dc8a9519b9 X-SET-LOWER-SCL-SCANNER: YES X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230032|376006|1800799016|82310400018|36860700005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?LnuJEp9N9y17EfjySCjYdJoKGpRbd4cwTM4IcZ7zBRTG1zxzP+xROFLUZU50?= =?us-ascii?Q?Nkpsykk61Q+hd75JyHby42YoYbQZYppePpBe45SzAAGqwDNV06S5yW9fFvy7?= =?us-ascii?Q?AFqFYlxNGSnZhXjupxBzE8eO1x4qpewd23DOd4Y6Stfm8puLjNa1mAUOtIR8?= =?us-ascii?Q?HGcrTbQcjGwEjT8r9SL38ErPwnVunLBN27hZXoWCaA4+d2Yyxi8bY+3zBkrU?= =?us-ascii?Q?yjW/l5ZAsCZntM1R8vOmHLsrrec9wct2Uv7bYM1/QICirX4Mvu/5GQinskEX?= =?us-ascii?Q?czBWfpPIg4NXtxsV1gE8uMXp3aKJYNPhvV6xbdsUOKtzBG2n04etkyKZFNwD?= =?us-ascii?Q?pJJTXrZpo4sJNeoXxtlk/3mwdrZn03qUqBKQqIHjIFWyTwGCZC0oIDMOALNE?= =?us-ascii?Q?+hAFQqJODu+PNTT/7Jy8+Q2nS5FhuwLpwCqc81VR/ZULEMK929q/xu8AOPy5?= =?us-ascii?Q?PzOoGwPE83aLSZJUEY5jXtoisKIMdBkXEALwOnsZrU8/sXfriaWq9JAc3yga?= =?us-ascii?Q?HWPtOLxC9lr8ogw0H/3mS3r4NECv/HMBdkK8oZwng9nfvCQeRQFBK1phZ4R7?= =?us-ascii?Q?ggT1ms2KyYsyBfLLtVzzX/AU5FPNA1fOHhm6Jd6L2d4IJfPwpFqnD9nUb0HN?= =?us-ascii?Q?qHmmGePZnVzm1eiw1LXMTM5+lpXtyhaT3wvmkResbTM0y818HGgtBywWERqC?= =?us-ascii?Q?yIoMw+TkwbD/MfP4YuE7AFGlLCneK4pO5GFt3c1M7mPPHKDkLZzAigT6RMEc?= =?us-ascii?Q?DsQV939H1c426fNXmtmG6i0k447sTbEQ0lICgq0YOmAcBO83gL51IEC/lctS?= =?us-ascii?Q?673uWx0RZHqY9cJOR4SsNSnQYaxb6PKkzsyn0rI6QTvK8HnyQ/ZPj85LIHmf?= =?us-ascii?Q?cTvYfNpA4GDDhOf7NOwVVXUtwD1a7BWRriMQSyJ5y4FcjfKrm86fLxMSVTsA?= =?us-ascii?Q?RMfQ2ajvIstc4StReZ+X17RX2PQBHtTFWRtT5NvgiN7Re32MgJfWnnfK2cAq?= =?us-ascii?Q?HCQLSVY2RYMEkbQnAY3V5n0mJu1UUgOFvh7OXK5IISoG6G18XzoaKw9jVwUK?= =?us-ascii?Q?YaaAWOMp1bjj6U/gGWpj9EGPwhtcUhmi3RMj9dwfWSIdy+HRdzQi1++OGP4P?= =?us-ascii?Q?abtVH9ggVOU/Smjy4FqvXFLcrnZY0e+zwzPR1oj+bAW9p9k9/lqdIbDq7DWB?= =?us-ascii?Q?vaTASmCLiMg8UwMOHi2heMZ9TXVeBJIOQVQO1+I1pyaMTj/Rwr/lYTH67Frr?= =?us-ascii?Q?ByzIiaNV8OwJ8qKe3MSDyK9deb1pDxJLbFMEsTkW92Pz8BU++gERISE9RHAu?= =?us-ascii?Q?vas/RVhDg564q8WRjPcBrlrCr0HjeAGljcH4v8kJfpPTpGg0KJf24yPhHFhm?= =?us-ascii?Q?tK8n/GG6hXWxL3CoDvIne6+qEG+elrWuo/KtmqduGZWduM0Mjg=3D=3D?= X-Forefront-Antispam-Report: CIP:193.8.40.94; CTRY:CH; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:hexagon.com; PTR:ahersrvdom50.leica-geosystems.com; CAT:NONE; SFS:(13230032)(376006)(1800799016)(82310400018)(36860700005); DIR:OUT; SFP:1101; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 04:06:56.5834 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae7dc12a-53ce-4928-fb64-08dc8a9519b9 X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a; Ip=[193.8.40.94]; Helo=[hexagon.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C712.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR06MB7023 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 X-Mailman-Approved-At: Wed, 12 Jun 2024 11:26:43 +0200 Subject: [OSS-Tools] [PATCH platsch 1/3] convert to meson build X-BeenThere: oss-tools@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "OSS-Tools" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: oss-tools-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Signed-off-by: LI Qingwu --- Makefile.am | 29 ----------------------------- README.rst | 27 +++++++++++++++++++++++++++ cairo.c | 4 ++-- configure.ac | 32 -------------------------------- meson.build | 26 ++++++++++++++++++++++++++ meson_options.txt | 1 + 6 files changed, 56 insertions(+), 63 deletions(-) delete mode 100644 Makefile.am delete mode 100644 configure.ac create mode 100644 meson.build create mode 100644 meson_options.txt diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index d486994..0000000 --- a/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -EXTRA_DIST = README.rst LICENSE - -sbin_PROGRAMS = platsch - -platsch_SOURCES = platsch.c -platsch_CFLAGS = $(LIBDRM_CFLAGS) -platsch_LDADD = $(LIBDRM_LIBS) - -if ENABLE_CAIRO -platsch_SOURCES += cairo.c -platsch_CFLAGS += $(CAIRO_CFLAGS) -platsch_LDADD += $(CAIRO_LIBS) -endif - -CLEANFILES = \ - $(DIST_ARCHIVES) - -DISTCLEAN = \ - config.log \ - config.status \ - Makefile - -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - configure \ - depcomp \ - install-sh \ - Makefile.in \ - missing diff --git a/README.rst b/README.rst index e318120..2af29e4 100644 --- a/README.rst +++ b/README.rst @@ -141,3 +141,30 @@ By adding a Signed-off-by line (e.g. using ``git commit -s``) saying:: (using your real name and e-mail address), you state that your contributions are in line with the DCO. + +Cross compiling instructions +---------------------------- + +To cross-compile the project, use the following commands: + +.. code-block:: shell + + meson build --cross-file= + ninja -C build + +Build options +------------- + +The following build options are available: + +.. list-table:: + :header-rows: 1 + + * - Option name + - Values + - Default + - Notes + * - HAVE_CAIRO + - true, false + - true + - Enable Cairo support diff --git a/cairo.c b/cairo.c index d29b3a4..8ced3b2 100644 --- a/cairo.c +++ b/cairo.c @@ -79,7 +79,7 @@ static const char *image_format_to_string(cairo_format_t format) return "RGB128F"; #endif case CAIRO_FORMAT_INVALID: - defaul: + default: return "invalid"; } } @@ -90,7 +90,6 @@ static int png_import_backend_import_picture(cairo_t *cr, const char *filename) cairo_format_t image_fmt, surface_fmt; cairo_surface_t *image, *surface; cairo_status_t status; - cairo_format_t format; int ret = 0; image = cairo_image_surface_create_from_png(filename); @@ -253,6 +252,7 @@ static uint32_t convert_to_cairo_format(uint32_t format) case DRM_FORMAT_XRGB8888: return CAIRO_FORMAT_ARGB32; } + return CAIRO_FORMAT_INVALID; } static cairo_t *cairo_init(struct modeset_dev *dev, const char *dir, const char *base) diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 11cdded..0000000 --- a/configure.ac +++ /dev/null @@ -1,32 +0,0 @@ -AC_PREREQ([2.69]) -AC_INIT([platsch], [2019.12.0], [oss-tools@pengutronix.de]) -AC_CONFIG_SRCDIR([platsch.c]) -AM_INIT_AUTOMAKE([foreign dist-xz]) - -AC_PROG_CC -AC_PROG_MAKE_SET - -PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.4.112]) - -AC_ARG_ENABLE([cairo], - [AS_HELP_STRING([--disable-cairo], - [Enable CAIRO support @<:@default=check@:>@])], - [], - [enable_cairo=check]) - -AS_IF([test "$enable_cairo" != "no"], - [PKG_CHECK_MODULES([CAIRO], - [cairo >= 1.0], - [enable_cairo=yes - AC_DEFINE(HAVE_CAIRO)], - [AS_IF([test "$enable_cairo" = "yes"], - [AC_MSG_ERROR([cairo required, but not found.])], - [enable_cairo=no]) - ]) - ]) - -AM_CONDITIONAL([ENABLE_CAIRO], [test "$enable_cairo" = "yes"]) - -AC_CONFIG_FILES([Makefile]) - -AC_OUTPUT diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..e7e8e80 --- /dev/null +++ b/meson.build @@ -0,0 +1,26 @@ +project('platsch', 'c') + +# Define dependencies conditionally based on the HAVE_CAIRO option +platsch_dep = [dependency('libdrm', required: true)] +sources = ['platsch.c'] +args = [] + +have_cairo = get_option('HAVE_CAIRO') + +if have_cairo + platsch_dep += dependency('cairo', required: true) + sources += 'cairo.c' + args += ['-DHAVE_CAIRO'] +endif + +# Define the headers +headers = ['platsch.h'] + +# Create the platsch executable +executable('platsch', + sources, + dependencies: platsch_dep, + c_args: args, + install: true, + include_directories: include_directories('.') +) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..1adfef3 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('HAVE_CAIRO', type: 'boolean', value: true, description: 'Enable Cairo support') -- 2.34.1