public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [v4l-utils PATCH 1/1] Allow building static binaries
@ 2015-12-08 15:18 Sakari Ailus
  2015-12-10 13:21 ` Sakari Ailus
  0 siblings, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2015-12-08 15:18 UTC (permalink / raw)
  To: linux-media; +Cc: laurent.pinchart, hverkuil

	$ LDFLAGS="--static -static" ./configure --enable-static
	$ LDFLAGS=-static make

can be used to create static binaries. The issue was that shared libraries
were attempted to link statically which naturally failed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 lib/libv4l1/Makefile.am | 3 +--
 lib/libv4l2/Makefile.am | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/libv4l1/Makefile.am b/lib/libv4l1/Makefile.am
index 005ae10..c325390 100644
--- a/lib/libv4l1/Makefile.am
+++ b/lib/libv4l1/Makefile.am
@@ -23,7 +23,6 @@ libv4l1_la_LIBADD = ../libv4l2/libv4l2.la
 v4l1compat_la_SOURCES = v4l1compat.c
 
 v4l1compat_la_LIBADD = libv4l1.la
-v4l1compat_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
-v4l1compat_la_LIBTOOLFLAGS = --tag=disable-static
+v4l1compat_la_LDFLAGS = -avoid-version -module -export-dynamic
 
 EXTRA_DIST = libv4l1-kernelcode-license.txt
diff --git a/lib/libv4l2/Makefile.am b/lib/libv4l2/Makefile.am
index b6f4d3b..878ccd9 100644
--- a/lib/libv4l2/Makefile.am
+++ b/lib/libv4l2/Makefile.am
@@ -22,7 +22,6 @@ libv4l2_la_LIBADD = ../libv4lconvert/libv4lconvert.la
 
 v4l2convert_la_SOURCES = v4l2convert.c
 v4l2convert_la_LIBADD = libv4l2.la
-v4l2convert_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
-v4l2convert_la_LIBTOOLFLAGS = --tag=disable-static
+v4l2convert_la_LDFLAGS = -avoid-version -module -export-dynamic
 
 EXTRA_DIST = Android.mk v4l2-plugin-android.c
-- 
2.1.0.231.g7484e3b


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [v4l-utils PATCH 1/1] Allow building static binaries
  2015-12-08 15:18 [v4l-utils PATCH 1/1] Allow building static binaries Sakari Ailus
@ 2015-12-10 13:21 ` Sakari Ailus
  2015-12-16 20:21   ` Gregor Jasny
  0 siblings, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2015-12-10 13:21 UTC (permalink / raw)
  To: Sakari Ailus, Gregor Jasny; +Cc: linux-media, laurent.pinchart, hverkuil

Hi Gregor,

I discussed with Hans and he thought you'd be the best person to take a look
at this.

The case is that I'd like to build static binaries and that doesn't seem to
work with what's in Makefile.am for libv4l1 and libv4l2 at the moment.

Thanks.

On Tue, Dec 08, 2015 at 05:18:21PM +0200, Sakari Ailus wrote:
> 	$ LDFLAGS="--static -static" ./configure --enable-static
> 	$ LDFLAGS=-static make
> 
> can be used to create static binaries. The issue was that shared libraries
> were attempted to link statically which naturally failed.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  lib/libv4l1/Makefile.am | 3 +--
>  lib/libv4l2/Makefile.am | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/libv4l1/Makefile.am b/lib/libv4l1/Makefile.am
> index 005ae10..c325390 100644
> --- a/lib/libv4l1/Makefile.am
> +++ b/lib/libv4l1/Makefile.am
> @@ -23,7 +23,6 @@ libv4l1_la_LIBADD = ../libv4l2/libv4l2.la
>  v4l1compat_la_SOURCES = v4l1compat.c
>  
>  v4l1compat_la_LIBADD = libv4l1.la
> -v4l1compat_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
> -v4l1compat_la_LIBTOOLFLAGS = --tag=disable-static
> +v4l1compat_la_LDFLAGS = -avoid-version -module -export-dynamic
>  
>  EXTRA_DIST = libv4l1-kernelcode-license.txt
> diff --git a/lib/libv4l2/Makefile.am b/lib/libv4l2/Makefile.am
> index b6f4d3b..878ccd9 100644
> --- a/lib/libv4l2/Makefile.am
> +++ b/lib/libv4l2/Makefile.am
> @@ -22,7 +22,6 @@ libv4l2_la_LIBADD = ../libv4lconvert/libv4lconvert.la
>  
>  v4l2convert_la_SOURCES = v4l2convert.c
>  v4l2convert_la_LIBADD = libv4l2.la
> -v4l2convert_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
> -v4l2convert_la_LIBTOOLFLAGS = --tag=disable-static
> +v4l2convert_la_LDFLAGS = -avoid-version -module -export-dynamic
>  
>  EXTRA_DIST = Android.mk v4l2-plugin-android.c
> -- 
> 2.1.0.231.g7484e3b
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v4l-utils PATCH 1/1] Allow building static binaries
  2015-12-10 13:21 ` Sakari Ailus
@ 2015-12-16 20:21   ` Gregor Jasny
  2015-12-21 12:45     ` Sakari Ailus
  0 siblings, 1 reply; 4+ messages in thread
From: Gregor Jasny @ 2015-12-16 20:21 UTC (permalink / raw)
  To: Sakari Ailus, Sakari Ailus; +Cc: linux-media, laurent.pinchart, hverkuil

Hello,

On 10/12/15 14:21, Sakari Ailus wrote:
> I discussed with Hans and he thought you'd be the best person to take a look
> at this.
> 
> The case is that I'd like to build static binaries and that doesn't seem to
> work with what's in Makefile.am for libv4l1 and libv4l2 at the moment.

Sorry for the late reply. Didi not notice this email earlier. Your patch
does not do what you'd like to achieve. Both v4l1compat and v4l2convert
are libraries which only purpose is to get preloaded by the loader. So
build them statically does not make sense. Instead they should not be
built at all. To achieve this the WITH_V4L_WRAPPERS variable should
evaluate to false. This is triggered by

AM_CONDITIONAL([WITH_V4L_WRAPPERS], [test x$enable_libv4l != xno -a
x$enable_shared != xno])

So changing

LDFLAGS="--static -static" ./configure --enable-static

to

LDFLAGS="--static -static" ./configure --enable-static --disabled-shared

should do the trick. Does this help?

Thanks,
Gregor



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v4l-utils PATCH 1/1] Allow building static binaries
  2015-12-16 20:21   ` Gregor Jasny
@ 2015-12-21 12:45     ` Sakari Ailus
  0 siblings, 0 replies; 4+ messages in thread
From: Sakari Ailus @ 2015-12-21 12:45 UTC (permalink / raw)
  To: Gregor Jasny; +Cc: Sakari Ailus, linux-media, laurent.pinchart, hverkuil

Hi Gregor,

On Wed, Dec 16, 2015 at 09:21:16PM +0100, Gregor Jasny wrote:
> Hello,
> 
> On 10/12/15 14:21, Sakari Ailus wrote:
> > I discussed with Hans and he thought you'd be the best person to take a look
> > at this.
> > 
> > The case is that I'd like to build static binaries and that doesn't seem to
> > work with what's in Makefile.am for libv4l1 and libv4l2 at the moment.
> 
> Sorry for the late reply. Didi not notice this email earlier. Your patch
> does not do what you'd like to achieve. Both v4l1compat and v4l2convert
> are libraries which only purpose is to get preloaded by the loader. So
> build them statically does not make sense. Instead they should not be
> built at all. To achieve this the WITH_V4L_WRAPPERS variable should
> evaluate to false. This is triggered by
> 
> AM_CONDITIONAL([WITH_V4L_WRAPPERS], [test x$enable_libv4l != xno -a
> x$enable_shared != xno])
> 
> So changing
> 
> LDFLAGS="--static -static" ./configure --enable-static
> 
> to
> 
> LDFLAGS="--static -static" ./configure --enable-static --disabled-shared
> 
> should do the trick. Does this help?

It does. I get statically linked binaries now without changes. Thank you,
Gregor!

Hans, Mauro, please ignore the patch.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-21 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 15:18 [v4l-utils PATCH 1/1] Allow building static binaries Sakari Ailus
2015-12-10 13:21 ` Sakari Ailus
2015-12-16 20:21   ` Gregor Jasny
2015-12-21 12:45     ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox