Commit 7fce294a authored by Piotr Roszatycki's avatar Piotr Roszatycki

Imported Upstream version 2.17

parent 30b4eaff
......@@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = man src scripts test
EXTRA_DIST = LICENSE NEWS README THANKS autogen.sh makedist.sh
EXTRA_DIST = LICENSE NEWS.md README.md THANKS autogen.sh makedist.sh
test: all
( cd test && $(MAKE) $(AM_MAKEFLAGS) test )
......
This diff is collapsed.
== Version 2.16 ==
11 Dec 2011
* The fakechroot script loads additional environment settings from
configuration directory (+--config-dir+ option). By default additional
settings are provided for +chroot+(8) and +debootstrap+(8) commands.
* Wrapped +chroot+(8) command loads +ld.so.conf+ paths to +LD_LIBRARY_PATH+
environment variable.
* The +debootstrap+(8) command works with default, buildd and minbase
variants.
* Fixes were made for +getpeeraddr+(3) and +getsockaddr+(3) functions.
+lwp-request+ command is working correctly.
== Version 2.15 ==
29 Sep 2011
* New function +faccessat+(2) was added. It fixes +test -r+ command.
Thanks to Johannes Schauer.
* The +popen+(3) function were reimplemented based on OpenBSD source to
prevent some coredumps with newer GNU C Library.
== Version 2.14 ==
18 Dec 2010
* The source code was refactored: all functions was moved to separated files.
* The +opendir+(3) function is compiled only if it doesn't call other function
internally. It fixes +opendir+(3), +fts_open+(3) and +ftw+(3) functions.
* The +fts_*+(3) functions were reimplemented based on OpenBSD source.
* The +ftw_*+(3) functions were reimplemented based on GNU C Library source.
* The +__opendir2+(3) function was reimplemented based on FreeBSD source.
* Fixes were made for older GNU C Library and for cross-compiling environment.
== Version 2.13.1 ==
30 Nov 2010
* Fixes were made for older GNU C Library.
== Version 2.13 ==
29 Nov 2010
* Fixes were made for +realpath+(3) and +ftw+(3) functions. +apt-ftparchive+
command currently is working.
* Fixes were made for +canonicalize_file_name+(3), +ftw64+(3), +nftw+(3) and
+nftw64+(3) functions.
* New functions +fts_children+(3) and +fts_read+(3) were added.
* Lazy dynamic symbol loading was implemented. Thanks to Alexander Shishkin.
* Fixed bug when +FAKECHROOT_EXCLUDE_PATH+ list was sometimes ignored.
* All source code is now on LGPL license again.
== Version 2.12 ==
10 Nov 2010
* New function +execlp+(3). Thanks to Robert Spanton.
* New functions +statfs+(2) and +statvfs+(2). Thanks to Paweł Stawicki.
* Better support for GNU/kFreeBSD was made.
== Version 2.11 ==
12 Sep 2010
* Fixes were made for +getpeername+(2) and +getsockname+(2) functions.
+host 127.0.0.1+ command currently is working. Thanks to Daniel Tschan.
* Fixes were made for +canonicalize_file_name+(3) function. +man-db+ command
currently is working.
* New functions +__*_chk+(3) were added for GNU libc with fortify +level > 0+.
* New environment variable +FAKECHROOT_AF_UNIX_PATH+ defines an optional
prefix for unix sockets.
* Better support for FreeBSD was made.
* Autoconf scripts were refactored.
* More test units were added.
== Version 2.10 ==
25 Aug 2010
* Handle properly GNU libc +open+(2), +open64+(2), +openat+(2) and
+openat64+(2) inline functions.
* Compatibility were improved for +scandir+(3) and +scandir64+(3) functions
on the latest GNU libc.
* Fixed +lstat+(2) function returns correct +st_size+. Thanks to Daniel
Baumann.
* Fixed +readlink+(2) function. Correctly truncates content if buffer is too
small.
* Fixed +undefined symbol: rpl_malloc+ error for compiled 32-bit library on
64-bit architecture by dropping +AC_FUNC_MALLOC+ in +configure.ac+.
* Fixed +chroot+(2) function for path which contains dot character. Thanks to
Robie Basak.
* New function +utimensat+(2) fixes +cp+ command on Debian sid.
* New functions +linkat+(2), +mknodat+(2), +mkfifoat+(2), +readlinkat+(2)
and +symlinkat+(2).
* New functions +popen+(3) and +system+(3) for GNU libc.
* +dpkg-shlibdeps(1)+ works again because +cd $FAKECHROOT_BASE+ does not
change current working directory to root directory.
* New +FAKECHROOT_CMD_SUBST+ environment variable handles a list of
substituted commands. Thanks to Richard W.M. Jones.
* New scripts ldd and ldconfig with .fakechroot suffix are installed.
* New +make test+ target uses Perl's +prove+ tool to run test units.
== Version 2.9 ==
31 Mar 2009
* Fixes were made for +getpeername+(2) and +getsockname+(2) functions. Thanks to
Axel Thimm and Fedora people.
* Fixes were made for +execve+(2):
* Always copy necessary variables to new environment.
* Do not make duplicates of environment variables. Thanks to Richard
W.M. Jones.
* Fixed were made for +chroot+(2). It is possible to escape chroot. Thanks
to Richard W.M. Jones.
* Fixed were made for +mktemp+(2). There was a buffer overflow. Thanks to
Mikhail Gusarov.
* New function: +futimesat+(2). Fixes +touch -m+ command.
* New functions: +bindtextdomain+(3), +inotify_add_watch+(2).
* More test units was added, +make check+ works as expected.
== Version 2.8 ==
25 Jul 2008
* Fixes were made for +__fxstatat64+(3) function which broke +chown+ command
on i386 architecture.
* Better support for FreeBSD was made.
== Version 2.7.1 ==
17 Jul 2008
* Compiles with older GNU libc: readlink type of return value is detected.
* Compiles with uClibc: existence of getwd function is detected.
== Version 2.7 ==
15 Jul 2008
* Stability and compatibility were improved for the latest libc.
* Fixes were made for latest version of coreutils.
* Fixed +readlink+(2) function to be ssize_t as it is in newer libc.
* New functions: +__fxstatat+(2), +__fxstatat64+(2), +fchmodat+(2),
+fchownat+(2), +__openat+(2), +__openat64+(2), +unlinkat+(2). It fixes
last coreutils.
* New functions: +mkdirat+(2), +renameat+(2).
* Fixed +chroot+(2) function to not change current working directory.
* Fixed +chroot+(2) function to handle relative path.
* Fixed +execve+(2) function to not expand argv0 and handle +#!+ correctly.
* New +eaccess+(3) function backported from Klik.
* New functions: +bind+(2), +connect+(2), +getpeername+(2), +getsockname+(2).
They support +PF_UNIX+ sockets.
* More memory allocation for fakechroot_init.
== Version 2.6 ==
5 May 2007
* New environment variable +FAKECHROOT_EXCLUDE_PATH+.
* Fixed +getcwd+(3). Unbreaks +cd+ command.
* Fixed +readlink+(2) function. Unbreaks +readlink+ command.
* Fixed +mktemp+(3) function. Unbreaks +patch+ and +ranlib+ command.
* The +chroot+(2) function is now recursive and allows nested chroots.
## Version 2.17
24 Nov 2013
* The `FAKECHROOT_ELFLOADER` environment variable changes the default dynamic
linker. The `fakechroot` script provides `--elfloader` option.
* The `FAKECHROOT_EXCLUDE_PATH` environment variable overrides the default
settings.
* The `ldd`(1) wrapper can work if overriden with `FAKECHROOT_CMD_SUBST`
environment variable.
* New `env`(1) wrapper was added. It preserves fakechroot environment even
for `--ignore-environment` option.
* The special environment `none` means that no environment settings are loaded
at all.
* The function `setenv`(3) and `unsetenv`(3) was reimplemented, to prevent
problems with binaries which brings own implementation of these functions.
* New function `clearenv`(3) was added. It preserves fakechroot environment.
* It is safe to use relative paths which won't escape from fake chroot.
* Fixes were made for `readline`(2) function if destination path is similar to
`FAKECHROOT_PATH`.
* Fixes were made for `mktemp`(3) function if used on a path in
`FAKECHROOT_EXCLUDE_PATHS`.
* The `_xftw64`(glibc) function is reenabled. It had wrong wrapper.
* Fixes were made for `__realpath_chk`(glibc) function when `__chk_fail`
function is missing.
* New functions `mkostemp`(3), `mkostemp64`(3), `mkostemps`(3),
`mkostemps64`(3), `mkstemps`(3) and `mkstemps64`(3) were implemented.
It fixes `sed -i` command.
## Version 2.16
11 Dec 2011
* The fakechroot script loads additional environment settings from
configuration directory (`--config-dir` option). By default additional
settings are provided for `chroot`(8) and `debootstrap`(8) commands.
* Wrapped `chroot`(8) command loads `ld.so.conf` paths to `LD_LIBRARY_PATH`
environment variable.
* The `debootstrap`(8) command works with default, buildd and minbase
variants.
* Fixes were made for `getpeeraddr`(3) and `getsockaddr`(3) functions.
`lwp-request` command is working correctly.
## Version 2.15
29 Sep 2011
* New function `faccessat`(2) was added. It fixes `test -r` command.
Thanks to Johannes Schauer.
* The `popen`(3) function were reimplemented based on OpenBSD source to
prevent some coredumps with newer GNU C Library.
## Version 2.14
18 Dec 2010
* The source code was refactored: all functions was moved to separated files.
* The `opendir`(3) function is compiled only if it doesn't call other function
internally. It fixes `opendir`(3), `fts_open`(3) and `ftw`(3) functions.
* The `fts_*`(3) functions were reimplemented based on OpenBSD source.
* The `ftw_*`(3) functions were reimplemented based on GNU C Library source.
* The `__opendir2`(3) function was reimplemented based on FreeBSD source.
* Fixes were made for older GNU C Library and for cross-compiling environment.
## Version 2.13.1
30 Nov 2010
* Fixes were made for older GNU C Library.
## Version 2.13
29 Nov 2010
* Fixes were made for `realpath`(3) and `ftw`(3) functions. `apt-ftparchive`
command currently is working.
* Fixes were made for `canonicalize_file_name`(3), `ftw64`(3), `nftw`(3) and
`nftw64`(3) functions.
* New functions `fts_children`(3) and `fts_read`(3) were added.
* Lazy dynamic symbol loading was implemented. Thanks to Alexander Shishkin.
* Fixed bug when `FAKECHROOT_EXCLUDE_PATH` list was sometimes ignored.
* All source code is now on LGPL license again.
## Version 2.12
10 Nov 2010
* New function `execlp`(3). Thanks to Robert Spanton.
* New functions `statfs`(2) and `statvfs`(2). Thanks to Paweł Stawicki.
* Better support for GNU/kFreeBSD was made.
## Version 2.11
12 Sep 2010
* Fixes were made for `getpeername`(2) and `getsockname`(2) functions.
`host 127.0.0.1` command currently is working. Thanks to Daniel Tschan.
* Fixes were made for `canonicalize_file_name`(3) function. `man-db` command
currently is working.
* New functions `__*_chk`(3) were added for GNU libc with fortify `level > 0`.
* New environment variable `FAKECHROOT_AF_UNIX_PATH` defines an optional
prefix for unix sockets.
* Better support for FreeBSD was made.
* Autoconf scripts were refactored.
* More test units were added.
## Version 2.10
25 Aug 2010
* Handle properly GNU libc `open`(2), `open64`(2), `openat`(2) and
`openat64`(2) inline functions.
* Compatibility were improved for `scandir`(3) and `scandir64`(3) functions
on the latest GNU libc.
* Fixed `lstat`(2) function returns correct `st_size`. Thanks to Daniel
Baumann.
* Fixed `readlink`(2) function. Correctly truncates content if buffer is too
small.
* Fixed `undefined symbol: rpl_malloc` error for compiled 32-bit library on
64-bit architecture by dropping `AC_FUNC_MALLOC` in `configure.ac`.
* Fixed `chroot`(2) function for path which contains dot character. Thanks to
Robie Basak.
* New function `utimensat`(2) fixes `cp` command on Debian sid.
* New functions `linkat`(2), `mknodat`(2), `mkfifoat`(2), `readlinkat`(2)
and `symlinkat`(2).
* New functions `popen`(3) and `system`(3) for GNU libc.
* `dpkg-shlibdeps(1)` works again because `cd $FAKECHROOT_BASE` does not
change current working directory to root directory.
* New `FAKECHROOT_CMD_SUBST` environment variable handles a list of
substituted commands. Thanks to Richard W.M. Jones.
* New scripts ldd and ldconfig with .fakechroot suffix are installed.
* New `make test` target uses Perl's `prove` tool to run test units.
## Version 2.9
31 Mar 2009
* Fixes were made for `getpeername`(2) and `getsockname`(2) functions. Thanks to
Axel Thimm and Fedora people.
* Fixes were made for `execve`(2):
* Always copy necessary variables to new environment.
* Do not make duplicates of environment variables. Thanks to Richard
W.M. Jones.
* Fixed were made for `chroot`(2). It is possible to escape chroot. Thanks
to Richard W.M. Jones.
* Fixed were made for `mktemp`(2). There was a buffer overflow. Thanks to
Mikhail Gusarov.
* New function: `futimesat`(2). Fixes `touch -m` command.
* New functions: `bindtextdomain`(3), `inotify_add_watch`(2).
* More test units was added, `make check` works as expected.
## Version 2.8
25 Jul 2008
* Fixes were made for `__fxstatat64`(3) function which broke `chown` command
on i386 architecture.
* Better support for FreeBSD was made.
## Version 2.7.1
17 Jul 2008
* Compiles with older GNU libc: readlink type of return value is detected.
* Compiles with uClibc: existence of getwd function is detected.
## Version 2.7
15 Jul 2008
* Stability and compatibility were improved for the latest libc.
* Fixes were made for latest version of coreutils.
* Fixed `readlink`(2) function to be ssize_t as it is in newer libc.
* New functions: `__fxstatat`(2), `__fxstatat64`(2), `fchmodat`(2),
`fchownat`(2), `__openat`(2), `__openat64`(2), `unlinkat`(2). It fixes
last coreutils.
* New functions: `mkdirat`(2), `renameat`(2).
* Fixed `chroot`(2) function to not change current working directory.
* Fixed `chroot`(2) function to handle relative path.
* Fixed `execve`(2) function to not expand argv0 and handle `#!` correctly.
* New `eaccess`(3) function backported from Klik.
* New functions: `bind`(2), `connect`(2), `getpeername`(2), `getsockname`(2).
They support `PF_UNIX` sockets.
* More memory allocation for fakechroot_init.
## Version 2.6
5 May 2007
* New environment variable `FAKECHROOT_EXCLUDE_PATH`.
* Fixed `getcwd`(3). Unbreaks `cd` command.
* Fixed `readlink`(2) function. Unbreaks `readlink` command.
* Fixed `mktemp`(3) function. Unbreaks `patch` and `ranlib` command.
* The `chroot`(2) function is now recursive and allows nested chroots.
NAME
fakechroot - gives a fake chroot environment
SYNOPSIS
fakechroot [-s|--use-system-libs] [-l|--lib *library*]
[-e|--environment *type*] [-c|--config-dir *directory*] [--] [*command*]
fakechroot [-h|--help]
fakechroot [-v|--version]
DESCRIPTION
fakechroot runs a command in an environment were is additional
possibility to use chroot(8) command without root privileges. This is
useful for allowing users to create own chrooted environment with
possibility to install another packages without need for root
privileges.
fakechroot replaces more library functions (chroot(2), open(2), etc.) by
ones that simulate the effect the real library functions would have had,
had the user really been in chroot. These wrapper functions are in a
shared library /usr/lib/fakechroot/libfakechroot.so which is loaded
through the `LD_PRELOAD' mechanism of the dynamic loader. (See ld.so(8))
In fake chroot you can install Debian bootstrap with debootstrap(8)
command. In this environment you can use i.e. apt-get(8) command to
install another packages from common user's account.
In the current version, the fakechroot does not provide the fakeroot(1)
functionality! You might to call fakechroot with fakeroot command, if
you want to emulate root environment, i.e.:
$ fakechroot fakeroot /usr/sbin/chroot /tmp/debian /bin/sh
# id
uid=0(root) gid=0(root) groups=0(root)
SECURITY ASPECTS
fakechroot is a regular, non-setuid program. It does not enhance a
user's privileges, or decrease the host's system security.
fakechroot should not be used as a tool for enhancing system security
i.e. by separating (sandboxing) applications. It is very easy to escape
from a fake chroot environment.
SEE ALSO
fakeroot(1), debuild(1), debootstrap(8), febootstrap(8),
http://fakechroot.alioth.debian.org/
BUGS
If you find the bug or want to implement new features, please report it
at https://github.com/fakechroot/fakechroot/issues
AUTHORS
Copyright (c) 2003, 2005, 2007-2011 Piotr Roszatycki <dexter@debian.org>
Copyright (c) 2007 Mark Eichin <eichin@metacarta.com>
Copyright (c) 2006, 2007 Alexander Shishkin <virtuoso@slind.org>
Copyright (c) 2006, 2007 Lionel Tricon <lionel.tricon@free.fr>
COPYING
fakechroot is distributed under the GNU Lesser General Public License
(LGPL 2.1 or greater).
![logo](http://fakechroot.alioth.debian.org/img/fakechroot_logo.png)
---
**Home** | [Download](https://github.com/fakechroot/fakechroot/wiki/Download) | [Documentation](https://github.com/fakechroot/fakechroot/blob/master/man/fakechroot.pod) | [ChangeLog](https://github.com/fakechroot/fakechroot/blob/master/NEWS.md) | [Development](https://github.com/fakechroot/fakechroot/wiki/Development) | [ToDo](https://github.com/fakechroot/fakechroot/wiki/Todo) | [Links](https://github.com/fakechroot/fakechroot/wiki/Links)
[![Build Status](https://travis-ci.org/dex4er/fakechroot.png?branch=master)](https://travis-ci.org/dex4er/fakechroot)
What is it?
===========
fakechroot runs a command in an environment were is additional possibility to
use `chroot`(8) command without root privileges. This is useful for allowing
users to create own chrooted environment with possibility to install another
packages without need for root privileges.
News
====
### 24 Nov 2013
Version 2.17 is released. The `FAKECHROOT_ELFLOADER` environment variable
changes the default dynamic linker. New `env`(1) wrapper was added. It is safe
to use relative paths which won't escape from fake chroot. Fixes were make for
`readline`(2), `mktemp`(3), `_xftw64`(glibc), `__realpath_chk`(glibc)
functions. New functions `mkostemp`(3), `mkostemp64`(3), `mkostemps`(3),
`mkostemps64`(3), `mkstemps`(3) and `mkstemps64`(3) were implemented.
### 11 Dec 2011
Version 2.16 is released. The fakechroot script loads additional environment
settings from configuration directory (`--config-dir` option). By default
additional settings are provided for `chroot`(8) and `debootstrap`(8)
commands. Wrapped `chroot`(8) command loads `ld.so.conf` paths to
`LD_LIBRARY_PATH` environment variable. Fixes were made for `getpeeraddr`(3)
and `getsockaddr`(3) functions.
### 29 Sep 2011
Version 2.15 is released. New function `faccessat`(2) was added: it fixes
`test -r` command. The `popen`(3) function were reimplemented based on OpenBSD
source to prevent some coredumps with newer GNU C Library.
How does it work?
=================
fakechroot replaces more library functions (`chroot`(2), `open`(2), etc.) by
ones that simulate the effect the real library functions would have had, had
the user really been in chroot. These wrapper functions are in a shared
library `/usr/lib/fakechroot/libfakechroot.so` which is loaded through the
`LD_PRELOAD` mechanism of the dynamic loader. (See `ld.so`(8))
In fake chroot you can install Debian bootstrap with `debootstrap` command.
In this environment you can use i.e. `apt-get`(8) command to install another
packages from common user's account.
Where is it used?
=================
fakechroot is mainly used as:
* a variant of [debootstrap](http://code.erisian.com.au/Wiki/debootstrap), the tool which can set up new Debian or Ubuntu system.
fakechroot had found another purposes:
* to be a part of [Klik](http://klik.atekon.de) application installer as kfakechroot project
* to be a supporter for [pbuilder](http://pbuilder.alioth.debian.org/) building system
* to be a supporter for [Apport](https://wiki.ubuntu.com/Apport) retracer
* to be a supporter for [libguestfs tools](http://libguestfs.org/) for accessing and modifying virtual machine disk images
* to be a part of [Slind](https://www.slind.org/Main_Page) - a minimal Debian-based distro for embedded devices as libfakechroot-cross project
* to be a supporter for [febootstrap](http://et.redhat.com/~rjones/febootstrap/), the tool which can set up new Fedora system.
* to be a part of [cuntubuntu](https://play.google.com/store/apps/details?id=com.cuntubuntu) - Ubuntu for Android without root
......@@ -16,6 +16,8 @@ I'm glad to see that fakechroot had found another purposes:
(https://www.slind.org/Main_Page)
* to be a part of scratchbox - the cross-compilation toolkit project
(http://freedesktop.org/wiki/Software/sbox2)
* to be a part of cuntubuntu - Ubuntu for Android without root
(https://play.google.com/store/apps/details?id=com.cuntubuntu)
I would like to thank to:
......
This diff is collapsed.
......@@ -4,18 +4,26 @@
set -e
autogen () {
rm -f Makefile Makefile.in aclocal.m4
rm -f config.guess config.h config.h.in config.log
rm -f config.status config.sub configure
rm -f depcomp install-sh libtool ltmain.sh missing stamp-h1
clean () {
rm -f Makefile Makefile.in aclocal.m4
rm -f config.h config.h.in config.log
rm -f config.status configure
rm -f libtool test-driver
rm -f stamp-h1
rm -f m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4
rm -rf autom4te.cache
rm -rf build-aux
}
autogen () {
autoreconf --verbose --force --install --make
}
set -x
cd $(dirname $0)
clean
test "$1" = clean && exit 0
autogen
rm -rf autom4te.cache
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then