2006-03-25 17:14:24 +01:00
|
|
|
AC_PREREQ(2.57)
|
2007-04-22 04:24:27 +02:00
|
|
|
AC_INIT([Aegisub], [2.00-alpha],, [aegisub])
|
|
|
|
AC_CONFIG_AUX_DIR([ac])
|
2007-01-03 22:51:09 +01:00
|
|
|
AC_CONFIG_SRCDIR([aegisub/main.cpp])
|
2006-03-25 17:14:24 +01:00
|
|
|
AM_INIT_AUTOMAKE
|
2006-12-29 00:49:16 +01:00
|
|
|
AC_CONFIG_HEADER([aegisub/posix/acconf.h])
|
2006-11-09 00:40:40 +01:00
|
|
|
AC_GNU_SOURCE
|
2007-07-05 17:11:22 +02:00
|
|
|
AM_GNU_GETTEXT([external])
|
|
|
|
AM_GNU_GETTEXT_VERSION([0.14.5])
|
2006-03-25 17:14:24 +01:00
|
|
|
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2007-06-08 02:29:20 +02:00
|
|
|
# --enable-lemming: make errors non-fatal. to be used for
|
|
|
|
# creating dist packages on boxes without X11. intentionally
|
|
|
|
# not appearing in --help :)
|
|
|
|
ignore_failure=""
|
|
|
|
AC_ARG_ENABLE([lemming], [], [ignore_failure="$enableval"])
|
|
|
|
AC_DEFUN([AC_MSG_XFAILURE], [{
|
|
|
|
if test "$ignore_failure" == "yes"
|
|
|
|
then AC_MSG_WARN([$1])
|
|
|
|
else AC_MSG_FAILURE([$1])
|
|
|
|
fi
|
|
|
|
}])
|
2006-03-25 17:14:24 +01:00
|
|
|
|
2007-04-24 02:52:49 +02:00
|
|
|
dnl Checks for programs.
|
|
|
|
CHECK_GNU_MAKE
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
2007-01-11 04:52:17 +01:00
|
|
|
AC_LANG(C++)
|
2007-05-07 18:44:26 +02:00
|
|
|
AC_PROG_LIBTOOL
|
2006-03-25 17:14:24 +01:00
|
|
|
|
2006-05-06 14:59:09 +02:00
|
|
|
AC_PATH_PROGS(CONVERT, [convert], [])
|
2007-04-24 00:34:52 +02:00
|
|
|
if test -z "$CONVERT"; then
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([Aegisub needs convert (from ImageMagick) to produce xpms from the supplied bitmaps/icons])
|
2007-04-24 00:34:52 +02:00
|
|
|
fi
|
|
|
|
|
2007-04-22 04:24:27 +02:00
|
|
|
ACX_PTHREAD([], [
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([Aegisub needs pthreads])
|
2007-04-22 04:24:27 +02:00
|
|
|
])
|
2007-04-24 02:52:49 +02:00
|
|
|
AC_MSG_CHECKING([whether pthreads works])
|
|
|
|
AC_COMPILE_IFELSE([
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
int main() { return 0; }
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
echo <<EOM
|
|
|
|
***********************************************************************
|
|
|
|
* Your pthreads installation seems to be broken.
|
|
|
|
* Apart from obviously being bad, this can cause strange detection
|
|
|
|
* errors as well.
|
|
|
|
* On some Linux distributions, this can be caused by having the package
|
|
|
|
* libpthread-dev installed. If you have this package, please uninstall
|
|
|
|
* it now.
|
|
|
|
***********************************************************************
|
|
|
|
EOM
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([You need a working pthreads installation.])
|
2007-04-24 02:52:49 +02:00
|
|
|
])
|
|
|
|
|
2006-03-25 17:14:24 +01:00
|
|
|
|
2007-06-21 22:41:17 +02:00
|
|
|
AC_CHECK_LIB([asound], [snd_pcm_open], [LIBS="-lasound $LIBS"; found_audio=yes], [with_alsa=no])
|
|
|
|
AC_CHECK_LIB([portaudio], [Pa_Initialize], [LIBS="-lportaudio $LIBS";found_audio=yes], [with_portaudio=no])
|
2007-04-22 02:23:21 +02:00
|
|
|
AC_CHECK_FUNCS([Pa_GetStreamTime])
|
2007-04-24 02:52:49 +02:00
|
|
|
PKG_CHECK_MODULES([LIBPULSE], libpulse >= 0.5, [found_audio=yes], [with_pulseaudio=no])
|
|
|
|
AC_CHECK_LIB([avcodec], [avcodec_init],, [with_ffmpeg=no])
|
|
|
|
AC_CHECK_LIB([avformat], [av_read_frame],, [with_ffmpeg=no])
|
2008-01-20 22:15:22 +01:00
|
|
|
AC_CHECK_LIB([swscale], [sws_scale],, [with_ffmpeg=no])
|
2007-04-24 02:52:49 +02:00
|
|
|
if test "$with_ffmpeg" != "no"; then
|
|
|
|
found_video_provider=yes
|
|
|
|
fi
|
2007-04-22 23:59:35 +02:00
|
|
|
AC_CHECK_LIB([hunspell], [main],, [with_hunspell=no])
|
2007-04-23 00:20:53 +02:00
|
|
|
AC_CHECK_LIB([ruby1.9], [ruby_init],, [with_ruby=no])
|
2007-04-22 02:23:21 +02:00
|
|
|
|
2008-01-24 18:20:47 +01:00
|
|
|
dnl Perl engine
|
|
|
|
AC_ARG_ENABLE([auto4-perl],
|
|
|
|
[AS_HELP_STRING([--enable-auto4-perl],[enable automation4 perl engine (under development)@<:@default=no@:>@])],,
|
|
|
|
[enable_auto4_perl=no])
|
|
|
|
if test "$enable_auto4_perl" != "no"; then
|
|
|
|
echo -n 'checking for perl version >= 5.004... '
|
|
|
|
if perl -e 'require 5.004'; then
|
|
|
|
enable_auto4_perl=yes
|
|
|
|
echo 'yes'
|
|
|
|
else
|
|
|
|
enable_auto4_perl=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2006-03-26 03:38:10 +02:00
|
|
|
AC_CHECK_HEADER([wchar.h],,[
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([aegisub needs wide character support, find a wchar.h])
|
2006-03-25 17:14:24 +01:00
|
|
|
])
|
2006-03-26 05:06:23 +02:00
|
|
|
PKG_CHECK_MODULES([FREETYPE], freetype2 >= 9.7.0,, [
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([aegisub needs FreeType2 2.1.9, go install it])
|
2006-03-25 17:14:24 +01:00
|
|
|
])
|
|
|
|
|
2007-04-22 04:24:27 +02:00
|
|
|
AX_CHECK_GL
|
|
|
|
if test ! "$GL_LIBS"; then
|
2007-04-24 00:34:52 +02:00
|
|
|
AC_MSG_WARN([Could not find system GL library])
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([GL support is required to build Aegisub. (Try mesa3d)])
|
2007-04-22 04:24:27 +02:00
|
|
|
fi
|
|
|
|
CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
|
|
|
|
LIBS="$LIBS $GL_LIBS"
|
2007-01-30 22:33:52 +01:00
|
|
|
|
2007-07-08 22:55:10 +02:00
|
|
|
AM_OPTIONS_WXCONFIG
|
|
|
|
AM_PATH_WXCONFIG(2.8.1, [has_wxconfig=1], [has_wxconfig=0], [std,gl,stc])
|
|
|
|
if test "$has_wxconfig" != 1; then
|
|
|
|
echo <<EOM
|
|
|
|
wxWidgets must be installed on your system
|
|
|
|
but wx-config script couldn't be found.
|
|
|
|
|
|
|
|
Please check that wx-config is in path, the directory
|
|
|
|
where wxWidgets libraries are installed (returned by
|
|
|
|
'wx-config --libs' command) is in LD_LIBRARY_PATH or
|
|
|
|
equivalent variable and wxWidgets version is 2.8.1 or above.
|
|
|
|
|
|
|
|
Also, make sure you have the STC (StyledTextCtrl) module
|
|
|
|
installed. It is shipped with wxWidgets under the contrib
|
|
|
|
directory, but not built by default.
|
|
|
|
EOM
|
2007-07-10 23:29:49 +02:00
|
|
|
AC_MSG_XFAILURE([wxWidgets detection failed.])
|
2006-03-25 17:14:24 +01:00
|
|
|
fi
|
|
|
|
|
2007-07-08 22:55:10 +02:00
|
|
|
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS $FREETYPE_CFLAGS $LIBPULSE_CFLAGS"
|
|
|
|
LIBS="$LIBS $WX_LIBS $FREETYPE_LIBS $LIBPULSE_LIBS"
|
2007-01-30 22:33:52 +01:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([wxWidgets OpenGL support])
|
|
|
|
AC_LINK_IFELSE([
|
|
|
|
#include <wx/glcanvas.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
wxGLCanvas *canvas;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT([not available])
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([wxWidgets OpenGL support missing])
|
2007-01-30 22:33:52 +01:00
|
|
|
])
|
2006-03-25 17:14:24 +01:00
|
|
|
|
2007-04-22 02:23:21 +02:00
|
|
|
AC_MSG_CHECKING([wxWidgets StyledTextCtrl support])
|
|
|
|
AC_LINK_IFELSE([
|
|
|
|
#include <wx/stc/stc.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
wxStyledTextCtrl *canvas;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT([not available])
|
2007-06-08 02:29:20 +02:00
|
|
|
AC_MSG_XFAILURE([wxWidgets missing StyledTextCtrl])
|
2007-01-11 04:52:17 +01:00
|
|
|
])
|
|
|
|
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_CHECK_LIB([m], [main])
|
|
|
|
AC_CHECK_LIB([dl], [dlopen])
|
|
|
|
|
2007-04-04 21:40:06 +02:00
|
|
|
AC_ARG_WITH([libass], [AS_HELP_STRING([--without-libass],[disable libass @<:@default=check@:>@])],[],[with_libass=check])
|
|
|
|
|
|
|
|
AS_IF([test "x$with_libass" != xno], [
|
|
|
|
PKG_CHECK_MODULES([LIBASS], libass >= 0.9.1, [
|
|
|
|
CPPFLAGS="$CPPFLAGS $LIBASS_CFLAGS"
|
|
|
|
LIBS="$LIBS $LIBASS_LIBS"
|
|
|
|
AC_DEFINE(HAVE_LIBASS, 1, [found libass via pkg-config])
|
|
|
|
AC_CHECK_HEADERS([ass/ass.h], [
|
|
|
|
with_libass=yes
|
|
|
|
], [ if test "x$with_libass" != xcheck
|
2007-06-08 02:29:20 +02:00
|
|
|
then AC_MSG_XFAILURE([--with-libass given, but libass headers not found])
|
2007-04-04 21:40:06 +02:00
|
|
|
fi
|
|
|
|
with_libass=no
|
|
|
|
])
|
|
|
|
], [ if test "x$with_libass" != xcheck
|
2007-06-08 02:29:20 +02:00
|
|
|
then AC_MSG_XFAILURE([--with-libass given, but libass pkgconfig module found])
|
2007-04-04 21:40:06 +02:00
|
|
|
fi
|
|
|
|
with_libass=no
|
|
|
|
])
|
|
|
|
])
|
2006-12-03 01:33:20 +01:00
|
|
|
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_VOLATILE
|
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
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])])
|
|
|
|
|
|
|
|
AC_C_FLAG([-Wall])
|
2007-04-23 04:58:49 +02:00
|
|
|
AC_C_FLAG([-O2])
|
2006-03-25 17:14:24 +01:00
|
|
|
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])
|
2007-04-23 04:58:49 +02:00
|
|
|
AC_CXX_FLAG([-O2])
|
2006-07-08 00:47:55 +02:00
|
|
|
AC_CXX_FLAG([-fpermissive])
|
2007-04-04 19:18:20 +02:00
|
|
|
AC_CXX_FLAG([-fno-strict-aliasing])
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_CXX_FLAG([-std=c++98])
|
|
|
|
|
|
|
|
|
|
|
|
AC_PATH_XTRA
|
|
|
|
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
|
2007-04-01 00:04:57 +02:00
|
|
|
AC_CONFIG_SUBDIRS([csri])
|
2006-03-25 17:14:24 +01:00
|
|
|
|
2007-04-04 21:40:06 +02:00
|
|
|
AM_CONDITIONAL([USE_LIBASS], [test "$with_libass" != "no" ])
|
2007-04-22 23:59:35 +02:00
|
|
|
AM_CONDITIONAL([HAVE_ALSA], [test "$with_alsa" != "no"])
|
2007-04-22 09:04:31 +02:00
|
|
|
AM_CONDITIONAL([HAVE_PORTAUDIO], [test "$with_portaudio" != "no"])
|
2007-04-23 04:30:27 +02:00
|
|
|
AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "$with_pulseaudio" != "no"])
|
2007-04-22 23:59:35 +02:00
|
|
|
AM_CONDITIONAL([HAVE_HUNSPELL], [test "$with_hunspell" != "no"])
|
2007-04-24 02:52:49 +02:00
|
|
|
AM_CONDITIONAL([HAVE_FFMPEG], [test "$with_ffmpeg" != "no"])
|
2007-05-03 19:57:21 +02:00
|
|
|
dnl FIXME: These three should probably get proper --with flags,
|
|
|
|
dnl and Ruby also keep its detection (warn/fail if you have --with-ruby
|
|
|
|
dnl but the lib isn't detected.)
|
2008-01-24 18:20:47 +01:00
|
|
|
AM_CONDITIONAL([WITH_AUTO4_PERL], [test "$enable_auto4_perl" != "no"])
|
2007-05-03 19:57:21 +02:00
|
|
|
AM_CONDITIONAL([WITH_AUTO4_RUBY], [test "$with_ruby" != "no"])
|
|
|
|
AM_CONDITIONAL([WITH_AUTO4_LUA], [true])
|
|
|
|
dnl TODO: Make the auto3 lib build on non-Win32 so this can be true
|
2007-05-07 18:44:26 +02:00
|
|
|
AM_CONDITIONAL([WITH_AUTO3], [true])
|
2007-04-04 21:40:06 +02:00
|
|
|
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
|
|
|
ac/Makefile
|
2007-05-07 18:44:26 +02:00
|
|
|
auto3/Makefile
|
2007-04-25 04:13:54 +02:00
|
|
|
automation/Makefile
|
2007-07-05 17:11:22 +02:00
|
|
|
po/Makefile.in
|
2006-12-29 00:49:16 +01:00
|
|
|
aegisub/Makefile
|
|
|
|
aegisub/bitmaps/Makefile
|
2007-04-25 04:13:54 +02:00
|
|
|
aegisub/posix/Makefile
|
2006-03-25 17:14:24 +01:00
|
|
|
])
|
|
|
|
|
2007-04-24 02:52:49 +02:00
|
|
|
if test -z "$found_audio"; then
|
|
|
|
echo <<EOM
|
|
|
|
***********************************************************************
|
|
|
|
* 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/
|
|
|
|
***********************************************************************
|
|
|
|
EOM
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$found_video_provider"; then
|
|
|
|
echo <<EOM
|
|
|
|
***********************************************************************
|
|
|
|
* 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/
|
|
|
|
***********************************************************************
|
|
|
|
EOM
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2006-12-03 01:33:20 +01:00
|
|
|
|
2008-01-20 22:15:22 +01:00
|
|
|
|