Imported Upstream version 0.3.2

parent cca39ac6
Roberto Maar <robi@users.berlios.de>
Roberto Maar (robi) <robi6@users.sf.net>
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
......@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
......@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
......@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
......@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
......@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
......@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
......@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
......@@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
......@@ -336,5 +335,6 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
......@@ -26,7 +26,7 @@ Check the version with the following commands:
# file -v
# /sbin/fsck.ext3 -V
the version of "file" must be > 5.03
the version of "file" must be > 5.03 (file-5.05 and file-5.17 see Known Bugs)
and the EXT2FS Library version >= 1.41.9 (libext2fs-1.42 see Known Bugs)
......@@ -70,7 +70,7 @@ Optional extensions
====================
with configure the following extensions can be activated
--enable-expert-mode # use of file system superblock copies
--enable-expert-mode # (recommended) use of file system superblock copies
and recover from partially destroyed file systems
--enable-file-attr # restore also file attributes
......@@ -96,10 +96,10 @@ Which version is installed displays the following command
# file -v
If found 5.04 on your Linux, install also the devel package, or you must create a symlink of the library. (see follow)
If found >= 5.04 on your Linux, install also the devel package, or you must create a symlink of the library. (see follow)
No version 5.04 for your Linux available? You can also install version file-5.04 from source.
No version >= 5.04 for your Linux available? You can also install version file-5.?? from source.
download ftp://ftp.astron.com/pub/file/
You can uninstall the older version of "file" (not recommended) if it has no dependencies to other packages. (eg. perl,apache,...)
......@@ -112,7 +112,7 @@ The following illustrates the installation of a second version
# tar -xzf file-5.04.tar.gz
# cd file-5.04
# ./configure
# ./configure
# make
# su -
# cd ????/file-5.04
......@@ -171,6 +171,7 @@ another version of libmagic should not have this symlink.
Devel packages and librarys of libext2fs
========================================
First check your current version of libext2fs with the following command
......@@ -178,8 +179,8 @@ First check your current version of libext2fs with the following command
if Version >= 1.41.9
===================
if Version >= 1.41.9 and not 1.42
==================================
Install the following devel packages:
There are possibley different names according your Linux distribution
......@@ -188,36 +189,52 @@ openSuse debian Fedora
libext2fs-devel e2fslibs-dev e2fsprogs-devel
libuuid-devel uuid-dev libuuid-devel
libblkid-devel libblkid-dev libblkid-devel
file-devel libmagic-dev file-devel
zlib-devel zlib1g-dev ?
libbz2-devel libbz2-dev ?
then compile ext4magic
# tar -xzf ext4magic-0.3.0.tar.gz
# cd ext4magic-0.3.0
# ./configure
# tar -xzf ext4magic-0.3.2.tar.gz
# cd ext4magic-0.3.2
# ./configure --enable-expert-mode
# make
# su
# make install
if Version < 1.41.9
if Version < 1.41.9 ( or if 1.42 )
===================
Install the following devel packages:
There are possibley different names according your Linux distribution
openSuse debian Fedora
----------------------------------------------------------------------
file-devel libmagic-dev file-devel
zlib-devel zlib1g-dev ?
libbz2-devel libbz2-dev ?
download a actual version of e2fsprogs from http://e2fsprogs.sourceforge.net/
# tar -xzf e2fsprogs-1.41.9.tar.gz
# cd e2fsprogs-1.41.9
# tar -xzf e2fsprogs-1.42.9.tar.gz
# cd e2fsprogs-1.42.9
# ./configure
# make
Important: Please do not install this version.
This could create problems with programs of your current distribution ..
Important: Please do not install this version. ( !!! do not "make install" !!!
this could create problems with programs of your current distribution ..)
save the actual directory path of lib/ in a variable for future use in configure commandline.
# EXT2LIB="$(pwd)/lib"
After this, change into the code directory of ext4magic
# tar -xzf ext4magic-0.3.0.tar.gz
# cd ext4magic-0.3.0
# ./configure CFLAGS="-I$EXT2LIB" LDFLAGS="-L$EXT2LIB" LIBS="-luuid -lcom_err -lpthread"
After this, change into the code directory of ext4magic ( Importent: use the same shell where you set EXT2LIB )
# tar -xzf ext4magic-0.3.2.tar.gz
# cd ext4magic-0.3.2
# ./configure --enable-expert-mode CFLAGS="-I$EXT2LIB" LDFLAGS="-L$EXT2LIB" LIBS="-luuid -lcom_err -lpthread -lmagic -lz -lbz2"
# make
# su
# make install
......
......@@ -14,6 +14,7 @@ Ubuntu Sparc64
Fedora (VM)
Zum Installieren von ext4magic aus dem Quellcode werden folgende Pakete auf dem Rechner benötigt
diese werden noch einige andere Pakete aus der Entwicklergruppe mit installieren und sollten soweit
nicht schon vorhanden, vorher installiert werden.
......@@ -35,8 +36,8 @@ Diese Libraries sind zwar auf jedem Linux vorhanden, doch es werden aktuelle Ver
# file -v
# /sbin/fsck.ext3 -V
Die Version von "file" muss > 5.03 sein
und die EXT2FS Library Version >= 1.41.9
Die Version von "file" muss > 5.03 sein (Achtung file-5.05 und file-5.17, siehe "Known Bugs" in README
und die EXT2FS Library Version >= 1.41.9 (Achtung Version 1.42 hat einen Bug und ist für ext4magic unbrauchbar)
In diesem Fall ist die Installation recht einfach.
Installiere folgende Develpakete:
......@@ -58,7 +59,7 @@ Entpacke das Archive und mit cd in das Verzeichnis wechseln
Die folgenden Kommandos kompilieren ext4magic
# ./configure
# ./configure --enable-expert-mode
# make
installieren dann als root
......@@ -90,22 +91,22 @@ Welche Version installiert ist zeigt der Befehl
# file -v
Sollte für die Version 5.04 auch ein Devel Paket für diese Distribution auffindbar sein, dann dieses auch
Sollte für deine Version >= 5.04 auch ein Devel Paket für diese Distribution auffindbar sein, dann dieses auch
installieren. Nicht in allen Distributionen wird ein solches Devel Paket für "file" gepflegt.
Das daraus entstehende Problem kann auch durch einen einfachen Symlink umgangen werden. (Siehe weiter unten)
Sollte keine Version >= file-5.04 für dein Linux erhältlich sein, kann auch die Version "file-5.04" aus dem
Sollte keine Version >= file-5.04 für dein Linux erhältlich sein, kann auch die Version "file-5.??" aus dem
Quellcode installieren werden.
Download ftp://ftp.astron.com/pub/file/
Es kann die alte "file" Version vom Rechner deinstalliert werden, (nicht empfohlener Weg)
Es kann die alte "file" Version vom Rechner deinstalliert werden, (aber nicht empfohlener Weg)
soweit keine weiteren Abhängikeiten zu anderen Paketen (zB apache, perl,...) bestehen,
Wird die alte Version gelöscht, muss die neue zwingend wieder für /usr und nicht für /usr/local
konfiguriert werden.
Oder, es kann auch eine zweite Version zusätzlich unterhalb von /usr/local installiert, werden. (empfohlener Weg)
In diesem Fall dann das Devel Paket einer älteren Version nicht installieren.
In diesem Fall dann bitte das Devel Paket einer älteren Version nicht installieren.
Die Installation einer zweiten Version hier im Überblick.
......@@ -170,7 +171,7 @@ lrwxrwxrwx 1 root root 17 Aug 28 16:09 /usr/lib/libmagic.so.1 -> libmagic.so
Die Version von libmagic mit der ext4magic zusammen kompiliert werden soll, muss diesen Link besitzen.
Eine eventuelle weitere Version von libmagic sollte diesen Link nicht besitzen damit sie nicht unbeabsichtigt
während der Kompilierung doch benutzt wird. Dieses würde innerhalb von ext4magic zu Speicherfehlern und Abstürzen führen.
Der Link kann nach dem Kopilieren wieder entfernt werden.
......@@ -183,7 +184,7 @@ Auf dieser Library basieren die Befehle zum Erstellen und Verwalten der ext2/3/4
Installation bei einer aktuellen Version von libext2fs
------------------------------------------------------
Soweit eine aktuelle Version (>= 1.41.9 ) von libext2fs auf dem Rechner installiert ist,
Soweit eine aktuelle Version (>= 1.41.9 und nicht 1.42) von libext2fs auf dem Rechner installiert ist,
kann die folgende Vorgehensweise zum erstellen des Programmes genutzt werden.
Die Version kann mit folgendem Befehl ermittet werden.
......@@ -200,17 +201,19 @@ openSuse debian Fedora
libext2fs-devel e2fslibs-dev e2fsprogs-devel
libuuid-devel uuid-dev libuuid-devel
libblkid-devel libblkid-dev libblkid-devel
file-devel libmagic-dev file-devel (siehe auch oben)
zlib-devel zlib1g-dev ?
libbz2-devel libbz2-dev ?
Das ext4magic Archiv downloaden und entpacken und in das so entstehende Verzeichnis wechseln
# tar -xzf ext4magic-0.3.0.tar.gz
# cd ext4magic-0.3.0
# tar -xzf ext4magic-0.3.2.tar.gz
# cd ext4magic-0.3.2
Das Paket wird jetzt kompiliert.
# ./configure
# ./configure --enable-expert-mode
# make
Damit wird das binäre Programm ext4magic erstellt. Dieses befindet sich derzeit noch im
......@@ -226,23 +229,34 @@ Deinstallieren dann entsprechend mit "make uninstall"
Installation bei einer älteren Version von libext2fs
Installation bei einer älteren Version von libext2fs oder bei 1.42
========================================================
Sollte ihr Rechner aktuell noch kein ext4 Filesystem unterstützen, befindet sich auf dem Rechner
derzeit wahrscheinlich auch eine ältere Version von libext2fs. Damit läßt sich ext4magic nicht
kompilieren. Eine Upgrade von libext2fs auf ein nicht zu ihrer Distribution passenden Version ist jedoch
nicht anzuraten, da auch wichtige Administrationskommandos wie zB "mkfs.ext3" und "fsck.ext3"
davon betroffen sind.
derzeit wahrscheinlich auch eine ältere Version von libext2fs. 1.42 (ohne .irgendwas) hat einen Bug
und ist für ext4magic nicht brauchbar. Damit läßt sich ext4magic nicht kompilieren oder im Fall 1.42
gibt es Speicherfehler. Eine Upgrade von libext2fs auf ein nicht zu ihrer Distribution passenden
Version ist jedoch nicht anzuraten, da auch wichtige Administrationskommandos
wie zB "mkfs.ext3" und "fsck.ext3" davon betroffen sind.
Mit folgender Vorgehensweise kann dieses Problem umgangen werden.
Zum kompilieren werden dabei bei dieser Vorgehensweise nur folgende Devel-Pakete benötigt.
openSuse debian Fedora
----------------------------------------------------------------------
file-devel libmagic-dev file-devel (siehe auch oben)
zlib-devel zlib1g-dev ?
libbz2-devel libbz2-dev ?
Von http://e2fsprogs.sourceforge.net/ eine Version von e2fsprogs größer oder gleich Version 1.41.9 herunterladen.
Das Archiv entpacken und in das Verzeichnis wechseln.
Dort den Quellcode kompilieren, jedoch ohne ihn zu installieren.
# tar -xzf e2fsprogs-1.41.9.tar.gz
# cd e2fsprogs-1.41.9
# tar -xzf e2fsprogs-1.42.9.tar.gz
# cd e2fsprogs-1.42.9
# ./configure
# make
......@@ -257,11 +271,11 @@ in einer Variable abspeichern. Diesen Path benötigen wir zum kompilieren von ex
Danach in das Verzeichnis von ext4magic wechseln, welches beim Entpacken des Archives von
ext4magic angelegt wird. Jetzt die gleiche Shell benutzen in der die EXT2LIB Variable angelegt wurde.
wie folgt compilieren
wie folgt compilieren ( die selbe Shell benutzen in der die Variabel EXT2LIB angelegt wurde )
# tar -xzf ext4magic-0.3.0.tar.gz
# cd ext4magic-0.3.0
# ./configure CFLAGS="-I$EXT2LIB" LDFLAGS="-L$EXT2LIB" LIBS="-luuid -lcom_err -lpthread"
# tar -xzf ext4magic-0.3.2.tar.gz
# cd ext4magic-0.3.2
# ./configure --enable-expert-mode CFLAGS="-I$EXT2LIB" LDFLAGS="-L$EXT2LIB" LIBS="-luuid -lcom_err -lpthread -lmagic -lz -lbz2"
# make
installieren dann als root mit
......
This diff is collapsed.
ext4magic 0.3.2 some minor bugs fixed
support for matlab5 files in magic-function
interface for furter use of a privat magic pattern file
(see http://ext4magic.sourceforge.net/magic-pattern-interface.html)
ext4magic is moved to http://sourceforge.net/projects/ext4magic/
ext4magic 0.3.1 new : support for ecryptfs by Magic-function
......
......@@ -378,7 +378,7 @@ _________________________________________________________________________
# Help-Script for ext4magic (needed is dump2fs >= 1.41.9)
# to identify options for the backup superblocks
# to restore of a partially damaged filesystem with ext4magic
# Autor robi@users.berlios.de (Version 1.1 vom 03.06.2011)
# Autor robi6@users.sf.net (Version 1.1 vom 03.06.2011)
if [ -b "$1" -o -f "$1" ]
then
......@@ -508,8 +508,10 @@ two possible causes:
7.0 Known Bugs
libext2fs-1.42 has a small bug, it crashed ext4magic. (see e2fstools BUG #3451486)
libext2fs-1.42 has a small bug, it crashed ext4magic. (see e2fstools BUG #3451486)
file-5.05 libmagic is stable in ext4magic, but the magic-function produce on some
video- and auto-formats many small erroneous files
file-5.17 libmagic is not stable enough for ext4magic and often produce segfaults
Only on big endian environments, there are some incorrect outputs of inode times, and missing of
......
......@@ -2,20 +2,24 @@ TODO over of the next year ;-)
- English documentation
we working on it, but we need help !!!!!!!
http://openfacts2.berlios.de/wikien/index.php/BerliosProject:Ext4magic
Current stat 04.2012: not ready but looks good
the wikisite from Berlios are outsourced to
http://ext4magic.sourceforge.net/ext4magic_en.html
Current stat 09.2014: does not look nice, but is informative
- support for ecrypfs in the Magic-function
is particularly interesting for Ubuntu user
Current stat 04.2012: ready for test
- the development in the file-project has negative implications for the quality of the magic function
file-5.04 ---> file-5.19 tests reached a negative recovery result of 5% and more
ext4magic need a own privat magic database in the future
the interface is integrated by ext4magic-0.3.2
for first experiments http://ext4magic.sourceforge.net/magic-pattern-interface.html
Current stat 09.2014: open
- the new Magic-function for ext3
old 0.2.x function is very slow and inaccurate
and is not compatible with the Magic-functions of the ext4 in 0.3.x
a support for both file systems is planned with 0.4.x
Current stat 04.2012: open
a support for both file systems is complex and expensive
Current stat 09.2014: postpone
- better support for source code and other text files
......@@ -28,21 +32,23 @@ TODO over of the next year ;-)
# sed '1,/^$/d' ext4magic.c | file -i -
/dev/stdin: text/x-c; charset=us-ascii
Current stat 04.2012: The current libmagic-5.11 eliminated the problem.
Changes within ext4magic therefore, not required
Current stat 09.2014: new libmagic version eliminated the problem.
Changes within ext4magic therefore, not required
- ext4 : with the Magic-function it should be possible to recover also some file types
if the deleted file has existed with 2 to 4 extents
if the deleted file has existed with 2 to 4 extents
the conditions and preparations are already included
the possible individual extents are already collected in the database
a function is needed to find out and check the correct order
Current stat 04.2012: open
Current stat 09.2014: open
Currently known issues
- on big-endian the crtime and deleted directory entry not correct if use the
real libfunction for read the inode.
The modified version to read the Journal inode works. BUG:#017304 ; #017304
- The modified version to read the journal inode works. BUG:#017304 ; #017304
- libmagic file-5.05 crushed some video/audio formats to postscript trash
- libmagic file-5.17 many segfaults, not usable for the magic-function of ext4magic
This diff is collapsed.
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-03-05.13; # UTC
# Copyright (C) 1999-2012 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
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`