Commit Graph

104 Commits

Author SHA1 Message Date
Michael Reed
2b4cbbebf4 cmake: Build with -fstack-protector-strong if available #2597
If not available, fall back to -fstack-protector + --param=ssp-buffer-size=4
If that isn't available, do nothing.

See the following articles for more information:

https://lwn.net/Articles/584225/
https://outflux.net/blog/archives/2014/01/27/fstack-protector-strong/
2015-08-26 18:05:38 -04:00
Rui Abreu Ferreira
fc7055f6e9 Mingw: Use POSIX compatible stdio #3232
- There are some differences between stdio (*printf) functions in POSIX
  and the MS runtime, this commit enables Mingw compatibility for these
  functions
2015-08-25 19:13:23 -04:00
ZyX
e1cc0fe996 cmake: Generate tags and some vim syntax elements 2015-07-26 21:09:52 +03:00
Florian Walch
fe6bd8cae2 CMake: Add option for Clang TSan, rename option ASAN -> ASAN_UBSAN. 2015-07-05 10:31:16 +03:00
Florian Walch
bd9042b1a9 CMake: Add option for Clang MSan. 2015-07-05 10:31:16 +03:00
Michael Reed
01a200996a Remove outdated and unused manuals #2891
`nvim-[lang].1`:
The non-english manuals are completely outdated and still written in
roff, as opposed to mdoc, which is used for `nvim.1`.
Given that, they're nearly useless at the moment, and when/if they are
updated, they should probably be rewritten from scratch using `nvim.1`
as a reference.

`xxd*.1`:
xxd hasn't been in the source tree for a long time, so the manual is of
little use.

`nvimtutor*.1`:
The vimtutor script hasn't ever shipped with nvim, and the consensus
seems to be that it won't, at least in the form of an executable
installed alongside `$(PREFIX)/bin/nvim` (see #2700).

In `nvim.1`, the argument to the `.Os` macro was removed. This was done
because its only purpose was to signify that nvim and nvimtutor
were part of the "Neovim" distribution, i.e., one and the same, which
isn't applicable anymore because `nvimtutor.1` is being removed.
From the `.Os` documentation in `man mdoc`:

    Os
	 Operating system version for display in the page footer.  This is the
	 mandatory third macro of any mdoc file.  Its syntax is as follows:

	       .Os [system [version]]

	 The optional system parameter specifies the relevant operating system or
	 environment.  It is suggested to leave it unspecified, in which case
	 mandoc(1) uses its -Ios argument or, if that isn't specified either,
	 sysname and release as returned by uname(3).

	 Examples:
	       .Os
	       .Os KTH/CSC/TCS
	       .Os BSD 4.3

	 See also Dd and Dt.

Reviewed-by: Felipe Morales <hel.sheep@gmail.com>
Reviewed-by: Florian Walch <florian@fwalch.com>
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>

[ci skip]
2015-06-25 19:08:21 -04:00
Thomas Anderson
9995f15a98 CMake: Fix helptags generation when prefix is not /usr. #2741 2015-06-09 01:12:08 -04:00
Florian Walch
2271b746d7 CMake: Fix _FORTIFY_SOURCE detection when using hardening-wrapper. #2788
When checking code with check_c_source_compiles, the "check variable"
(for the _FORTIFY_SOURCE detection: previously _FORTIFY_SOURCE_ACCEPTABLE, now
HAS_ACCEPTABLE_FORTIFY) is passed to the compiler like
-D_FORTIFY_SOURCE_ACCEPTABLE. This throws off hardening-wrapper [1],
which then NOT sets _FORTIFY_SOURCE=2 for the check, assuming it had already
been set manually as it detected -D_FORTIFY_SOURCE*. Renaming the "check
variable" to not match this pattern works around this problem.

[1] https://github.com/thestinger/hardening-wrapper
2015-06-04 13:43:02 +03:00
Thiago de Arruda
1352725beb build: Limit --coverage flag to files under "src"
Resolves #2632. This is done so C helper modules don't generate unexpected
coverage output.

Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Florian Walch <florian@fwalch.com>
2015-05-18 04:28:01 -03:00
Michael Reed
aa1d9a1807 Build: Use GNUInstallDirs, install man pages #2649
For now, only install man pages matching "nvim*.1": we don't want to
install xxd.1 as it might conflict with that of a user's Vim
installation.

closes #1826

Reviewed-by: Florian Walch <florian@fwalch.com>
Helped-by: John Szakmeister <john@szakmeister.net>
2015-05-17 14:57:43 -04:00
John Szakmeister
d00558bbdb build: create prereq targets for test dependencies
This will help make sure that we build all the right prereqs before
manually running tests under QuickBuild.

Notice that shell-test has been added as a prereq for the functional
tests, since it's a requirement for testing the terminal features.
2015-05-09 09:24:07 -04:00
Scott Prager
74aef89720 term: use an argument vector for termopen().
Old behaviour: termopen('cmd') would run `&shell &shcf "cmd"`, which
caused the functional tests to fail on some systems due to the process
not "owning" the terminal. Also, it is inconsistent with jobstart().

Modify termopen() so that &shell is not invoked, but maintain the old
behaviour with :terminal. Factor the common code for building the
argument vector from jobstart() and modify the functional tests to call
termopen() instead of :terminal (fixes #2354).

Also:
 * Add a 'name' option for termopen() so that `:terminal {cmd}` produces
   a buffer named "term//{cwd}/{cmd}" and termopen() users can customize
   the name.
 * Update the documentation.
 * Add functional tests for `:terminal` sinse its behaviour now differs
   from termopen(). Add "test/functional/fixtures/shell-test.c" and move
   "test/functional/job/tty-test.c" there, too.

Helped-by: Justin M. Keyes <@justinmk>
2015-05-02 09:47:29 -04:00
Florian Walch
8130eb1191 jemalloc: Force use of prefixed functions.
* Set JEMALLOC_NO_DEMANGLE to be able to use `je_*` functions,
  regardless of how jemalloc was compiled (--with-jemalloc-prefix)
* Show jemalloc information in Neovim's version output.

Resolve #2449.
2015-04-29 22:26:55 +03:00
Florian Walch
5b5d353151 CMake: Don't request static linking for dependencies.
For built-in dependencies, shared libraries are removed and static
linking is always used.

For systemwide dependencies, static linking should not be used.
2015-04-29 22:26:55 +03:00
Florian Walch
07d4142a18 CMake: Refer to Unibilium instead of LibUnibilium. 2015-04-29 22:26:55 +03:00
Michael Reed
55aab0e7e1 CMakeLists.txt: Remove unneeded globs
refs #2426
2015-04-16 20:22:05 -04:00
Thiago de Arruda
8a1a9b9558 deps: Add jemalloc as an optional dependency
Jemalloc will be used if the cmake option `USE_JEMALLOC` is enabled(which is the
default). To avoid trouble with clang's ASAN, it is disabled by default if the
`SANITIZE` option is enabled.

Since jemalloc has thread cache for small objects, it fills the gap created by
removing klib memory pools.

The `xstrdup` funciton(memory.c) had to be reimplemented on top of `xmalloc` to
make it work with a custom allocator.
2015-04-13 08:22:59 -03:00
David Bürgin
d3bb177f1e vim-patch:7.4.497 #2295
Problem:    With some regexp patterns the NFA engine uses many states and
            becomes very slow.  To the user it looks like Vim freezes.
Solution:   When the number of states reaches a limit fall back to the old
            engine. (Christian Brabandt)

https://github.com/vim/vim/releases/tag/v7-4-497

Helped-by: David Bürgin <676c7473@gmail.com>
Helped-by: Justin M. Keyes <justinkz@gmail.com>
Helped-by: Scott Prager <splinterofchaos@gmail.com>
2015-04-05 19:24:58 -04:00
Scott Prager
feca9624b8 CMakeLists: enable USE_FNAME_CASE on Mac 2015-03-31 11:20:24 -03:00
lyuts
862d687fea Fixed compilation when using custom libtermkey (not installed in base
system).
2015-03-15 00:11:10 -07:00
Volodymyr Medvid
f7d5839d0c deps: Provide options to disable static linkage
Allow dynamic linkage to libunibilium, libtermkey and libvterm.
2015-03-08 23:29:47 +02:00
Thiago de Arruda
81a346553c deps: Add libvterm to the project dependencies
libvterm is a terminal emulation library with abstract display. It will be used
to implement builtin terminal emulation into Nvim.
2015-02-28 10:41:53 -03:00
Mike Zeller
f28941b96d illumos requires the use of limits.h for things like INT_MAX #2049 2015-02-26 11:42:05 -05:00
John Szakmeister
9bc1e4335c build: make sure our deps area is picked up for pkg-config files 2015-02-24 14:01:20 -05:00
Thiago de Arruda
d7e560e5b3 job: Allow spawning jobs connected to pseudo terminals 2015-02-23 21:43:33 -03:00
Thiago de Arruda
9a2dd7c498 ui: Rewrite the builtin terminal UI
Now all terminal-handling code was moved to src/nvim/tui, which implements a
new terminal UI based on libtermkey and unibilium
2015-02-16 23:17:39 -03:00
John Szakmeister
1eef530351 Merge pull request #1588 from equalsraf/tb-no-central-deps
Dont force ../.deps in third-party/CMakeLists.txt use the Makefile instead
2014-12-18 08:11:00 -05:00
John Szakmeister
379dcd7d7f Merge pull request #1686 from jszakmeister/include-opts-in-fortify-check
build: include the flags for the build type in the _FORTIFY_SOURCE check
2014-12-18 04:14:14 -05:00
Ross Smith
1c3d093c85 Detect and propagate _FORTIFY_SOURCE prefix
Get prefix to a -D_FORTIFY_SOURCE string if it is present in
CFLAGS and apply the prefix to flags added to redefine
_FORTIFY_SOURCE in CFLAGS and CPPFLAGS

* fixes 1569
2014-12-17 23:05:46 -05:00
John Szakmeister
0a5dad8a10 build: include the flags for the build type in the _FORTIFY_SOURCE check
It turns out the check was being performed without optimizations enabled
even when the CMAKE_BUILD_TYPE was set to a release build.  This led to
_FORTIFY_SOURCE's level not being correctly determined, and us failing
to apply the correct workaround.

To counter this, we'll take the default flags for the build type and
apply them.  Also, if options are passed via CFLAGS, they are
automatically passed on to the underlying build.  So this should cover
all the necessary ground.

This fixes #1647.
2014-12-16 06:02:42 -05:00
Rui Abreu Ferreira
8d54a7203e Allow cmake caller to override DEPS_PREFIX
- Caller can override bundled dependency location using
  DEPS_PREFIX
- Cache variable DEPS_PREFIX, using .deps/usr by default
- Removed unused variables DEPS_BIN_DIR, DEPS_BUILD_DIR, DEPS_DIR
  DEPS_INSTALL_DIR
- Corner case: if the caller tries to override DEPS_PREFIX after a
  successful cmake configuration, the caller needs to clear the cache
  because dependency checks are based on the old value
2014-12-16 10:28:43 +00:00
oakes
dd9e5a3d7a Allow building as a static -fPIC library 2014-12-12 14:48:39 -05:00
John Szakmeister
7b6f705e5f build: probe the compiler to see if we need to turn down _FORTIFY_SOURCE
Some builds don't use Release (such as Gentoo, though it can be told
to).  So let's go a bit further and probe the compiler to see if we need
to turn down the _FORTIFY_SOURCE level.
2014-11-25 20:18:51 -05:00
Florian Walch
96b31ca048 CMake: Set -Wconversion by default. 2014-11-19 17:21:21 +01:00
Rui Abreu Ferreira
2b887ec66b Use cmake --build instead of Make
- If possble try to abstract away from Make, and use cmake --build
- third-party still needs to find Make to build some components
- Removed search for Make from CMakeLists.txt
* for CMake < 3.0 --build has no color output
2014-11-14 14:35:16 +00:00
John Szakmeister
2540155591 build: fix CMAKE_MODULE_PATH usage
Fixes #1447.  `CMAKE_MODULE_PATH` is meant to be a list of directories,
and as such, is not the proper way to launch our scripts.  Let's use
`${PROJECT_SOURCE_DIR}/cmake` instead.  Also, let's not outright set
`CMAKE_MODULE_PATH`, but instead append our location to the list.
2014-11-10 19:26:01 -05:00
Florian Walch
176930fa56 version: Add compilation info. 2014-11-09 18:34:57 +01:00
John Szakmeister
dcccc1a50d Merge pull request #1437 from jszakmeister/build-search-fixes
A few fixes for some build-related issues.
2014-11-09 08:31:33 -05:00
John Szakmeister
d51c0a9471 build: only attempt to use -Og if it's supported
Commit a1d411f9c9 just assumes that gcc
will support the `-Og` option, but gcc that comes with Ubuntu 12.04 does
not.  Let's check to see if the flag is supported, and then decide
whether to enable it or not.
2014-11-09 06:58:17 -05:00
Justin M. Keyes
c9df7ba308 Merge pull request #1383 from fwalch/nvim-buildtype
CMake: Set custom RelWithDebInfo compile flags.
2014-11-08 18:39:12 -05:00
John Szakmeister
9344a40e74 build: pull iconv detection into its own FindIconv.cmake file
This will provide better control for those who may want to alter which
one gets used.
2014-11-08 16:22:35 -05:00
John Szakmeister
203a5166a0 build: give priority to /sw and /opt/local on Mac OS X
Unfortunately, we can't force the specific inclusion of a header file.
So if anything add /opt/local/include to the include path--such as
libintl--then other dependencies might be drawn from /opt/local at
compile time, even though we detected them elsewhere at configure time.
This, in turn, causes issues with mixed versions, such as the iconv.h
header being pulled from /opt/local/include, but linked against the
library in /usr/lib--which can be mismatched versions.

So, despite CMake's best effort to treat /sw and /opt/local as just
another system area, we really need to give them preferential treatment.
To do this, we add them to CMAKE_PREFIX_PATH.

This fixes an issue discovered while re-enabling iconv in #1370.
2014-11-08 16:21:47 -05:00
John Szakmeister
05f78d30ac build: use the proper libintl include variable
What was there worked, but it wasn't meant to be the variable that you
use for inclusion.
2014-11-08 16:11:12 -05:00
Florian Walch
a1d411f9c9 CMake: Set custom RelWithDebInfo compile flags. 2014-11-08 21:54:30 +01:00
John Szakmeister
5d97f3fc2c build: default to using -O2 for release builds
The -O3 optimization level can often lead to dangerous (and sometimes
incorrect) optimizations being performed.  So let's use a level that's
more stable.
2014-11-07 06:21:54 -05:00
John Szakmeister
5ba1d980fb build: fix running of functional tests directly with CMake
If you aren't just building everything into build/, then the functional
tests fail because they can't find the nvim executable.  Let's pass in
the location of the nvim executable, and set NVIM_PRG environment
variable accordingly.
2014-11-05 07:26:35 -05:00
Florian Walch
b904c33e41 CMake: Rename target "test" to "functionaltest".
Remove build warning:

    The target name "test" is reserved or not valid for certain CMake
    features, such as generator expressions, and may result in undefined
    behavior.
2014-11-05 11:54:20 +01:00
Florian Walch
5714afc11e CMake: Modify _FORTIFY_SOURCE only for release builds.
Remove build warning for Debug builds:

    # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
2014-11-05 11:54:15 +01:00
John Szakmeister
64ea00299d build: turn down the _FORTIFY_SOURCE level on gcc >= 4.0 2014-11-05 03:53:31 -05:00
John Szakmeister
5e65400c6f Add missing linker flags required for LuaJIT on 64-bit Mac OS X.
This was brought up in #1294.
2014-10-17 06:50:13 -04:00