Add configure options

Allow the packager to decide if she wants to compile/install
programs, VAMP plugin and LADSPA plugin.

if --disable-programs is used, then sndfile is not required.
if --disable-vamp is used, then vamp-sdk is not required.
if --disable-lapsda is used, then lapsda is not required.
This commit is contained in:
Brian Matherly
2020-02-14 11:23:52 +00:00
parent 817c781efc
commit 8043a8fc8f
3 changed files with 158 additions and 29 deletions

View File

@@ -5,6 +5,9 @@ CC := @CC@
CXXFLAGS := -DHAVE_LIBSAMPLERATE -DHAVE_FFTW3 -DFFTW_DOUBLE_ONLY -DNO_THREAD_CHECKS -DUSE_PTHREADS -DNO_TIMING -DNDEBUG -I. -Isrc -Irubberband @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ $(OPTFLAGS)
CFLAGS := @CFLAGS@ $(OPTFLAGS)
LDFLAGS := @LDFLAGS@ -lpthread $(LDFLAGS)
WITH_PROGRAMS := @WITH_PROGRAMS@
WITH_VAMP := @WITH_VAMP@
WITH_LADSPA := @WITH_LADSPA@
JNI_CXXFLAGS := -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JAVAC := $(JAVA_HOME)/bin/javac
@@ -45,8 +48,21 @@ JAR_TARGET := lib/$(JARNAME)
VAMP_TARGET := lib/vamp-rubberband$(DYNAMIC_EXTENSION)
LADSPA_TARGET := lib/ladspa-rubberband$(DYNAMIC_EXTENSION)
all: bin lib $(PROGRAM_TARGET) $(STATIC_TARGET) $(DYNAMIC_TARGET) $(VAMP_TARGET) $(LADSPA_TARGET)
ALL_TARGETS := lib $(STATIC_TARGET) $(DYNAMIC_TARGET)
ifeq ($(WITH_PROGRAMS), yes)
ALL_TARGETS += bin $(PROGRAM_TARGET)
endif
ifeq ($(WITH_VAMP), yes)
ALL_TARGETS += $(VAMP_TARGET)
endif
ifeq ($(WITH_LADSPA), yes)
ALL_TARGETS += $(LADSPA_TARGET)
endif
all: $(ALL_TARGETS)
static: $(STATIC_TARGET)
dynamic: $(DYNAMIC_TARGET)
library: $(STATIC_TARGET) $(DYNAMIC_TARGET)
@@ -167,14 +183,9 @@ lib:
$(MKDIR) $@
install: all
$(MKDIR) -p $(DESTDIR)$(INSTALL_BINDIR)
$(MKDIR) -p $(DESTDIR)$(INSTALL_INCDIR)
$(MKDIR) -p $(DESTDIR)$(INSTALL_LIBDIR)
$(MKDIR) -p $(DESTDIR)$(INSTALL_VAMPDIR)
$(MKDIR) -p $(DESTDIR)$(INSTALL_LADSPADIR)
$(MKDIR) -p $(DESTDIR)$(INSTALL_LRDFDIR)
$(MKDIR) -p $(DESTDIR)$(INSTALL_PKGDIR)
cp $(PROGRAM_TARGET) $(DESTDIR)$(INSTALL_BINDIR)
cp $(PUBLIC_INCLUDES) $(DESTDIR)$(INSTALL_INCDIR)
cp $(STATIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_ABI_VERSION)
@@ -184,13 +195,24 @@ install: all
ln -s $(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_ABI_VERSION)
ln -s $(LIBNAME)$(DYNAMIC_EXTENSION).$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)$(DYNAMIC_EXTENSION)
test -f $(JNI_TARGET) && cp -f $(JNI_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)/$(JNINAME)$(DYNAMIC_EXTENSION) || true
sed "s,%PREFIX%,$(PREFIX)," rubberband.pc.in \
> $(DESTDIR)$(INSTALL_PKGDIR)/rubberband.pc
ifeq ($(WITH_PROGRAMS), yes)
$(MKDIR) -p $(DESTDIR)$(INSTALL_BINDIR)
cp $(PROGRAM_TARGET) $(DESTDIR)$(INSTALL_BINDIR)
endif
ifeq ($(WITH_VAMP), yes)
$(MKDIR) -p $(DESTDIR)$(INSTALL_VAMPDIR)
cp $(VAMP_TARGET) $(DESTDIR)$(INSTALL_VAMPDIR)
cp vamp/vamp-rubberband.cat $(DESTDIR)$(INSTALL_VAMPDIR)
endif
ifeq ($(WITH_LADSPA), yes)
$(MKDIR) -p $(DESTDIR)$(INSTALL_LADSPADIR)
$(MKDIR) -p $(DESTDIR)$(INSTALL_LRDFDIR)
cp $(LADSPA_TARGET) $(DESTDIR)$(INSTALL_LADSPADIR)
cp ladspa/ladspa-rubberband.cat $(DESTDIR)$(INSTALL_LADSPADIR)
cp ladspa/ladspa-rubberband.rdf $(DESTDIR)$(INSTALL_LRDFDIR)
sed "s,%PREFIX%,$(PREFIX)," rubberband.pc.in \
> $(DESTDIR)$(INSTALL_PKGDIR)/rubberband.pc
endif
clean:
rm -f $(LIBRARY_OBJECTS) $(JNI_OBJECT) $(JAVA_OBJECT) $(PROGRAM_OBJECTS) $(LADSPA_OBJECTS) $(VAMP_OBJECTS)

107
configure vendored
View File

@@ -648,6 +648,9 @@ CPPFLAGS
LDFLAGS
CXXFLAGS
CXX
WITH_LADSPA
WITH_VAMP
WITH_PROGRAMS
target_alias
host_alias
build_alias
@@ -667,6 +670,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -689,6 +693,9 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_programs
enable_vamp
enable_ladspa
'
ac_precious_vars='build_alias
host_alias
@@ -751,6 +758,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1003,6 +1011,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1140,7 +1157,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1293,6 +1310,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1318,6 +1336,14 @@ if test -n "$ac_init_help"; then
esac
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-programs Disable compilation of programs
--disable-vamp Disable compilation of vamp plugin
--disable-ladspa Disable compilation of ladspa plugin
Some influential environment variables:
CXX C++ compiler command
CXXFLAGS C++ compiler flags
@@ -2054,6 +2080,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Check whether --enable-programs was given.
if test "${enable_programs+set}" = set; then :
enableval=$enable_programs; case "${enableval}" in
yes | no ) WITH_PROGRAMS="${enableval}" ;;
*) as_fn_error $? "bad value ${enableval} for --disable-programs" "$LINENO" 5 ;;
esac
else
WITH_PROGRAMS="yes"
fi
# Check whether --enable-vamp was given.
if test "${enable_vamp+set}" = set; then :
enableval=$enable_vamp; case "${enableval}" in
yes | no ) WITH_VAMP="${enableval}" ;;
*) as_fn_error $? "bad value ${enableval} for --disable-vamp" "$LINENO" 5 ;;
esac
else
WITH_VAMP="yes"
fi
# Check whether --enable-ladspa was given.
if test "${enable_ladspa+set}" = set; then :
enableval=$enable_ladspa; case "${enableval}" in
yes | no ) WITH_LADSPA="${enableval}" ;;
*) as_fn_error $? "bad value ${enableval} for --disable-ladspa" "$LINENO" 5 ;;
esac
else
WITH_LADSPA="yes"
fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
@@ -3846,8 +3911,8 @@ $as_echo "no" >&6; }
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for samplerate" >&5
$as_echo_n "checking for samplerate... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SRC" >&5
$as_echo_n "checking for SRC... " >&6; }
if test -n "$SRC_CFLAGS"; then
pkg_cv_SRC_CFLAGS="$SRC_CFLAGS"
@@ -3887,7 +3952,7 @@ fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -3914,7 +3979,7 @@ Alternatively, you may set the environment variables SRC_CFLAGS
and SRC_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -3938,10 +4003,11 @@ fi
if test "x$WITH_PROGRAMS" = "xyes"; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sndfile" >&5
$as_echo_n "checking for sndfile... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SNDFILE" >&5
$as_echo_n "checking for SNDFILE... " >&6; }
if test -n "$SNDFILE_CFLAGS"; then
pkg_cv_SNDFILE_CFLAGS="$SNDFILE_CFLAGS"
@@ -3981,7 +4047,7 @@ fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -4008,7 +4074,7 @@ Alternatively, you may set the environment variables SNDFILE_CFLAGS
and SNDFILE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -4029,13 +4095,14 @@ else
$as_echo "yes" >&6; }
fi
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw3" >&5
$as_echo_n "checking for fftw3... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW" >&5
$as_echo_n "checking for FFTW... " >&6; }
if test -n "$FFTW_CFLAGS"; then
pkg_cv_FFTW_CFLAGS="$FFTW_CFLAGS"
@@ -4075,7 +4142,7 @@ fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -4102,7 +4169,7 @@ Alternatively, you may set the environment variables FFTW_CFLAGS
and FFTW_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -4126,7 +4193,8 @@ fi
for ac_header in ladspa.h
if test "x$WITH_LADSPA" = "xyes"; then
for ac_header in ladspa.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "ladspa.h" "ac_cv_header_ladspa_h" "$ac_includes_default"
if test "x$ac_cv_header_ladspa_h" = xyes; then :
@@ -4138,6 +4206,7 @@ fi
done
fi
for ac_header in pthread.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
@@ -4151,10 +4220,11 @@ fi
done
if test "x$WITH_VAMP" = "xyes"; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vamp-sdk" >&5
$as_echo_n "checking for vamp-sdk... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Vamp" >&5
$as_echo_n "checking for Vamp... " >&6; }
if test -n "$Vamp_CFLAGS"; then
pkg_cv_Vamp_CFLAGS="$Vamp_CFLAGS"
@@ -4194,7 +4264,7 @@ fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -4221,7 +4291,7 @@ Alternatively, you may set the environment variables Vamp_CFLAGS
and Vamp_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -4242,6 +4312,7 @@ else
$as_echo "yes" >&6; }
fi
fi

View File

@@ -1,6 +1,36 @@
AC_INIT(RubberBand, 1.8.2, chris.cannam@breakfastquay.com)
AC_ARG_ENABLE(programs,
[ --disable-programs Disable compilation of programs],
[case "${enableval}" in
yes | no ) WITH_PROGRAMS="${enableval}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-programs) ;;
esac],
[WITH_PROGRAMS="yes"]
)
AC_SUBST(WITH_PROGRAMS)
AC_ARG_ENABLE(vamp,
[ --disable-vamp Disable compilation of vamp plugin],
[case "${enableval}" in
yes | no ) WITH_VAMP="${enableval}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-vamp) ;;
esac],
[WITH_VAMP="yes"]
)
AC_SUBST(WITH_VAMP)
AC_ARG_ENABLE(ladspa,
[ --disable-ladspa Disable compilation of ladspa plugin],
[case "${enableval}" in
yes | no ) WITH_LADSPA="${enableval}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-ladspa) ;;
esac],
[WITH_LADSPA="yes"]
)
AC_SUBST(WITH_LADSPA)
AC_CONFIG_SRCDIR(src/StretcherImpl.h)
AC_PROG_CXX
AC_PROG_CC
@@ -11,7 +41,9 @@ PKG_CHECK_MODULES([SRC],[samplerate])
AC_SUBST(SRC_CFLAGS)
AC_SUBST(SRC_LIBS)
PKG_CHECK_MODULES([SNDFILE],[sndfile])
if test "x$WITH_PROGRAMS" = "xyes"; then
PKG_CHECK_MODULES([SNDFILE],[sndfile])
fi
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
@@ -19,10 +51,14 @@ PKG_CHECK_MODULES([FFTW],[fftw3])
AC_SUBST(FFTW_CFLAGS)
AC_SUBST(FFTW_LIBS)
AC_CHECK_HEADERS(ladspa.h)
if test "x$WITH_LADSPA" = "xyes"; then
AC_CHECK_HEADERS(ladspa.h)
fi
AC_CHECK_HEADERS(pthread.h)
PKG_CHECK_MODULES([Vamp],[vamp-sdk])
if test "x$WITH_VAMP" = "xyes"; then
PKG_CHECK_MODULES([Vamp],[vamp-sdk])
fi
AC_SUBST(Vamp_CFLAGS)
AC_SUBST(Vamp_LIBS)