2007-04-22 04:24:27 +02:00
|
|
|
sinclude([ac/acx_pthread.m4])
|
|
|
|
sinclude([ac/ax_check_gl.m4])
|
|
|
|
|
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
|
2006-03-25 17:14:24 +01:00
|
|
|
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2007-04-22 02:23:21 +02:00
|
|
|
# Commented out for now, since for some reason not all systems have
|
|
|
|
# /usr/share/aclocal/gettext.m4 and can't get it. (Feisty Fawn for
|
|
|
|
# one doesn't have it.)
|
|
|
|
# wxWidgets doesn't use real gettext anyway, but implements its own
|
|
|
|
# support, so only the gettext tools are required to compile the
|
|
|
|
# po files.
|
|
|
|
#AM_GNU_GETTEXT
|
2006-05-06 16:20:34 +02:00
|
|
|
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_DEFUN([AC_C_FLAG], [{
|
|
|
|
AC_LANG_PUSH(C)
|
|
|
|
ac_c_flag_save="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $1"
|
|
|
|
AC_MSG_CHECKING([[whether $CC supports $1]])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[]])],
|
|
|
|
[AC_MSG_RESULT([yes])],
|
|
|
|
[
|
|
|
|
CFLAGS="$ac_c_flag_save"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
$2
|
|
|
|
])
|
|
|
|
AC_LANG_POP(C)
|
|
|
|
}])
|
|
|
|
AC_DEFUN([AC_CXX_FLAG], [{
|
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
ac_cxx_flag_save="$CXXFLAGS"
|
|
|
|
CXXFLAGS="$CXXFLAGS $1"
|
|
|
|
AC_MSG_CHECKING([[whether $CXX supports $1]])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[]])],
|
|
|
|
[AC_MSG_RESULT([yes])],
|
|
|
|
[
|
|
|
|
CXXFLAGS="$ac_cxx_flag_save"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
$2
|
|
|
|
])
|
|
|
|
AC_LANG_POP(C++)
|
|
|
|
}])
|
|
|
|
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
2007-01-11 04:52:17 +01:00
|
|
|
AC_LANG(C++)
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
2006-05-06 14:59:09 +02:00
|
|
|
AC_PATH_PROGS(CONVERT, [convert], [])
|
|
|
|
if test -z "$CONVERT"
|
|
|
|
then AC_MSG_FAILURE([aegisub needs convert (from ImageMagick) to produce xpms from the supplied bitmaps/icons])
|
|
|
|
fi
|
|
|
|
|
2007-04-22 04:24:27 +02:00
|
|
|
ACX_PTHREAD([], [
|
|
|
|
AC_MSG_FAILURE([Aegisub needs pthreads])
|
|
|
|
])
|
2006-03-25 17:14:24 +01:00
|
|
|
|
2007-04-22 02:23:21 +02:00
|
|
|
AC_CHECK_LIB([portaudio], [Pa_Initialize],, [AC_MSG_ERROR([portaudio not found.])])
|
|
|
|
AC_CHECK_FUNCS([Pa_GetStreamTime])
|
2007-04-22 06:21:19 +02:00
|
|
|
AC_CHECK_LIB([avcodec], [avcodec_init],, [AC_MSG_ERROR([avcodec not found.])])
|
|
|
|
AC_CHECK_LIB([avformat], [av_read_frame],, [AC_MSG_ERROR([avformat not found.])])
|
|
|
|
AC_CHECK_LIB([hunspell], [main],, [AC_MSG_ERROR([Hunspell not found.])])
|
2007-04-22 02:23:21 +02:00
|
|
|
|
2006-03-26 03:38:10 +02:00
|
|
|
AC_CHECK_HEADER([wchar.h],,[
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_MSG_FAILURE([aegisub needs wide character support, find a wchar.h])
|
|
|
|
])
|
2006-03-26 05:06:23 +02:00
|
|
|
PKG_CHECK_MODULES([FREETYPE], freetype2 >= 9.7.0,, [
|
|
|
|
AC_MSG_FAILURE([aegisub needs FreeType2 2.1.9, go install it])
|
2006-03-25 17:14:24 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
WXCONFIG=wx-config
|
|
|
|
AC_ARG_WITH(wx-config,
|
|
|
|
AC_HELP_STRING([--with-wx-config=FILE], [Use specific wx-config script to determine wxWidgets configuration. [[wx-config]]]),
|
|
|
|
[
|
|
|
|
if test "$withval" != "yes" -a "$withval" != ""; then
|
|
|
|
WXCONFIG=$withval
|
|
|
|
fi
|
|
|
|
])
|
2007-01-30 22:33:52 +01:00
|
|
|
|
2007-04-22 04:24:27 +02:00
|
|
|
AX_CHECK_GL
|
|
|
|
if test ! "$GL_LIBS"; then
|
|
|
|
AC_MSG_ERROR([Could not find system GL library])
|
|
|
|
fi
|
|
|
|
CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
|
|
|
|
LIBS="$LIBS $GL_LIBS"
|
2007-01-30 22:33:52 +01:00
|
|
|
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_MSG_CHECKING([wxWidgets version])
|
|
|
|
if wxversion=`$WXCONFIG --version`; then
|
|
|
|
AC_MSG_RESULT([$wxversion])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([not found])
|
|
|
|
AC_MSG_ERROR([wxWidgets is required. Try --with-wx-config.])
|
|
|
|
fi
|
|
|
|
|
2006-03-26 03:38:10 +02:00
|
|
|
CPPFLAGS="$CPPFLAGS `$WXCONFIG --cppflags | sed -e 's/-fno-exceptions//'` $FREETYPE_CFLAGS"
|
2007-04-22 02:23:21 +02:00
|
|
|
LIBS="$LIBS `$WXCONFIG --libs std,gl,stc` $FREETYPE_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])
|
|
|
|
AC_MSG_FAILURE([wxWidgets OpenGL support missing])
|
|
|
|
])
|
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])
|
|
|
|
AC_MSG_FAILURE([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
|
|
|
|
then AC_MSG_FAILURE([--with-libass given, but libass headers not found])
|
|
|
|
fi
|
|
|
|
with_libass=no
|
|
|
|
])
|
|
|
|
], [ if test "x$with_libass" != xcheck
|
|
|
|
then AC_MSG_FAILURE([--with-libass given, but libass pkgconfig module found])
|
|
|
|
fi
|
|
|
|
with_libass=no
|
|
|
|
])
|
|
|
|
])
|
2006-12-03 01:33:20 +01:00
|
|
|
|
2006-03-26 03:38:10 +02:00
|
|
|
PKG_CHECK_MODULES([GLIB], glib-2.0, [
|
|
|
|
CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
|
|
|
|
LIBS="$LIBS $GLIB_LIBS"
|
|
|
|
|
|
|
|
AC_CHECK_LIB([ssa], [SSA_Init])
|
|
|
|
AC_CHECK_HEADERS([libssa/libssa.h])
|
|
|
|
], [
|
|
|
|
AC_MSG_WARN([not testing for libssa as it depends on glib-2.0, which was not found])
|
|
|
|
])
|
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])
|
|
|
|
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])
|
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" ])
|
|
|
|
|
2006-03-25 17:14:24 +01:00
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
|
|
|
ac/Makefile
|
2006-05-06 16:20:34 +02:00
|
|
|
locale/Makefile
|
2007-01-31 00:09:33 +01:00
|
|
|
FexTrackerSource/Makefile
|
2006-12-29 00:49:16 +01:00
|
|
|
aegisub/Makefile
|
|
|
|
aegisub/posix/Makefile
|
|
|
|
aegisub/bitmaps/Makefile
|
2006-03-25 17:14:24 +01:00
|
|
|
])
|
|
|
|
|
2006-12-03 01:33:20 +01:00
|
|
|
|