diff mbox

build both static and dynamic linked libs

Message ID 1406806863-30363-1-git-send-email-anders.roxell@linaro.org
State Accepted
Commit 57611a5057abfa20842593a049edc7ad9386e468
Headers show

Commit Message

Anders Roxell July 31, 2014, 11:41 a.m. UTC
Move static decisions to Makefiles instead in the configure scripts.
This makes it possible to build binaries with shared, static or
all-static without reconfiguring and libodp is built both static
and dynamic per default.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 configure.ac                      | 2 +-
 example/generator/Makefile.am     | 1 +
 example/l2fwd/Makefile.am         | 1 +
 example/odp_example/Makefile.am   | 1 +
 example/packet/Makefile.am        | 1 +
 example/packet_netmap/Makefile.am | 1 +
 example/timer/Makefile.am         | 1 +
 test/api_test/Makefile.am         | 4 ++++
 8 files changed, 11 insertions(+), 1 deletion(-)

Comments

Maxim Uvarov Aug. 4, 2014, 7:18 a.m. UTC | #1
Applied, thanks!

Maxim.

On 07/31/2014 03:41 PM, Anders Roxell wrote:
> Move static decisions to Makefiles instead in the configure scripts.
> This makes it possible to build binaries with shared, static or
> all-static without reconfiguring and libodp is built both static
> and dynamic per default.
>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>   configure.ac                      | 2 +-
>   example/generator/Makefile.am     | 1 +
>   example/l2fwd/Makefile.am         | 1 +
>   example/odp_example/Makefile.am   | 1 +
>   example/packet/Makefile.am        | 1 +
>   example/packet_netmap/Makefile.am | 1 +
>   example/timer/Makefile.am         | 1 +
>   test/api_test/Makefile.am         | 4 ++++
>   8 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 22d5c80..6b75e66 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -21,7 +21,7 @@ AC_PROG_INSTALL
>   AC_PROG_MAKE_SET
>   
>   #Use libtool
> -LT_INIT([disable-shared static])
> +LT_INIT([])
>   AC_SUBST([LIBTOOL_DEPS])
>   AM_PROG_LIBTOOL
>   
> diff --git a/example/generator/Makefile.am b/example/generator/Makefile.am
> index d3bd5bf..5b3d55a 100644
> --- a/example/generator/Makefile.am
> +++ b/example/generator/Makefile.am
> @@ -1,5 +1,6 @@
>   include $(top_srcdir)/example/Makefile.inc
>   
>   bin_PROGRAMS = odp_generator
> +odp_generator_LDFLAGS = $(AM_LDFLAGS) -static
>   
>   dist_odp_generator_SOURCES = odp_generator.c
> diff --git a/example/l2fwd/Makefile.am b/example/l2fwd/Makefile.am
> index 9b5a7ef..a83e757 100644
> --- a/example/l2fwd/Makefile.am
> +++ b/example/l2fwd/Makefile.am
> @@ -1,5 +1,6 @@
>   include $(top_srcdir)/example/Makefile.inc
>   
>   bin_PROGRAMS = odp_l2fwd
> +odp_l2fwd_LDFLAGS = $(AM_LDFLAGS) -static
>   
>   dist_odp_l2fwd_SOURCES = odp_l2fwd.c
> diff --git a/example/odp_example/Makefile.am b/example/odp_example/Makefile.am
> index c1b4ed3..e6f23d0 100644
> --- a/example/odp_example/Makefile.am
> +++ b/example/odp_example/Makefile.am
> @@ -1,5 +1,6 @@
>   include $(top_srcdir)/example/Makefile.inc
>   
>   bin_PROGRAMS = odp_example
> +odp_example_LDFLAGS = $(AM_LDFLAGS) -static
>   
>   dist_odp_example_SOURCES = odp_example.c
> diff --git a/example/packet/Makefile.am b/example/packet/Makefile.am
> index 2d778dd..603a1ab 100644
> --- a/example/packet/Makefile.am
> +++ b/example/packet/Makefile.am
> @@ -1,5 +1,6 @@
>   include $(top_srcdir)/example/Makefile.inc
>   
>   bin_PROGRAMS = odp_pktio
> +odp_pktio_LDFLAGS = $(AM_LDFLAGS) -static
>   
>   dist_odp_pktio_SOURCES = odp_pktio.c
> diff --git a/example/packet_netmap/Makefile.am b/example/packet_netmap/Makefile.am
> index 6db0f98..5a5913c 100644
> --- a/example/packet_netmap/Makefile.am
> +++ b/example/packet_netmap/Makefile.am
> @@ -2,6 +2,7 @@ include $(top_srcdir)/example/Makefile.inc
>   
>   if ODP_NETMAP_ENABLED
>   bin_PROGRAMS = odp_pktio_netmap
> +odp_pktio_netmap_LDFLAGS = $(AM_LDFLAGS) -static
>   endif
>   
>   dist_odp_pktio_netmap_SOURCES = odp_pktio_netmap.c
> diff --git a/example/timer/Makefile.am b/example/timer/Makefile.am
> index 09253a6..6229f13 100644
> --- a/example/timer/Makefile.am
> +++ b/example/timer/Makefile.am
> @@ -1,5 +1,6 @@
>   include $(top_srcdir)/example/Makefile.inc
>   
>   bin_PROGRAMS = odp_timer_test
> +odp_timer_test_LDFLAGS = $(AM_LDFLAGS) -static
>   
>   dist_odp_timer_test_SOURCES = odp_timer_test.c
> diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
> index fd7eab3..5104454 100644
> --- a/test/api_test/Makefile.am
> +++ b/test/api_test/Makefile.am
> @@ -1,6 +1,10 @@
>   include $(top_srcdir)/test/Makefile.inc
>   
>   bin_PROGRAMS = odp_atomic odp_shm odp_ring odp_timer_ping
> +odp_atomic_LDFLAGS = $(AM_LDFLAGS) -static
> +odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
> +odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
> +odp_timer_ping_LDFLAGS = $(AM_LDFLAGS) -static
>   
>   dist_odp_atomic_SOURCES = odp_atomic_test.c odp_common.c
>   dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 22d5c80..6b75e66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@  AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 
 #Use libtool
-LT_INIT([disable-shared static])
+LT_INIT([])
 AC_SUBST([LIBTOOL_DEPS])
 AM_PROG_LIBTOOL
 
diff --git a/example/generator/Makefile.am b/example/generator/Makefile.am
index d3bd5bf..5b3d55a 100644
--- a/example/generator/Makefile.am
+++ b/example/generator/Makefile.am
@@ -1,5 +1,6 @@ 
 include $(top_srcdir)/example/Makefile.inc
 
 bin_PROGRAMS = odp_generator
+odp_generator_LDFLAGS = $(AM_LDFLAGS) -static
 
 dist_odp_generator_SOURCES = odp_generator.c
diff --git a/example/l2fwd/Makefile.am b/example/l2fwd/Makefile.am
index 9b5a7ef..a83e757 100644
--- a/example/l2fwd/Makefile.am
+++ b/example/l2fwd/Makefile.am
@@ -1,5 +1,6 @@ 
 include $(top_srcdir)/example/Makefile.inc
 
 bin_PROGRAMS = odp_l2fwd
+odp_l2fwd_LDFLAGS = $(AM_LDFLAGS) -static
 
 dist_odp_l2fwd_SOURCES = odp_l2fwd.c
diff --git a/example/odp_example/Makefile.am b/example/odp_example/Makefile.am
index c1b4ed3..e6f23d0 100644
--- a/example/odp_example/Makefile.am
+++ b/example/odp_example/Makefile.am
@@ -1,5 +1,6 @@ 
 include $(top_srcdir)/example/Makefile.inc
 
 bin_PROGRAMS = odp_example
+odp_example_LDFLAGS = $(AM_LDFLAGS) -static
 
 dist_odp_example_SOURCES = odp_example.c
diff --git a/example/packet/Makefile.am b/example/packet/Makefile.am
index 2d778dd..603a1ab 100644
--- a/example/packet/Makefile.am
+++ b/example/packet/Makefile.am
@@ -1,5 +1,6 @@ 
 include $(top_srcdir)/example/Makefile.inc
 
 bin_PROGRAMS = odp_pktio
+odp_pktio_LDFLAGS = $(AM_LDFLAGS) -static
 
 dist_odp_pktio_SOURCES = odp_pktio.c
diff --git a/example/packet_netmap/Makefile.am b/example/packet_netmap/Makefile.am
index 6db0f98..5a5913c 100644
--- a/example/packet_netmap/Makefile.am
+++ b/example/packet_netmap/Makefile.am
@@ -2,6 +2,7 @@  include $(top_srcdir)/example/Makefile.inc
 
 if ODP_NETMAP_ENABLED
 bin_PROGRAMS = odp_pktio_netmap
+odp_pktio_netmap_LDFLAGS = $(AM_LDFLAGS) -static
 endif
 
 dist_odp_pktio_netmap_SOURCES = odp_pktio_netmap.c
diff --git a/example/timer/Makefile.am b/example/timer/Makefile.am
index 09253a6..6229f13 100644
--- a/example/timer/Makefile.am
+++ b/example/timer/Makefile.am
@@ -1,5 +1,6 @@ 
 include $(top_srcdir)/example/Makefile.inc
 
 bin_PROGRAMS = odp_timer_test
+odp_timer_test_LDFLAGS = $(AM_LDFLAGS) -static
 
 dist_odp_timer_test_SOURCES = odp_timer_test.c
diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
index fd7eab3..5104454 100644
--- a/test/api_test/Makefile.am
+++ b/test/api_test/Makefile.am
@@ -1,6 +1,10 @@ 
 include $(top_srcdir)/test/Makefile.inc
 
 bin_PROGRAMS = odp_atomic odp_shm odp_ring odp_timer_ping
+odp_atomic_LDFLAGS = $(AM_LDFLAGS) -static
+odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
+odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
+odp_timer_ping_LDFLAGS = $(AM_LDFLAGS) -static
 
 dist_odp_atomic_SOURCES = odp_atomic_test.c odp_common.c
 dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c