Skip to content

Commit 3fd9356

Browse files
committed
add --enable-all-static option for static frontend linking
Note that I also replaced AC_PROG_RANLIB with LT_INIT in configure.ac and added an m4 subdir to hold the output of libtoolize.
1 parent 04e60fa commit 3fd9356

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ Makefile.in
1010
/aclocal.m4
1111
/ar-lib
1212
/autom4te.cache
13+
/compile
14+
/config.guess
1315
/config.h
1416
/config.h.in
1517
/config.h.in~
1618
/config.log
1719
/config.status
20+
/config.sub
1821
/configure
1922
/depcomp
2023
/install-sh
24+
/libtool
25+
/ltmain.sh
2126
/missing
2227
/alfalfa-*.tar.gz
2328
/stamp-h1

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ACLOCAL_AMFLAGS = -I m4
12
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-debug
23

34
SUBDIRS = src man

configure.ac

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ AC_INIT([alfalfa], [0.1], [[email protected]])
66
AM_INIT_AUTOMAKE([foreign tar-ustar])
77
AC_CONFIG_SRCDIR([src/decoder/prediction.cc])
88
AC_CONFIG_HEADERS([config.h])
9+
AC_CONFIG_MACRO_DIRS([m4])
910

1011
# Checks for programs.
1112
AC_PROG_CXX
12-
AC_PROG_RANLIB
13+
dnl AC_PROG_RANLIB
14+
LT_INIT
1315
AC_PATH_PROG([PERL], [perl], [])
1416
AS_IF([test x"$PERL" = x],
1517
[AC_MSG_ERROR([cannot find perl])])
@@ -42,6 +44,20 @@ AC_ARG_ENABLE([debug],
4244

4345
AC_SUBST(NODEBUG_CXXFLAGS)
4446

47+
AC_ARG_ENABLE([all-static],
48+
[AS_HELP_STRING([--enable-all-static], [Build statically linked binaries])],
49+
[case "$enableval" in
50+
'' | yes)
51+
STATIC_BUILD_FLAG="-all-static"
52+
;;
53+
*)
54+
AC_MSG_ERROR([Unknown argument '$enableval' to --enable-all-static])
55+
;;
56+
esac],
57+
[STATIC_BUILD_FLAG=""])
58+
59+
AC_SUBST(STATIC_BUILD_FLAG)
60+
4561
# Checks for assemblers
4662
# TODO only check this when arch is x86
4763
AC_CHECK_PROGS([AS], [yasm nasm], [none])

m4/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

src/frontend/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
AM_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../decoder -I$(srcdir)/../display -I$(srcdir)/../encoder $(GLU_CFLAGS) $(GLEW_CFLAGS) $(GLFW3_CFLAGS) $(X264_CFLAGS) $(CXX11_FLAGS)
22
AM_CXXFLAGS = $(PICKY_CXXFLAGS) $(NODEBUG_CXXFLAGS)
3+
AM_LDFLAGS = $(STATIC_BUILD_FLAG)
34

45
bin_PROGRAMS = vp8decode vp8play collisions xc-enc xc-ssim xc-dissect xc-framesize xc-stitch comp-states
56

@@ -8,6 +9,9 @@ vp8decode_LDADD = ../decoder/libalfalfadecoder.a ../util/libalfalfautil.a $(X264
89

910
vp8play_SOURCES = vp8play.cc
1011
vp8play_LDADD = ../decoder/libalfalfadecoder.a ../encoder/libalfalfaencoder.a ../display/libalfalfadisplay.a ../util/libalfalfautil.a $(GLU_LIBS) $(X264_LIBS) $(GLEW_LIBS) $(GLFW3_LIBS)
12+
# NOTE: Debian does not distribute static libs for libGLEW et al,
13+
# so we have to override AM_LDFLAGS and always dynamically link
14+
vp8play_LDFLAGS =
1115

1216
collisions_SOURCES = collisions.cc
1317
collisions_LDADD = ../decoder/libalfalfadecoder.a ../util/libalfalfautil.a $(X264_LIBS)

0 commit comments

Comments
 (0)