aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-03-24 20:56:29 +1000
committerGravatar axel <axel@liljencrantz.se>2007-03-24 20:56:29 +1000
commitf36508837b2bf7cb19e5e36503799226b0a39dff (patch)
tree336ce39a964a2eaae289630c80275351db4087e1 /configure.ac
parent3969c1b453eb73a5ea0829edd317f0de163f6c96 (diff)
Use per-binary LDFLAGS to remove linking to useless libraries. This will reduce the size of the binaries and may also speed up startup time slightly. These changes are based on suggestions and a patch by James Vega.
darcs-hash:20070324105629-ac50b-64425ff68a18e3adf51eee141d3a4450405c1ddb.gz
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac118
1 files changed, 97 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac
index 917a28ae..0d044bc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,26 @@ AC_INIT(fish,1.22.3,fish-users@lists.sf.net)
#
+# List of output variables produced by this configure script
+#
+
+AC_SUBST( docdir )
+AC_SUBST( HAVE_GETTEXT )
+AC_SUBST( LDFLAGS_FISH )
+AC_SUBST( LIBS_FISH )
+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 )
+AC_SUBST( XSEL_MAN_PATH )
+
+#
# If needed, run autoconf to regenerate the configure file
#
# This makes sure that after running autoconf once to create the first
@@ -107,8 +127,6 @@ for i in /usr/pkg /sw /opt /opt/local; do
done
-AC_SUBST( optbindirs, $optbindirs )
-
#
# Tell autoconf to create config.h header
@@ -161,7 +179,7 @@ if test "$SEQ_FALLBACK"; then
shebang=`grep "\(^#!/.*/fish\|^#!/usr/bin/env fish\)" $file`
if test "$shebang"; then
- AC_SUBST( SEQ_FALLBACK, seq )
+ SEQ_FALLBACK=seq
AC_MSG_RESULT(yes, replace it)
else
AC_MSG_RESULT(no, keep it)
@@ -185,13 +203,9 @@ AC_ARG_WITH(
)
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,[ ])
+ XSEL=xsel-0.9.6/xsel
+ XSEL_MAN=xsel.1x
+ XSEL_MAN_PATH=xsel-0.9.6/xsel.1x
fi
@@ -291,7 +305,7 @@ if test "$CC" = gcc; then
# This is needed in order to get the really cool backtraces
#
- LDFLAGS="$LDFLAGS -rdynamic"
+ LDFLAGS_FISH="$LDFLAGS_FISH -rdynamic"
fi
@@ -398,10 +412,7 @@ esac
#
if [[ "$prefix" = NONE ]]; then
- export prefix=/usr/local
- AC_SUBST( prefix, /usr/local)
-else
- AC_SUBST( prefix, [$prefix])
+ prefix=/usr/local
fi
@@ -413,9 +424,9 @@ fi
AC_ARG_VAR( [docdir], [Documentation direcotry] )
if test -z $docdir; then
- AC_SUBST(docdir, [$datadir/doc/fish] )
+ docdir=$datadir/doc/fish
else
- AC_SUBST(docdir, [$docdir])
+ docdir=$docdir
fi
@@ -424,7 +435,7 @@ fi
# installed.
#
-AC_SUBST( [localedir], [$datadir/locale])
+localedir=$datadir/locale
#
@@ -448,10 +459,18 @@ AC_DEFINE(
#
-# Check presense of various libraries
+# 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.
#
-# Only link with gettext if we are using it
+#
+# Check for libraries needed by fish.
+#
+
+LIBS_COMMON=$LIBS
+LIBS=""
if test x$local_gettext != xno; then
AC_SEARCH_LIBS( gettext, intl,,)
fi
@@ -459,9 +478,66 @@ AC_SEARCH_LIBS( connect, socket, , [AC_MSG_ERROR([Cannot find the socket library
AC_SEARCH_LIBS( nanosleep, rt, , [AC_MSG_ERROR([Cannot find the rt library, needed to build this package.] )] )
AC_SEARCH_LIBS( setupterm, [ncurses curses], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
AC_SEARCH_LIBS( iconv_open, iconv, , [AC_MSG_ERROR([Could not find an iconv implementation, needed to build fish])] )
+LIBS_FISH=$LIBS
+LIBS=$LIBS_COMMON
+
+
+#
+# Check for libraries needed by fishd.
+#
+
+LIBS_COMMON=$LIBS
+LIBS=""
+if test x$local_gettext != xno; then
+ AC_SEARCH_LIBS( gettext, intl,,)
+fi
+AC_SEARCH_LIBS( connect, socket, , [AC_MSG_ERROR([Cannot find the socket library, needed to build this package.] )] )
+LIBS_FISHD=$LIBS
+LIBS=$LIBS_COMMON
#
+# Check for libraries needed by mimedb.
+#
+
+LIBS_COMMON=$LIBS
+LIBS=""
+if test x$local_gettext != xno; then
+ AC_SEARCH_LIBS( gettext, intl,,)
+fi
+LIBS_FISHD=$LIBS
+LIBS=$LIBS_COMMON
+
+
+#
+# Check for libraries needed by fish_pager.
+#
+
+LIBS_COMMON=$LIBS
+LIBS=""
+if test x$local_gettext != xno; then
+ AC_SEARCH_LIBS( gettext, intl,,)
+fi
+AC_SEARCH_LIBS( connect, socket, , [AC_MSG_ERROR([Cannot find the socket library, needed to build this package.] )] )
+AC_SEARCH_LIBS( setupterm, [ncurses curses], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
+LIBS_FISH_PAGER=$LIBS
+LIBS=$LIBS_COMMON
+
+
+#
+# Check for libraries needed by set_color
+#
+
+LIBS_COMMON=$LIBS
+LIBS=""
+if test x$local_gettext != xno; then
+ AC_SEARCH_LIBS( gettext, intl,,)
+fi
+AC_SEARCH_LIBS( setupterm, [ncurses curses], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
+LIBS_SET_COLOR=$LIBS
+LIBS=$LIBS_COMMON
+
+#
# Check presense of various header files
#
@@ -617,7 +693,7 @@ AC_CHECK_FUNCS( dcgettext backtrace backtrace_symbols)
#
if test x$local_gettext != xno; then
- AC_CHECK_FUNC( gettext, AC_SUBST( HAVE_GETTEXT, 1 ), AC_SUBST( HAVE_GETTEXT, 0 ) )
+ AC_CHECK_FUNC( gettext, HAVE_GETTEXT=1, HAVE_GETTEXT=0 )
fi
#