mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
From: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
To: Philipp Zabel <p.zabel@pengutronix.de>,
	"oss-tools@pengutronix.de" <oss-tools@pengutronix.de>,
	"m.felsch@pengutronix.de" <m.felsch@pengutronix.de>
Cc: GEO-CHHER-bsp-development <bsp-development.geo@leica-geosystems.com>
Subject: Re: [OSS-Tools] [PATCH platsch V5 2/5] convert to meson build
Date: Sun, 23 Jun 2024 11:46:23 +0000	[thread overview]
Message-ID: <AS8PR06MB7432FE04D64574675FDBC617D7CB2@AS8PR06MB7432.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <92f9a4d6aaba2dd867c91e7260016859ca855bfb.camel@pengutronix.de>

Hi Philipp,

> -----Original Message-----
> From: Philipp Zabel <p.zabel@pengutronix.de>
> Sent: Thursday, June 20, 2024 8:19 PM
> To: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>;
> oss-tools@pengutronix.de; m.felsch@pengutronix.de
> Cc: GEO-CHHER-bsp-development
> <bsp-development.geo@leica-geosystems.com>
> Subject: Re: [OSS-Tools] [PATCH platsch V5 2/5] convert to meson build
> 
> [Some people who received this message don't often get email from
> p.zabel@pengutronix.de. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ]
> 
> This email is not from Hexagon's Office 365 instance. Please be careful while
> clicking links, opening attachments, or replying to this email.
> 
> 
> Hi,
> 
> On Mi, 2024-06-19 at 12:22 +0200, LI Qingwu wrote:
> > Convert to meson build and update the README.rst version update to
> > 2024.06.0 cleanup .gitignore
> >
> > Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
> > ---
> >  .gitignore   | 14 --------------
> >  Makefile.am  | 23 -----------------------
> >  README.rst   |  8 ++++++++
> >  configure.ac | 13 -------------
> >  meson.build  | 14 ++++++++++++++
> >  5 files changed, 22 insertions(+), 50 deletions(-)  delete mode
> > 100644 Makefile.am  delete mode 100644 configure.ac  create mode
> > 100644 meson.build
> >
> > diff --git a/.gitignore b/.gitignore
> > index bef7e68..e69de29 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -1,14 +0,0 @@
> > -/*.o
> > -/aclocal.m4
> > -/autom4te.cache
> > -/compile
> > -/config.log
> > -/config.status
> > -/configure
> > -/depcomp
> > -/.deps
> > -/install-sh
> > -/Makefile
> > -/Makefile.in
> > -/missing
> > -/platsch
> > diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index
> > d149ae0..0000000
> > --- a/Makefile.am
> > +++ /dev/null
> > @@ -1,23 +0,0 @@
> > -EXTRA_DIST = README.rst LICENSE
> > -
> > -sbin_PROGRAMS = platsch
> > -
> > -platsch_SOURCES = platsch.c
> > -platsch_CFLAGS = $(LIBDRM_CFLAGS)
> > -platsch_LDADD = $(LIBDRM_LIBS)
> > -
> > -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..f1c0812 100644
> > --- a/README.rst
> > +++ b/README.rst
> > @@ -141,3 +141,11 @@ 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.
> > +
> > +Compiling Instructions
> > +----------------------------
> > +
> > +.. code-block:: shell
> > +
> > +    meson setup build
> > +    meson compile -C build
> > diff --git a/configure.ac b/configure.ac deleted file mode 100644
> > index 18878db..0000000
> > --- a/configure.ac
> > +++ /dev/null
> > @@ -1,13 +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_CONFIG_FILES([Makefile])
> > -
> > -AC_OUTPUT
> > diff --git a/meson.build b/meson.build new file mode 100644 index
> > 0000000..b732a06
> > --- /dev/null
> > +++ b/meson.build
> > @@ -0,0 +1,14 @@
> > +project('platsch', 'c', version: '2024.06.0', license : '0BSD')
> > +
> > +dep_libdrm = dependency('libdrm',
> > +    version: '>= 2.4.112',
> > +    static: true
> > +)
> > +
> > +executable('platsch',
> > +    'platsch.c',
> > +    dependencies: dep_libdrm,
> > +    link_args: '-static',
> 
> Dynamic linking should be kept working in case the build environment does not
> provide static libraries. I think we could gate static linking behind the
> --prefer-static Meson option, like this:
> 
> dep_libdrm = dependency('libdrm', version: '>= 2.4.112')
> 
> platsch_link_args = []
> 
> if get_option('prefer_static')
>   cc = meson.get_compiler('c')
>   if cc.find_library('drm', static: true, required: false).found()
>     platsch_link_args += '-static'
>   endif
> endif
> 
> executable('platsch',
>   'platsch.c',
>   dependencies: dep_libdrm,
>   link_args: platsch_link_args,
>   install: true,
>   install_dir: 'sbin',
> )

During my test, meson build will link static if set prefer_static=true,
I just update the document in v6, user just set prefer_static=true during setup:
meson setup -Dspinner=true -Dprefer_static=true build



> Another option would be to drop static linking for now and only add it in a
> separate patch later.
> 
> > +    install: true,
> > +    install_dir : 'sbin'
> 
> Please pick a formatting style and apply it consistently, e.g. remove the space
> before all colons, or add it everywhere.
> 
> Apart from the static linking issue, this looks good to me now.
> 
> regards
> Philipp



  reply	other threads:[~2024-06-26  8:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 10:22 [OSS-Tools] [PATCH platsch V5 1/5] platsch: constify draw_buffer LI Qingwu
2024-06-19 10:22 ` [OSS-Tools] [PATCH platsch V5 2/5] convert to meson build LI Qingwu
2024-06-20 12:19   ` Philipp Zabel
2024-06-23 11:46     ` LI Qingwu [this message]
2024-06-19 10:22 ` [OSS-Tools] [PATCH platsch V5 3/5] platsch: split into platsch and libplatsch LI Qingwu
2024-06-20 12:55   ` Philipp Zabel
2024-06-19 10:22 ` [OSS-Tools] [PATCH platsch V5 4/5] Platsch: always fork child process LI Qingwu
2024-06-19 10:22 ` [OSS-Tools] [PATCH platsch V5 5/5] Add spinner executable for boot animation and text show LI Qingwu
2024-06-20 12:46   ` Philipp Zabel
2024-06-23 11:52     ` LI Qingwu
2024-06-24  7:55       ` Philipp Zabel

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=AS8PR06MB7432FE04D64574675FDBC617D7CB2@AS8PR06MB7432.eurprd06.prod.outlook.com \
    --to=qing-wu.li@leica-geosystems.com.cn \
    --cc=bsp-development.geo@leica-geosystems.com \
    --cc=m.felsch@pengutronix.de \
    --cc=oss-tools@pengutronix.de \
    --cc=p.zabel@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