From d5f5e66e3349d7b32c240be7fa63e868a37b3c03 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Tue, 6 Jan 2009 13:59:15 +0000 Subject: [PATCH] * Split HAVE_FFMPEG into HAVE_FFMPEG / HAVE_PROVIDER_FFMPEG * s/HAVE_FFMPEGSOURCE/HAVE_PROVIDER_FFMPEGSOURCE/ * Add FFMPEG_CFLAGS / FFMPEG_LDFLAGS as configure env vars for FFMPEG detection. Originally committed to SVN as r2664. --- Makefile.am | 2 +- aegisub/Makefile.am | 11 +++++++---- configure.in | 19 ++++++++++++++----- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index fa089c69a..39cf42fd8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ if WITH_LIBASS libass = libass endif -if HAVE_FFMPEGSOURCE +if HAVE_PROVIDER_FFMPEGSOURCE ffmpegsource = FFmpegSource2 endif diff --git a/aegisub/Makefile.am b/aegisub/Makefile.am index 320dab77f..6d9a89388 100644 --- a/aegisub/Makefile.am +++ b/aegisub/Makefile.am @@ -10,7 +10,7 @@ endif SUBDIRS = bitmaps libresrc $(libosxutil_subdir) -AM_CXXFLAGS = -DAEGISUB -Iinclude @WX_CPPFLAGS@ @OPENMP_CXXFLAGS@ +AM_CXXFLAGS = -DAEGISUB -Iinclude @WX_CPPFLAGS@ @OPENMP_CXXFLAGS@ @FFMPEG_CFLAGS@ bin_PROGRAMS = aegisub-2.1 aegisub_2_1_LDADD = libresrc/libresrc.a $(libosxutil_lib) @@ -53,16 +53,19 @@ aegisub_2_1_LDADD += libaudio_openal.a endif if HAVE_FFMPEG +aegisub_2_1_LDFLAGS += @AVFORMAT_LDFLAGS@ @AVCODEC_LDFLAGS@ @SWSCALE_LDFLAGS@ @FFMPEG_LDFLAGS@ +endif + +if HAVE_PROVIDER_FFMPEG noinst_LIBRARIES += libaudiovideo_ffmpeg.a libaudiovideo_ffmpeg_a_SOURCES = audio_provider_lavc.cpp lavc_file.cpp video_provider_lavc.cpp lavc_keyframes.cpp -aegisub_2_1_LDFLAGS += @AVFORMAT_LDFLAGS@ @AVCODEC_LDFLAGS@ @SWSCALE_LDFLAGS@ +aegisub_2_1_LDFLAGS += @POSTPROC_LDFLAGS@ aegisub_2_1_LDADD += libaudiovideo_ffmpeg.a endif -if HAVE_FFMPEGSOURCE +if HAVE_PROVIDER_FFMPEGSOURCE noinst_LIBRARIES += libaudiovideo_ffmpegsource.a libaudiovideo_ffmpegsource_a_SOURCES = audio_provider_ffmpegsource.cpp video_provider_ffmpegsource.cpp ffmpegsource_common.cpp -aegisub_2_1_LDFLAGS += @AVFORMAT_LDFLAGS@ @AVCODEC_LDFLAGS@ @SWSCALE_LDFLAGS@ @POSTPROC_LDFLAGS@ aegisub_2_1_LDADD += libaudiovideo_ffmpegsource.a ../FFmpegSource2/libffmpegsource2_aegisub.a endif diff --git a/configure.in b/configure.in index a8bb69767..4bf520520 100644 --- a/configure.in +++ b/configure.in @@ -99,13 +99,12 @@ AC_DEFINE_UNQUOTED(AEGISUB_VERSION_DATA, ["$AEGISUB_VERSION_DATA"], [Data path s aegisubdatadir="$datadir/$PACKAGE/aegisub_version_data" aegisubdocdir="$datadir/doc/$PACKAGE/aegisub_version_data" -AEGISUB_COMMAND="aegisub-aegisub_version_data" +AEGISUB_COMMAND="aegisub-$AEGISUB_VERSION_MAJOR.AEGISUB_VERSION_MINOR" AC_SUBST(aegisubdatadir) AC_SUBST(aegisubdocdir) AC_SUBST(AEGISUB_COMMAND) - AC_ARG_WITH(desktop-dir, [ --with-desktop-dir=PATH desktop file locations (default: PREFIX/share)]) if test -z "$with_desktop_dir" ; then DESKTOP_DATADIR=$with_desktop_dir @@ -504,6 +503,14 @@ AC_ARG_WITH(ffmpeg, [ --without-ffmpeg build without FFMPEG support. Disables FFMPEG and FFmpegSource A/V providers. (default: auto)], ffmpeg_disabled="(disabled)") +AC_ARG_VAR([FFMPEG_LDFLAGS], [LDFLAGS to use for FFMPEG (default: LDFLAGS)]) +AC_ARG_VAR([FFMPEG_CFLAGS], [CFLAGS to use for FFMPEG (default: CPPFLAGS)]) + +aegisub_save_CPPFLAGS="$CPPFLAGS" +aegisub_save_LDFLAGS="$LDFLAGS" +CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS" +LDFLAGS="$LDFLAGS $FFMPEG_LDFLAGS" + if test "$with_ffmpeg" != "no"; then AC_CHECK_LIB([avcodec], [avcodec_init],[AVCODEC_LDFLAGS="-lavcodec"; with_ffmpeg="yes"], [with_ffmpeg="no"]) AC_CHECK_LIB([avformat], [av_read_frame],[AVFORMAT_LDFLAGS="-lavformat"; with_ffmpeg="yes"], [with_ffmpeg="no"]) @@ -521,12 +528,15 @@ if test "$with_ffmpeg" != "no"; then with_ffmpeg="no"; fi fi +CPPFLAGS="$aegisub_save_CPPFLAGS" +LDFLAGS="$aegisub_save_LDFLAGS" AC_SUBST(SWSCALE_LDFLAGS) AC_SUBST(AVCODEC_LDFLAGS) AC_SUBST(AVFORMAT_LDFLAGS) AC_SUBST(AVUTIL_LDFLAGS) +AM_CONDITIONAL([HAVE_FFMPEG], [test "$with_ffmpeg" = "yes"]) AC_ARG_WITH(provider-ffmpeg, [ --without-provider-ffmpeg build without FFMPEG A/V provider. (default: auto)], ffmpeg_provider_disabled="(disabled)") @@ -544,7 +554,7 @@ if test "$with_ffmpeg" = "no"; then ffmpeg_provider_disabled="(disabled, requires FFMPEG)" fi -AM_CONDITIONAL([HAVE_FFMPEG], [test "$with_provider_ffmpeg" = "yes"]) +AM_CONDITIONAL([HAVE_PROVIDER_FFMPEG], [test "$with_provider_ffmpeg" = "yes"]) AC_ARG_WITH(provider-ffmpegsource, [ --without-provider-ffmpegsource build without FFmpegSource A/V provider. @@ -564,8 +574,7 @@ if test "$with_ffmpegsource" != "no"; then fi AC_SUBST(POSTPROC_LDFLAGS) - -AM_CONDITIONAL([HAVE_FFMPEGSOURCE], [test "$with_provider_ffmpegsource" = "yes"]) +AM_CONDITIONAL([HAVE_PROVIDER_FFMPEGSOURCE], [test "$with_provider_ffmpegsource" = "yes"])