2005-09-20 13:26:39 +00:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
2006-01-26 16:30:46 +00:00
|
|
|
AC_INIT(fish,1.20.1,fish-users@lists.sf.net)
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2006-02-04 11:36:19 +00:00
|
|
|
for i in /usr/pkg /sw /opt /opt/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)
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$i/include/"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for $i/lib library directory])
|
|
|
|
if test -d $i/lib; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
LDFLAGS="$LDFLAGS -L$i/lib/ -R$i/lib/"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
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
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2006-01-30 16:57:06 +00:00
|
|
|
done
|
2006-02-02 15:23:56 +00:00
|
|
|
|
2006-02-03 21:29:01 +00:00
|
|
|
AC_SUBST( optbindirs, $optbindirs )
|
|
|
|
|
2006-01-18 12:41:13 +00:00
|
|
|
# If needed, run autoheader automatically
|
2006-01-30 16:57:06 +00:00
|
|
|
AC_MSG_CHECKING([if autoheader needs to be run])
|
2006-01-18 12:41:13 +00:00
|
|
|
if test ! -f ./config.h.in -o config.h.in -ot configure.ac; then
|
2006-01-30 16:57:06 +00:00
|
|
|
AC_MSG_RESULT([yes])
|
2006-01-18 12:41:13 +00:00
|
|
|
if which autoheader >/dev/null; then
|
2006-01-30 16:57:06 +00:00
|
|
|
AC_MSG_NOTICE([running autoheader])
|
2006-01-18 12:41:13 +00:00
|
|
|
autoheader
|
|
|
|
else
|
2006-01-30 16:57:06 +00:00
|
|
|
AC_MSG_ERROR( [cannot find the autoheader program in your path.
|
|
|
|
This program is needed because the configure.ac file has been modified.
|
|
|
|
Please install it and try again.])
|
2006-01-18 12:41:13 +00:00
|
|
|
fi
|
2006-01-30 16:57:06 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
2006-01-18 12:41:13 +00:00
|
|
|
fi
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
# Tell autoconf to create config.h header
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
# Set up various programs needed for install
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
2006-01-18 12:41:13 +00:00
|
|
|
# Check for doxygen, which is needed to build
|
2005-12-25 11:59:40 +00:00
|
|
|
AC_CHECK_PROG( has_doxygen, [doxygen], "true")
|
|
|
|
|
|
|
|
if ! test $has_doxygen = "true"; then
|
2006-01-30 16:57:06 +00:00
|
|
|
AC_MSG_ERROR( [cannot find the Doxygen program in your path.
|
|
|
|
This program is needed to build fish.
|
|
|
|
Please install it and try again.])
|
2005-12-25 11:59:40 +00:00
|
|
|
fi
|
|
|
|
|
2006-01-22 21:07:56 +00:00
|
|
|
# Check for seq program. If missing, install fallback shellscript implementation
|
|
|
|
AC_CHECK_PROG( SEQ_FALLBACK, seq, [ ], [seq])
|
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
# Optionally drop xsel
|
|
|
|
AC_ARG_WITH( xsel,
|
|
|
|
AC_HELP_STRING([--without-xsel],
|
|
|
|
[do not build the xsel program needed for X clipboard integration]),
|
|
|
|
[xsel=$withval],
|
|
|
|
[xsel=with_xsel] )
|
|
|
|
|
|
|
|
if [[ "$xsel" = "with_xsel" ]]; then
|
|
|
|
AC_SUBST( XSEL,[xsel-0.9.6/xsel])
|
|
|
|
AC_SUBST( XSEL_MAN,[xsel.1x])
|
|
|
|
AC_SUBST( XSEL_MAN_PATH,[xsel-0.9.6/xsel.1x])
|
|
|
|
else
|
|
|
|
AC_SUBST( XSEL,[ ])
|
|
|
|
AC_SUBST( XSEL_MAN,[ ])
|
|
|
|
AC_SUBST( XSEL_MAN_PATH,[ ])
|
|
|
|
fi
|
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
# Test cpu for special handling of ppc
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
|
|
|
if test $target_cpu = powerpc; then
|
|
|
|
AC_DEFINE([TPUTS_KLUDGE],[1],[Evil kludge to get Power based machines to work])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED([CPU],[L"$target_cpu"],[CPU type])
|
|
|
|
|
|
|
|
|
2006-01-18 12:41:13 +00:00
|
|
|
# Set up installation directories
|
2005-11-01 20:52:15 +00:00
|
|
|
if [[ "$prefix" = NONE ]]; then
|
|
|
|
AC_DEFINE_UNQUOTED( [PREFIX], L"/usr/local", [Installation directory])
|
|
|
|
AC_SUBST( PREFIX, /usr/local)
|
|
|
|
export prefix=/usr/local
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED( [PREFIX], L"$prefix", [Installation directory])
|
|
|
|
AC_SUBST( PREFIX, [$prefix])
|
|
|
|
fi
|
|
|
|
|
2005-09-26 12:33:06 +00:00
|
|
|
AC_SUBST(fishdir,[/fish.d])
|
|
|
|
AC_SUBST(fishfile,[/fish])
|
|
|
|
AC_SUBST(fishinputfile,[/fish_inputrc])
|
2005-09-20 13:26:39 +00:00
|
|
|
|
|
|
|
AC_ARG_VAR( [docdir], [Documentation direcotry] )
|
|
|
|
|
|
|
|
if test -z $docdir; then
|
|
|
|
AC_SUBST(docdir,[$datadir/doc/fish])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED( DOCDIR, [L"$(eval echo $docdir)"], [Documentation directory] )
|
2005-11-01 21:56:28 +00:00
|
|
|
AC_DEFINE_UNQUOTED( SYSCONFDIR, [L"$(eval echo $sysconfdir)"], [System configuration directory] )
|
2005-11-03 14:35:35 +00:00
|
|
|
AC_SUBST( SYSCONFDIR, ["$(eval echo $sysconfdir)"] )
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
# Set up locale directory
|
|
|
|
AC_DEFINE_UNQUOTED( [LOCALEDIR], "$(eval echo $datadir)/locale", [Locale directory])
|
|
|
|
AC_SUBST( [LOCALEDIR], [$datadir/locale])
|
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
# See if Linux procfs is present
|
|
|
|
AC_CHECK_FILES([/proc/self/stat])
|
|
|
|
|
2005-10-17 13:36:57 +00:00
|
|
|
# Check for RLIMIT_AS in sys/resource.h.
|
|
|
|
AC_MSG_CHECKING([for RLIMIT_AS in sys/resource.h])
|
|
|
|
AC_TRY_COMPILE([#include <sys/resource.h>],
|
|
|
|
[int tmp; tmp=RLIMIT_AS;], have_rlimit_as=yes, have_rlimit_as=no)
|
|
|
|
if test "$have_rlimit_as" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE_RLIMIT_AS], [1],
|
|
|
|
[Define to 1 if HAVE_RLIMIT_AS is defined in <sys/resource.h>.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2005-11-24 11:13:21 +00:00
|
|
|
# Check for RLIMIT_MEMLOCK in sys/resource.h.
|
|
|
|
AC_MSG_CHECKING([for RLIMIT_MEMLOCK in sys/resource.h])
|
|
|
|
AC_TRY_COMPILE([#include <sys/resource.h>],
|
|
|
|
[int tmp; tmp=RLIMIT_MEMLOCK;], have_rlimit_as=yes, have_rlimit_as=no)
|
|
|
|
if test "$have_rlimit_as" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE_RLIMIT_MEMLOCK], [1],
|
|
|
|
[Define to 1 if HAVE_RLIMIT_MEMLOCK is defined in <sys/resource.h>.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check for RLIMIT_RSS in sys/resource.h.
|
|
|
|
AC_MSG_CHECKING([for RLIMIT_RSS in sys/resource.h])
|
|
|
|
AC_TRY_COMPILE([#include <sys/resource.h>],
|
|
|
|
[int tmp; tmp=RLIMIT_RSS;], have_rlimit_as=yes, have_rlimit_as=no)
|
|
|
|
if test "$have_rlimit_as" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE_RLIMIT_RSS], [1],
|
|
|
|
[Define to 1 if HAVE_RLIMIT_RSS is defined in <sys/resource.h>.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2006-01-04 12:51:02 +00:00
|
|
|
|
2005-11-24 11:13:21 +00:00
|
|
|
# Check for RLIMIT_NPROC in sys/resource.h.
|
|
|
|
AC_MSG_CHECKING([for RLIMIT_NPROC in sys/resource.h])
|
|
|
|
AC_TRY_COMPILE([#include <sys/resource.h>],
|
|
|
|
[int tmp; tmp=RLIMIT_NPROC;], have_rlimit_as=yes, have_rlimit_as=no)
|
|
|
|
if test "$have_rlimit_as" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE_RLIMIT_NPROC], [1],
|
|
|
|
[Define to 1 if HAVE_RLIMIT_NPROC is defined in <sys/resource.h>.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2006-02-02 15:23:56 +00:00
|
|
|
# Check if realpath accepts null for its second argument
|
|
|
|
AC_MSG_CHECKING([if realpath accepts null for its second argument])
|
|
|
|
AC_RUN_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([#include <limits.h>
|
2006-02-03 00:41:45 +00:00
|
|
|
#include <errno.h>
|
2006-02-02 15:23:56 +00:00
|
|
|
#include <stdlib.h>],
|
2006-02-03 00:41:45 +00:00
|
|
|
[int status; char *res; res = realpath( "somefile", 0 ); status = !(res != 0 || errno == ENOENT); exit( status );])],
|
2006-02-02 15:23:56 +00:00
|
|
|
[have_realpath_null=yes],
|
|
|
|
[have_realpath_null=no] )
|
|
|
|
|
|
|
|
if test "$have_realpath_null" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE_REALPATH_NULL], [1],
|
|
|
|
[Define to 1 if realpath accepts null for its second argument.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2006-01-21 16:02:34 +00:00
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
# Check for libraries
|
2006-01-10 17:49:07 +00:00
|
|
|
AC_CHECK_LIB(socket, connect)
|
|
|
|
AC_CHECK_LIB(rt, nanosleep)
|
2006-01-18 12:41:13 +00:00
|
|
|
AC_CHECK_LIB(intl, gettext)
|
2005-11-24 11:13:21 +00:00
|
|
|
|
2006-01-15 21:19:29 +00:00
|
|
|
# Check for various header files
|
2006-01-18 18:37:58 +00:00
|
|
|
AC_CHECK_HEADERS([getopt.h termio.h sys/resource.h term.h ncurses/term.h libintl.h])
|
2006-01-15 21:19:29 +00:00
|
|
|
|
2006-01-24 18:12:05 +00:00
|
|
|
AC_CHECK_HEADER([regex.h],
|
2006-01-26 16:30:02 +00:00
|
|
|
[AC_DEFINE([HAVE_REGEX_H], [1], [Define to 1 if you have the <regex.h> header file.])],
|
2006-01-24 18:12:05 +00:00
|
|
|
[AC_MSG_ERROR([Could not find the header regex.h, needed to build fish])])
|
|
|
|
|
|
|
|
|
2006-01-18 12:41:13 +00:00
|
|
|
# Check for various functions, and insert results into config.h
|
2006-01-20 14:27:21 +00:00
|
|
|
AC_CHECK_FUNCS( wcsdup wcsndup wcslen wcscasecmp wcsncasecmp gettext fwprintf )
|
2006-01-21 16:02:34 +00:00
|
|
|
AC_CHECK_FUNCS( futimes wcwidth wcswidth getopt_long wcstok fputwc fgetwc )
|
|
|
|
AC_CHECK_FUNCS( wcstol dcgettext )
|
2006-01-15 21:19:29 +00:00
|
|
|
|
2006-01-28 02:17:40 +00:00
|
|
|
AC_DEFINE([HAVE_TRANSLATE_H], [1],
|
|
|
|
[Define to 1 if the wgettext function should be used for translating strings.])
|
|
|
|
|
2006-01-18 12:41:13 +00:00
|
|
|
# Check again for gettext library, and insert results into the Makefile
|
2006-01-04 12:51:02 +00:00
|
|
|
AC_CHECK_FUNC(gettext, AC_SUBST(HAVE_GETTEXT,1), AC_SUBST(HAVE_GETTEXT,0) )
|
2005-12-17 21:32:05 +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])
|
|
|
|
AC_TRY_LINK([#if HAVE_LIBINTL_H]
|
|
|
|
[#include <libintl.h>]
|
|
|
|
[#endif],
|
|
|
|
[extern int _nl_msg_cat_cntr;]
|
2006-02-02 15:29:39 +00:00
|
|
|
[int tmp = _nl_msg_cat_cntr; exit(tmp);], have__nl_msg_cat_cntr=yes, have__nl_msg_cat_cntr=no)
|
2006-01-21 16:02:34 +00:00
|
|
|
if test "$have__nl_msg_cat_cntr" = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE__NL_MSG_CAT_CNTR], [1],
|
2006-01-21 21:12:39 +00:00
|
|
|
[Define to 1 if the _nl_msg_cat_cntr symbol is exported.])
|
2006-01-21 16:02:34 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
# Check if we have ncurses, and use it rather than curses if possible.
|
2006-01-30 16:57:06 +00:00
|
|
|
AC_SEARCH_LIBS( setupterm, [ncurses curses], [ AC_MSG_NOTICE([Found curses implementation])], [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2006-01-22 21:07:56 +00:00
|
|
|
AC_CONFIG_FILES([Makefile fish.spec doc_src/fish.1 doc_src/Doxyfile init/fish init/fish_interactive.fish init/fish_complete.fish seq])
|
2005-09-20 13:26:39 +00:00
|
|
|
AC_OUTPUT
|
2006-01-15 21:19:29 +00:00
|
|
|
|
2006-01-18 12:41:13 +00:00
|
|
|
echo "Now run 'make' and 'make install' to built and install fish."
|
|
|
|
echo "Good luck!"
|