diff --git a/core/Makefile.am b/core/Makefile.am new file mode 100644 index 000000000..2d417d05c --- /dev/null +++ b/core/Makefile.am @@ -0,0 +1,91 @@ +AUTOMAKE_OPTIONS = foreign +EXTRA_DIST = res.rc $(srcdir)/*.h +SUFFIXES = .c .cpp .rc + +SUBDIRS = ac bitmaps posix + +bin_PROGRAMS = aegisub + +AM_CPPFLAGS = -Iposix -include posix/defines.h +LDADD = posix/libposix.a +aegisub_SOURCES = about.cpp \ + aegisublocale.cpp \ + ass_dialogue.cpp \ + ass_entry.cpp \ + ass_export_filter.cpp \ + ass_exporter.cpp \ + ass_file.cpp \ + ass_override.cpp \ + ass_style.cpp \ + ass_style_storage.cpp \ + ass_time.cpp \ + audio_box.cpp \ + audio_display.cpp \ + audio_karaoke.cpp \ + audio_player.cpp \ + audio_player_portaudio.cpp \ + audio_provider.cpp \ + audio_provider_hd.cpp \ + audio_provider_ram.cpp \ + automation.cpp \ + automation_filter.cpp \ + automation_gui.cpp \ + avisynth_wrap.cpp \ + base_grid.cpp \ + colorspace.cpp \ + dialog_colorpicker.cpp \ + dialog_export.cpp \ + dialog_hotkeys.cpp \ + dialog_jumpto.cpp \ + dialog_progress.cpp \ + dialog_properties.cpp \ + dialog_resample.cpp \ + dialog_search_replace.cpp \ + dialog_selection.cpp \ + dialog_shift_times.cpp \ + dialog_spellcheck.cpp \ + dialog_style_editor.cpp \ + dialog_style_manager.cpp \ + dialog_styling_assistant.cpp \ + dialog_timing_processor.cpp \ + dialog_translation.cpp \ + drop.cpp \ + export_clean_info.cpp \ + export_fixstyle.cpp \ + export_framerate.cpp \ + fft.cpp \ + fonts_collector.cpp \ + frame_main.cpp \ + frame_main_events.cpp \ + hilimod_textctrl.cpp \ + hotkeys.cpp \ + main.cpp \ + mkv_wrap.cpp \ + options.cpp \ + splash.cpp \ + static_bmp.cpp \ + string_codec.cpp \ + subs_edit_box.cpp \ + subs_grid.cpp \ + subtitle_format.cpp \ + subtitle_format_ass.cpp \ + subtitle_format_srt.cpp \ + subtitle_format_txt.cpp \ + text_file_reader.cpp \ + text_file_writer.cpp \ + timeedit_ctrl.cpp \ + tip.cpp \ + toggle_bitmap.cpp \ + utils.cpp \ + validators.cpp \ + variable_data.cpp \ + vfr.cpp \ + video_box.cpp \ + video_display.cpp \ + video_provider.cpp \ + video_provider_lavc.cpp \ + video_slider.cpp \ + video_zoom.cpp \ + yatta_wrap.cpp \ + MatroskaParser.c + diff --git a/core/ac/Makefile.am b/core/ac/Makefile.am new file mode 100644 index 000000000..076b3e741 --- /dev/null +++ b/core/ac/Makefile.am @@ -0,0 +1 @@ +extra_DIST=compile config.guess config.sub depcomp install-sh missing mkinstalldirs diff --git a/core/autogen.sh b/core/autogen.sh new file mode 100644 index 000000000..36d0bda55 --- /dev/null +++ b/core/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +aclocal && autoheader && automake -a && autoconf && echo "'configure' script created successfully." + diff --git a/core/bitmaps/Makefile.am b/core/bitmaps/Makefile.am new file mode 100644 index 000000000..12184412b --- /dev/null +++ b/core/bitmaps/Makefile.am @@ -0,0 +1,14 @@ +EXTRA_DIST = genxpm.sh $(srcdir)/*.bmp $(srcdir)/*.ico +CLEANFILES = Makefile.bitmaps *.xpm + +.PHONY: all-bitmaps + +Makefile.bitmaps: $(srcdir)/genxpm.sh $(top_srcdir)/res.rc + /bin/sh $^ $(srcdir) >$@ + +all: all-bitmaps + +all-bitmaps: Makefile.bitmaps + make -f Makefile.bitmaps all + + diff --git a/core/bitmaps/genxpm.sh b/core/bitmaps/genxpm.sh new file mode 100644 index 000000000..dbba0d4b3 --- /dev/null +++ b/core/bitmaps/genxpm.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +RESFILE="$1" +SRCDIR="$2" + +cd "$SRCDIR" + +cat <= 9.8.3,, [ + AC_MSG_FAILURE([aegisub needs FreeType2, go install it]) +]) + +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 +]) +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 + +CXXFLAGS="$CXXFLAGS `$WXCONFIG --cxxflags | sed -e 's/-fno-exceptions//'`" +LIBS="$LIBS `$WXCONFIG --libs`" + +AC_CHECK_LIB([m], [main]) +AC_CHECK_LIB([dl], [dlopen]) + +AC_CHECK_LIB([lua], [lua_call],, [AC_MSG_ERROR([lua not found.])]) +AC_CHECK_LIB([lualib], [lua_tostring],, [AC_MSG_ERROR([lualib not found.])]) +AC_CHECK_LIB([portaudio], [Pa_Initialize],, [AC_MSG_ERROR([portaudio not found.])]) +AC_CHECK_LIB([avcodec], [avcodec_init],, [AC_MSG_ERROR([libavcodec (ffmpeg) not found.])]) +AC_CHECK_LIB([avformat], [av_frac_init],, [AC_MSG_ERROR([libavformat (ffmpeg) not found or too old.])]) + +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]) +AC_CXX_FLAG([-std=c++98]) + + +AC_PATH_XTRA + +AC_HEADER_STDC +AC_HEADER_STDBOOL + + +AC_OUTPUT([ + Makefile + ac/Makefile + posix/Makefile + bitmaps/Makefile +]) + diff --git a/core/posix/Makefile.am b/core/posix/Makefile.am new file mode 100644 index 000000000..31986501b --- /dev/null +++ b/core/posix/Makefile.am @@ -0,0 +1,9 @@ +noinst_LIBRARIES = libposix.a +nodist_libposix_a_SOURCES = res.cpp +CLEANFILES = res.cpp res.h +EXTRA_DIST = genres.sh defines.h + +res.h: $(srcdir)/genres.sh $(top_srcdir)/res.rc + /bin/sh $^ +res.cpp: res.h + diff --git a/core/posix/defines.h b/core/posix/defines.h new file mode 100644 index 000000000..739422250 --- /dev/null +++ b/core/posix/defines.h @@ -0,0 +1,22 @@ +#pragma once + +#ifndef _DEFINES_H +#define _DEFINES_H + +#define __AVISYNTH_H__ +#define WX_PRECOMP + +#include + +typedef int64_t __int64; +typedef uint64_t __uint64; +#define abs64 llabs + +#define NO_SPELLCHECKER +#define NO_FEX +#define USE_LAVC + +#include "res.h" + +#endif /* _DEFINES_H */ + diff --git a/core/posix/genres.sh b/core/posix/genres.sh new file mode 100644 index 000000000..34a551118 --- /dev/null +++ b/core/posix/genres.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +RESFILE="$1" + +egrep -v "^(#|/|.$)" $RESFILE | cut -d ' ' -f 1 | ( + echo "#define static" >&4 + + echo "#ifndef _RES_H" >&5 + echo "#define _RES_H" >&5 + while read NAME + do echo "extern char *${NAME}_xpm[];" >&5 + echo "#include \"../bitmaps/${NAME}_xpm.xpm\"" >&4 + done + echo "#endif /* _RES_H */" >&5 +) 4>res.cpp 5>res.h +