2006-08-28 10:03:34 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# This file is the main build configuration file for fish. It is used
|
2006-10-31 02:06:56 +00:00
|
|
|
# to determine your systems capabilities, and tries to adapt fish to
|
2006-08-28 10:03:34 +00:00
|
|
|
# take maximum advantage of the services your system offers.
|
|
|
|
#
|
2006-10-31 02:06:56 +00:00
|
|
|
# Process this file using the 'autoconf' command to produce a working
|
2006-08-28 10:03:34 +00:00
|
|
|
# configure script, which should in turn be executed in order to
|
2006-10-31 02:06:56 +00:00
|
|
|
# configure the build process.
|
2006-08-28 10:03:34 +00:00
|
|
|
#
|
|
|
|
|
2012-07-08 22:20:39 +00:00
|
|
|
AC_INIT(fish,2.0.0,fish-users@lists.sf.net)
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2010-09-18 06:31:18 +00:00
|
|
|
#
|
|
|
|
# preserve configure arguments for xsel
|
|
|
|
#
|
|
|
|
|
|
|
|
conf_arg=$@
|
2006-10-31 02:06:56 +00:00
|
|
|
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
|
|
|
# List of output variables produced by this configure script
|
|
|
|
#
|
|
|
|
|
2009-02-01 14:09:28 +00:00
|
|
|
AC_SUBST(docdir)
|
|
|
|
AC_SUBST(HAVE_GETTEXT)
|
|
|
|
AC_SUBST(LDFLAGS_FISH)
|
|
|
|
AC_SUBST(LIBS_FISH)
|
|
|
|
AC_SUBST(LIBS_FISH_INDENT)
|
|
|
|
AC_SUBST(LIBS_FISH_PAGER)
|
|
|
|
AC_SUBST(LIBS_FISHD)
|
|
|
|
AC_SUBST(LIBS_MIMEDB)
|
|
|
|
AC_SUBST(LIBS_SET_COLOR)
|
|
|
|
AC_SUBST(localedir)
|
|
|
|
AC_SUBST(optbindirs)
|
|
|
|
AC_SUBST(prefix)
|
|
|
|
AC_SUBST(SEQ_FALLBACK)
|
|
|
|
AC_SUBST(XSEL)
|
|
|
|
AC_SUBST(XSEL_MAN)
|
2010-09-18 05:49:03 +00:00
|
|
|
AC_SUBST(XSEL_BIN)
|
2009-02-01 14:09:28 +00:00
|
|
|
AC_SUBST(XSEL_MAN_PATH)
|
2007-03-24 10:56:29 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 13:44:44 +00:00
|
|
|
# If needed, run autoconf to regenerate the configure file
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
# This makes sure that after running autoconf once to create the first
|
|
|
|
# version of configure, we never again need to worry about manually
|
|
|
|
# running autoconf to handle an updates configure.ac.
|
|
|
|
#
|
|
|
|
|
2006-03-02 13:44:44 +00:00
|
|
|
AC_MSG_CHECKING([if autoconf needs to be run])
|
|
|
|
if test configure -ot configure.ac; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
if which autoconf >/dev/null; then
|
2006-03-10 13:50:24 +00:00
|
|
|
# No need to provide any error messages if autoconf fails, the
|
|
|
|
# shell and autconf should take care of that themselves
|
2006-03-02 13:44:44 +00:00
|
|
|
AC_MSG_NOTICE([running autoconf])
|
|
|
|
if autoconf; then
|
2006-03-29 00:25:00 +00:00
|
|
|
./configure "$@"
|
2006-08-28 10:03:34 +00:00
|
|
|
exit
|
2006-03-02 13:44:44 +00:00
|
|
|
fi
|
2006-08-28 10:03:34 +00:00
|
|
|
exit 1
|
2006-03-02 13:44:44 +00:00
|
|
|
else
|
2010-09-18 02:18:26 +00:00
|
|
|
AC_MSG_ERROR(
|
2006-08-28 10:03:34 +00:00
|
|
|
[cannot find the autoconf program in your path.
|
2006-03-29 00:25:00 +00:00
|
|
|
This program needs to be run whenever the configure.ac file is modified.
|
2006-08-28 10:03:34 +00:00
|
|
|
Please install it and try again.]
|
|
|
|
)
|
2006-03-02 13:44:44 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 13:44:44 +00:00
|
|
|
# If needed, run autoheader to regenerate config.h.in
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
# This makes sure we never ever have to run autoheader manually. It
|
|
|
|
# will be run whenever needed automatically.
|
|
|
|
#
|
|
|
|
|
2006-03-02 13:44:44 +00:00
|
|
|
AC_MSG_CHECKING([if autoheader needs to be run])
|
|
|
|
if test ! -f ./config.h.in -o config.h.in -ot configure.ac; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
if which autoheader >/dev/null; then
|
|
|
|
AC_MSG_NOTICE([running autoheader])
|
2006-08-28 10:03:34 +00:00
|
|
|
autoheader || exit 1
|
2006-03-02 13:44:44 +00:00
|
|
|
else
|
2010-09-18 02:18:26 +00:00
|
|
|
AC_MSG_ERROR(
|
2006-08-28 10:03:34 +00:00
|
|
|
[cannot find the autoheader program in your path.
|
2006-03-29 00:25:00 +00:00
|
|
|
This program needs to be run whenever the configure.ac file is modified.
|
2006-08-28 10:03:34 +00:00
|
|
|
Please install it and try again.]
|
2006-11-30 13:24:31 +00:00
|
|
|
)
|
2006-03-02 13:44:44 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# Detect directories which may contain additional headers, libraries
|
|
|
|
# and commands. This needs to be done early - before Autoconf starts
|
|
|
|
# to mess with CFLAGS and all the other environemnt variables.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
# This mostly helps OS X users, since fink usually installs out of
|
|
|
|
# tree and doesn't update CFLAGS.
|
|
|
|
#
|
2012-07-10 22:37:16 +00:00
|
|
|
# It also helps FreeBSD which puts libiconv in /usr/local/lib
|
2006-10-31 02:06:56 +00:00
|
|
|
|
2012-07-10 22:37:16 +00:00
|
|
|
for i in /usr/pkg /sw /opt /opt/local /usr/local; do
|
2006-01-30 16:57:06 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for $i/include include directory])
|
|
|
|
if test -d $i/include; then
|
|
|
|
AC_MSG_RESULT(yes)
|
2012-01-06 18:23:38 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -I$i/include/"
|
2006-03-02 01:30:16 +00:00
|
|
|
CFLAGS="$CFLAGS -I$i/include/"
|
2006-01-30 16:57:06 +00:00
|
|
|
else
|
2006-11-30 13:24:31 +00:00
|
|
|
AC_MSG_RESULT(no)
|
2006-01-30 16:57:06 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for $i/lib library directory])
|
|
|
|
if test -d $i/lib; then
|
|
|
|
AC_MSG_RESULT(yes)
|
2012-07-12 00:18:49 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L$i/lib/ -Wl,-rpath,$i/lib/"
|
2006-01-30 16:57:06 +00:00
|
|
|
else
|
2006-11-30 13:24:31 +00:00
|
|
|
AC_MSG_RESULT(no)
|
2006-01-30 16:57:06 +00:00
|
|
|
fi
|
2006-02-02 15:23:56 +00:00
|
|
|
|
2006-02-03 21:29:01 +00:00
|
|
|
AC_MSG_CHECKING([for $i/bin command directory])
|
|
|
|
if test -d $i/bin; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
optbindirs="$optbindirs $i/bin"
|
|
|
|
else
|
2006-11-30 13:24:31 +00:00
|
|
|
AC_MSG_RESULT(no)
|
2006-02-03 21:29:01 +00:00
|
|
|
fi
|
|
|
|
|
2006-01-30 16:57:06 +00:00
|
|
|
done
|
2006-02-02 15:23:56 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2010-09-18 02:18:26 +00:00
|
|
|
# Tell autoconf to create config.h header
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# This adds markup to the code that results in a few extra compile
|
|
|
|
# time checks on recent GCC versions. It helps stop a few common bugs.
|
|
|
|
#
|
|
|
|
|
2006-10-19 15:19:47 +00:00
|
|
|
AH_BOTTOM([#if __GNUC__ >= 3
|
|
|
|
#define __warn_unused __attribute__ ((warn_unused_result))
|
|
|
|
#define __sentinel __attribute__ ((sentinel))
|
|
|
|
#else
|
2010-09-18 02:18:26 +00:00
|
|
|
#define __warn_unused
|
|
|
|
#define __sentinel
|
2006-10-19 15:19:47 +00:00
|
|
|
#endif])
|
|
|
|
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-01-15 21:19:29 +00:00
|
|
|
# Set up various programs needed for install
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2012-01-06 19:29:03 +00:00
|
|
|
AC_PROG_CXX([g++ c++])
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# Check for seq command. If missing, make sure fallback shellscript
|
2006-10-31 02:06:56 +00:00
|
|
|
# implementation is installed.
|
|
|
|
#
|
|
|
|
|
2006-01-22 21:07:56 +00:00
|
|
|
AC_CHECK_PROG( SEQ_FALLBACK, seq, [ ], [seq])
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
2006-11-03 13:16:21 +00:00
|
|
|
if test "$SEQ_FALLBACK"; then
|
|
|
|
|
|
|
|
#
|
|
|
|
# We already have seq. Check if the seq version is installed by an
|
|
|
|
# earlier fish version. If it is, we'll replace it.
|
|
|
|
#
|
|
|
|
|
|
|
|
file=`which seq`
|
|
|
|
if test -f "$file"; then
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if seq comes from a previous fish version])
|
|
|
|
shebang=`grep "\(^#!/.*/fish\|^#!/usr/bin/env fish\)" $file`
|
|
|
|
|
|
|
|
if test "$shebang"; then
|
2007-03-24 10:56:29 +00:00
|
|
|
SEQ_FALLBACK=seq
|
2006-11-03 13:16:21 +00:00
|
|
|
AC_MSG_RESULT(yes, replace it)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no, keep it)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# Optionally drop xsel command
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2010-09-18 02:18:26 +00:00
|
|
|
AC_ARG_WITH(
|
|
|
|
xsel,
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_HELP_STRING(
|
|
|
|
[--without-xsel],
|
2010-09-18 06:31:18 +00:00
|
|
|
[do not build the xsel program needed for X clipboard integration.
|
|
|
|
If build xsel, it will be configured with the same options as fish.]
|
2006-08-28 10:03:34 +00:00
|
|
|
),
|
|
|
|
[xsel=$withval],
|
2010-09-18 02:18:26 +00:00
|
|
|
[xsel=with_xsel]
|
2006-08-28 10:03:34 +00:00
|
|
|
)
|
2005-09-20 13:26:39 +00:00
|
|
|
|
|
|
|
if [[ "$xsel" = "with_xsel" ]]; then
|
2010-09-18 05:27:34 +00:00
|
|
|
XSEL=xsel-1.2.0
|
|
|
|
XSEL_BIN=$XSEL/xsel
|
2007-03-24 10:56:29 +00:00
|
|
|
XSEL_MAN=xsel.1x
|
2010-09-18 05:27:34 +00:00
|
|
|
XSEL_MAN_PATH=$XSEL/xsel.1x
|
2005-09-20 13:26:39 +00:00
|
|
|
fi
|
|
|
|
|
2006-08-13 03:08:06 +00:00
|
|
|
|
2006-11-29 14:18:22 +00:00
|
|
|
#
|
|
|
|
# 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]
|
|
|
|
)
|
|
|
|
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2006-11-29 14:18:22 +00:00
|
|
|
AC_DEFINE([USE_GETTEXT],[1],[Perform string translations with gettext])
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2007-02-05 12:25:53 +00:00
|
|
|
#
|
2007-02-25 11:17:38 +00:00
|
|
|
# Try to enable large file support. This will make sure that on systems
|
2007-02-05 12:25:53 +00:00
|
|
|
# where off_t can be either 32 or 64 bit, the latter size is used. On
|
|
|
|
# other systems, this should do nothing. (Hopefully)
|
|
|
|
#
|
|
|
|
|
2012-01-06 18:23:38 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64"
|
2007-02-05 12:25:53 +00:00
|
|
|
|
2006-03-25 16:18:48 +00:00
|
|
|
#
|
|
|
|
# If we are using gcc, set some flags that increase the odds of the
|
|
|
|
# compiler producing a working binary...
|
|
|
|
#
|
|
|
|
|
2007-08-22 07:57:41 +00:00
|
|
|
if test "$GCC" = yes; then
|
2006-03-25 16:18:48 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# -fno-optimize-sibling-calls seems to work around a bug where
|
2006-08-28 10:03:34 +00:00
|
|
|
# sending a SIGWINCH to fish on NetBSD 3.0 causes fish to exit when
|
2006-03-25 16:18:48 +00:00
|
|
|
# compiled with GCC 3.3.3. This is probably either a compiler bug
|
|
|
|
# or a libc bug, but adding this flag seems to fix things for
|
|
|
|
# now. Long term, the real problem should be tracked down and
|
|
|
|
# truly fixed, at which point we can remove this silly flag. This
|
|
|
|
# bug has been verified to not exist on Linux using GCC 3.3.3.
|
|
|
|
#
|
|
|
|
|
2012-01-06 18:23:38 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -fno-optimize-sibling-calls"
|
2006-03-25 16:18:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# -Wall is there to keep me on my toes
|
|
|
|
#
|
|
|
|
|
2012-01-06 19:29:03 +00:00
|
|
|
# Some day...
|
2012-01-06 18:23:38 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -Wall"
|
2006-03-25 16:18:48 +00:00
|
|
|
|
2007-01-20 02:36:49 +00:00
|
|
|
#
|
|
|
|
# This is needed in order to get the really cool backtraces
|
|
|
|
#
|
|
|
|
|
2007-03-24 10:56:29 +00:00
|
|
|
LDFLAGS_FISH="$LDFLAGS_FISH -rdynamic"
|
2007-01-20 02:36:49 +00:00
|
|
|
|
2006-03-29 00:25:00 +00:00
|
|
|
fi
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
2006-03-29 21:31:24 +00:00
|
|
|
#
|
|
|
|
# If we are compiling against glibc, set some flags to work around
|
|
|
|
# some rather stupid attempts to hide prototypes for *wprintf
|
|
|
|
# functions, as well as prototypes of various gnu extensions.
|
|
|
|
#
|
2006-03-29 00:25:00 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([if we are compiling against glibc])
|
|
|
|
AC_RUN_IFELSE(
|
2006-08-28 10:03:34 +00:00
|
|
|
[
|
|
|
|
AC_LANG_PROGRAM(
|
|
|
|
[
|
|
|
|
#include <stdlib.h>
|
|
|
|
#ifdef __GLIBC__
|
|
|
|
#define STATUS 0
|
|
|
|
#else
|
|
|
|
#define STATUS 1
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
[
|
|
|
|
return STATUS;
|
|
|
|
]
|
|
|
|
)
|
2010-09-18 02:18:26 +00:00
|
|
|
],
|
|
|
|
[glibc=yes],
|
|
|
|
[glibc=no]
|
2006-08-28 10:03:34 +00:00
|
|
|
)
|
2006-03-29 00:25:00 +00:00
|
|
|
|
|
|
|
if test "$glibc" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
|
2006-03-25 16:18:48 +00:00
|
|
|
#
|
2006-03-29 00:25:00 +00:00
|
|
|
# This gives us access to prototypes for gnu extensions and C99
|
|
|
|
# functions if we are compiling agains glibc. All GNU extensions
|
|
|
|
# that are used must have a fallback implementation available in
|
|
|
|
# fallback.h, in order to keep fish working on non-gnu platforms.
|
2006-03-25 16:18:48 +00:00
|
|
|
#
|
|
|
|
|
2006-10-09 21:24:40 +00:00
|
|
|
CFLAGS="$CFLAGS -D_GNU_SOURCE=1 -D_ISO99_SOURCE=1"
|
2006-03-29 00:25:00 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2006-03-25 16:18:48 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2006-01-15 21:19:29 +00:00
|
|
|
# Test cpu for special handling of ppc
|
2006-03-29 00:25:00 +00:00
|
|
|
#
|
|
|
|
# This is used to skip use of tputs on ppc systems, since it seemed to
|
|
|
|
# be broken, at least on older debin-based systems. This is obviously
|
|
|
|
# not the right way to to detect whether this workaround should be
|
|
|
|
# used, since it catches far to many systems, but I do not have the
|
|
|
|
# hardware available to narrow this problem down, and in practice, it
|
|
|
|
# seems that tputs is never really needed.
|
|
|
|
#
|
2006-10-31 02:06:56 +00:00
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
|
|
|
if test $target_cpu = powerpc; then
|
2006-11-29 14:21:02 +00:00
|
|
|
AC_DEFINE([TPUTS_KLUDGE],[1],[Evil kludge to get Power based machines to work])
|
2006-01-15 21:19:29 +00:00
|
|
|
fi
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2006-08-10 20:37:56 +00:00
|
|
|
# Solaris-specific flags go here
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2006-08-01 01:30:18 +00:00
|
|
|
AC_MSG_CHECKING([if we are under Solaris])
|
|
|
|
case $target_os in
|
2010-09-18 02:18:26 +00:00
|
|
|
solaris*)
|
2006-08-11 13:48:59 +00:00
|
|
|
AC_DEFINE( __EXTENSIONS__, 1, [Macro to enable additional prototypes under Solaris])
|
2006-08-01 01:30:18 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-08-22 07:57:41 +00:00
|
|
|
# Check for Solaris curses tputs having fixed length parameter list.
|
|
|
|
AC_MSG_CHECKING([if we are using non varargs tparm.])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[
|
|
|
|
AC_LANG_PROGRAM(
|
2010-09-18 02:18:26 +00:00
|
|
|
[
|
2007-08-22 07:57:41 +00:00
|
|
|
#include <curses.h>
|
|
|
|
#include <term.h>
|
|
|
|
],
|
|
|
|
[
|
|
|
|
tparm( "" );
|
|
|
|
]
|
|
|
|
)
|
|
|
|
],
|
2010-09-18 02:18:26 +00:00
|
|
|
[tparm_solaris_kludge=no],
|
|
|
|
[tparm_solaris_kludge=yes]
|
2007-08-22 07:57:41 +00:00
|
|
|
)
|
|
|
|
if test "x$tparm_solaris_kludge" = "xyes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(
|
|
|
|
[TPARM_SOLARIS_KLUDGE],
|
|
|
|
[1],
|
|
|
|
[Define to 1 if tparm accepts a fixed amount of paramters.]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-08-10 20:37:56 +00:00
|
|
|
# BSD-specific flags go here
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2006-08-10 20:37:56 +00:00
|
|
|
AC_MSG_CHECKING([if we are under BSD])
|
|
|
|
case $target_os in
|
2010-09-18 02:18:26 +00:00
|
|
|
*bsd*)
|
2006-08-10 20:37:56 +00:00
|
|
|
AC_DEFINE( __BSD_VISIBLE, 1, [Macro to enable additional prototypes under BSD])
|
|
|
|
AC_DEFINE( _NETBSD_SOURCE, 1, [Macro to enable additional prototypes under BSD])
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# Set up PREFIX and related preprocessor symbols. Fish needs to know
|
|
|
|
# where it will be installed. One of the reasons for this is so that
|
|
|
|
# it can make sure the fish installation directory is in the path
|
|
|
|
# during startup.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2005-11-01 20:52:15 +00:00
|
|
|
if [[ "$prefix" = NONE ]]; then
|
2007-03-24 10:56:29 +00:00
|
|
|
prefix=/usr/local
|
2005-11-01 20:52:15 +00:00
|
|
|
fi
|
2006-03-02 01:47:29 +00:00
|
|
|
|
2005-11-01 20:52:15 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# Set up the directory where the documentation files should be
|
|
|
|
# installed
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_ARG_VAR( [docdir], [Documentation direcotry] )
|
|
|
|
|
|
|
|
if test -z $docdir; then
|
2007-03-24 10:56:29 +00:00
|
|
|
docdir=$datadir/doc/fish
|
2006-07-18 16:41:55 +00:00
|
|
|
else
|
2007-03-24 10:56:29 +00:00
|
|
|
docdir=$docdir
|
2005-09-20 13:26:39 +00:00
|
|
|
fi
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# Set up locale directory. This is where the .po files will be
|
|
|
|
# installed.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2007-03-24 10:56:29 +00:00
|
|
|
localedir=$datadir/locale
|
2006-01-15 21:19:29 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# See if Linux procfs is present. This is used to get extra
|
|
|
|
# information about running processes.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_CHECK_FILES([/proc/self/stat])
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2006-03-29 00:25:00 +00:00
|
|
|
# This is ued to tell the wgetopt library to translate strings. This
|
|
|
|
# way wgetopt can be dropped into any project without requiring i18n.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-29 00:25:00 +00:00
|
|
|
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_DEFINE(
|
2010-09-18 02:18:26 +00:00
|
|
|
[HAVE_TRANSLATE_H],
|
2006-08-28 10:03:34 +00:00
|
|
|
[1],
|
|
|
|
[Define to 1 if the wgettext function should be used for translating strings.]
|
|
|
|
)
|
2006-03-29 00:25:00 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2007-03-24 10:56:29 +00:00
|
|
|
# Check presense of various libraries. This is done on a per-binary
|
|
|
|
# level, since including various extra libraries in all binaries only
|
|
|
|
# because thay are used by some of them can cause extra bloat and
|
|
|
|
# slower compiles when developing fish.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2007-08-22 07:57:41 +00:00
|
|
|
# Check for os dependant libraries for all binaries.
|
|
|
|
LIBS_COMMON=$LIBS
|
|
|
|
LIBS=""
|
|
|
|
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.] )] )
|
2012-01-06 19:50:17 +00:00
|
|
|
AC_SEARCH_LIBS( pthread_create, pthread, , [AC_MSG_ERROR([Cannot find the pthread library, needed to build this package.] )] )
|
2007-08-22 07:57:41 +00:00
|
|
|
AC_SEARCH_LIBS( setupterm, [ncurses curses], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
|
2009-02-02 23:20:49 +00:00
|
|
|
AC_SEARCH_LIBS( [nan], [m], [AC_DEFINE( [HAVE_NAN], [1], [Define to 1 if you have the nan function])] )
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS_SHARED=$LIBS
|
|
|
|
LIBS=$LIBS_COMMON
|
|
|
|
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
2010-09-18 02:18:26 +00:00
|
|
|
# Check for libraries needed by fish.
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LIBS_COMMON=$LIBS
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS="$LIBS_SHARED"
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2006-11-29 14:18:22 +00:00
|
|
|
AC_SEARCH_LIBS( gettext, intl,,)
|
|
|
|
fi
|
2007-08-22 07:57:41 +00:00
|
|
|
|
2009-02-22 19:16:49 +00:00
|
|
|
# Check for libiconv_open if we can't find iconv_open. Silly OS X does
|
|
|
|
# weird macro magic for the sole purpose of amusing me.
|
|
|
|
AC_SEARCH_LIBS( iconv_open, iconv, , [AC_SEARCH_LIBS( libiconv_open, iconv, , [AC_MSG_ERROR([Could not find an iconv implementation, needed to build fish])] )] )
|
2009-02-03 00:26:20 +00:00
|
|
|
|
2007-03-24 10:56:29 +00:00
|
|
|
LIBS_FISH=$LIBS
|
|
|
|
LIBS=$LIBS_COMMON
|
|
|
|
|
2007-04-22 10:03:12 +00:00
|
|
|
#
|
2010-09-18 02:18:26 +00:00
|
|
|
# Check for libraries needed by fish_indent.
|
2007-04-22 10:03:12 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LIBS_COMMON=$LIBS
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS="$LIBS_SHARED"
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2007-04-22 10:03:12 +00:00
|
|
|
AC_SEARCH_LIBS( gettext, intl,,)
|
|
|
|
fi
|
|
|
|
LIBS_FISH_INDENT=$LIBS
|
|
|
|
LIBS=$LIBS_COMMON
|
2007-03-24 10:56:29 +00:00
|
|
|
|
|
|
|
#
|
2010-09-18 02:18:26 +00:00
|
|
|
# Check for libraries needed by fish_pager.
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LIBS_COMMON=$LIBS
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS="$LIBS_SHARED"
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2007-03-24 10:56:29 +00:00
|
|
|
AC_SEARCH_LIBS( gettext, intl,,)
|
|
|
|
fi
|
2012-06-06 13:57:52 +00:00
|
|
|
AC_SEARCH_LIBS( iconv_open, iconv, , [AC_SEARCH_LIBS( libiconv_open, iconv, , [AC_MSG_ERROR([Could not find an iconv implementation, needed to build fish])] )] )
|
2007-04-22 10:03:12 +00:00
|
|
|
LIBS_FISH_PAGER=$LIBS
|
2007-03-24 10:56:29 +00:00
|
|
|
LIBS=$LIBS_COMMON
|
2006-03-02 01:28:58 +00:00
|
|
|
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
2010-09-18 02:18:26 +00:00
|
|
|
# Check for libraries needed by fishd.
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LIBS_COMMON=$LIBS
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS="$LIBS_SHARED"
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2007-03-24 10:56:29 +00:00
|
|
|
AC_SEARCH_LIBS( gettext, intl,,)
|
|
|
|
fi
|
2012-06-06 13:57:52 +00:00
|
|
|
AC_SEARCH_LIBS( iconv_open, iconv, , [AC_SEARCH_LIBS( libiconv_open, iconv, , [AC_MSG_ERROR([Could not find an iconv implementation, needed to build fish])] )] )
|
2007-03-24 10:56:29 +00:00
|
|
|
LIBS_FISHD=$LIBS
|
|
|
|
LIBS=$LIBS_COMMON
|
|
|
|
|
|
|
|
#
|
2010-09-18 02:18:26 +00:00
|
|
|
# Check for libraries needed by mimedb.
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LIBS_COMMON=$LIBS
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS="$LIBS_SHARED"
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2007-03-24 10:56:29 +00:00
|
|
|
AC_SEARCH_LIBS( gettext, intl,,)
|
|
|
|
fi
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS_MIMEDB=$LIBS
|
2007-03-24 10:56:29 +00:00
|
|
|
LIBS=$LIBS_COMMON
|
|
|
|
|
|
|
|
|
|
|
|
#
|
2010-09-18 02:18:26 +00:00
|
|
|
# Check for libraries needed by set_color
|
2007-03-24 10:56:29 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LIBS_COMMON=$LIBS
|
2007-08-22 07:57:41 +00:00
|
|
|
LIBS="$LIBS_SHARED"
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2007-03-24 10:56:29 +00:00
|
|
|
AC_SEARCH_LIBS( gettext, intl,,)
|
|
|
|
fi
|
|
|
|
LIBS_SET_COLOR=$LIBS
|
|
|
|
LIBS=$LIBS_COMMON
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
# Check presense of various header files
|
|
|
|
#
|
|
|
|
|
2007-01-20 02:36:49 +00:00
|
|
|
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 execinfo.h])
|
2006-03-02 01:28:58 +00:00
|
|
|
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_CHECK_HEADER(
|
|
|
|
[regex.h],
|
|
|
|
[
|
|
|
|
AC_DEFINE(
|
2010-09-18 02:18:26 +00:00
|
|
|
[HAVE_REGEX_H],
|
|
|
|
[1],
|
2006-08-28 10:03:34 +00:00
|
|
|
[Define to 1 if you have the <regex.h> header file.]
|
2006-11-30 13:24:31 +00:00
|
|
|
)
|
|
|
|
],
|
|
|
|
[AC_MSG_ERROR([Could not find the header regex.h, needed to build fish])]
|
2006-08-28 10:03:34 +00:00
|
|
|
)
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
2006-08-28 10:03:34 +00:00
|
|
|
#
|
|
|
|
# On some platforms (Solaris 10) adding -std=c99 in turn requires that
|
|
|
|
# _POSIX_C_SOURCE be defined to 200112L otherwise several
|
|
|
|
# POSIX-specific, non-ISO-C99 types/prototypes are made unavailable
|
2006-11-30 13:24:31 +00:00
|
|
|
# e.g. siginfo_t. Defining _XOPEN_SOURCE to 600 is compatible with
|
2006-08-28 10:03:34 +00:00
|
|
|
# the _POSIX_C_SOURCE value and provides a little assurance that
|
|
|
|
# extension functions' prototypes are available, e.g. killpg().
|
|
|
|
#
|
|
|
|
# Some other platforms (OS X), will remove types/prototypes/macros
|
|
|
|
# e.g. SIGWINCH if either _POSIX_C_SOURCE or _XOPEN_SOURCE is defined.
|
|
|
|
#
|
|
|
|
# This test adds these macros only if they enable a program that uses
|
|
|
|
# both Posix and non-standard features to compile, and that program
|
|
|
|
# does not compile without these macros.
|
|
|
|
#
|
|
|
|
# We try to make everyone happy.
|
|
|
|
#
|
|
|
|
# The ordering of the various autoconf tests is very critical as well:
|
|
|
|
#
|
|
|
|
# * This test needs to be run _after_ header detection tests, so that
|
|
|
|
# the proper headers are included.
|
|
|
|
#
|
|
|
|
# * This test needs to be run _before_ testing for the presense of any
|
|
|
|
# prototypes or other language functinality.
|
|
|
|
#
|
|
|
|
# * This test should be (but does not need to be) run after the
|
|
|
|
# conditional definition of __EXTENSIONS__, to avoid redundant tests.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-08-28 10:03:34 +00:00
|
|
|
|
2012-01-06 18:23:38 +00:00
|
|
|
XCFLAGS="$CXXFLAGS"
|
2006-08-28 10:03:34 +00:00
|
|
|
|
|
|
|
echo Checking how to use -D_XOPEN_SOURCE=600 and -D_POSIX_C_SOURCE=200112L...
|
|
|
|
local_found_posix_switch=no
|
|
|
|
|
|
|
|
for i in "" "-D_POSIX_C_SOURCE=200112L" "-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"; do
|
|
|
|
|
|
|
|
AC_MSG_CHECKING( if switches \"$i\" works)
|
|
|
|
CFLAGS="$XCFLAGS $i"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Try to run this program, which should test various extensions
|
|
|
|
# and Posix functionality. If this program works, then everything
|
|
|
|
# should work. Hopefully.
|
|
|
|
#
|
|
|
|
|
|
|
|
AC_TRY_LINK(
|
|
|
|
[
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
/* POSIX, C89 and C99: POSIX extends this header.
|
|
|
|
* For: kill(), killpg(), siginfo_t, sigset_t,
|
|
|
|
* struct sigaction, sigemptyset(), sigaction(),
|
|
|
|
* SIGIO and SIGWINCH. */
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_SIGINFO_H
|
|
|
|
/* Neither POSIX, C89 nor C99: Solaris-specific (others?).
|
|
|
|
* For: siginfo_t (also defined by signal.h when in
|
|
|
|
* POSIX/extensions mode). */
|
|
|
|
#include <siginfo.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TERMIOS_H
|
|
|
|
/* Neither POSIX, C89 nor C99: a common extension.
|
|
|
|
* For: TIOCGWINSZ and struct winsize (under at least
|
|
|
|
* Solaris, NetBSD and (dual-listed) FreeBSD). */
|
|
|
|
#include <sys/termios.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_IOCTL_H
|
|
|
|
/* As above (under at least Linux and FreeBSD). */
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
[
|
|
|
|
/* Avert high-level optimisation, by making the program's
|
|
|
|
* return value depend on all tested identifiers. */
|
2012-01-06 18:43:27 +00:00
|
|
|
long ret = 0;
|
2006-08-28 10:03:34 +00:00
|
|
|
/* POSIX only: might be unhidden by _POSIX_C_SOURCE. */
|
|
|
|
struct sigaction sa;
|
|
|
|
sigset_t ss;
|
|
|
|
siginfo_t info;
|
2012-01-06 18:43:27 +00:00
|
|
|
ret += (long)(void *)&info + kill( 0, 0 ) +
|
2006-08-28 10:03:34 +00:00
|
|
|
sigaction( 0, &sa, 0 ) + sigemptyset( &ss );
|
|
|
|
/* Extended-POSIX: might be unhidden by _XOPEN_SOURCE. */
|
|
|
|
ret += killpg( 0, 0 );
|
|
|
|
/* Non-standard: might be hidden by the macros. */
|
2010-09-18 02:18:26 +00:00
|
|
|
{
|
2006-08-28 10:03:34 +00:00
|
|
|
struct winsize termsize;
|
2012-01-06 18:43:27 +00:00
|
|
|
ret += (long)(void *)&termsize;
|
2010-09-18 02:18:26 +00:00
|
|
|
ret += SIGWINCH + TIOCGWINSZ + SIGIO;
|
2006-08-28 10:03:34 +00:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
],
|
|
|
|
local_cv_use__posix_c_source=yes,
|
|
|
|
local_cv_use__posix_c_source=no,
|
|
|
|
)
|
2006-10-09 20:12:30 +00:00
|
|
|
|
2006-08-28 10:03:34 +00:00
|
|
|
if test x$local_cv_use__posix_c_source = xyes; then
|
|
|
|
AC_MSG_RESULT( yes )
|
|
|
|
local_found_posix_switch=yes
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT( no )
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-08-28 10:03:34 +00:00
|
|
|
# We didn't find any combination of switches that worked - revert to
|
|
|
|
# no switches and hope that the fallbacks work. A warning will be
|
|
|
|
# printed at the end of the configure script.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-08-28 10:03:34 +00:00
|
|
|
|
|
|
|
if test ! x$local_found_posix_switch = xyes; then
|
|
|
|
CFLAGS="$XCFLAGS"
|
|
|
|
fi
|
2006-03-02 01:28:58 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Check for presense of various functions used by fish
|
|
|
|
#
|
|
|
|
|
2006-11-29 14:18:22 +00:00
|
|
|
AC_CHECK_FUNCS( wcsdup wcsndup wcslen wcscasecmp wcsncasecmp fwprintf )
|
2006-08-28 10:29:49 +00:00
|
|
|
AC_CHECK_FUNCS( futimes wcwidth wcswidth wcstok fputwc fgetwc )
|
2007-01-20 02:36:49 +00:00
|
|
|
AC_CHECK_FUNCS( wcstol wcslcat wcslcpy lrand48_r killpg gettext )
|
2007-10-15 11:39:36 +00:00
|
|
|
AC_CHECK_FUNCS( dcgettext backtrace backtrace_symbols sysconf )
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The Makefile also needs to know if we have gettext, so it knows if
|
|
|
|
# the translations should be installed.
|
|
|
|
#
|
|
|
|
|
2010-09-18 02:18:26 +00:00
|
|
|
if test x$local_gettext != xno; then
|
2007-03-24 10:56:29 +00:00
|
|
|
AC_CHECK_FUNC( gettext, HAVE_GETTEXT=1, HAVE_GETTEXT=0 )
|
2006-11-29 14:18:22 +00:00
|
|
|
fi
|
2006-07-20 13:01:48 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 01:47:29 +00:00
|
|
|
# Here follows a list of small programs used to test for various
|
|
|
|
# features that Autoconf doesn't tell us about
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2006-03-02 01:47:29 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
2006-03-02 01:28:58 +00:00
|
|
|
# Check if realpath accepts null for its second argument
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2006-03-02 01:28:58 +00:00
|
|
|
AC_MSG_CHECKING([if realpath accepts null for its second argument])
|
|
|
|
AC_RUN_IFELSE(
|
2006-08-28 10:03:34 +00:00
|
|
|
[
|
|
|
|
AC_LANG_PROGRAM(
|
|
|
|
[
|
|
|
|
#include <limits.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
],
|
|
|
|
[
|
2010-09-18 02:18:26 +00:00
|
|
|
int status;
|
|
|
|
char *res;
|
|
|
|
res = realpath( "somefile", 0 );
|
|
|
|
status = !(res != 0 || errno == ENOENT);
|
2006-08-28 10:03:34 +00:00
|
|
|
exit( status );
|
|
|
|
]
|
|
|
|
)
|
2010-09-18 02:18:26 +00:00
|
|
|
],
|
|
|
|
[have_realpath_null=yes],
|
|
|
|
[have_realpath_null=no]
|
2006-08-28 10:03:34 +00:00
|
|
|
)
|
2006-03-02 01:28:58 +00:00
|
|
|
|
|
|
|
if test "$have_realpath_null" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_DEFINE(
|
2010-09-18 02:18:26 +00:00
|
|
|
[HAVE_REALPATH_NULL],
|
2006-08-28 10:03:34 +00:00
|
|
|
[1],
|
|
|
|
[Define to 1 if realpath accepts null for its second argument.]
|
|
|
|
)
|
2006-03-02 01:28:58 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2006-07-30 20:55:44 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
# Check if struct winsize and TIOCGWINSZ exist
|
|
|
|
#
|
|
|
|
|
2006-08-09 22:53:38 +00:00
|
|
|
AC_MSG_CHECKING([if struct winsize and TIOCGWINSZ exist])
|
2006-07-30 20:55:44 +00:00
|
|
|
AC_LINK_IFELSE(
|
2006-08-28 10:03:34 +00:00
|
|
|
[
|
|
|
|
AC_LANG_PROGRAM(
|
|
|
|
[
|
|
|
|
#ifdef HAVE_SYS_TERMIOS_H
|
|
|
|
#include <sys/termios.h>
|
|
|
|
#endif
|
2006-07-30 20:55:44 +00:00
|
|
|
|
2006-08-28 10:03:34 +00:00
|
|
|
#ifdef HAVE_SYS_IOCTL_H
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
[
|
2010-09-18 02:18:26 +00:00
|
|
|
struct winsize termsize = {0};
|
2006-08-28 10:03:34 +00:00
|
|
|
TIOCGWINSZ;
|
|
|
|
]
|
|
|
|
)
|
2010-09-18 02:18:26 +00:00
|
|
|
],
|
2006-08-28 10:03:34 +00:00
|
|
|
[
|
2010-09-18 02:18:26 +00:00
|
|
|
AC_MSG_RESULT(yes);
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_DEFINE([HAVE_WINSIZE], [1], [Define to 1 if the winsize struct and TIOCGWINSZ macro exist])
|
2010-09-18 02:18:26 +00:00
|
|
|
],
|
2006-08-28 10:03:34 +00:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
]
|
|
|
|
)
|
2006-07-30 20:55:44 +00:00
|
|
|
|
2006-10-31 02:06:56 +00:00
|
|
|
|
|
|
|
#
|
2006-03-29 00:25:00 +00:00
|
|
|
# If we have a fwprintf in libc, test that it actually works. As of
|
|
|
|
# March 2006, it is broken under Dragonfly BSD.
|
2006-10-31 02:06:56 +00:00
|
|
|
#
|
|
|
|
|
2006-03-02 01:28:58 +00:00
|
|
|
if test "$ac_cv_func_fwprintf" = yes; then
|
|
|
|
|
2006-03-02 11:29:17 +00:00
|
|
|
AC_MSG_CHECKING([if fwprintf is broken])
|
|
|
|
AC_RUN_IFELSE(
|
2006-08-28 10:03:34 +00:00
|
|
|
[
|
|
|
|
AC_LANG_PROGRAM(
|
|
|
|
[
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
],
|
|
|
|
[
|
|
|
|
setlocale( LC_ALL, "" );
|
|
|
|
fwprintf( stderr, L"%ls%ls", L"", L"fish:" );
|
|
|
|
]
|
|
|
|
)
|
|
|
|
],
|
2006-11-30 13:24:31 +00:00
|
|
|
[
|
2006-03-02 13:44:44 +00:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
],
|
2006-11-30 13:24:31 +00:00
|
|
|
[
|
2006-03-02 13:44:44 +00:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE([HAVE_BROKEN_FWPRINTF], [1], [Define to 1 one if the implemented fwprintf is broken])
|
2010-09-18 02:18:26 +00:00
|
|
|
]
|
2006-08-28 10:03:34 +00:00
|
|
|
)
|
2006-03-02 01:28:58 +00:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
2005-11-24 11:13:21 +00:00
|
|
|
|
2006-01-21 16:02:34 +00:00
|
|
|
# Check for _nl_msg_cat_cntr symbol
|
|
|
|
AC_MSG_CHECKING([for _nl_msg_cat_cntr symbol])
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_TRY_LINK(
|
|
|
|
[
|
|
|
|
#if HAVE_LIBINTL_H
|
|
|
|
#include <libintl.h>
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
[
|
|
|
|
extern int _nl_msg_cat_cntr;
|
2010-09-18 02:18:26 +00:00
|
|
|
int tmp = _nl_msg_cat_cntr;
|
2006-08-28 10:03:34 +00:00
|
|
|
exit(tmp);
|
|
|
|
],
|
2010-09-18 02:18:26 +00:00
|
|
|
have__nl_msg_cat_cntr=yes,
|
2006-08-28 10:03:34 +00:00
|
|
|
have__nl_msg_cat_cntr=no
|
|
|
|
)
|
2006-01-21 16:02:34 +00:00
|
|
|
if test "$have__nl_msg_cat_cntr" = yes; then
|
2006-03-02 01:28:58 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_DEFINE(
|
2010-09-18 02:18:26 +00:00
|
|
|
[HAVE__NL_MSG_CAT_CNTR],
|
2006-08-28 10:03:34 +00:00
|
|
|
[1],
|
|
|
|
[Define to 1 if the _nl_msg_cat_cntr symbol is exported.]
|
2010-09-18 02:18:26 +00:00
|
|
|
)
|
2006-01-21 16:02:34 +00:00
|
|
|
else
|
2006-11-30 13:24:31 +00:00
|
|
|
AC_MSG_RESULT(no)
|
2006-01-21 16:02:34 +00:00
|
|
|
fi
|
|
|
|
|
2007-01-27 16:59:11 +00:00
|
|
|
# Check for __environ symbol
|
|
|
|
AC_MSG_CHECKING([for __environ symbol])
|
|
|
|
AC_TRY_LINK(
|
|
|
|
[
|
|
|
|
#include <unistd.h>
|
|
|
|
],
|
|
|
|
[
|
|
|
|
extern char **__environ;
|
2010-09-18 02:18:26 +00:00
|
|
|
char **tmp = __environ;
|
2007-01-27 16:59:11 +00:00
|
|
|
exit(tmp!=0);
|
|
|
|
],
|
2010-09-18 02:18:26 +00:00
|
|
|
have___environ=yes,
|
2007-01-27 16:59:11 +00:00
|
|
|
have___environ=no
|
|
|
|
)
|
|
|
|
if test "$have___environ" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(
|
2010-09-18 02:18:26 +00:00
|
|
|
[HAVE___ENVIRON],
|
2007-01-27 16:59:11 +00:00
|
|
|
[1],
|
|
|
|
[Define to 1 if the __environ symbol is exported.]
|
2010-09-18 02:18:26 +00:00
|
|
|
)
|
2007-01-27 16:59:11 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2006-09-03 23:00:06 +00:00
|
|
|
# Check if getopt_long exists and works
|
|
|
|
AC_MSG_CHECKING([if getopt_long exists and works])
|
2006-08-28 10:29:49 +00:00
|
|
|
AC_TRY_LINK(
|
|
|
|
[
|
|
|
|
#if HAVE_GETOPT_H
|
|
|
|
#include <getopt.h>
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
[
|
|
|
|
static struct option
|
|
|
|
long_options[] =
|
|
|
|
{
|
2010-09-18 02:18:26 +00:00
|
|
|
0, 0, 0, 0
|
2006-08-28 10:29:49 +00:00
|
|
|
}
|
|
|
|
;
|
|
|
|
int opt = getopt_long( 0,
|
|
|
|
0,
|
2010-09-18 02:18:26 +00:00
|
|
|
0,
|
|
|
|
long_options,
|
2006-08-28 10:29:49 +00:00
|
|
|
0 );
|
2010-09-18 02:18:26 +00:00
|
|
|
|
2006-08-28 10:29:49 +00:00
|
|
|
],
|
2010-09-18 02:18:26 +00:00
|
|
|
have_working_getopt_long=yes,
|
2006-08-28 10:29:49 +00:00
|
|
|
have_working_getopt_long=no
|
|
|
|
)
|
|
|
|
if test "$have_working_getopt_long" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(
|
2010-09-18 02:18:26 +00:00
|
|
|
[HAVE_WORKING_GETOPT_LONG],
|
2006-08-28 10:29:49 +00:00
|
|
|
[1],
|
2006-09-03 23:00:06 +00:00
|
|
|
[Define to 1 if getopt_long exists and works.]
|
2010-09-18 02:18:26 +00:00
|
|
|
)
|
2006-08-28 10:29:49 +00:00
|
|
|
else
|
2006-11-30 13:24:31 +00:00
|
|
|
AC_MSG_RESULT(no)
|
2006-08-28 10:29:49 +00:00
|
|
|
fi
|
|
|
|
|
2006-08-11 10:07:56 +00:00
|
|
|
# Check if del_curterm is broken - in that case we redefine
|
2006-05-11 11:58:46 +00:00
|
|
|
# del_curterm as a no-op, to avoid a double-free
|
|
|
|
|
2006-08-11 10:07:56 +00:00
|
|
|
AC_MSG_CHECKING([If del_curterm is broken])
|
2006-05-11 11:58:46 +00:00
|
|
|
case $target_os in
|
|
|
|
*bsd*)
|
|
|
|
AC_MSG_RESULT(yes)
|
2006-08-28 10:03:34 +00:00
|
|
|
AC_DEFINE(
|
|
|
|
[HAVE_BROKEN_DEL_CURTERM],
|
|
|
|
[1],
|
|
|
|
[del_curterm is broken, redefine it to a no-op to avoid a double-free bug]
|
|
|
|
)
|
2006-05-11 11:58:46 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2006-03-02 01:47:29 +00:00
|
|
|
# Tell the world what we know
|
2006-11-20 13:53:36 +00:00
|
|
|
AC_CONFIG_FILES([Makefile fish.spec Doxyfile.help seq])
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_OUTPUT
|
2006-01-15 21:19:29 +00:00
|
|
|
|
2006-08-28 10:03:34 +00:00
|
|
|
if test ! x$local_found_posix_switch = xyes; then
|
|
|
|
echo "Can't find a combination of switches to enable common extensions like detecting window size."
|
|
|
|
echo "Some fish features may be disabled."
|
|
|
|
fi
|
|
|
|
|
2010-09-18 06:31:18 +00:00
|
|
|
if [[ "$xsel" = "with_xsel" ]]; then
|
|
|
|
echo "Now configure xsel with $conf_arg"
|
|
|
|
rm -rf $XSEL
|
|
|
|
tar xf $XSEL.tar.gz
|
|
|
|
cd $XSEL && ./configure $conf_arg
|
|
|
|
fi
|
2006-03-02 01:30:16 +00:00
|
|
|
echo "fish is now configured."
|
2006-06-13 23:40:36 +00:00
|
|
|
echo "Use 'make' and 'make install' to build and install fish."
|
2006-08-28 10:03:34 +00:00
|
|
|
|