Commit graph

261 commits

Author SHA1 Message Date
David Adam
3444fe87fb configure: check for definition of setupterm, not just linkability
Some platforms ship the headers and libraries for ncurses in different
packages, which can produce false positives when checking for their
presence.

Closes #3866.
2017-03-05 15:06:20 +08:00
ridiculousfish
07c9f0de9d Set -Wno-missing-field-initializers
Suppresses a hugely annoying warning in g++ build for
code initialized via the ={} idiom (which is safe).
2017-01-26 16:34:55 -08:00
mathbunnyru
9768653df7 New pcre2 2017-01-18 16:44:48 -08:00
David Adam
4bc220f349 Drop requirement for socket library
The socket(2) library function is only required on Linux, and does not
require special linker arguments to work.

Closes #2360.
2017-01-11 19:34:32 +08:00
Zoltán Mizsei
aedee4e1a4 Haiku have no lsocket, but lnetwork 2016-12-26 08:00:53 +08:00
Kurtis Rader
0019c12af3 changes to allow building on Solaris 10
Fixes #3456
2016-12-08 19:15:11 -08:00
David Adam
2b0bad889a configure: force use of -pthread on Solaris
This fixes a problem with non-threadsafe errno.

Ideally, this would be the use of the AX_PTHREAD macro, but it is GPL 3+
only, which is incompatible with the GPL 2 license of fish. It also
would need extending to cover C++.

For now, fish doesn't build on anything except GCC under Solaris anyway,
so `-pthread` is the right thing to use.

Work on #3340.
2016-12-03 16:36:06 +08:00
David Adam
ee15f1b987 configure: check that errno is threadsafe
Without `-pthread` specified to the compiler, errno is not threadsafe on
Solaris (as _REENTRANT is undefined, and _POSIX_C_SOURCE may not be set
until after the inclusion of <errno.h>).

Work on #3340.
2016-12-03 16:36:06 +08:00
David Adam
2b7dddf342 add flock fallback
Import the flock compatibility wrapper from NetBSD.

Work on #3340.
2016-12-03 16:36:06 +08:00
David Adam
1293cd8b6a Check for functions in std namespace
On Solaris, some standard wide character functions are only contained in
the std:: namespace. The configure script now checks for these, enabling
the appropriate `uses` statements in src/common.h.

The checks are handwritten, because Autoconf's AC_CHECK_FUNC macro
always uses C linkage, but the problem only appears under C++ linkage.

Work on #3340.
2016-12-03 16:36:06 +08:00
ridiculousfish
87b0d1b828 Merge pull request #3585 from fornwall/build-without-shmem
Fix build on systems without shm_open()
2016-11-26 14:38:07 -08:00
ridiculousfish
df55991806 Teach ./configure to rerun autoreconf --no-recursive
Currently, the ./configure script generated by autotools will
test if the configure.ac script is newer than its output configure
script, and if so, run autoconf to rebuild it. However autoconf
is no longer sufficient because we have some m4 macros. So now
run autoreconf --no-recursive (per #3572)
2016-11-26 13:17:23 -08:00
Fredrik Fornwall
df12ac24b2 Fix build on systems without shm_open()
Notably, this fixes building on Android.
2016-11-26 16:14:15 -05:00
ridiculousfish
f0ba37b73a Enable C++11 in autotools build 2016-11-26 12:59:00 -08:00
Fredrik Fornwall
fe8727fb71 Fix building on Android by avoiding getpwent() (#3441)
* Fix building on Android by avoiding getpwent() if missing with autoconf check

The getpwent() function does not link when building for Android,
and user names on that platform are not interesting anyway.
2016-10-15 17:20:53 -07:00
Fredrik Fornwall
36f320598e Check for struct stat.st_ctime_nsec before using
Using a configure check for stat.st_ctime_nsec fixes building on
Android which has that field but does not define STAT_HAVE_NSEC.

Before this change the Android build failed on the st_ctim.tv_nsec
fallback #else clause.
2016-10-10 19:33:25 -07:00
Aaron Gyes
8d40bf325d Fix configure.ac comments 2016-10-08 16:09:25 -07:00
Aaron Gyes
488a09fffb Don't prefer clang++
This change causes our configure script to just use the default behavior
of autoconf: in practice it will try g++ instead of clang++ first.

There are good reasons to use the behavior this reverts, namely g++
might be a symlink to clang++ and clang++ is never a symlink to g++ -
when `configure` says using "g++" that doens't tell us much.

On more systems than not, as far as I can tell, clang++ will often be a
newer compiler than g++ from what I can see as well.

However, it appears we have some bad things happening with Cygwin on
clang.

Fixes #3435
2016-10-07 23:56:48 -07:00
Kurtis Rader
7fd3079bb6 remove one of the wrealpath() definitions
It is believed there are no longer any platforms we support that do not
support passing NULL as the second argument to realpath(). So rather
than duplicating the logic to get reasonable behavior from our
wrealpath() wrapper simply remove the redundant implementation.
2016-10-04 20:20:11 -07:00
David Adam
53f1ebaf6b don't check for CPP in the configure script
The preprocessor never gets called directly.
2016-10-02 18:52:21 +08:00
Aaron Gyes
30b71fbb78 $(v)echo foo -> $v echo foo for verbosity modifier
Not sure why I crammed $(v) up like that with the parens. This is
a little sed job after regretting the Makefile seeming harder to read.
Certainly better.

We want clang or gcc picked for both C++/C

Few final cleanups - time to feed it to Travis.
2016-09-17 16:29:43 -07:00
Aaron Gyes
06c658dd5e Autotools build: teach it clang, utility macros
Teach autotools about clang++.
 - Use AC macros for these utilities in Makefile:
    LN_S, MKDIR_P, AWK, GREP, FGREP.
   This has the effect on OS X with prefixed coreutils installed
   from macports: > make show-LN_S show-MKDIR_P show-AWK show-GREP
    LN_S = 'ln -s'
    MKDIR_P = '/opt/local/bin/gmkdir -p'
    AWK = 'awk'
    GREP = '/opt/local/bin/grep'
    FGREP = '/opt/local/bin/grep -F'
 - Use GNU Make findstrings, wildcard,notdir,
 - SHELL = @SHELL@ per reccomended practice and in line with
    actual behavior.
 - Add output for string wrangling steps
2016-09-15 23:24:41 -07:00
Kurtis Rader
9f21e3792a remove dependency on dcgettext()
While fixing issue #3110 I noticed there is exactly one place we use
dcgettext() and that use is completely unnecessary. So remove it.
2016-06-05 18:52:19 -07:00
Kurtis Rader
db1ec847f9 fix lint error in wgettext()
Cppcheck was complaining about the `return val.c_str()` at the end of the
`wgettext()` function. That would normally a bug since the lifetime of
`val` ends when the function returns. In this particular case that's not
true because the string is interned in a cache. Nonetheless, rather than
suppress the lint warning I decided to modify the API to be more idiomatic.

In the process of fixing the aforementioned lint warning I fixed several other
lint errors in that module.

This required making our copy of `wgetopt()` compatible with the rest of
the fish code. Specifically, by removing its local definitions of the
"_" macro so it uses the same macro used everywhere else in the fish
code. The sooner we kill the use of wide chars the better.
2016-06-01 22:19:03 -07:00
Kurtis Rader
5bf1b0e5f5 fix random lint issues
This only eliminates errors reported by `make lint`. It shouldn't cause any
functional changes.

This change does remove several functions that are unused. It also removes the
`desc_arr` variable which is both unused and out of date with reality.
2016-05-29 22:24:29 -07:00
David Adam
91962d8aa2 configure: move an errant space
Introduced in 6b92fdd18d.
2016-05-25 21:39:57 +00:00
David Adam
6b92fdd18d configure: fix CXXFLAGS with system pcre2
cleanups in configure meant that a number of arguably spurious spaces
were dropped from the CXXFLAGS, which produced an error without the
below.
2016-05-24 12:24:56 +00:00
Kurtis Rader
7c24369454 fix building on Cygwin
Cygwin still doesn't support any of the backtrace functions. Also, remove a
spurious newline from a debug message.

Fixes #2993
2016-05-19 19:27:22 -07:00
David Adam
9192bf1db5 configure: fix _nl_msg_cat_cntr check 2016-05-18 22:39:20 +00:00
David Adam
db18449f4c fallback: drop fallbacks for C99/C++0x wide character functions
Drops configure check for wcsdup, wcslen, wcscasecmp, wcsncasecmp,
wcwidth, wcswidth, wcstok, fputwc, fgetwc, and wcstol. Drop the fallback
implementations of these on non-Snow Leopard platforms.

Work on #2999.
2016-05-18 22:39:20 +00:00
David Adam
44757c81af fallback: remove fwprintf and friends fallbacks
All modern operating systems implement fwprintf, including NetBSD (which
introduced them in 2005).

Work on #2999.
2016-05-18 22:39:20 +00:00
David Adam
d0aa461587 fallback: remove sysconf fallback
sysconf was introduced in IEEE Std 1003.1-1988 (POSIX.1) and exists
on every system I can find.

Work on #2999.
2016-05-18 22:39:20 +00:00
David Adam
504b32f61b configure: drop fwprintf test
fwprintf would segfault on DragonFly BSD 1.4.0, released in January
2006. This was fixed by DragonFly BSD 1.4.4, released in April 2006. It
seems unlikely that anyone is still running a ten-year-old, unsupported
version, and hoping that fish will continue to build.

I've checked this in virtual machines.

Work on #2999.
2016-05-18 22:39:20 +00:00
David Adam
6a5d89669e configure: drop tests for ancient platforms
Work on #2999.
2016-05-18 22:39:20 +00:00
David Adam
e39628bbe9 configure: drop unnecessary feature flag checks
Work on #2999.
2016-05-18 22:39:20 +00:00
David Adam
f5dcb6a0cb configure: Use standard macro to enable Large File Support
Work on #2999.
2016-05-18 22:39:20 +00:00
David Adam
14187f9e3f configure: drop manual checks for __EXTENSIONS__
375bef4443 includes the appropriate
autoconf method of checking for this feature flag.

Work on #2999.
2016-05-18 22:39:20 +00:00
Kurtis Rader
73f2992a2e make debug() output more useful
This change does several things. First, and most important, it allows
dumping the "n" most recent stack frames on each debug() call. Second,
it demangles the C++ symbols. Third, it prepends each debug() message
with the debug level.

Unrelated to the above I've replaced all `assert(!is_forked_child());`
statements with `ASSERT_IS_NOT_FORKED_CHILD()` for consistency.
2016-05-17 14:52:55 -07:00
David Adam
28228627fc Merge branch 'Integration_2.3.0'
(Bump version numbers to reflect post-2.3b2)
2016-05-06 23:11:52 +01:00
ridiculousfish
58d7c4b388 Remove use of __environ
It has apparently never worked. Fixes #2988
2016-04-30 17:46:14 -07:00
Michael Steed
8a940a2ee7 configure: require at least pcre2-10.21
(cherry picked from commit c4c7983497)
2016-04-27 21:50:18 +08:00
Michael Steed
c4c7983497 configure: require at least pcre2-10.21 2016-04-27 12:14:53 +08:00
David Adam
375bef4443 configure: enable GNU/POSIX extensions by default
Reenable mkostemp on Cygwin. Work on #2952.
2016-04-21 22:34:37 +08:00
David Adam
0e7ab7a7d0 configure: work harder to ensure mkostemp usability
Closes #2952.
2016-04-21 22:33:32 +08:00
Aaron Gyes
0fd3f5c0dd Update to pcre2 10.21
Point build tools at 10.21
2016-04-19 11:49:12 +08:00
David Adam
c37c93fcf6 configure: remove tiny leftover from xsel build 2016-04-07 08:21:13 +08:00
David Adam
200a10e78d Rename "snippets" to "conf" internally, and document them as snippets
Discussed in #2896.
2016-04-06 09:33:09 +08:00
David Adam
484c1484c9 Customisable extra configuration, completion and function directories
- Add options to the autotools build to set the path for the "vendor"
   or "extra" configuration snippets, functions and completions
   directories.

 - Remove the vendor_completions directory from the Xcode build, as
   these are relocatable and compiling the paths in does not make sense.

This allows packaging tools like Homebrew and Nix to use a common
directory outside of the main prefix for third-party completions, and
to make these available for programmatic discovery through `pkg-config`.

Closes #2113
2016-04-04 15:58:13 -07:00
Kurtis Rader
6a16bdb808 assume getopt/getopt_long is available
There is no longer a good reason to detect whether or not getopt_long()
is available. All UNIX implementations we're likely to run on have it. And
if we ever find one that doesn't the right thing to do is not fallback to
getopt() but to include the getopt_long() source in our package like we
do with the pcre2 library. Since it's licensed under LGPL we can legally
do so if it becomes necessary.

This partially addresses issue #2790.
2016-03-08 13:38:57 -08:00
David Adam
7143512198 detect and provide fallback for backtrace_symbols_fd
Closes #2615 to fix includes on FreeBSD and provide fallback on Cygwin.
2015-12-17 20:36:33 +08:00