2008-03-03 08:22:58 +01:00
|
|
|
AC_PREREQ(2.57)
|
|
|
|
|
|
|
|
######################
|
|
|
|
# aegisub version info
|
|
|
|
######################
|
|
|
|
m4_define([aegisub_major_version], [2])
|
|
|
|
m4_define([aegisub_minor_version], [1])
|
|
|
|
m4_define([aegisub_version], [aegisub_major_version.aegisub_minor_version-dev])
|
|
|
|
|
|
|
|
|
|
|
|
###################
|
|
|
|
# Required packages
|
|
|
|
###################
|
2008-03-03 08:54:19 +01:00
|
|
|
m4_define([ffmpeg_required_version], [1])
|
|
|
|
m4_define([portaudio_required_version], [1])
|
|
|
|
m4_define([pulseaudio_required_version], [1])
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
m4_define([pkgconfig_required_version], [0.20])
|
|
|
|
m4_define([libass_required_version], [0.9.1])
|
|
|
|
m4_define([freetype_required_version], [9.7.0])
|
|
|
|
m4_define([fontconfig_required_version], [2.4])
|
|
|
|
m4_define([perl_required_version], [5.004])
|
|
|
|
m4_define([ruby_required_version], [1.8])
|
|
|
|
m4_define([lua_auto4_required_version], [5.1])
|
|
|
|
m4_define([lua_auto3_required_version], [5.0])
|
|
|
|
|
|
|
|
|
|
|
|
#######
|
|
|
|
# Setup
|
|
|
|
#######
|
|
|
|
AC_INIT([Aegisub], [aegisub_version],, [aegisub])
|
|
|
|
AC_CONFIG_SRCDIR([aegisub/main.cpp])
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AC_CONFIG_HEADER([aegisub/posix/acconf.h])
|
|
|
|
AC_GNU_SOURCE
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
|
|
|
|
|
|
|
########################
|
|
|
|
# Configurable variables
|
|
|
|
########################
|
|
|
|
aegisubdatadir="$datadir/aegisub/2.1"
|
|
|
|
AC_SUBST(aegisubdatadir)
|
|
|
|
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Check for programs
|
|
|
|
####################
|
|
|
|
CHECK_GNU_MAKE
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_LANG(C++)
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
PKG_PROG_PKG_CONFIG([0.20])
|
|
|
|
|
|
|
|
|
2008-03-04 17:59:01 +01:00
|
|
|
#################
|
|
|
|
# Developers only
|
|
|
|
#################
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
|
|
|
AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable debug (default: -g)])
|
|
|
|
if test -z "$DEBUG_FLAGS"; then
|
|
|
|
DEBUG_FLAGS="-g";
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to turn on debugging])
|
|
|
|
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging (default=no)])
|
|
|
|
if test "$enable_debug" = "yes"; then
|
|
|
|
AC_MSG_RESULT([yes ($DEBUG_FLAGS)])
|
|
|
|
CPPFLAGS="$DEBUG_FLAGS $CPPFLAGS"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
2008-03-06 02:16:07 +01:00
|
|
|
AC_ARG_ENABLE(build-dist)
|
|
|
|
if test "$enable_build_dist" = "yes"; then
|
|
|
|
SVN_VERSION=`svnversion .`
|
|
|
|
PACKAGE_STRING="${PACKAGE_STRING}-r$SVN_VERSION"
|
|
|
|
PACKAGE_VERSION="${PACKAGE_VERSION}-r$SVN_VERSION"
|
|
|
|
VERSION="${VERSION}-r$SVN_VERSION"
|
|
|
|
fi
|
2008-03-04 17:59:01 +01:00
|
|
|
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
###################################################
|
|
|
|
# Check for pthreads and setup variables / compiler
|
|
|
|
###################################################
|
|
|
|
ACX_PTHREAD([], [AC_MSG_FAILURE([aegisub requires pthreads])])
|
|
|
|
#LIBS="$PTHREAD_LIBS $LIBS";
|
|
|
|
#CFLAGS="$CFLAGS $PTHREAD_CFLAGS";
|
|
|
|
CC="$PTHREAD_CC";
|
|
|
|
|
|
|
|
|
|
|
|
######################
|
|
|
|
# Check compiler flags
|
|
|
|
######################
|
|
|
|
AC_C_FLAG([-Wall])
|
|
|
|
AC_C_FLAG([-O2])
|
|
|
|
AC_C_FLAG([-Wextra],[AC_C_FLAG([-W])])
|
|
|
|
AC_C_FLAG([-Wno-unused-parameter])
|
|
|
|
AC_C_FLAG([-std=gnu99])
|
|
|
|
AC_CXX_FLAG([-Wall])
|
|
|
|
AC_CXX_FLAG([-Wextra],[AC_CXX_FLAG([-W])])
|
|
|
|
AC_CXX_FLAG([-Wno-unused-parameter])
|
|
|
|
AC_CXX_FLAG([-Wno-long-long])
|
|
|
|
AC_CXX_FLAG([-O2])
|
|
|
|
AC_CXX_FLAG([-fpermissive])
|
|
|
|
AC_CXX_FLAG([-fno-strict-aliasing])
|
|
|
|
AC_CXX_FLAG([-std=c++98])
|
|
|
|
|
|
|
|
|
|
|
|
######################################
|
|
|
|
# Check Headers / Features / Libraries
|
|
|
|
######################################
|
|
|
|
AC_PATH_XTRA
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_VOLATILE
|
|
|
|
AC_CHECK_LIB([m], [main])
|
|
|
|
AC_LIBTOOL_DLOPEN_SELF
|
|
|
|
AC_MSG_CHECKING([[whether preprocessor supports #pragma once]])
|
|
|
|
AC_PREPROC_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#pragma once]])],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE([HAVE_PRAGMA_ONCE], [1], [Preprocessor support for #pragma once])
|
|
|
|
],
|
|
|
|
[AC_MSG_RESULT([no])])
|
|
|
|
|
2008-03-06 19:18:09 +01:00
|
|
|
AX_OPENMP([], [with_openmp="no"])
|
|
|
|
AM_CONDITIONAL([HAVE_OPENMP], [test "$with_openmp" != "no"])
|
|
|
|
AC_SUBST(OPENMP_CXXFLAGS)
|
2008-03-03 08:22:58 +01:00
|
|
|
|
|
|
|
|
2008-03-21 22:01:03 +01:00
|
|
|
|
|
|
|
##############################
|
|
|
|
# Program Support and Features
|
|
|
|
##############################
|
|
|
|
AC_CHECK_HEADER([wchar.h],,[AC_MSG_FAILURE([aegisub requires wide character support])])
|
|
|
|
|
|
|
|
AX_CHECK_GL
|
|
|
|
if test ! "$GL_LIBS"; then
|
|
|
|
AC_MSG_FAILURE([aegisub requires GL support.])
|
|
|
|
fi
|
|
|
|
AC_SUBST(GL_CFLAGS)
|
|
|
|
AC_SUBST(GL_LIBS)
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.7.0,
|
|
|
|
AC_DEFINE(WITH_FREETYPE2, 1, [Enable FreeType 2 support.]),
|
|
|
|
[AC_MSG_FAILURE([aegisub requires >= FreeType2 2.1.9])])
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.4,
|
|
|
|
AC_DEFINE(WITH_FONTCONFIG, 1, [Enable FontConfig support.]),
|
|
|
|
[AC_MSG_FAILURE([aegisub requires >= fontconfig >= 2.4])])
|
|
|
|
AC_SUBST(FONTCONFIG_CFLAGS)
|
|
|
|
AC_SUBST(FONTCONFIG_LIBS)
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
#################
|
|
|
|
# Audio Providers
|
|
|
|
#################
|
2008-03-13 04:25:29 +01:00
|
|
|
#######
|
|
|
|
## ALSA
|
|
|
|
#######
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_ARG_WITH(alsa, [ --without-alsa build without ALSA audio provider. (default: auto)], alsa_disabled="(disabled)")
|
|
|
|
if test "x$with_alsa" != xno; then
|
|
|
|
AC_CHECK_LIB([asound], [snd_pcm_open], [ALSA_LDFLAGS="-lasound"; found_audio=yes; with_alsa=yes], [with_alsa=no])
|
|
|
|
fi
|
2008-03-05 18:15:55 +01:00
|
|
|
if test "$with_alsa" = "yes"; then
|
2008-03-03 08:54:19 +01:00
|
|
|
AC_DEFINE(WITH_ALSA, 1, [Enable ALSA Support])
|
|
|
|
fi
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_SUBST(ALSA_LDFLAGS)
|
|
|
|
AM_CONDITIONAL([HAVE_ALSA], [test "$with_alsa" != "no"])
|
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
############
|
|
|
|
## PortAudio
|
|
|
|
############
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_ARG_WITH(portaudio,[ --without-portaudio build without PortAudio audio provider.
|
|
|
|
(default: auto)], portaudio_disabled="(disabled)")
|
|
|
|
|
2008-03-03 08:54:19 +01:00
|
|
|
if test "x$with_portaudio" != xno; then
|
|
|
|
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS"
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_CHECK_LIB([portaudio], [Pa_Initialize], [PORTAUDIO_LDFLAGS="-lportaudio"; found_audio=yes; with_portaudio=yes], [with_portaudio=no])
|
|
|
|
fi
|
2008-03-03 08:54:19 +01:00
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
if test "x$with_portaudio" != xno; then
|
|
|
|
AC_CHECK_LIB([portaudio], [Pa_GetStreamTime], [LIBS="-lportaudio"], [with_portaudio_getstreamtime=no])
|
|
|
|
if test "x$with_portaudio_getstreamtime" != xno; then
|
|
|
|
AC_DEFINE(HAVE_PA_GETSTREAMTIME, 1, [Define to 1 if Pa_GetStreamTime is available in PortAudio])
|
|
|
|
fi
|
|
|
|
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
|
2008-03-05 18:15:55 +01:00
|
|
|
if test "$with_portaudio" = "yes"; then
|
2008-03-03 08:54:19 +01:00
|
|
|
AC_DEFINE(WITH_PORTAUDIO, 1, [Enable PortAudio Audio Provider])
|
|
|
|
fi
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_SUBST(PORTAUDIO_LDFLAGS)
|
|
|
|
AM_CONDITIONAL([HAVE_PORTAUDIO], [test "$with_portaudio" != "no"])
|
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
#############
|
|
|
|
## PulseAudio
|
|
|
|
#############
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_ARG_WITH(pulseaudio,[ --without-pulseaudio build without PulseAudio audio provider.
|
|
|
|
(default: auto)], pulseaudio_disabled="(disabled)")
|
|
|
|
if test "x$with_pulseaudio" != xno; then
|
|
|
|
PKG_CHECK_MODULES(LIBPULSE, libpulse >= 0.5, [found_audio=yes; with_pulseaudio=yes], [with_pulseaudio=no])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "$with_pulseaudio" != "no"])
|
2008-03-05 18:15:55 +01:00
|
|
|
if test "$with_pulseaudio" = "yes"; then
|
2008-03-03 08:54:19 +01:00
|
|
|
AC_DEFINE(WITH_PULSEAUDIO, 1, [Enable PulseAudio support])
|
|
|
|
fi
|
2008-03-03 08:22:58 +01:00
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
#########
|
|
|
|
## OpenAL
|
|
|
|
#########
|
2008-03-11 08:24:10 +01:00
|
|
|
AC_ARG_WITH(openal,[ --without-openal build without OpenAL audio provider.
|
2008-03-04 01:59:02 +01:00
|
|
|
(default: auto)], openal_disabled="(disabled)")
|
|
|
|
if test "x$with_openal" != xno; then
|
2008-03-07 04:52:47 +01:00
|
|
|
PKG_CHECK_MODULES(OPENAL, openal >= 0.0.8, [found_audio=yes; with_openal=yes], [with_openal=no])
|
2008-03-04 01:59:02 +01:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_OPENAL], [test "$with_openal" != "no"])
|
2008-03-05 18:15:55 +01:00
|
|
|
if test "$with_openal" = "yes"; then
|
2008-03-04 01:59:02 +01:00
|
|
|
AC_DEFINE(WITH_OPENAL, 1, [Enable OpenAL support])
|
|
|
|
fi
|
|
|
|
|
2008-03-07 16:45:12 +01:00
|
|
|
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
|
|
|
|
#################
|
|
|
|
# Video Providers
|
|
|
|
#################
|
|
|
|
|
|
|
|
AC_ARG_WITH(ffmpeg, [ --without-ffmpeg build without FFMPEG video provider.. (default: auto)], ffmpeg_disabled="(disabled)")
|
|
|
|
|
2008-03-03 22:52:41 +01:00
|
|
|
if test "$with_ffmpeg" != "no"; then
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_CHECK_LIB([avcodec], [avcodec_init],AVCODEC_LDFLAGS="-lavcodec", [with_ffmpeg=no])
|
2008-03-04 02:02:13 +01:00
|
|
|
AC_CHECK_LIB([avformat], [av_read_frame],AVFORMAT_LDFLAGS="-lavformat", [with_ffmpeg=no])
|
2008-03-03 09:57:08 +01:00
|
|
|
AC_CHECK_LIB([avformat], [sws_scale],[with_swscale="yes"], [with_swscale="no"])
|
2008-03-03 08:22:58 +01:00
|
|
|
|
2008-03-03 09:57:08 +01:00
|
|
|
if test "$with_swscale" = "no"; then
|
|
|
|
AC_CHECK_LIB([swscale], [sws_scale],[SWSCALE_LDFLAGS="-lswscale"; with_swscale_lib="yes"], [with_swscale_lib="no"])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$with_swscale" = "yes" || test "$with_swscale_lib" = "yes"; then
|
|
|
|
with_ffmpeg="yes";
|
|
|
|
else
|
|
|
|
with_ffmpeg="no";
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$with_ffmpeg" = "yes"; then
|
2008-03-03 08:22:58 +01:00
|
|
|
found_video_provider=yes
|
|
|
|
with_ffmpeg="yes"
|
2008-03-03 08:54:19 +01:00
|
|
|
AC_DEFINE(WITH_FFMPEG, 1, [Enable FFMPEG Video Provider])
|
2008-03-03 08:22:58 +01:00
|
|
|
fi
|
|
|
|
fi
|
2008-03-03 09:57:08 +01:00
|
|
|
|
2008-03-09 08:38:49 +01:00
|
|
|
|
2008-03-03 09:57:08 +01:00
|
|
|
AC_SUBST(SWSCALE_LDFLAGS)
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_SUBST(AVCODEC_LDFLAGS)
|
|
|
|
AC_SUBST(AVFORMAT_LDFLAGS)
|
|
|
|
AM_CONDITIONAL([HAVE_FFMPEG], [test "$with_ffmpeg" != "no"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###################
|
|
|
|
# Subtitle Provider
|
|
|
|
###################
|
2008-03-13 04:25:29 +01:00
|
|
|
|
2008-03-21 22:01:03 +01:00
|
|
|
AC_ARG_WITH(libass, [ --without-libass disable libass (default=enable)],libass_disabled="(disabled)")
|
|
|
|
AC_ARG_ENABLE(libass, [ --disable-libass disable internal libass support (default=enabled)],libass_internal_disabled="(disabled)")
|
2008-03-03 08:22:58 +01:00
|
|
|
|
2008-03-21 22:01:03 +01:00
|
|
|
AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv (default: CPPFLAGS)])
|
2008-03-22 08:37:38 +01:00
|
|
|
AC_ARG_VAR([ICONV_LDFLAGS], [LDFLAGS to use for iconv (default: LDFLAGS -liconv)])
|
2008-03-22 08:33:57 +01:00
|
|
|
|
|
|
|
if test -z "ICONV_LDFLAGS"; then
|
|
|
|
ICONV_LDFLAGS="-liconv";
|
|
|
|
fi
|
2008-03-03 08:22:58 +01:00
|
|
|
|
2008-03-21 22:01:03 +01:00
|
|
|
if test "$with_libass" != "no"; then
|
2008-03-22 08:33:57 +01:00
|
|
|
|
|
|
|
if test "$enable_libass" != "no"; then
|
|
|
|
AC_CHECK_HEADER(iconv.h, [ICONV_CFLAGS="$ICONV_CFLAGS"; with_iconv="yes"], with_iconv="no")
|
2008-03-22 08:37:38 +01:00
|
|
|
aegisub_save_LDFLAGS="$LDFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $ICONV_LDFLAGS"
|
2008-03-22 08:33:57 +01:00
|
|
|
AC_CHECK_LIB([iconv], [iconv_open],[ICONV_LDFLAGS="$ICONV_LIBS"; with_iconv="yes"], with_iconv="no")
|
2008-03-22 08:37:38 +01:00
|
|
|
LDFLAGS="$aegisub_save_LDFLAGS"
|
2008-03-22 08:33:57 +01:00
|
|
|
|
|
|
|
if test "$with_iconv" = "yes"; then
|
|
|
|
LIBASS_LIBS="-L../libass -lass_aegisub"
|
|
|
|
LIBASS_CFLAGS="-I../libass"
|
|
|
|
with_internal_libass="yes"
|
|
|
|
else
|
|
|
|
with_internal_libass="no"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$with_internal_libass" != "yes"; then
|
2008-03-21 22:01:03 +01:00
|
|
|
PKG_CHECK_MODULES(LIBASS, libass >= 0.9.1)
|
|
|
|
|
|
|
|
aegisub_save_LDFLAGS="$LDFLAGS"
|
|
|
|
LDFLAGS="$LIBASS_LIBS"
|
|
|
|
AC_CHECK_LIB([ass], [ass_read_styles],[LIBASS_LIBS="$LIBASS_LIBS"; with_libass="yes"], with_libass=no)
|
|
|
|
LDFLAGS="$aegisub_save_LDFLAGS"
|
|
|
|
|
|
|
|
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$LIBASS_CFLAGS"
|
|
|
|
AC_CHECK_HEADER([ass/ass.h], [LIBASS_CFLAGS="$LIBASS_CFLAGS"; with_libass="yes"], with_libass="no")
|
|
|
|
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
|
|
|
with_internal_libass="no"
|
|
|
|
else
|
2008-03-22 08:33:57 +01:00
|
|
|
with_libass="no"
|
2008-03-21 22:01:03 +01:00
|
|
|
fi
|
2008-03-22 08:33:57 +01:00
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
fi
|
|
|
|
|
2008-03-22 08:33:57 +01:00
|
|
|
if test "$with_libass" = "yes" || test "$with_internal_libass" = "yes"; then
|
2008-03-03 08:54:19 +01:00
|
|
|
AC_DEFINE(WITH_LIBASS, 1, [Enable libass Subtitle Provider])
|
2008-03-03 08:22:58 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(LIBASS_LIBS)
|
|
|
|
AC_SUBST(LIBASS_CFLAGS)
|
2008-03-21 22:01:03 +01:00
|
|
|
AM_CONDITIONAL([WITH_INTERNAL_LIBASS], [test "$with_libass" != "no" ])
|
2008-03-03 08:22:58 +01:00
|
|
|
AM_CONDITIONAL([HAVE_LIBASS], [test "$with_libass" != "no" ])
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-03 10:09:34 +01:00
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
###########
|
|
|
|
## Hunspell
|
|
|
|
###########
|
2008-03-07 17:38:55 +01:00
|
|
|
AC_ARG_WITH(hunspell, [ --without-hunspell build without hunspell support (default: auto)], hunspell_disabled="(disabled)")
|
|
|
|
if test "x$with_hunspell" != xno; then
|
|
|
|
PKG_CHECK_MODULES(HUNSPELL, hunspell <= 1.1.10, [with_old_hunspell=yes], [with_old_hunspell=no])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_HUNSPELL], [test "$with_old_hunspell" != "no"])
|
|
|
|
if test "$with_old_hunspell" = "yes"; then
|
|
|
|
AC_DEFINE(WITH_OLD_HUNSPELL, 1, [Enable Older Hunspell support.])
|
|
|
|
HUNSPELL_CFLAGS="$HUNSPELL_CFLAGS -DWITH_OLD_HUNSPELL"
|
2008-03-08 21:47:36 +01:00
|
|
|
with_hunspell="yes (old hunspell)"
|
|
|
|
else
|
|
|
|
with_hunspell="no"
|
2008-03-03 08:54:19 +01:00
|
|
|
fi
|
2008-03-03 08:22:58 +01:00
|
|
|
|
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
######################
|
|
|
|
## universalchardetect
|
|
|
|
######################
|
2008-03-20 23:24:28 +01:00
|
|
|
AC_ARG_ENABLE(univchardet, [ --disable-univchardet diable universalchardet support.], univchardet_disabled="(disabled)")
|
|
|
|
if test "$enable_univchardet" != "no"; then
|
2008-03-05 19:52:09 +01:00
|
|
|
with_univchardet="yes"
|
|
|
|
AC_DEFINE(WITH_UNIVCHARDET, 1, [Enable universalchardet support])
|
|
|
|
else
|
|
|
|
with_univchardet="no"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_UNIVCHARDET], [test "$with_univchardet" != "no"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
############
|
|
|
|
# Automation
|
|
|
|
############
|
2008-03-13 04:25:29 +01:00
|
|
|
|
|
|
|
############
|
|
|
|
## Auto4 LUA
|
|
|
|
############
|
2008-03-20 22:24:01 +01:00
|
|
|
|
|
|
|
AC_ARG_VAR([LUA_CFLAGS], [CFLAGS to use for LUA 5.1 (default: CPPFLAGS)])
|
|
|
|
AC_ARG_VAR([LUA_LDFLAGS], [LDFLAGS to use for LUA 5.1 (default: -llua)])
|
|
|
|
if test -z "$LUA_LDFLAGS"; then
|
|
|
|
LUA_LDFLAGS="-llua";
|
|
|
|
fi
|
2008-03-13 08:35:39 +01:00
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_ARG_WITH(lua,
|
2008-03-13 08:16:53 +01:00
|
|
|
[ --without-lua build without lua 5.1 (auto4)], [lua_disabled="(disabled)"])
|
2008-03-03 08:22:58 +01:00
|
|
|
|
2008-03-03 22:52:41 +01:00
|
|
|
if test "$with_lua" != no; then
|
2008-03-03 08:22:58 +01:00
|
|
|
|
|
|
|
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
2008-03-20 22:24:01 +01:00
|
|
|
aegisub_save_LDFLAGS="$LDFLAGS"
|
|
|
|
|
|
|
|
CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $LUA_LDFLAGS"
|
|
|
|
|
|
|
|
AC_CACHE_CHECK(
|
|
|
|
[whether LUA 5.1 works], [with_lua],
|
|
|
|
[AC_COMPILE_IFELSE([
|
|
|
|
extern "C" {
|
|
|
|
#include <lua.h>
|
|
|
|
#include <lauxlib.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
int main () {
|
|
|
|
lua_State *L = luaL_newstate();
|
|
|
|
lua_pushstring(L, "test");
|
|
|
|
int res = lua_objlen(L, -1) == 4;
|
|
|
|
lua_close(L);
|
|
|
|
return !res;
|
|
|
|
}],
|
|
|
|
[with_lua="yes"],
|
|
|
|
[with_lua="no"])
|
|
|
|
])
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
2008-03-20 22:24:01 +01:00
|
|
|
LDFLAGS="$aegisub_save_LDFLAGS"
|
2008-03-03 08:22:58 +01:00
|
|
|
fi
|
|
|
|
|
2008-03-20 22:24:01 +01:00
|
|
|
if test "$with_lua" != "no"; then
|
2008-03-03 08:22:58 +01:00
|
|
|
with_auto4="yes"
|
2008-03-05 05:09:04 +01:00
|
|
|
with_automation="yes"
|
|
|
|
AC_DEFINE(WITH_AUTO4_LUA, 1, [Enable Automation (auto4), requires lua])
|
2008-03-03 08:22:58 +01:00
|
|
|
else
|
|
|
|
with_auto4="no"
|
2008-03-20 22:24:01 +01:00
|
|
|
LUA_CFLAGS=""
|
|
|
|
LUA_LDFLAGS=""
|
2008-03-03 08:22:58 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_AUTO4_LUA], [test "$with_auto4" != "no"])
|
2008-03-20 22:24:01 +01:00
|
|
|
AC_SUBST(LUA50_CFLAGS)
|
|
|
|
AC_SUBST(LUA50_LDFLAGS)
|
2008-03-03 08:22:58 +01:00
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
|
|
|
|
##################
|
|
|
|
## Auto3 (LUA 5.0)
|
|
|
|
##################
|
2008-03-20 22:24:01 +01:00
|
|
|
|
|
|
|
AC_ARG_VAR([LUA50_CFLAGS], [CFLAGS to use for LUA 5.0 (default: CPPFLAGS)])
|
|
|
|
AC_ARG_VAR([LUA50_LDFLAGS], [LDFLAGS to use for LUA 5.1 (default: -llua -llualib)])
|
|
|
|
if test -z "$LUA50_LDFLAGS"; then
|
|
|
|
LUA50_LDFLAGS="-llua -llualib";
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_WITH(lua50,
|
|
|
|
[ --without-lua50 build without lua 5.0 (auto3)], [lua_disabled="(disabled)"])
|
|
|
|
|
|
|
|
if test "$with_lua50" != no; then
|
2008-03-13 04:25:29 +01:00
|
|
|
|
|
|
|
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
2008-03-20 22:24:01 +01:00
|
|
|
aegisub_save_LDFLAGS="$LDFLAGS"
|
|
|
|
|
|
|
|
CPPFLAGS="$CPPFLAGS $LUA50_CFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $LUA50_LDFLAGS"
|
|
|
|
|
|
|
|
AC_CACHE_CHECK(
|
|
|
|
[whether LUA 5.0 works], [with_lua50],
|
|
|
|
[AC_COMPILE_IFELSE([
|
|
|
|
extern "C" {
|
|
|
|
#include "lua.h"
|
|
|
|
#include "lauxlib.h"
|
|
|
|
}
|
|
|
|
#ifdef lua_open
|
|
|
|
#error This is not Lua 5.0
|
|
|
|
#endif
|
|
|
|
int main() {
|
|
|
|
lua_State *L = lua_open();
|
|
|
|
if (!L) return 1;
|
|
|
|
luaL_newmetatable(L, "test");
|
|
|
|
lua_close(L);
|
|
|
|
}],
|
|
|
|
[with_lua50="yes"],
|
|
|
|
[with_lua50="no"])
|
|
|
|
])
|
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
2008-03-20 22:24:01 +01:00
|
|
|
LDFLAGS="$aegisub_save_LDFLAGS"
|
2008-03-13 04:25:29 +01:00
|
|
|
fi
|
|
|
|
|
2008-03-20 22:24:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
if test "$with_lua50" != "no"; then
|
2008-03-13 04:25:29 +01:00
|
|
|
with_auto3="yes"
|
|
|
|
with_automation="yes"
|
|
|
|
AC_DEFINE(WITH_AUTO3, 1, [Enable Automation (auto3, DEPRECIATED!), requires lua 5.0])
|
|
|
|
else
|
|
|
|
with_auto3="no"
|
2008-03-20 22:24:01 +01:00
|
|
|
LUA50_CFLAGS=""
|
|
|
|
LUA50_LDFLAGS=""
|
2008-03-13 04:25:29 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_AUTO3_LUA], [test "$with_auto3" != "no"])
|
2008-03-20 22:24:01 +01:00
|
|
|
AC_SUBST(LUA50_CFLAGS)
|
2008-03-13 04:25:29 +01:00
|
|
|
AC_SUBST(LUA50_LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#############
|
|
|
|
## Auto4 PERL
|
|
|
|
#############
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_ARG_WITH(perl, [ --without-perl build without PERL Automation. (default: auto)], perl_disabled="(disabled)")
|
|
|
|
AC_ARG_WITH(perl-bin, [ --with-perl-bin=PATH location of PERL binary.. (default: $PATH)], [WITH_PERL_BIN="$withval"])
|
|
|
|
|
|
|
|
if test -z "$perl_disabled"; then
|
|
|
|
if test -z "$WITH_PERL_BIN"; then
|
|
|
|
AC_PATH_PROG([PERL_BIN],perl,no)
|
|
|
|
else
|
|
|
|
PERL_BIN="$WITH_PERL_BIN"
|
|
|
|
fi
|
|
|
|
|
2008-03-03 08:54:19 +01:00
|
|
|
# XXX: add a --with-perlconsole flag.
|
|
|
|
# AC_DEFINE(WITH_PERLCONSOLE, 1, [Enable PERL Console support (for debugging purposes)])
|
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
if test "$PERL_BIN" != "no"; then
|
|
|
|
AC_MSG_CHECKING([checking for perl version >= 5.004])
|
|
|
|
if $PERL_BIN -e 'require 5.004'; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
with_perl=yes
|
2008-03-05 05:09:04 +01:00
|
|
|
with_automation="yes"
|
2008-03-03 08:54:19 +01:00
|
|
|
AC_DEFINE(WITH_PERL, 1, [Enable PERL support.])
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_CHECKING([checking $PERL_BIN clfags])
|
|
|
|
PERL_CFLAGS=`$PERL_BIN -MExtUtils::Embed -eccflags -eperl_inc`
|
|
|
|
AC_MSG_RESULT([$PERL_CFLAGS])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([checking $PERL_BIN libs])
|
|
|
|
PERL_LDFLAGS=`$PERL_BIN -MExtUtils::Embed -eldopts`
|
|
|
|
AC_MSG_RESULT([$PERL_LDFLAGS])
|
|
|
|
|
|
|
|
else
|
2008-03-09 08:40:07 +01:00
|
|
|
AC_MSG_RESULT([no])
|
2008-03-03 08:22:58 +01:00
|
|
|
with_perl=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(PERL_CFLAGS)
|
|
|
|
AC_SUBST(PERL_LDFLAGS)
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_AUTO4_PERL], [test "$with_perl" != "no"])
|
|
|
|
|
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
|
|
|
|
#############
|
|
|
|
## Auto4 Ruby
|
|
|
|
#############
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_ARG_WITH(ruby, [ --without-ruby build without Ruby Automation. (default: auto)], ruby_disabled="(disabled)")
|
|
|
|
AC_ARG_WITH(ruby-bin, [ --with-ruby-bin=PATH location of RUBY binary.. (default: $PATH)], [WITH_RUBY_BIN="$withval"])
|
|
|
|
|
|
|
|
if test -z "$ruby_disabled"; then
|
|
|
|
if test -z "$WITH_RUBY_BIN"; then
|
|
|
|
AC_PATH_PROG([RUBY_BIN],ruby,no)
|
|
|
|
else
|
|
|
|
RUBY_BIN="$WITH_RUBY_BIN"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$RUBY_BIN" != "no"; then
|
|
|
|
AC_MSG_CHECKING([checking for ruby version >= 1.8])
|
|
|
|
if $RUBY_BIN -r rbconfig -e 'if Config::CONFIG@<:@"ruby_version"@:>@.to_f >= 1.8 then exit(0) else exit(1) end' ; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
with_ruby=yes
|
2008-03-05 05:09:04 +01:00
|
|
|
with_automation="yes"
|
2008-03-03 08:54:19 +01:00
|
|
|
AC_DEFINE(WITH_RUBY, 1, [Enable RUBY Automation.])
|
2008-03-03 08:22:58 +01:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([checking $RUBY_BIN -r rbconfig archdir, cflags])
|
|
|
|
RUBY_CFLAGS=`$RUBY_BIN -r rbconfig -e "printf(\"-I%s %s\", Config::CONFIG@<:@'archdir'@:>@, Config::CONFIG@<:@'CFLAGS'@:>@)"`
|
|
|
|
AC_MSG_RESULT([$RUBY_CFLAGS])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([checking $RUBY_BIN rbconfig libs])
|
2008-03-04 21:08:06 +01:00
|
|
|
RUBY_LDFLAGS=`$RUBY_BIN -r rbconfig -e "print Config::CONFIG@<:@'LIBRUBYARG'@:>@"`
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_RESULT([$RUBY_LDFLAGS])
|
|
|
|
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
with_ruby=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(RUBY_CFLAGS)
|
|
|
|
AC_SUBST(RUBY_LDFLAGS)
|
|
|
|
AM_CONDITIONAL([HAVE_AUTO4_RUBY], [test "$with_ruby" != "no"])
|
|
|
|
|
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
# Automation setup
|
2008-03-05 05:09:04 +01:00
|
|
|
if test "$with_automation" = "yes"; then
|
|
|
|
AC_DEFINE(WITH_AUTOMATION, 1, [Enable Automation support, requires any automation language.])
|
|
|
|
fi
|
2008-03-11 06:01:30 +01:00
|
|
|
AM_CONDITIONAL([HAVE_AUTOMATION], [test "$with_automation" = "yes"])
|
2008-03-03 08:22:58 +01:00
|
|
|
|
|
|
|
|
2008-03-13 04:25:29 +01:00
|
|
|
|
2008-03-03 08:22:58 +01:00
|
|
|
################
|
|
|
|
# Widget support
|
|
|
|
################
|
|
|
|
AM_OPTIONS_WXCONFIG
|
|
|
|
AM_PATH_WXCONFIG(2.8.1, [have_wxconfig=1], [have_wxconfig=0], [std,gl,stc])
|
|
|
|
|
|
|
|
if test "$have_wxconfig" != 1; then
|
|
|
|
AC_MSG_FAILURE([
|
|
|
|
wxWidgets detection failed, please set --with-wx* or add
|
|
|
|
the libraries to your LDFLAGS, CXX/CFLAGS.
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
|
|
|
aegisub_save_CPPLAGS="$CPPLAGS"
|
|
|
|
CPPFLAGS="$WX_CFLAGS"
|
|
|
|
|
2008-03-11 08:24:10 +01:00
|
|
|
AC_ARG_ENABLE(wx-opengl, [ --enable-wx-opengl Force wxwidgets OpenGL support. ])
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_CHECKING([wxWidgets OpenGL support])
|
2008-03-11 08:24:10 +01:00
|
|
|
if test "$enable_wx_opengl" != "yes"; then
|
|
|
|
AC_TRY_COMPILE([#include <wx/glcanvas.h>],
|
|
|
|
[wxGLCanvas *canvas;],
|
|
|
|
with_wxgl=yes, with_wxgl=no)
|
|
|
|
else
|
|
|
|
with_wxgl="yes"
|
|
|
|
fi
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_RESULT($with_wxgl)
|
|
|
|
if test "$with_wxgl" = "no"; then
|
|
|
|
AC_MSG_FAILURE([wxWidgets OpenGL support missing])
|
|
|
|
fi
|
|
|
|
|
2008-03-11 08:24:10 +01:00
|
|
|
AC_ARG_ENABLE(wx-styledtextctrl, [ --enable-wx-styledtextctrl
|
|
|
|
Force wxwidgets StyledTextCtrl support. ])
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_CHECKING([wxWidgets StyledTextCtrl support])
|
2008-03-11 08:24:10 +01:00
|
|
|
if test "$enable_wx_styledtextctrl" != "yes"; then
|
|
|
|
AC_TRY_COMPILE([#include <wx/stc/stc.h>],
|
|
|
|
[wxStyledTextCtrl *canvas;],
|
|
|
|
with_wxstc=yes, with_wxstc=no)
|
|
|
|
else
|
|
|
|
with_wxstc="yes"
|
|
|
|
fi
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_RESULT($with_wxstc)
|
|
|
|
|
|
|
|
if test "$with_wxstc" = "no"; then
|
|
|
|
AC_MSG_FAILURE([wxWidgets missing StyledTextCtrl])
|
|
|
|
fi
|
|
|
|
|
|
|
|
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
################################################
|
|
|
|
# Internationalisation support (keep this last!)
|
|
|
|
################################################
|
|
|
|
AC_PROG_INTLTOOL
|
|
|
|
AM_GLIB_GNU_GETTEXT
|
|
|
|
|
|
|
|
GETTEXT_PACKAGE=aegisub21
|
|
|
|
AC_SUBST(GETTEXT_PACKAGE)
|
|
|
|
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
|
|
|
[The prefix for our gettext translation domains.])
|
|
|
|
|
|
|
|
|
|
|
|
AC_OUTPUT([
|
2008-03-05 19:52:09 +01:00
|
|
|
Makefile
|
|
|
|
aegisub/Makefile
|
|
|
|
aegisub/bitmaps/Makefile
|
|
|
|
aegisub/posix/Makefile
|
|
|
|
universalchardet/Makefile
|
|
|
|
auto3/Makefile
|
2008-03-21 22:01:03 +01:00
|
|
|
libass/Makefile
|
2008-03-05 19:52:09 +01:00
|
|
|
automation/Makefile
|
|
|
|
po/Makefile.in
|
2008-03-05 21:20:23 +01:00
|
|
|
m4macros/Makefile
|
2008-03-03 08:22:58 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
if test -z "$found_audio"; then
|
|
|
|
AC_MSG_NOTICE([
|
|
|
|
|
|
|
|
***********************************************************************
|
|
|
|
* No supported audio player interface was found on your system.
|
|
|
|
* If you want audio support in Aegisub you need to install one of
|
|
|
|
* these libraries:
|
|
|
|
* - PulseAudio
|
|
|
|
* * http://pulseaudio.org/
|
|
|
|
* - ALSA (Linux only) (Currently broken)
|
|
|
|
* * http://www.alsa-project.org/
|
|
|
|
* - PortAudio (version 18 only, version 19 is not compatible)
|
|
|
|
* * http://www.portaudio.com/
|
|
|
|
***********************************************************************
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$found_video_provider"; then
|
|
|
|
AC_MSG_NOTICE([
|
|
|
|
|
|
|
|
***********************************************************************
|
|
|
|
* No supported video/audio reader interface was found on your system.
|
|
|
|
* You will not be able to open any video or audio files in Aegisub
|
|
|
|
* unless you install a supported video/audio provider.
|
|
|
|
* You will however still be able to open "dummy" video, ie. a blank,
|
|
|
|
* virtual video clip with subtitles overlaid.
|
|
|
|
* Currently we only support one video/audio provider on non-Windows
|
|
|
|
* systems:
|
|
|
|
* - FFmpeg (libavcodec + libavformat)
|
|
|
|
* * http://ffmpeg.mplayerhq.hu/
|
|
|
|
***********************************************************************
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
AC_MSG_RESULT([
|
|
|
|
Scripting Engines:
|
|
|
|
auto4 Perl: $with_perl $perl_disabled
|
2008-03-13 08:16:53 +01:00
|
|
|
auto3: $with_auto3 $lua50_disabled
|
2008-03-03 08:22:58 +01:00
|
|
|
auto4: $with_auto4 $lua_disabled
|
|
|
|
auto4 Ruby: $with_ruby $ruby_disabled
|
|
|
|
|
|
|
|
Audio Providers:
|
|
|
|
ALSA: $with_alsa $alsa_disabled
|
2008-03-04 01:59:02 +01:00
|
|
|
OpenAL: $with_openal $openal_disabled
|
2008-03-03 08:22:58 +01:00
|
|
|
PortAudio: $with_portaudio $portaudio_disabled
|
|
|
|
PulseAudio: $with_pulseaudio $pulseaudio_disabled
|
|
|
|
|
|
|
|
Video Providers
|
|
|
|
ffmpeg: $with_ffmpeg $ffmpeg_disabled
|
|
|
|
|
|
|
|
Subtitle Providers:
|
|
|
|
asa: $with_asa
|
2008-03-22 08:33:57 +01:00
|
|
|
libass (external): $with_libass $libass_disabled
|
|
|
|
libass (internal) $with_internal_libass (requires iconv, fontconfig) $libass_internal_disabled
|
2008-03-05 16:35:47 +01:00
|
|
|
Misc Packages:
|
|
|
|
hunspell: $with_hunspell $hunspell_disabled
|
2008-03-20 23:24:28 +01:00
|
|
|
universalchardet: $with_univchardet $univchardet_disabled
|
2008-03-03 08:22:58 +01:00
|
|
|
]);
|