|
Packit |
5e46da |
dnl library version number
|
|
Packit |
5e46da |
m4_define([bluray_major], 1)
|
|
Packit |
5e46da |
m4_define([bluray_minor], 0)
|
|
Packit |
5e46da |
m4_define([bluray_micro], 2)
|
|
Packit |
5e46da |
m4_define([bluray_version],[bluray_major.bluray_minor.bluray_micro])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl shared library version (.so version)
|
|
Packit |
5e46da |
dnl
|
|
Packit |
5e46da |
dnl - If there are no interface changes, increase revision.
|
|
Packit |
5e46da |
dnl - If interfaces have been added, increase current and age. Set revision to 0.
|
|
Packit |
5e46da |
dnl - If interfaces have been changed or removed, increase current and set age and revision to 0.
|
|
Packit |
5e46da |
dnl
|
|
Packit |
5e46da |
dnl Library file name will be libbluray.so.(current-age).age.revision
|
|
Packit |
5e46da |
dnl
|
|
Packit |
5e46da |
m4_define([lt_current], 2)
|
|
Packit |
5e46da |
m4_define([lt_revision], 2)
|
|
Packit |
5e46da |
m4_define([lt_age], 0)
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl initilization
|
|
Packit |
5e46da |
AC_INIT([libbluray], bluray_version, [http://www.videolan.org/developers/libbluray.html])
|
|
Packit |
5e46da |
AC_CONFIG_AUX_DIR([build-aux])
|
|
Packit |
5e46da |
AC_CONFIG_MACRO_DIR([m4])
|
|
Packit |
5e46da |
AC_CANONICAL_HOST
|
|
Packit |
5e46da |
AM_INIT_AUTOMAKE([foreign tar-ustar dist-bzip2 no-dist-gzip subdir-objects])
|
|
Packit |
5e46da |
AC_CONFIG_HEADERS(config.h)
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl Enable silent rules only when available (automake 1.11 or later).
|
|
Packit |
5e46da |
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
case "${host_os}" in
|
|
Packit |
5e46da |
"")
|
|
Packit |
5e46da |
SYS=unknown
|
|
Packit |
5e46da |
;;
|
|
Packit |
5e46da |
*mingw32* | *cygwin* | *wince* | *mingwce*)
|
|
Packit |
5e46da |
case "${host_os}" in
|
|
Packit |
5e46da |
*wince* | *mingwce* | *mingw32ce*)
|
|
Packit |
5e46da |
SYS=mingwce
|
|
Packit |
5e46da |
;;
|
|
Packit |
5e46da |
*mingw32*)
|
|
Packit |
5e46da |
SYS=mingw32
|
|
Packit |
5e46da |
AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows XP SP2 APIs.])
|
|
Packit |
5e46da |
AC_DEFINE([_WIN32_IE], 0x0501, [Define to '0x0501' for IE 5.01.])
|
|
Packit |
5e46da |
CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
|
|
Packit |
5e46da |
;;
|
|
Packit |
5e46da |
esac
|
|
Packit |
5e46da |
;;
|
|
Packit |
5e46da |
*darwin*)
|
|
Packit |
5e46da |
SYS=darwin
|
|
Packit |
5e46da |
;;
|
|
Packit |
5e46da |
netbsd*)
|
|
Packit |
5e46da |
SYS=netbsd
|
|
Packit |
5e46da |
CFLAGS="${CFLAGS} -D_NETBSD_SOURCE"
|
|
Packit |
5e46da |
;;
|
|
Packit |
5e46da |
*)
|
|
Packit |
5e46da |
SYS="${host_os}"
|
|
Packit |
5e46da |
;;
|
|
Packit |
5e46da |
esac
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
|
|
Packit |
5e46da |
AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl messages
|
|
Packit |
5e46da |
library_not_found="Could not find required library!"
|
|
Packit |
5e46da |
function_not_found="Could not find required function!"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl configure options
|
|
Packit |
5e46da |
AC_ARG_VAR([JDK_HOME], [Path to the JDK])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_ENABLE([werror],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--enable-werror], [set warnings as errors via -Werror @<:@default=disabled@:>@])])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_ENABLE([extra-warnings],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--disable-extra-warnings], [set extra warnings @<:@default=enabled@:>@])])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_ENABLE([optimizations],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--disable-optimizations], [disable optimizations @<:@default=enabled@:>@])])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_ENABLE([examples],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--enable-examples],
|
|
Packit |
5e46da |
[build examples (default is yes)])],
|
|
Packit |
5e46da |
[use_examples=$enableval],
|
|
Packit |
5e46da |
[use_examples=yes])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_ENABLE([bdjava-jar],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--disable-bdjava-jar],
|
|
Packit |
5e46da |
[disable building of BD-Java JAR file @<:@default=enabled@:>@])],
|
|
Packit |
5e46da |
[use_bdjava_jar=$enableval],
|
|
Packit |
5e46da |
[use_bdjava_jar=yes])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_WITH([libxml2],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--without-libxml2], [build without libxml2 support @<:@default=with@:>@])])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_WITH([freetype],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--without-freetype], [build without freetype support @<:@default=with@:>@])])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_WITH([fontconfig],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--without-fontconfig], [build without fontconfig support @<:@default=with@:>@])])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_WITH([bdj-type],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--with-bdj-type=TYPE],
|
|
Packit |
5e46da |
[Specify the type of BD-J implementation (j2se, j2me). Default is j2se.])],
|
|
Packit |
5e46da |
[BDJ_TYPE=$withval],
|
|
Packit |
5e46da |
[BDJ_TYPE=j2se])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_ARG_WITH([bdj-bootclasspath],
|
|
Packit |
5e46da |
[AS_HELP_STRING([--with-bdj-bootclasspath=PATH],
|
|
Packit |
5e46da |
[Specify BD-J build-time bootclass path (example /opt/PhoneME/lib/btclasses.zip;/opt/PhoneME/lib/xmlparer.jar). Default is empty.])],
|
|
Packit |
5e46da |
[BDJ_BOOTCLASSPATH=$withval],
|
|
Packit |
5e46da |
[BDJ_BOOTCLASSPATH=])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl required programs
|
|
Packit |
5e46da |
AC_PROG_CC
|
|
Packit |
5e46da |
AM_PROG_CC_C_O
|
|
Packit |
5e46da |
AC_PROG_LIBTOOL
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl required types
|
|
Packit |
5e46da |
AC_TYPE_SIGNAL
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl required headers
|
|
Packit |
5e46da |
AC_CHECK_HEADERS([stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h])
|
|
Packit |
5e46da |
AC_CHECK_HEADERS([stdlib.h mntent.h linux/cdrom.h inttypes.h strings.h])
|
|
Packit |
5e46da |
AC_CHECK_HEADERS([sys/time.h time.h mntent.h])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl required structures
|
|
Packit |
5e46da |
AC_STRUCT_DIRENT_D_TYPE
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl required system services
|
|
Packit |
5e46da |
AC_SYS_LARGEFILE
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl required functions
|
|
Packit |
5e46da |
AC_CHECK_FUNC([snprintf],, [AC_MSG_ERROR($function_not_found)])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl required libraries
|
|
Packit |
5e46da |
dnl pthreads (not on win32)
|
|
Packit |
5e46da |
AS_IF([test "${SYS}" != "mingw32"], [
|
|
Packit |
5e46da |
AC_CHECK_HEADERS([pthread.h], ,
|
|
Packit |
5e46da |
[AC_MSG_ERROR([pthread required])])
|
|
Packit |
5e46da |
AC_SEARCH_LIBS([pthread_create], [pthread], ,
|
|
Packit |
5e46da |
[AC_MSG_ERROR([pthread required])])
|
|
Packit |
5e46da |
AC_SEARCH_LIBS([dlopen], [dl])
|
|
Packit |
5e46da |
DLOPEN_LIBS="$ac_cv_search_dlopen"
|
|
Packit |
5e46da |
AS_CASE([$DLOPEN_LIBS],
|
|
Packit |
5e46da |
[no|none\ required], [DLOPEN_LIBS=""])
|
|
Packit |
5e46da |
AC_SUBST([DLOPEN_LIBS])
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl libxml2 for metadata parser
|
|
Packit |
5e46da |
AS_IF([test "x$with_libxml2" != "xno"], [
|
|
Packit |
5e46da |
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6],
|
|
Packit |
5e46da |
[with_libxml2=yes; AC_DEFINE([HAVE_LIBXML2], [1],
|
|
Packit |
5e46da |
[Define to 1 if libxml2 is to be used for metadata parsing])])
|
|
Packit |
5e46da |
PACKAGES="$PACKAGES libxml-2.0"
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl FreeType2
|
|
Packit |
5e46da |
AS_IF([test "x$with_freetype" != "xno"], [
|
|
Packit |
5e46da |
PKG_CHECK_MODULES([FT2], [freetype2],
|
|
Packit |
5e46da |
[with_freetype=yes; AC_DEFINE([HAVE_FT2], 1, [Define this if you have FreeType2 library])])
|
|
Packit |
5e46da |
PACKAGES="$PACKAGES freetype2"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl fontconfig support
|
|
Packit |
5e46da |
AS_IF([test "${SYS}" != "mingw32"], [
|
|
Packit |
5e46da |
AS_IF([test "x$with_fontconfig" != "xno"], [
|
|
Packit |
5e46da |
PKG_CHECK_MODULES([FONTCONFIG], [fontconfig],
|
|
Packit |
5e46da |
[with_fontconfig=yes; AC_DEFINE([HAVE_FONTCONFIG], 1, [Define this if you have fontconfig library])])
|
|
Packit |
5e46da |
PACKAGES="$PACKAGES fontconfig"
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
],[
|
|
Packit |
5e46da |
FONTCONFIG_LIBS="-lgdi32"
|
|
Packit |
5e46da |
AC_SUBST([FONTCONFIG_LIBS])
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
CC_CHECK_CFLAGS_APPEND([-Wall -Wdisabled-optimization -Wpointer-arith ]dnl
|
|
Packit |
5e46da |
[-Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef ]dnl
|
|
Packit |
5e46da |
[-Wmissing-prototypes -Wshadow])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
CC_CHECK_CFLAGS_APPEND([-Werror=implicit-function-declaration ]dnl
|
|
Packit |
5e46da |
[-Werror-implicit-function-declaration],
|
|
Packit |
5e46da |
[break;])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
CC_CHECK_WERROR
|
|
Packit |
5e46da |
AS_IF([test "x$enable_werror" = "xyes"], [
|
|
Packit |
5e46da |
CFLAGS="${CFLAGS} $cc_cv_werror"
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AS_IF([test "x$enable_extra_warnings" != "xno"], [
|
|
Packit |
5e46da |
CC_CHECK_CFLAGS_APPEND([-Wextra -Winline])
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AS_IF([test "x$enable_optimizations" != "xno"], [
|
|
Packit |
5e46da |
CC_CHECK_CFLAGS_APPEND([-O3 -fomit-frame-pointer])
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl use examples
|
|
Packit |
5e46da |
AM_CONDITIONAL([USING_EXAMPLES], [ test $use_examples = "yes" ])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl use bdjava
|
|
Packit |
5e46da |
case $host_cpu in
|
|
Packit |
5e46da |
x86_64) java_arch=amd64 ;;
|
|
Packit |
5e46da |
i?86) java_arch=i386 ;;
|
|
Packit |
5e46da |
arm*) java_arch=arm ;;
|
|
Packit |
5e46da |
*) java_arch=$host_cpu ;;
|
|
Packit |
5e46da |
esac
|
|
Packit |
5e46da |
case $host_os in
|
|
Packit |
5e46da |
linux*) java_os=linux ;;
|
|
Packit |
5e46da |
win*) java_os=win32 ;;
|
|
Packit |
5e46da |
mingw*) java_os=win32 ;;
|
|
Packit |
5e46da |
freebsd*) java_os=freebsd ;;
|
|
Packit |
5e46da |
solaris*) java_os=solaris ;;
|
|
Packit |
5e46da |
darwin*) java_os=darwin ;;
|
|
Packit |
5e46da |
*) java_os=$host_os ;;
|
|
Packit |
5e46da |
esac
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AS_IF([test "x${JDK_HOME}" != "x"], [
|
|
Packit |
5e46da |
BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
temp_CPPFLAGS="$CPPFLAGS"
|
|
Packit |
5e46da |
CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS"
|
|
Packit |
5e46da |
AC_CHECK_HEADERS([jni.h], [], [AC_MSG_ERROR(could not find jni.h)])
|
|
Packit |
5e46da |
CPPFLAGS="$temp_CPPFLAGS"
|
|
Packit |
5e46da |
], [
|
|
Packit |
5e46da |
BDJAVA_CFLAGS='-I${abs_top_srcdir}/jni -I${abs_top_srcdir}/jni/'"${java_os}"
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_CHECK_PROG(HAVE_ANT, [ant], yes, no)
|
|
Packit |
5e46da |
if test "x$use_bdjava_jar" = "xyes" && test "x$HAVE_ANT" = "xno"; then
|
|
Packit |
5e46da |
AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Please install it.])
|
|
Packit |
5e46da |
fi
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
|
|
Packit |
5e46da |
AC_DEFINE_UNQUOTED([JDK_HOME], ["$JDK_HOME"], [""])
|
|
Packit |
5e46da |
AM_CONDITIONAL([USING_BDJAVA_BUILD_JAR], [ test $use_bdjava_jar = "yes" ])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl BD-J type
|
|
Packit |
5e46da |
if test "$BDJ_TYPE" = "j2me"; then
|
|
Packit |
5e46da |
AC_DEFINE([HAVE_BDJ_J2ME], [1], [Define to 1 if using libbluray J2ME stack])
|
|
Packit |
5e46da |
else
|
|
Packit |
5e46da |
BDJ_TYPE=j2se
|
|
Packit |
5e46da |
fi
|
|
Packit |
5e46da |
AC_SUBST(BDJ_TYPE)
|
|
Packit |
5e46da |
dnl bootclasspath
|
|
Packit |
5e46da |
AC_SUBST(BDJ_BOOTCLASSPATH)
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl udf support (using git submodule)
|
|
Packit |
5e46da |
if test ! -f "${srcdir}/contrib/libudfread/src/udfread.h"; then
|
|
Packit |
5e46da |
AC_MSG_ERROR("libudfread source tree not found")
|
|
Packit |
5e46da |
fi
|
|
Packit |
5e46da |
AC_CHECK_HEADERS([unistd.h fcntl.h])
|
|
Packit |
5e46da |
AS_IF([test "${SYS}" != "mingw32"], [
|
|
Packit |
5e46da |
AC_CHECK_FUNC([pread],, [AC_DEFINE([NEED_PREAD_IMPL], [1], [Define to 1 to use inefficient pread() replacement])])
|
|
Packit |
5e46da |
])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl generate documentation
|
|
Packit |
5e46da |
DX_INIT_DOXYGEN(libbluray, doc/doxygen-config, [doc/doxygen])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl export library version number
|
|
Packit |
5e46da |
BLURAY_VERSION_MAJOR=bluray_major()
|
|
Packit |
5e46da |
AC_SUBST(BLURAY_VERSION_MAJOR)
|
|
Packit |
5e46da |
BLURAY_VERSION_MINOR=bluray_minor()
|
|
Packit |
5e46da |
AC_SUBST(BLURAY_VERSION_MINOR)
|
|
Packit |
5e46da |
BLURAY_VERSION_MICRO=bluray_micro()
|
|
Packit |
5e46da |
AC_SUBST(BLURAY_VERSION_MICRO)
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl export library (.so) version
|
|
Packit |
5e46da |
LT_VERSION_INFO="lt_current():lt_revision():lt_age()"
|
|
Packit |
5e46da |
AC_SUBST(LT_VERSION_INFO)
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl generate output files
|
|
Packit |
5e46da |
AC_SUBST(BDJAVA_CFLAGS)
|
|
Packit |
5e46da |
AC_CONFIG_FILES([Makefile src/libbluray.pc src/libbluray/bluray-version.h])
|
|
Packit |
5e46da |
AC_OUTPUT
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
AC_SUBST([PACKAGES])
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
dnl ---------------------------------------------
|
|
Packit |
5e46da |
dnl Some infos:
|
|
Packit |
5e46da |
dnl ---------------------------------------------
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
echo " Summary:"
|
|
Packit |
5e46da |
echo " --------"
|
|
Packit |
5e46da |
echo " BD-J type: $BDJ_TYPE"
|
|
Packit |
5e46da |
echo " build JAR: $use_bdjava_jar"
|
|
Packit |
5e46da |
if test x"$BDJ_BOOTCLASSPATH" != x""; then
|
|
Packit |
5e46da |
echo " BD-J bootclasspath: $BDJ_BOOTCLASSPATH"
|
|
Packit |
5e46da |
fi
|
|
Packit |
5e46da |
echo " Font support (freetype2): $with_freetype"
|
|
Packit |
5e46da |
if [[ $with_freetype = "yes" ]]; then
|
|
Packit |
5e46da |
if test "${SYS}" != "mingw32"; then
|
|
Packit |
5e46da |
echo " Use system fonts (fontconfig): $with_fontconfig"
|
|
Packit |
5e46da |
else
|
|
Packit |
5e46da |
echo " Use system fonts: yes"
|
|
Packit |
5e46da |
fi
|
|
Packit |
5e46da |
fi
|
|
Packit |
5e46da |
echo " Metadata support (libxml2): $with_libxml2"
|
|
Packit |
5e46da |
echo " Build examples: $use_examples"
|
|
Packit |
5e46da |
|