New configure option --enable-internal-data for Mac OS X:

keep data inside the application (currently only affects
translations). Also fix commandline build which currently looks for
translations inside a nonexistent application bundle.  To retain
current behaviour on Mac OS X add -DUSE_INTERNAL_DATA to compiler
flags, eg. in Xcode project.
This commit is contained in:
András Salamon 2005-05-22 23:37:43 +00:00
parent 7941bd7f3e
commit 5350cc011d
2 changed files with 14 additions and 5 deletions

View file

@ -222,6 +222,12 @@ AC_ARG_ENABLE([dummy-locales],
[dummylocales=$enableval],
[dummylocales=no])
AC_ARG_ENABLE([internal-data],
AS_HELP_STRING([--enable-internal-data],
[put data inside application: Mac OS X only]),
[internaldata=$enableval],
[internaldata=no])
AM_CONDITIONAL([STATIC], [test x$static = xyes])
AM_CONDITIONAL([GAME], [test x$game = xyes])
AM_CONDITIONAL([SERVER], [test x$server = xyes])
@ -238,6 +244,10 @@ if test x$dummylocales = xyes; then
AC_DEFINE([USE_DUMMYLOCALES],,[Define if the game should not use system locales])
fi
if test x$internaldata = xyes; then
AC_DEFINE([USE_INTERNAL_DATA],[],[Define if translations should be placed inside app, for Mac OS X])
fi
#######################################################################
# Checks for programs. #
#######################################################################

View file

@ -263,15 +263,14 @@ std::string get_intl_dir()
return get_cwd() + "/po";
#endif
#ifdef __APPLE__
return get_cwd() + "/messages";
#ifdef USE_INTERNAL_DATA
return get_cwd() + "/" LOCALEDIR;
#endif
std::string res;
#if HAS_RELATIVE_LOCALEDIR
res = game_config::path + "/" LOCALEDIR;
std::string res = game_config::path + "/" LOCALEDIR;
#else
res = LOCALEDIR;
std::string res = LOCALEDIR;
#endif
return res;