* Add support for universalchardet

* Fix #ifdef for STIDO/fstream with a proper ifdef/else
 * Make auto3 subdir inclusion conditional
 * Rename libspell_hunspell to libmisc*

Please note that universalchardet is only set to work with X86 for now, I'll fi$
the rest later.

Originally committed to SVN as r1907.
This commit is contained in:
Amar Takhar 2008-03-05 18:52:09 +00:00
parent 93db5bfd96
commit f55ffd6d91
5 changed files with 114 additions and 17 deletions

View File

@ -1,6 +1,22 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = aegisub auto3 automation po m4macros
if HAVE_UNIVCHARDET
univchardet = universalchardet
endif
if HAVE_AUTO3_LUA
auto3 = auto3
endif
SUBDIRS = \
$(univchardet) \
$(auto3) \
aegisub \
automation \
po \
m4macros
EXTRA_DIST = \
intltool-extract.in \

View File

@ -61,13 +61,6 @@ aegisub_LDFLAGS += @LIBASS_LIBS@
aegisub_LDADD += libsubtitle_ass.a
endif
if HAVE_HUNSPELL
noinst_LIBRARIES += libspell_hunspell.a
libspell_hunspell_a_SOURCES = spellchecker_hunspell.cpp
aegisub_LDFLAGS += @HUNSPELL_LDFLAGS@
aegisub_LDADD += libspell_hunspell.a
endif
if HAVE_AUTO4_LUA
noinst_LIBRARIES += libauto4_lua.a
libauto4_lua_a_SOURCES = auto4_lua.cpp auto4_lua_assfile.cpp auto4_lua_dialog.cpp auto4_lua_scriptreader.cpp
@ -98,6 +91,21 @@ aegisub_LDADD += -L$(srcdir)/../auto3 -laegisub-auto3
endif
if HAVE_HUNSPELL
noinst_LIBRARIES += libmisc_hunspell.a
libmisc_hunspell_a_SOURCES = spellchecker_hunspell.cpp
aegisub_LDFLAGS += @HUNSPELL_LDFLAGS@
aegisub_LDADD += libmisc_hunspell.a
endif
if HAVE_UNIVCHARDET
noinst_LIBRARIES += libmisc_universalchardet.a
libmisc_universalchardet_a_SOURCES = charset_detect.cpp
libmisc_universalchardet_a_CPPFLAGS = -D_X86_ -DTEXT_READER_USE_STDIO
aegisub_LDADD += libmisc_universalchardet.a ../universalchardet/libuniversalchardet.a
endif
## These aren't built, but are listed here so 'make dist' can always find all the sources
## This should also list all Win32 specific files

View File

@ -42,9 +42,10 @@
#include <wx/wxprec.h>
#include <wx/dynarray.h>
#include <wx/string.h>
#include <fstream>
#ifdef TEXT_READER_USE_STDIO
#include <stdio.h>
#else
#include <fstream>
#endif

View File

@ -282,12 +282,24 @@ fi
if test "$with_hunspell" = "yes"; then
AC_DEFINE(WITH_HUNSPELL, 1, [Enable hunspell support])
fi
AM_CONDITIONAL([HAVE_HUNSPELL], [test "$with_hunspell" != "no"])
AC_SUBST(HUNSPELL_LDFLAGS)
AC_ARG_WITH(univchardet, [ --without-univchardet build without universalchardet support], univchardet_disabled="(disabled)")
if test "$with_univchardet" != "no"; then
with_univchardet="yes"
AC_DEFINE(WITH_UNIVCHARDET, 1, [Enable universalchardet support])
else
with_univchardet="no"
fi
AM_CONDITIONAL([HAVE_UNIVCHARDET], [test "$with_univchardet" != "no"])
############
# Automation
@ -509,13 +521,14 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
AC_OUTPUT([
Makefile
auto3/Makefile
automation/Makefile
po/Makefile.in
aegisub/Makefile
aegisub/bitmaps/Makefile
aegisub/posix/Makefile
Makefile
aegisub/Makefile
aegisub/bitmaps/Makefile
aegisub/posix/Makefile
universalchardet/Makefile
auto3/Makefile
automation/Makefile
po/Makefile.in
])
@ -576,4 +589,5 @@ Subtitle Providers:
Misc Packages:
hunspell: $with_hunspell $hunspell_disabled
universalchardet: $with_univchardet $univchardet_disabled
]);

View File

@ -0,0 +1,58 @@
noinst_LIBRARIES = libuniversalchardet.a
AM_CPPFLAGS = -D_X86_
nodist_libuniversalchardet_a_SOURCES = \
CharDistribution.cpp \
JpCntx.cpp \
LangBulgarianModel.cpp \
LangCyrillicModel.cpp \
LangGreekModel.cpp \
LangHebrewModel.cpp \
LangHungarianModel.cpp \
LangThaiModel.cpp \
nsBig5Prober.cpp \
nsCharSetProber.cpp \
nsEUCJPProber.cpp \
nsEUCKRProber.cpp \
nsEUCTWProber.cpp \
nsEscCharsetProber.cpp \
nsEscSM.cpp \
nsGB2312Prober.cpp \
nsHebrewProber.cpp \
nsLatin1Prober.cpp \
nsMBCSGroupProber.cpp \
nsMBCSSM.cpp \
nsSBCSGroupProber.cpp \
nsSBCharSetProber.cpp \
nsSJISProber.cpp \
nsUTF8Prober.cpp \
nsUniversalDetector.cpp
nodist_libuniversalchardet_a_SOURCES += \
CharDistribution.h \
JpCntx.h \
nsBig5Prober.h \
nsCharSetProber.h \
nsCodingStateMachine.h \
nsEUCJPProber.h \
nsEUCKRProber.h \
nsEUCTWProber.h \
nsError.h \
nsEscCharsetProber.h \
nsGB2312Prober.h \
nsHebrewProber.h \
nsLatin1Prober.h \
nsMBCSGroupProber.h \
nsPkgInt.h \
nsSBCSGroupProber.h \
nsSBCharSetProber.h \
nsSJISProber.h \
nsUTF8Prober.h \
nsUniversalDetector.h \
nscore.h \
prcpucfg.h \
prmem.h \
protypes.h \
prtypes.h \
xpcom-config.h