On Thu, 2008-01-10 at 22:10 +0100, Bram Moolenaar wrote:

> Philip Prindeville wrote:

> What I tried to say: excluding /usr/local/[include|lib] is not specific
> for cross compiling.  This should be a separate setting.  Then it can
> also be set for cross compiling.

Thank you for the trigger to rework my old patch
http://www.mail-archive.com/[EMAIL PROTECTED]/msg02896.html
to check gcc if it already uses the wanted local-dir.

/haubi/

-- 
13. - 14. Februar 2008
Salomon Automation am 6. Hamburger Logistiktag, Kreuzfahrtterminal Hamburg, 
Deutschland

19. - 21. Februar 2008
Salomon Automation auf der LogiMAT 2008, Neue Messe Stuttgart, Deutschland
Halle 6, Stand 527

23. - 27. Februar 2008
MoveRetail auf der EuroShop 2008 in Düsseldorf, Deutschland
Halle 6, Stand C50





Salomon Automation GmbH - Friesachstrasse 15 - A-8114 Friesach bei Graz
Sitz der Gesellschaft: Friesach bei Graz
UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K
Firmenbuchgericht: Landesgericht für Zivilrechtssachen Graz


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

--- src/configure.in.orig	2008-01-11 09:29:46.000000000 +0100
+++ src/configure.in	2008-01-11 10:21:34.000000000 +0100
@@ -189,27 +189,45 @@
 dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
 dnl Only when the directory exists and it wasn't there yet.
 dnl For gcc don't do this when it is already in the default search path.
+AC_MSG_CHECKING(for local dir)
+local_dir=/usr/local
 have_local_include=''
 have_local_lib=''
-if test "$GCC" = yes; then
+AC_ARG_WITH(local-dir, [dnl
+  --with-local-dir=/path  build with /path/include, /path/lib [[/usr/local]]
+  --without-local-dir     do not build with /usr/local/include, /usr/local/lib], [
+  local_dir="$withval"
+  case "$withval" in
+  */*) ;;
+  no) local_dir= ;;
+  *) AC_MSG_ERROR(must pass path argument or 'no' to --with-local-dir) ;;
+  esac
+])
+if test -z "${local_dir}"; then
+    # avoid adding local dir to LDFLAGS and CPPFLAGS
+    have_local_dir=yes
+    have_local_lib=yes
+fi
+if test -n "${local_dir}" -a "$GCC" = yes; then
   echo 'void f(){}' > conftest.c
   dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler)
-  have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep '/usr/local/include'`
-  have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep '/usr/local/lib'`
+  have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep "${local_dir}/include"`
+  have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"`
   rm -f conftest.c conftest.o
 fi
-if test -z "$have_local_lib" -a -d /usr/local/lib; then
-  tt=`echo "$LDFLAGS" | sed -e 's+-L/usr/local/lib ++g' -e 's+-L/usr/local/lib$++g'`
+if test -z "$have_local_lib" -a -d "${local_dir}"/lib; then
+  tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}lib ++g" -e "s+-L${local_dir}/lib$++g"`
   if test "$tt" = "$LDFLAGS"; then
-    LDFLAGS="$LDFLAGS -L/usr/local/lib"
+    LDFLAGS="$LDFLAGS -L${local_dir}/lib"
   fi
 fi
-if test -z "$have_local_include" -a -d /usr/local/include; then
-  tt=`echo "$CPPFLAGS" | sed -e 's+-I/usr/local/include ++g' -e 's+-I/usr/local/include$++g'`
+if test -z "$have_local_include" -a -d "${local_dir}"/include; then
+  tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"`
   if test "$tt" = "$CPPFLAGS"; then
-    CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+    CPPFLAGS="$CPPFLAGS -I${local_dir}/include"
   fi
 fi
+AC_MSG_RESULT($local_dir)
 
 AC_MSG_CHECKING(--with-vim-name argument)
 AC_ARG_WITH(vim-name, [  --with-vim-name=NAME    what to call the Vim executable],

Raspunde prin e-mail lui