2013-10-18 15:05:15 +00:00
|
|
|
## Process this file with autoconf to produce a configure script.
|
|
|
|
|
2016-06-27 14:18:13 +00:00
|
|
|
AC_PREREQ(2.65)
|
2016-07-01 19:37:17 +00:00
|
|
|
AC_INIT([Infinity plugin],[0.9.0-dev],[https://github.com/dprotti/infinity-plugin/issues],[infinity-plugin],[https://dprotti.github.io/infinity-plugin])
|
2016-06-27 14:18:13 +00:00
|
|
|
AC_CANONICAL_HOST
|
2016-06-25 20:58:50 +00:00
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
2016-06-27 14:18:13 +00:00
|
|
|
AM_INIT_AUTOMAKE([1.15 -Wno-portability no-dist-gzip dist-xz tar-ustar])
|
|
|
|
|
|
|
|
# Support silent build rules. Disable by either passing --disable-silent-rules
|
|
|
|
# to configure or passing V=1 to make
|
|
|
|
AM_SILENT_RULES([yes])
|
2013-10-18 15:05:15 +00:00
|
|
|
|
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
AC_PREFIX_PROGRAM(audacious)
|
|
|
|
|
|
|
|
# Check for programs.
|
2016-06-22 00:08:54 +00:00
|
|
|
AC_PROG_CXX
|
2013-10-18 15:05:15 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
AC_DISABLE_STATIC
|
|
|
|
LT_INIT
|
|
|
|
|
|
|
|
AC_PATH_PROG(PKG_CONFIG, [pkg-config], [no])
|
|
|
|
if test x$PKG_CONFIG = xno ; then
|
|
|
|
AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
|
|
|
|
fi
|
|
|
|
if $PKG_CONFIG --atleast-pkgconfig-version 0.14 ; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([*** pkg-config too old; version 0.14 or better required.])
|
|
|
|
fi
|
|
|
|
|
2016-06-29 18:53:14 +00:00
|
|
|
# Check dependencies
|
2016-06-29 17:32:48 +00:00
|
|
|
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28,,)
|
2013-10-18 15:05:15 +00:00
|
|
|
AC_SUBST(GLIB_LIBS)
|
|
|
|
AC_SUBST(GLIB_CFLAGS)
|
|
|
|
|
2016-07-01 03:25:36 +00:00
|
|
|
PKG_CHECK_MODULES(SDL, sdl2 >= 2,,)
|
2016-06-30 18:20:54 +00:00
|
|
|
AC_SUBST(SDL_LIBS)
|
|
|
|
AC_SUBST(SDL_CFLAGS)
|
2013-10-18 15:05:15 +00:00
|
|
|
|
2016-02-12 19:25:56 +00:00
|
|
|
PKG_CHECK_MODULES(AUDACIOUS, audacious >= 3.5,,)
|
2013-10-18 15:05:15 +00:00
|
|
|
AC_SUBST(AUDACIOUS_LIBS)
|
|
|
|
AC_SUBST(AUDACIOUS_CFLAGS)
|
|
|
|
|
|
|
|
# Check for header files.
|
|
|
|
AC_HEADER_STDC
|
2016-06-25 20:52:08 +00:00
|
|
|
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
|
2013-10-18 15:05:15 +00:00
|
|
|
|
|
|
|
# Check for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_VOLATILE
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_BIGENDIAN(AC_MSG_WARN([*** You have a big endian system, Infinity have not been tested on these systems]),,)
|
|
|
|
|
|
|
|
AC_CHECK_SIZEOF(long long)
|
|
|
|
if test x$ac_cv_sizeof_long_long = x8; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Infinity requires a 64 bit long long type. You might want to consider
|
|
|
|
*** using the GNU C compiler.
|
|
|
|
])
|
|
|
|
fi
|
2016-06-29 20:01:46 +00:00
|
|
|
|
|
|
|
AC_CHECK_SIZEOF([size_t])
|
|
|
|
AC_MSG_CHECKING([whether compiler is 32 or 64 bit])
|
|
|
|
if test x$ac_cv_sizeof_size_t = x8; then
|
|
|
|
AC_MSG_RESULT([64])
|
|
|
|
compiler_width=64
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([32])
|
|
|
|
compiler_width=32
|
|
|
|
fi
|
|
|
|
|
2013-10-18 15:05:15 +00:00
|
|
|
# Check for library functions.
|
2016-06-25 20:52:08 +00:00
|
|
|
AC_CHECK_FUNCS([floor sqrt])
|
2013-10-18 15:05:15 +00:00
|
|
|
|
|
|
|
# Arguments to specify certain features.
|
|
|
|
AC_ARG_ENABLE([mmx],
|
2016-06-29 20:01:46 +00:00
|
|
|
AS_HELP_STRING([--enable-mmx],[use MMX if available and if building with a 32 bit compiler @<:@default=enabled@:>@]),
|
2013-10-18 15:05:15 +00:00
|
|
|
[mmx=$enableval],
|
2016-06-29 20:01:46 +00:00
|
|
|
[mmx=yes])
|
|
|
|
AC_MSG_CHECKING([whether to enable MMX])
|
2013-10-18 15:05:15 +00:00
|
|
|
if test x$mmx = xyes; then
|
2016-06-29 20:01:46 +00:00
|
|
|
if test x$compiler_width = x32; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE([MMX_DETECTION], [1], [Activate MMX Extensions support])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no, was requested but feature is not supported with a 64bit compiler])
|
|
|
|
fi
|
2013-10-18 15:05:15 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([debug],
|
2016-06-29 20:01:46 +00:00
|
|
|
AS_HELP_STRING([--enable-debug],[turn on debug mode @<:@default=disabled@:>@]),
|
2013-10-18 15:05:15 +00:00
|
|
|
[debug=$enableval],
|
|
|
|
[debug=no])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to activate debugging])
|
|
|
|
if test "$debug" = yes; then
|
|
|
|
AC_MSG_RESULT([yes])
|
2016-02-15 00:48:36 +00:00
|
|
|
AC_DEFINE([INFINITY_DEBUG], [1], [Activate Infinity debugging])
|
2013-10-18 15:05:15 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
INF_CFLAGS_EXTRA=''
|
|
|
|
|
|
|
|
if test x"$GCC" = xyes; then
|
|
|
|
INF_CFLAGS_EXTRA="${INF_CFLAGS_EXTRA} -Wall -Wimplicit -Wunused -Wmissing-prototypes"
|
2016-06-22 00:08:54 +00:00
|
|
|
CXXFLAGS="${CXXFLAGS} -std=c++11"
|
2013-10-18 15:05:15 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([vectorization],
|
2016-06-29 20:01:46 +00:00
|
|
|
AS_HELP_STRING([--enable-vectorization],[turn on vectorization optimizations (gcc >= 4 only) @<:@default=enabled@:>@]),
|
2013-10-18 15:05:15 +00:00
|
|
|
[vectorization=$enableval],
|
|
|
|
[vectorization=yes])
|
|
|
|
|
2016-02-12 18:37:38 +00:00
|
|
|
AC_MSG_CHECKING([whether to activate vectorization under gcc >= 4])
|
2013-10-18 15:05:15 +00:00
|
|
|
if test x"$vectorization" = xyes; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
if test x"$GCC" = xno; then
|
|
|
|
AC_MSG_ERROR([You are not using a gcc compiler])
|
|
|
|
else
|
2016-02-12 18:37:38 +00:00
|
|
|
# Some distros call gcc 4.x as gcc4
|
2013-10-18 15:05:15 +00:00
|
|
|
if test -z "$ac_cv_prog_CC" || test x"$CC" = xgcc4; then
|
|
|
|
our_gcc="$CC"
|
|
|
|
else
|
|
|
|
our_gcc="$ac_cv_prog_CC"
|
|
|
|
fi
|
|
|
|
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
|
2016-02-15 00:48:36 +00:00
|
|
|
*2. | *3.)
|
|
|
|
AC_MSG_ERROR([You need gcc version 4 or newer to build with vectorization optimizations])
|
|
|
|
;;
|
|
|
|
*)
|
2013-10-18 15:05:15 +00:00
|
|
|
INF_CFLAGS_EXTRA="${INF_CFLAGS_EXTRA} -ftree-vectorize"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(INF_CFLAGS_EXTRA)
|
|
|
|
|
2016-06-22 00:43:25 +00:00
|
|
|
# Define EXPORT
|
2016-06-22 00:08:54 +00:00
|
|
|
if test "x$HAVE_MSWINDOWS" = "xyes" ; then
|
|
|
|
EXPORT="__declspec(dllexport)"
|
|
|
|
elif test "x$GCC" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -fvisibility=hidden"
|
|
|
|
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
|
|
|
|
EXPORT="__attribute__((visibility(\"default\")))"
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([Unknown syntax for EXPORT keyword])
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED([EXPORT], [$EXPORT], [Compiler syntax for export of public symbols])
|
|
|
|
|
2013-10-18 17:56:30 +00:00
|
|
|
AC_CHECK_FILE("${prefix}/lib/x86_64-linux-gnu/libSDL.so",
|
|
|
|
# Ubuntu on AMD64 puts libraries into x86_64-linux-gnu/
|
|
|
|
libdir="${libdir}/x86_64-linux-gnu/audacious/Visualization",
|
|
|
|
libdir="${libdir}/audacious/Visualization"
|
|
|
|
)
|
|
|
|
|
|
|
|
pkglibdir="${libdir}"
|
|
|
|
AC_SUBST(libdir)
|
|
|
|
AC_SUBST(pkglibdir)
|
|
|
|
|
2013-10-18 15:05:15 +00:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2016-06-28 14:58:34 +00:00
|
|
|
minidocs/Makefile
|
2016-06-22 00:43:25 +00:00
|
|
|
src/Makefile])
|
2013-10-18 15:05:15 +00:00
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
echo "
|
2016-02-12 19:25:56 +00:00
|
|
|
==============================================================
|
2013-10-18 15:05:15 +00:00
|
|
|
Infinity Plugin for the Audacious Player -- version $VERSION
|
2016-02-12 19:25:56 +00:00
|
|
|
==============================================================
|
2013-10-18 15:05:15 +00:00
|
|
|
|
2013-10-18 17:56:30 +00:00
|
|
|
Install path : ${libdir}
|
2013-10-18 15:05:15 +00:00
|
|
|
Compiler : ${CC}
|
2016-06-22 00:08:54 +00:00
|
|
|
CFLAGS : ${INF_CFLAGS_EXTRA} ${CFLAGS}
|
|
|
|
CXXFLAGS : ${CXXFLAGS}
|
2013-10-18 15:05:15 +00:00
|
|
|
Debug enabled : ${debug}
|
|
|
|
"
|