linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, gjasny@googlemail.com
Subject: Re: [v4l-utils PATCH 2/2] Add --with-static-binaries option to link binaries statically
Date: Mon, 19 Sep 2016 11:21:50 -0300	[thread overview]
Message-ID: <20160919112150.4c3eef98@vento.lan> (raw)
In-Reply-To: <1474291350-15655-1-git-send-email-sakari.ailus@linux.intel.com>

Em Mon, 19 Sep 2016 16:22:30 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> escreveu:

> Add a new variable STATIC_LDFLAGS to add the linker flags required for
> static linking for each binary built.
> 
> Static and dynamic libraries are built by default but the binaries are
> otherwise linked dynamically. --with-static-binaries requires that static
> libraries are built.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  configure.ac                      |  5 +++++
>  contrib/gconv/Makefile.am         |  4 ++--
>  contrib/test/Makefile.am          |  8 ++++----
>  lib/libv4l1/Makefile.am           |  2 +-
>  lib/libv4l2/Makefile.am           |  2 +-
>  utils/cec-compliance/Makefile.am  |  2 +-
>  utils/cec-ctl/Makefile.am         |  1 +
>  utils/cec-follower/Makefile.am    |  2 +-
>  utils/cx18-ctl/Makefile.am        |  1 +
>  utils/decode_tm6000/Makefile.am   |  2 +-
>  utils/dvb/Makefile.am             | 10 +++++-----
>  utils/ir-ctl/Makefile.am          |  2 +-
>  utils/ivtv-ctl/Makefile.am        |  2 +-
>  utils/keytable/Makefile.am        |  2 +-
>  utils/media-ctl/Makefile.am       |  1 +
>  utils/qv4l2/Makefile.am           |  6 +++---
>  utils/rds-ctl/Makefile.am         |  2 +-
>  utils/v4l2-compliance/Makefile.am |  1 +
>  utils/v4l2-ctl/Makefile.am        |  1 +
>  utils/v4l2-sysfs-path/Makefile.am |  2 +-
>  20 files changed, 34 insertions(+), 24 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 0d416b0..91597a4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -427,6 +427,11 @@ AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_LIBV4L], [test x${enable_v4l2_compliance_li
>  # append -static to libtool compile and link command to enforce static libs
>  AS_IF([test x$enable_libdvbv5 = xno], [AC_SUBST([ENFORCE_LIBDVBV5_STATIC], ["-static"])])
>  AS_IF([test x$enable_libv4l = xno],   [AC_SUBST([ENFORCE_LIBV4L_STATIC],   ["-static"])])
> +AC_ARG_WITH([static-binaries], AS_HELP_STRING([--with-static-binaries], [link binaries statically, requires static libraries to be built]))
> +AS_IF([test x$with_static_binaries = xyes],
> +      [AS_IF([test x$enable_static = xno],
> +	     [AC_MSG_ERROR([--with-static-binaries requires --enable-static])])]
> +      [AC_SUBST([STATIC_LDFLAGS], ["--static -static"])])
>  
>  # misc
>  
> diff --git a/contrib/gconv/Makefile.am b/contrib/gconv/Makefile.am
> index 0e89f5b..2a39e5e 100644
> --- a/contrib/gconv/Makefile.am
> +++ b/contrib/gconv/Makefile.am
> @@ -9,9 +9,9 @@ gconv_base_sources = iconv/skeleton.c iconv/loop.c
>  arib-std-b24.c, en300-468-tab00.c: $(gconv_base_sources)
>  
>  ARIB_STD_B24_la_SOURCES = arib-std-b24.c jis0201.h jis0208.h jisx0213.h
> -ARIB_STD_B24_la_LDFLAGS = $(gconv_ldflags) -L@gconvsysdir@ -R @gconvsysdir@ -lJIS -lJISX0213
> +ARIB_STD_B24_la_LDFLAGS = $(gconv_ldflags) -L@gconvsysdir@ -R @gconvsysdir@ -lJIS -lJISX0213 $(STATIC_LDFLAGS)

Instead of adding STATIC_LDFLAGS to all LDFLAGS, wouldn't be better to
add the flags to LDFLAGS on configure.ac?

Regards,
Mauro

  reply	other threads:[~2016-09-19 14:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 10:50 [v4l-utils PATCH 1/1] Fix static linking of v4l2-compliance and v4l2-ctl Sakari Ailus
2016-09-19 11:22 ` Mauro Carvalho Chehab
2016-09-19 13:21   ` Sakari Ailus
2016-09-19 14:19     ` Mauro Carvalho Chehab
2016-09-26 15:46       ` Sakari Ailus
2016-09-26 16:59         ` Mauro Carvalho Chehab
2016-09-26 21:40           ` Sakari Ailus
2016-09-27 16:04             ` Mauro Carvalho Chehab
2016-09-27 17:35               ` Mauro Carvalho Chehab
2016-09-19 13:22 ` [v4l-utils PATCH 2/2] Add --with-static-binaries option to link binaries statically Sakari Ailus
2016-09-19 14:21   ` Mauro Carvalho Chehab [this message]
2016-09-19 14:34     ` Sakari Ailus
2016-09-26 17:41     ` Gregor Jasny
2016-09-26 18:02       ` Mauro Carvalho Chehab
2018-02-22  9:02         ` Sakari Ailus

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=20160919112150.4c3eef98@vento.lan \
    --to=mchehab@s-opensource.com \
    --cc=gjasny@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).