mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Cc: oss-tools@pengutronix.de
Subject: Re: [OSS-Tools] [PATCH platsch 1/3] convert to meson build
Date: Wed, 12 Jun 2024 10:05:48 +0200	[thread overview]
Message-ID: <20240612080548.mutitblbh2uj2bma@pengutronix.de> (raw)
In-Reply-To: <20240612075353.2551648-1-Qing-wu.Li@leica-geosystems.com.cn>

Hi Qingwu,

thank you for your patch.

On 24-06-12, LI Qingwu wrote:
> Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
> ---
>  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

This is not part of the upstream project.

> -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=<path-to-meson-cross-file>
> +    ninja -C build

       meson setup build
       meson compile -C build

should be enough

> +
> +Build options
> +-------------

Build options are covered by the meson_options.txt. If we list them here
as well, they may/will drift apart.

> +The following build options are available:
> +
> +.. list-table::
> +   :header-rows: 1
> +
> +   * - Option name
> +     - Values
> +     - Default
> +     - Notes
> +   * - HAVE_CAIRO

The option should be not named HAVE_CAIRO also upstream doesn't support
cairo.

Regards,
  Marco

> +     - 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
> 
> 



  parent reply	other threads:[~2024-06-12  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12  7:53 LI Qingwu
2024-06-12  7:53 ` [OSS-Tools] [PATCH platsch 2/3] platsch: split into platsch and libplatsch LI Qingwu
2024-06-12  8:09   ` Marco Felsch
2024-06-12  7:53 ` [OSS-Tools] [PATCH platsch 3/3] Add spinner executable for boot animation and text show LI Qingwu
2024-06-12  8:05 ` Marco Felsch [this message]
2024-06-12  8:19   ` [OSS-Tools] [PATCH platsch 1/3] convert to meson build LI Qingwu
  -- strict thread matches above, loose matches on Subject: below --
2024-06-12  4:06 LI Qingwu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240612080548.mutitblbh2uj2bma@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=Qing-wu.Li@leica-geosystems.com.cn \
    --cc=oss-tools@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox