mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 04:52:44 +08:00
Add --without-gettext switch to optionally disable gettext support
darcs-hash:20061129141822-ac50b-64a78e7a3594827abe5024fdbf7d4c79ac21162c.gz
This commit is contained in:
parent
ddc617f80a
commit
e0322bf0e0
|
@ -165,7 +165,12 @@
|
|||
not be translated. (Gettext returns the version information as the
|
||||
response)
|
||||
*/
|
||||
#ifdef USE_GETTEXT
|
||||
#define C_(wstr) ((wstr==L"")?L"":wgettext(wstr))
|
||||
#else
|
||||
#define C_(string) (string)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
Struct describing a completion option entry.
|
||||
|
|
34
configure.ac
34
configure.ac
|
@ -195,6 +195,25 @@ else
|
|||
fi
|
||||
|
||||
|
||||
#
|
||||
# Optionally drop gettext support
|
||||
#
|
||||
|
||||
AC_ARG_WITH(
|
||||
gettext,
|
||||
AC_HELP_STRING(
|
||||
[--without-gettext],
|
||||
[do not translate messages, even if gettext is available]
|
||||
),
|
||||
[local_gettext=$withval],
|
||||
[local_gettext=yes]
|
||||
)
|
||||
|
||||
if test x$local_gettext != xno; then
|
||||
AC_DEFINE([USE_GETTEXT],[1],[Perform string translations with gettext])
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Test if the compiler accepts the -std=c99 flag. If so, using it
|
||||
# increases the odds of correct compilation, since we want to use the
|
||||
|
@ -418,7 +437,10 @@ AC_DEFINE(
|
|||
# Check presense of various libraries
|
||||
#
|
||||
|
||||
AC_SEARCH_LIBS( gettext, intl,,)
|
||||
# Only link with gettext if we are using it
|
||||
if test x$local_gettext != xno; then
|
||||
AC_SEARCH_LIBS( gettext, intl,,)
|
||||
fi
|
||||
AC_SEARCH_LIBS( connect, socket, , [AC_MSG_ERROR([Cannot find the socket library, needed to build this package.] )] )
|
||||
AC_SEARCH_LIBS( nanosleep, rt, , [AC_MSG_ERROR([Cannot find the rt library, needed to build this package.] )] )
|
||||
AC_SEARCH_LIBS( setupterm, [ncurses curses], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
|
||||
|
@ -429,7 +451,7 @@ AC_SEARCH_LIBS( iconv_open, iconv, , [AC_MSG_ERROR([Could not find an iconv impl
|
|||
# Check presense of various header files
|
||||
#
|
||||
|
||||
AC_CHECK_HEADERS([getopt.h termio.h sys/resource.h term.h ncurses/term.h libintl.h ncurses.h curses.h stropts.h siginfo.h sys/select.h sys/ioctl.h sys/termios.h])
|
||||
AC_CHECK_HEADERS([getopt.h termio.h sys/resource.h term.h ncurses/term.h ncurses.h curses.h stropts.h siginfo.h sys/select.h sys/ioctl.h sys/termios.h libintl.h])
|
||||
|
||||
AC_CHECK_HEADER(
|
||||
[regex.h],
|
||||
|
@ -570,9 +592,9 @@ fi
|
|||
# Check for presense of various functions used by fish
|
||||
#
|
||||
|
||||
AC_CHECK_FUNCS( gettext wcsdup wcsndup wcslen wcscasecmp wcsncasecmp fwprintf )
|
||||
AC_CHECK_FUNCS( wcsdup wcsndup wcslen wcscasecmp wcsncasecmp fwprintf )
|
||||
AC_CHECK_FUNCS( futimes wcwidth wcswidth wcstok fputwc fgetwc )
|
||||
AC_CHECK_FUNCS( wcstol dcgettext wcslcat wcslcpy lrand48_r killpg)
|
||||
AC_CHECK_FUNCS( wcstol wcslcat wcslcpy lrand48_r killpg gettext dcgettext )
|
||||
|
||||
|
||||
#
|
||||
|
@ -580,7 +602,9 @@ AC_CHECK_FUNCS( wcstol dcgettext wcslcat wcslcpy lrand48_r killpg)
|
|||
# the translations should be installed.
|
||||
#
|
||||
|
||||
AC_CHECK_FUNC( gettext, AC_SUBST( HAVE_GETTEXT, 1 ), AC_SUBST( HAVE_GETTEXT, 0 ) )
|
||||
if test x$local_gettext != xno; then
|
||||
AC_CHECK_FUNC( gettext, AC_SUBST( HAVE_GETTEXT, 1 ), AC_SUBST( HAVE_GETTEXT, 0 ) )
|
||||
fi
|
||||
|
||||
#
|
||||
# Here follows a list of small programs used to test for various
|
||||
|
|
5
mimedb.c
5
mimedb.c
|
@ -139,8 +139,11 @@ static int launch_pos=0;
|
|||
/**
|
||||
gettext alias
|
||||
*/
|
||||
#ifdef USE_GETTEXT
|
||||
#define _(string) gettext(string)
|
||||
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Call malloc, set error flag and print message on failure
|
||||
|
|
|
@ -57,7 +57,11 @@
|
|||
*/
|
||||
#define GETOPT_STRING "b:hvocu"
|
||||
|
||||
#ifdef USE_GETTEXT
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
char *col[]=
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user