[Tfug] compiling vim with the :perldo option
Robert Hunter
hunter at tfug.org
Tue May 9 22:59:40 MST 2006
Building vim 7.0 on debian sarge also had problems, specifically with
finding the perl library, even though it was installed. Here is a
script of the build..
1) Get the source and look at options...
>tar xfj vim-7.0.tar.bz2
>cd vim70/
>./configure --help
2) Now configure
>./configure --prefix=$PWD/installhere --enable-perlinterp
3) But something went wrong according to the configure script
checking --enable-perlinterp argument... yes
checking for perl... /usr/bin/perl
checking Perl version... OK
checking if compile and link flags for Perl are sane... no: PERL DISABLED
4) Let's look at the log file for more details
>less src/auto/config.log
configure:3953: checking if compile and link flags for Perl are sane
configure:3977: gcc -o conftest -g -O2 -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -I/usr/local/include -D_LAR\
GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE
-Wl,-E -L/usr/local/lib conftest.c -Wl,-E -L/usr/local/lib \
/usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
-L/usr/lib/perl/5.8/CORE -lperl -ldl -lm -lpthread -lcrypt \
>&5
/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
configure:3983: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define UNIX 1
| #define FEAT_NORMAL 1
| #define USE_XSMP_INTERACT 1
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4004: result: no: PERL DISABLED
5) The offending line is "/usr/bin/ld: cannot find -lperl". The
linker can't find the perl library.
>dpkg -l | grep libperl
ii libperl5.6 5.6.1-8.9 Shared Perl library.
ii libperl5.8 5.8.4-8sarge3 Shared Perl library
>dpkg -L libperl5.8
/.
/usr
/usr/lib
/usr/lib/libperl.so.5.8.4
/usr/share
/usr/share/doc
/usr/lib/libperl.so.5.8
/usr/share/doc/libperl5.8
6) But wait, libperl is installed on my system, so why can't the build
find it? The linker is probably looking for something like
"libperl.so" or "libperl.a", so there is a symlink missing. Let's
test that theory, by creating a symlink in the current directory, and
then setting LDFLAGS environment variable ( which the configure script
will use ).
>ln -s /usr/lib/libperl.so.5.8.4 libperl.so
>export LDFLAGS=-L$PWD
>make distclean
>./configure --prefix=$PWD/installhere --enable-perlinterp
7) Now the configure script is happy.
checking --enable-perlinterp argument... yes
checking for perl... /usr/bin/perl
checking Perl version... OK
checking if compile and link flags for Perl are sane... yes
8) Finish up with 'make && make install'.
Hope it helps.
--
Rob
More information about the tfug
mailing list