Sunday, November 29, 2009

Re: Compiling Vim for 64-bit Fedora Linux

On 11/29/2009 11:34 AM, Bram Moolenaar wrote:
>
> Michael Henry wrote:
>
>> I recently decided to try out 64-bit Linux with Fedora 12. When
>> I tried to compile Vim, the configure script couldn't locate the
>> Python "config" directory, which is necessary to successfully
>> compile with --enable-pythoninterp. This is because 64-bit
>> Fedora 12 puts the Python libraries beneath /usr/lib64 instead
>> of /usr/lib.

> Using python-config sounds like it's something that is the recommended
> way. I have no idea when this was introduced, we should fall back to the
> old method when it can't be found.
>
> You say the libs are below /usr/lib64, but the --libs output doesn't
> contain this. Does the compiler have a builtin path for this?

Yes, /usr/lib64 is in the default set of paths of gcc:

$ gcc -print-search-dirs # trimmed for email
install: /usr/lib/gcc/x86_64-redhat-linux/4.4.2/
[...]
libraries:
[...]
/lib/../lib64/
[...]
/usr/lib/../lib64/
[...]

I took a quick look at the source RPM for Vim on Fedora 12 to
see how the distro handles this problem. They've patched Vim's
configure script to search the "lib64" directory in addition to
"lib" and "share" as follows:

$ cat SOURCES/vim-7.1-lib64.patch
diff -up vim71/src/auto/configure.lib64 vim71/src/auto/configure
--- vim71/src/auto/configure.lib64 2008-07-23 12:36:17.000000000 +0200
+++ vim71/src/auto/configure 2008-07-23 12:37:04.000000000 +0200
@@ -4291,7 +4291,7 @@ else

vi_cv_path_python_conf=
for path in "${vi_cv_path_python_pfx}"
"${vi_cv_path_python_epfx}"; do
- for subdir in lib share; do
+ for subdir in lib64 lib share; do
d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
if test -d "$d" && test -f "$d/config.c"; then
vi_cv_path_python_conf="$d"
diff -up vim71/src/configure.in.lib64 vim71/src/configure.in
--- vim71/src/configure.in.lib64 2008-07-23 12:36:17.000000000 +0200
+++ vim71/src/configure.in 2008-07-23 12:36:17.000000000 +0200
@@ -634,7 +634,7 @@ if test "$enable_pythoninterp" = "yes";
[
vi_cv_path_python_conf=
for path in "${vi_cv_path_python_pfx}"
"${vi_cv_path_python_epfx}"; do
- for subdir in lib share; do
+ for subdir in lib64 lib share; do
d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
if test -d "$d" && test -f "$d/config.c"; then
vi_cv_path_python_conf="$d"

It seems like the Fedora team's patch to include lib64 in the
list of subdirectories might be the simplest fix, though the
python-config tool seems like the right idea when it's
available.

I also looked quickly to see how old python-config might be, but
I think it's new enough that you are right to want to fall back
to the old configuration logic.

Michael Henry

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

No comments:

Post a Comment