From c6722b058731717d2bfd1b9539d72338ba25cfea Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 22 Apr 2007 00:23:21 +0000 Subject: [PATCH] Fixed some building on Linux, at least on Ubuntu Feisty amd64. Also updated configure.ac to check for wxSTC instead of wxScintilla. Originally committed to SVN as r1106. --- aegisub/audio_provider_lavc.cpp | 2 ++ aegisub/lavc_file.h | 2 ++ aegisub/video_provider_lavc.cpp | 2 ++ configure.ac | 48 +++++++++++++++++---------------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/aegisub/audio_provider_lavc.cpp b/aegisub/audio_provider_lavc.cpp index 60080647e..287c74a0f 100644 --- a/aegisub/audio_provider_lavc.cpp +++ b/aegisub/audio_provider_lavc.cpp @@ -36,7 +36,9 @@ /////////// // Headers +#ifdef WIN32 #define EMULATE_INTTYPES +#endif #include /* avcodec.h uses INT64_C in a *single* place. This prolly breaks on Win32, diff --git a/aegisub/lavc_file.h b/aegisub/lavc_file.h index 459594f9c..97f662421 100644 --- a/aegisub/lavc_file.h +++ b/aegisub/lavc_file.h @@ -38,7 +38,9 @@ #include "setup.h" +#ifdef WIN32 #define EMULATE_INTTYPES +#endif #include extern "C" { #include diff --git a/aegisub/video_provider_lavc.cpp b/aegisub/video_provider_lavc.cpp index 55dc7b268..d8e1dd241 100644 --- a/aegisub/video_provider_lavc.cpp +++ b/aegisub/video_provider_lavc.cpp @@ -36,7 +36,9 @@ /////////// // Headers +#ifdef WIN32 #define EMULATE_INTTYPES +#endif #include #include #include diff --git a/configure.ac b/configure.ac index 77151a867..4c2b5aca0 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,13 @@ AC_GNU_SOURCE AC_CANONICAL_HOST -AM_GNU_GETTEXT +# 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 AC_DEFUN([AC_C_FLAG], [{ AC_LANG_PUSH(C) @@ -57,6 +63,11 @@ AC_C_FLAG([-pthread]) AC_CXX_FLAG([-pthread]) AC_CHECK_LIB([pthread], [pthread_join]) +AC_CHECK_LIB([portaudio], [Pa_Initialize],, [AC_MSG_ERROR([portaudio not found.])]) +AC_CHECK_FUNCS([Pa_GetStreamTime]) +AC_CHECK_LIB([avcodec], [avcodec_init]) +AC_CHECK_LIB([avformat], [av_read_frame]) + AC_CHECK_HEADER([wchar.h],,[ AC_MSG_FAILURE([aegisub needs wide character support, find a wchar.h]) ]) @@ -86,7 +97,7 @@ else fi CPPFLAGS="$CPPFLAGS `$WXCONFIG --cppflags | sed -e 's/-fno-exceptions//'` $FREETYPE_CFLAGS" -LIBS="$LIBS `$WXCONFIG --libs` `$WXCONFIG --libs gl` $FREETYPE_LIBS" +LIBS="$LIBS `$WXCONFIG --libs std,gl,stc` $FREETYPE_LIBS" AC_MSG_CHECKING([wxWidgets OpenGL support]) AC_LINK_IFELSE([ @@ -102,32 +113,23 @@ int main(int argc, char **argv) { AC_MSG_FAILURE([wxWidgets OpenGL support missing]) ]) -AC_ARG_WITH(wxscintilla, - AC_HELP_STRING([--with-wxscintilla=DIR], [Use wxScintilla includes from DIR/include and libraries from DIR/lib.]), -[ - if test "$withval" != "yes" -a "$withval" != ""; then - WXSCINTDIR=$withval - if test "${WXSCINTDIR#/}" == "$WXSCINTDIR"; - then WXSCINTDIR="`pwd`/$WXSCINTDIR" - fi - CPPFLAGS="$CPPFLAGS -I$WXSCINTDIR/include" - LDFLAGS="$LDFLAGS -L$WXSCINTDIR/lib -Wl,-rpath,$WXSCINTDIR/lib" - fi -],, [ -#include +AC_MSG_CHECKING([wxWidgets StyledTextCtrl support]) +AC_LINK_IFELSE([ +#include +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]) ]) -AC_CHECK_HEADER([wx/wxscintilla.h],, [AC_MSG_ERROR([wxScintilla includes not found.])]) -LIBS="$LIBS -lwxscintilla" - AC_CHECK_LIB([m], [main]) AC_CHECK_LIB([dl], [dlopen]) -AC_CHECK_LIB([portaudio], [Pa_Initialize],, [AC_MSG_ERROR([portaudio not found.])]) -AC_CHECK_FUNCS([Pa_GetStreamTime]) -AC_CHECK_LIB([avcodec], [avcodec_init]) -AC_CHECK_LIB([avformat], [av_read_frame]) - AC_ARG_WITH([libass], [AS_HELP_STRING([--without-libass],[disable libass @<:@default=check@:>@])],[],[with_libass=check]) AS_IF([test "x$with_libass" != xno], [