Skip to content

Commit 72cf89b

Browse files
committed
Import vim from changeset v5628:c9cad40b4181
- Cleanup source tree, leaving only files necessary for compilation/testing - Process files through unifdef to remove tons of FEAT_* macros - Process files through uncrustify to normalize source code formatting. - Port the build system to cmake
0 parents  commit 72cf89b

File tree

380 files changed

+501011
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

380 files changed

+501011
-0
lines changed

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
build/
2+
*.rej
3+
*.orig
4+
*.mo
5+
*.swp
6+
*~
7+
*.pyc
8+
src/po/vim.pot
9+
10+
src/po/*.ck
11+
src/testdir/mbyte.vim
12+
src/testdir/mzscheme.vim
13+
src/testdir/lua.vim
14+
src/testdir/small.vim
15+
src/testdir/tiny.vim
16+
src/testdir/test*.out
17+
src/testdir/test.log

CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
cmake_minimum_required (VERSION 2.6)
2+
project (NEOVIM)
3+
4+
set(NEOVIM_VERSION_MAJOR 0)
5+
set(NEOVIM_VERSION_MINOR 0)
6+
set(NEOVIM_VERSION_PATCH 0)
7+
8+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
9+
10+
add_definitions(-DHAVE_CONFIG_H -Wall -std=gnu99)
11+
if(CMAKE_BUILD_TYPE MATCHES Debug)
12+
# cmake automatically appends -g to the compiler flags
13+
set(DEBUG 1)
14+
else()
15+
set(DEBUG 0)
16+
endif()
17+
18+
# add dependencies to include/lib directories
19+
link_directories ("${PROJECT_SOURCE_DIR}/.deps/usr/lib")
20+
include_directories ("${PROJECT_SOURCE_DIR}/.deps/usr/include")
21+
22+
include_directories ("${PROJECT_BINARY_DIR}/config")
23+
24+
add_subdirectory(src)
25+
add_subdirectory(config)

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=Debug
2+
3+
test: build/src/vim
4+
cd src/testdir && make
5+
6+
build/src/vim:
7+
cd build && make
8+
9+
cmake:
10+
rm -rf build
11+
mkdir build
12+
cd build && cmake $(CMAKE_FLAGS) ../
13+
14+
.PHONY: test cmake

config/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include(CheckTypeSize)
2+
check_type_size("int" SIZEOF_INT)
3+
check_type_size("long" SIZEOF_LONG)
4+
check_type_size("time_t" SIZEOF_TIME_T)
5+
check_type_size("off_t" SIZEOF_OFF_T)
6+
7+
# generate configuration header and update include directories
8+
configure_file (
9+
"${PROJECT_SOURCE_DIR}/config/config.h.in"
10+
"${PROJECT_BINARY_DIR}/config/auto/config.h"
11+
)
12+
# generate pathdef.c
13+
find_program(WHOAMI_PROG whoami)
14+
find_program(HOSTNAME_PROG hostname)
15+
16+
if (EXISTS ${WHOAMI_PROG})
17+
execute_process(COMMAND ${WHOAMI_PROG}
18+
OUTPUT_STRIP_TRAILING_WHITESPACE
19+
OUTPUT_VARIABLE USERNAME)
20+
endif()
21+
if (EXISTS ${HOSTNAME_PROG})
22+
execute_process(COMMAND ${HOSTNAME_PROG}
23+
OUTPUT_STRIP_TRAILING_WHITESPACE
24+
OUTPUT_VARIABLE HOSTNAME)
25+
endif()
26+
27+
configure_file (
28+
"${PROJECT_SOURCE_DIR}/config/pathdef.c.in"
29+
"${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
30+
ESCAPE_QUOTES)

config/config.h.in

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
#define NEOVIM_VERSION_MAJOR @NEOVIM_VERSION_MAJOR@
2+
#define NEOVIM_VERSION_MINOR @NEOVIM_VERSION_MINOR@
3+
#define NEOVIM_VERSION_PATCH @NEOVIM_VERSION_PATCH@
4+
5+
#if @DEBUG@
6+
#define DEBUG
7+
#endif
8+
9+
#define SIZEOF_INT @SIZEOF_INT@
10+
#define SIZEOF_LONG @SIZEOF_LONG@
11+
#define SIZEOF_TIME_T @SIZEOF_TIME_T@
12+
#define SIZEOF_OFF_T @SIZEOF_OFF_T@
13+
14+
#define _FILE_OFFSET_BITS 64
15+
#define HAVE_ATTRIBUTE_UNUSED 1
16+
#define HAVE_BCMP 1
17+
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
18+
#define HAVE_DATE_TIME 1
19+
#define HAVE_DIRENT_H 1
20+
#define HAVE_DLFCN_H 1
21+
#define HAVE_DLOPEN 1
22+
#define HAVE_DLSYM 1
23+
#define HAVE_ERRNO_H 1
24+
#define HAVE_FCHDIR 1
25+
#define HAVE_FCHOWN 1
26+
#define HAVE_FCNTL_H 1
27+
#define HAVE_FD_CLOEXEC 1
28+
#define HAVE_FLOAT_FUNCS 1
29+
#define HAVE_FSEEKO 1
30+
#define HAVE_FSYNC 1
31+
#define HAVE_GETCWD 1
32+
#define HAVE_GETPWENT 1
33+
#define HAVE_GETPWNAM 1
34+
#define HAVE_GETPWUID 1
35+
#define HAVE_GETRLIMIT 1
36+
#define HAVE_GETTEXT 1
37+
#define HAVE_GETTIMEOFDAY 1
38+
#define HAVE_GETWD 1
39+
#define HAVE_ICONV 1
40+
#define HAVE_ICONV_H 1
41+
#define HAVE_INTTYPES_H 1
42+
#define HAVE_ISWUPPER 1
43+
#define HAVE_LANGINFO_H 1
44+
#define HAVE_LIBGEN_H 1
45+
#define HAVE_LIBINTL_H 1
46+
#define HAVE_LOCALE_H 1
47+
#define HAVE_LSTAT 1
48+
#define HAVE_MATH_H 1
49+
#define HAVE_MEMCMP 1
50+
#define HAVE_MEMSET 1
51+
#define HAVE_MKDTEMP 1
52+
#define HAVE_NANOSLEEP 1
53+
#define HAVE_NL_LANGINFO_CODESET 1
54+
#define HAVE_NL_MSG_CAT_CNTR 1
55+
#define HAVE_OPENDIR 1
56+
#define HAVE_OSPEED 1
57+
#define HAVE_POLL_H 1
58+
#define HAVE_PUTENV 1
59+
#define HAVE_PWD_H 1
60+
#define HAVE_QSORT 1
61+
#define HAVE_READLINK 1
62+
#define HAVE_RENAME 1
63+
#define HAVE_SELECT 1
64+
#define HAVE_SELINUX 1
65+
#define HAVE_SETENV 1
66+
#define HAVE_SETJMP_H 1
67+
#define HAVE_SETPGID 1
68+
#define HAVE_SETSID 1
69+
#define HAVE_SGTTY_H 1
70+
#define HAVE_SIGACTION 1
71+
#define HAVE_SIGALTSTACK 1
72+
#define HAVE_SIGCONTEXT 1
73+
#define HAVE_SIGSTACK 1
74+
#define HAVE_SIGVEC 1
75+
#define HAVE_ST_BLKSIZE 1
76+
#define HAVE_STDARG_H 1
77+
#define HAVE_STDINT_H 1
78+
#define HAVE_STDLIB_H 1
79+
#define HAVE_STRCASECMP 1
80+
#define HAVE_STRERROR 1
81+
#define HAVE_STRFTIME 1
82+
#define HAVE_STRING_H 1
83+
#define HAVE_STRINGS_H 1
84+
#define HAVE_STRNCASECMP 1
85+
#define HAVE_STROPTS_H 1
86+
#define HAVE_STRPBRK 1
87+
#define HAVE_STRTOL 1
88+
#define HAVE_SVR4_PTYS 1
89+
#define HAVE_SYSCONF 1
90+
#define HAVE_SYSINFO 1
91+
#define HAVE_SYSINFO_MEM_UNIT 1
92+
#define HAVE_SYS_IOCTL_H 1
93+
#define HAVE_SYS_PARAM_H 1
94+
#define HAVE_SYS_POLL_H 1
95+
#define HAVE_SYS_RESOURCE_H 1
96+
#define HAVE_SYS_SELECT_H 1
97+
#define HAVE_SYS_STATFS_H 1
98+
#define HAVE_SYS_SYSCTL_H 1
99+
#define HAVE_SYS_SYSINFO_H 1
100+
#define HAVE_SYS_TIME_H 1
101+
#define HAVE_SYS_TYPES_H 1
102+
#define HAVE_SYS_UTSNAME_H 1
103+
#define HAVE_SYS_WAIT_H 1
104+
#define HAVE_TERMCAP_H 1
105+
#define HAVE_TERMIO_H 1
106+
#define HAVE_TERMIOS_H 1
107+
#define HAVE_TGETENT 1
108+
#define HAVE_TOWLOWER 1
109+
#define HAVE_TOWUPPER 1
110+
#define HAVE_UNISTD_H 1
111+
#define HAVE_UP_BC_PC 1
112+
#define HAVE_USLEEP 1
113+
#define HAVE_UTIME 1
114+
#define HAVE_UTIME_H 1
115+
#define HAVE_UTIMES 1
116+
#define HAVE_WCHAR_H 1
117+
#define HAVE_WCTYPE_H 1
118+
#define RETSIGTYPE void
119+
#define SIGRETURN return
120+
#define SYS_SELECT_WITH_SYS_TIME 1
121+
#define TERMINFO 1
122+
#define TGETENT_ZERO_ERR 0
123+
#define TIME_WITH_SYS_TIME 1
124+
#define UNIX 1
125+
#define USEMAN_S 1
126+
#define USEMEMMOVE 1
127+
128+
#define FEAT_ARABIC
129+
#define FEAT_AUTOCHDIR
130+
#define FEAT_AUTOCMD
131+
#define FEAT_BROWSE
132+
#define FEAT_BROWSE_CMD
133+
#define FEAT_BYTEOFF
134+
#define FEAT_CINDENT
135+
#define FEAT_CMDHIST
136+
#define FEAT_CMDL_COMPL
137+
#define FEAT_CMDL_INFO
138+
#define FEAT_CMDWIN
139+
#define FEAT_COMMENTS
140+
#define FEAT_COMPL_FUNC
141+
#define FEAT_CONCEAL
142+
#define FEAT_CON_DIALOG
143+
#define FEAT_CRYPT
144+
#define FEAT_CSCOPE
145+
#define FEAT_CURSORBIND
146+
#define FEAT_DIFF
147+
#define FEAT_DIGRAPHS
148+
#define FEAT_EVAL
149+
#define FEAT_EX_EXTRA
150+
#define FEAT_FIND_ID
151+
#define FEAT_FKMAP
152+
#define FEAT_FLOAT
153+
#define FEAT_FOLDING
154+
#define FEAT_GETTEXT
155+
#define FEAT_HANGULIN
156+
#define FEAT_INS_EXPAND
157+
#define FEAT_JUMPLIST
158+
#define FEAT_KEYMAP
159+
#define FEAT_LANGMAP
160+
#define FEAT_LINEBREAK
161+
#define FEAT_LISP
162+
#define FEAT_LISTCMDS
163+
#define FEAT_LOCALMAP
164+
#define FEAT_MBYTE
165+
#define FEAT_MENU
166+
#define FEAT_MODIFY_FNAME
167+
#define FEAT_MOUSE
168+
#define FEAT_MOUSE_DEC
169+
#define FEAT_MOUSE_NET
170+
#define FEAT_MOUSE_SGR
171+
#define FEAT_MOUSE_TTY
172+
#define FEAT_MOUSE_URXVT
173+
#define FEAT_MOUSE_XTERM
174+
#define FEAT_MULTI_LANG
175+
#define FEAT_PATH_EXTRA
176+
#define FEAT_PERSISTENT_UNDO
177+
#define FEAT_POSTSCRIPT
178+
#define FEAT_PRINTER
179+
#define FEAT_PROFILE
180+
#define FEAT_QUICKFIX
181+
#define FEAT_RELTIME
182+
#define FEAT_RIGHTLEFT
183+
#define FEAT_SCROLLBIND
184+
#define FEAT_SEARCHPATH
185+
#define FEAT_SEARCH_EXTRA
186+
#define FEAT_SESSION
187+
#define FEAT_SMARTINDENT
188+
#define FEAT_SPELL
189+
#define FEAT_STL_OPT
190+
#define FEAT_SYN_HL
191+
#define FEAT_TAG_BINS
192+
#define FEAT_TAG_OLDSTATIC
193+
#define FEAT_TERMRESPONSE
194+
#define FEAT_TEXTOBJ
195+
#define FEAT_TITLE
196+
#define FEAT_USR_CMDS
197+
#define FEAT_VERTSPLIT
198+
#define FEAT_VIMINFO
199+
#define FEAT_VIRTUALEDIT
200+
#define FEAT_VISUAL
201+
#define FEAT_VISUALEXTRA
202+
#define FEAT_VREPLACE
203+
#define FEAT_WAK
204+
#define FEAT_WILDIGN
205+
#define FEAT_WILDMENU
206+
#define FEAT_WINDOWS
207+
#define FEAT_WRITEBACK
208+
#define FEAT_HUGE
209+
#define FEAT_BIG
210+
#define FEAT_NORMAL
211+
#define FEAT_SMALL
212+
#define FEAT_TINY
213+
#define FEAT_WRITEBACKUP
214+
#define VIM_BACKTICK /* internal backtick expansion */

config/pathdef.c.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "${PROJECT_SOURCE_DIR}/src/vim.h"
2+
char_u *default_vim_dir = (char_u *)"${CMAKE_INSTALL_PREFIX}/share/vim";
3+
char_u *default_vimruntime_dir = (char_u *)"";
4+
char_u *all_cflags = (char_u *)"${COMPILER_FLAGS}";
5+
char_u *all_lflags = (char_u *)"${LINKER_FLAGS}";
6+
char_u *compiled_user = (char_u *)"${USERNAME}";
7+
char_u *compiled_sys = (char_u *)"${HOSTNAME}";

src/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
file( GLOB NEOVIM_SOURCES *.c )
2+
3+
foreach(sfile ${NEOVIM_SOURCES})
4+
get_filename_component(f ${sfile} NAME)
5+
if(${f} MATCHES "^(regexp_nfa.c|farsi.c|arabic.c)$")
6+
list(APPEND to_remove ${sfile})
7+
endif()
8+
endforeach()
9+
10+
list(REMOVE_ITEM NEOVIM_SOURCES ${to_remove})
11+
list(APPEND NEOVIM_SOURCES "${PROJECT_BINARY_DIR}/config/auto/pathdef.c")
12+
13+
file( GLOB IO_SOURCES io/*.c )
14+
15+
add_executable (vim ${NEOVIM_SOURCES} ${IO_SOURCES})
16+
17+
target_link_libraries (vim m termcap selinux)
18+
include_directories ("${PROJECT_SOURCE_DIR}/src/proto")

0 commit comments

Comments
 (0)