aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraph <a.hewson@gmail.com>2014-01-31 18:10:18 +0000
committerThiago de Arruda <tpadilha84@gmail.com>2014-02-01 10:34:04 -0300
commit2d00ead2e57653b771354a564f9a760c2ce0d18e (patch)
treec205d7000191c5f7f2f1a439bc5ac67524c4fc00 /src
parent72cf89bce8e4230dbc161dc5606f48ef9884ba70 (diff)
downloadrneovim-2d00ead2e57653b771354a564f9a760c2ce0d18e.tar.gz
rneovim-2d00ead2e57653b771354a564f9a760c2ce0d18e.tar.bz2
rneovim-2d00ead2e57653b771354a564f9a760c2ce0d18e.zip
Fix build on OSX/Archlinux and add README
- remove SELinux dependency for now - OSX: find libintl.h - OSX: fix compile errors - OSX: use hack around gettext nonsense - fix gettext on ubuntu - work around Arch's lack of -ltermcap - add README.md
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt17
-rw-r--r--src/ex_cmds2.c9
-rw-r--r--src/ex_docmd.c9
-rw-r--r--src/ex_getln.c3
-rw-r--r--src/mbyte.c2
-rw-r--r--src/os_unix.c8
-rw-r--r--src/vim.h22
7 files changed, 34 insertions, 36 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 65138a6d5d..48aa9250fe 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,5 +14,20 @@ file( GLOB IO_SOURCES io/*.c )
add_executable (vim ${NEOVIM_SOURCES} ${IO_SOURCES})
-target_link_libraries (vim m termcap selinux)
+target_link_libraries (vim m)
+
+include(CheckLibraryExists)
+check_library_exists(termcap tgetent "" HAVE_LIBTERMCAP)
+
+if (HAVE_LIBTERMCAP)
+ target_link_libraries(vim termcap)
+else()
+ check_library_exists(curses tgetent "" HAVE_LIBCURSES)
+ if (HAVE_LIBCURSES)
+ target_link_libraries(vim curses)
+ else()
+ message(FATAL_ERROR "can't find something resembling -ltermcap")
+ endif()
+endif()
+
include_directories ("${PROJECT_SOURCE_DIR}/src/proto")
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 42ccf5a416..0162031b75 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -3349,11 +3349,7 @@ char_u * get_mess_lang() {
}
/* Complicated #if; matches with where get_mess_env() is used below. */
-#if (defined(FEAT_EVAL) && !((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
- && defined(LC_MESSAGES))) \
- || ((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
- && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) \
- && !defined(LC_MESSAGES))
+#ifdef HAVE_WORKING_LIBINTL
static char_u *get_mess_env __ARGS((void));
/*
@@ -3411,8 +3407,7 @@ void set_lang_var() {
set_vim_var_string(VV_LC_TIME, loc, -1);
}
-#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
- && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
+#ifdef HAVE_WORKING_LIBINTL
/*
* ":language": Set the language (locale).
*/
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index d3d9c256be..88fe8e1c5d 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -206,8 +206,7 @@ static void ex_X __ARGS((exarg_T *eap));
static void ex_fold __ARGS((exarg_T *eap));
static void ex_foldopen __ARGS((exarg_T *eap));
static void ex_folddo __ARGS((exarg_T *eap));
-#if !((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
- && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)))
+#ifndef HAVE_WORKING_LIBINTL
# define ex_language ex_ni
#endif
# define ex_sign ex_ni
@@ -3161,8 +3160,7 @@ char_u *buff; /* buffer for command string */
xp->xp_pattern = arg;
break;
-#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
- && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
+#ifdef HAVE_WORKING_LIBINTL
case CMD_language:
p = skiptowhite(arg);
if (*p == NUL) {
@@ -4452,8 +4450,7 @@ static struct {
{EXPAND_HELP, "help"},
{EXPAND_HIGHLIGHT, "highlight"},
{EXPAND_HISTORY, "history"},
-#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
- && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
+#ifdef HAVE_WORKING_LIBINTL
{EXPAND_LOCALES, "locale"},
#endif
{EXPAND_MAPPINGS, "mapping"},
diff --git a/src/ex_getln.c b/src/ex_getln.c
index ee9fc079fe..dbef0a9449 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -3783,8 +3783,7 @@ int options; /* EW_ flags */
{EXPAND_AUGROUP, get_augroup_name, TRUE, TRUE},
{EXPAND_CSCOPE, get_cscope_name, TRUE, TRUE},
{EXPAND_PROFILE, get_profile_name, TRUE, TRUE},
-#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
- && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
+#ifdef HAVE_WORKING_LIBINTL
{EXPAND_LANGUAGE, get_lang_arg, TRUE, FALSE},
{EXPAND_LOCALES, get_locales, TRUE, FALSE},
#endif
diff --git a/src/mbyte.c b/src/mbyte.c
index 66f26826c4..8b7abe15ee 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -612,7 +612,7 @@ char_u * mb_init() {
set_string_option_direct((char_u *)"fencs", -1,
(char_u *)"ucs-bom,utf-8,default,latin1", OPT_FREE, 0);
-#if defined(HAVE_BIND_TEXTDOMAIN_CODESET) && defined(FEAT_GETTEXT)
+#ifdef HAVE_WORKING_LIBINTL
/* GNU gettext 0.10.37 supports this feature: set the codeset used for
* translated messages independently from the current locale. */
(void)bind_textdomain_codeset(VIMPACKAGE,
diff --git a/src/os_unix.c b/src/os_unix.c
index 83a65cf9b5..cf50cfb28e 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -623,14 +623,6 @@ static char *signal_stack;
static void init_signal_stack() {
if (signal_stack != NULL) {
# ifdef HAVE_SIGALTSTACK
-# if defined(__APPLE__) && (!defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
- || MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
- /* missing prototype. Adding it to osdef?.h.in doesn't work, because
- * "struct sigaltstack" needs to be declared. */
- extern int sigaltstack __ARGS((const struct sigaltstack *ss,
- struct sigaltstack *oss));
-# endif
-
sigstk.ss_sp = signal_stack;
sigstk.ss_size = SIGSTKSZ;
sigstk.ss_flags = 0;
diff --git a/src/vim.h b/src/vim.h
index 3095dbf541..93f66cf438 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -336,22 +336,22 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
# define USE_IM_CONTROL
#endif
-/*
- * For dynamically loaded gettext library. Currently, only for Win32.
- */
-
-
-/*
- * The _() stuff is for using gettext(). It is a no-op when libintl.h is not
- * found or the +multilang feature is disabled.
- */
+#ifdef HAVE_WORKING_LIBINTL
# include <libintl.h>
# define _(x) gettext((char *)(x))
+// XXX do we actually need this?
# ifdef gettext_noop
-# define N_(x) gettext_noop(x)
+# define N_(x) gettext_noop(x)
# else
-# define N_(x) x
+# define N_(x) x
# endif
+#else
+# define _(x) ((char *)(x))
+# define N_(x) x
+# define bindtextdomain(x, y) /* empty */
+# define bind_textdomain_codeset(x, y) /* empty */
+# define textdomain(x) /* empty */
+#endif
/*
* flags for update_screen()