Added option to disable building of examples

This commit is contained in:
Joachim Bauch 2013-01-09 18:20:21 +01:00
parent 5c43051d6d
commit 809d35d08b
2 changed files with 30 additions and 10 deletions

View file

@ -20,10 +20,14 @@ libquirc_la_SOURCES = lib/decode.c \
libquirc_la_LIBADD = $(SYS_LIBS)
libquirc_la_LDFLAGS = -version-info $(VERSION_INFO)
bin_PROGRAMS = quirc-demo \
quirc-scanner
bin_PROGRAMS =
noinst_PROGRAMS =
noinst_PROGRAMS = qrtest \
if COMPILE_EXAMPLES
bin_PROGRAMS += quirc-demo \
quirc-scanner
noinst_PROGRAMS += qrtest \
inspect
DEMO_SOURCES = \
@ -47,6 +51,8 @@ quirc_demo_LDADD = libquirc.la -ljpeg $(sdl_LIBS) -lSDL_gfx
quirc_scanner_SOURCES = $(DEMO_SOURCES) tests/dbgutil.c demo/scanner.c
quirc_scanner_LDADD = libquirc.la -ljpeg
endif
AM_CPPFLAGS = -I$(srcdir)/lib $(SYS_INCLUDES)
DISTCLEANFILES = ./lib/quirc-config.h

View file

@ -19,16 +19,30 @@ AC_PROG_LN_S
AC_HEADER_STDC
PKG_CHECK_MODULES(sdl, sdl)
AC_SUBST(sdl_CFLAGS)
AC_SUBST(sdl_LIBS)
AC_ARG_ENABLE([quirc-examples],
AS_HELP_STRING([--disable-quirc-examples disable compilation of examples]),
[], [enable_compile_examples=yes])
AC_MSG_CHECKING(whether to disable building of examples)
if test "$enable_compile_examples" = "yes"; then
AC_MSG_RESULT(no)
PKG_CHECK_MODULES(sdl, sdl)
AC_SUBST(sdl_CFLAGS)
AC_SUBST(sdl_LIBS)
AC_CHECK_HEADERS(setjmp.h jpeglib.h)
AC_CHECK_HEADERS(linux/videodev2.h linux/videodev.h)
else
AC_MSG_RESULT(yes)
fi
AM_CONDITIONAL([COMPILE_EXAMPLES], [test "$enable_compile_examples" = "yes"])
AC_CHECK_HEADERS(setjmp.h jpeglib.h)
AC_CHECK_HEADERS(linux/videodev2.h linux/videodev.h)
AC_SEARCH_LIBS([rint], [m])
AC_ARG_ENABLE(large-images,
[ --enable-large-images enable decoding of large images],
AC_ARG_ENABLE([large-images],
AS_HELP_STRING([--enable-large-images enable decoding of large images]),
[large_images=true],
[large_images=false])