head	1.30;
access;
symbols
	release-1-3-10:1.28.0.2;
locks; strict;
comment	@# @;


1.30
date	2007.07.11.12.37.49;	author shd;	state Exp;
branches;
next	1.29;

1.29
date	2007.05.24.09.03.52;	author shd;	state Exp;
branches;
next	1.28;

1.28
date	2007.03.25.20.40.56;	author shd;	state Exp;
branches;
next	1.27;

1.27
date	2006.07.01.10.38.34;	author shd;	state Exp;
branches;
next	1.26;

1.26
date	2006.07.01.09.28.33;	author shd;	state Exp;
branches;
next	1.25;

1.25
date	2006.03.07.15.54.07;	author shd;	state Exp;
branches;
next	1.24;

1.24
date	2006.03.06.20.20.41;	author shd;	state Exp;
branches;
next	1.23;

1.23
date	2005.10.24.17.19.40;	author shd;	state Exp;
branches;
next	1.22;

1.22
date	2005.10.24.16.38.05;	author shd;	state Exp;
branches;
next	1.21;

1.21
date	2005.10.23.20.32.41;	author shd;	state Exp;
branches;
next	1.20;

1.20
date	2005.10.23.20.25.09;	author shd;	state Exp;
branches;
next	1.19;

1.19
date	2005.08.03.20.01.08;	author shd;	state Exp;
branches;
next	1.18;

1.18
date	2005.08.03.19.22.28;	author shd;	state Exp;
branches;
next	1.17;

1.17
date	2005.08.03.19.22.08;	author shd;	state Exp;
branches;
next	1.16;

1.16
date	2005.08.03.19.12.25;	author shd;	state Exp;
branches;
next	1.15;

1.15
date	2005.05.22.20.53.11;	author shd;	state Exp;
branches;
next	1.14;

1.14
date	2005.05.18.14.08.13;	author shd;	state Exp;
branches;
next	1.13;

1.13
date	2005.05.12.13.35.54;	author shd;	state Exp;
branches;
next	1.12;

1.12
date	2005.02.21.11.15.46;	author shd;	state Exp;
branches;
next	1.11;

1.11
date	2005.02.04.17.46.14;	author shd;	state Exp;
branches;
next	1.10;

1.10
date	2005.02.04.17.45.04;	author shd;	state Exp;
branches;
next	1.9;

1.9
date	2005.02.04.17.26.45;	author shd;	state Exp;
branches;
next	1.8;

1.8
date	2005.02.04.17.26.27;	author shd;	state Exp;
branches;
next	1.7;

1.7
date	2005.02.04.17.20.08;	author shd;	state Exp;
branches;
next	1.6;

1.6
date	2005.02.04.15.04.01;	author shd;	state Exp;
branches;
next	1.5;

1.5
date	2005.02.03.13.20.55;	author shd;	state Exp;
branches;
next	1.4;

1.4
date	2005.01.25.21.55.44;	author shd;	state Exp;
branches;
next	1.3;

1.3
date	2005.01.25.21.53.41;	author shd;	state Exp;
branches;
next	1.2;

1.2
date	2005.01.25.21.40.46;	author shd;	state Exp;
branches;
next	1.1;

1.1
date	2005.01.24.17.21.57;	author shd;	state Exp;
branches;
next	;


desc
@@


1.30
log
@Added a notice that development has moved into the Git repository.
@
text
@#!/bin/sh

version="1.3.10"
prefix="/usr/local"
packageprefix=""
compiler="gcc"
have_mandir="no"
have_bindir="no"

for opt in "$@@" ; do
	case $opt in
	--prefix=*)
		prefix=`echo $opt | sed -n 's/--prefix=\(.*\)/\1/p'`
		;;
	--package-prefix=*)
		packageprefix=`echo $opt | sed -n 's|--package-prefix=\(.*\)|\1|p'`
		;;
	--bindir=*)
		bindir=`echo $opt | sed -n 's|--bindir=\(.*\)|\1|p'`
		have_bindir="yes"
		;;
	--mandir=*)
		mandir=`echo $opt | sed -n 's|--mandir=\(.*\)|\1|p'`
		have_mandir="yes"
		;;
	--compiler=*)
		compiler=`echo $opt | sed -n 's|--compiler=\(.*\)|\1|p'`
		;;
	--help)
		echo ""
		echo "valid options are:"
		echo "--prefix=dir           install to prefix 'dir'"
 		echo "--package-prefix=dest  pretend to install to the prefix,"
		echo "                       but copy files to 'dest/prefix' on make install"
		echo "--bindir=dir           install program to 'dir' (PREFIX/bin/)"
		echo "--mandir=dir           install man page to 'dir' (PREFIX/share/man/)"
		echo "--compiler=program     compile with 'program' (gcc)"
		exit
		;;
        *)
		echo "unknown configure argument:" "$opt" "(ignoring)"
		;;
	esac
done

if test -n "$packageprefix" ; then
    packageprefix="$packageprefix/"
fi

if test "$have_bindir" = "no" ; then
    bindir="$prefix/bin"
fi

if test "$have_mandir" = "no" ; then
    mandir="$prefix/share/man"
fi

packagebindir="$packageprefix$bindir"
packagemandir="$packageprefix$mandir"

sed -e "s|{BINDIR}|$packagebindir|g" \
    -e "s|{MANDIR}|$packagemandir|g" \
    < Makefile.in > Makefile

if test -z "$CFLAGS" ; then
    CFLAGS="-O2"
fi
EXTRASOURCES=""

os="`uname`"
echo $os |grep MINGW32 > /dev/null
if test "$?" = "0" ; then
    os="MinGW"
fi

if test "$os" = "MinGW" ; then
    EXTRASOURCES="$EXTRASOURCES basename.c"
    cp win32/libgen.h win32/basename.c src/
fi

sed -e "s|{CC}|$compiler|" \
    -e "s|{CFLAGS}|$CFLAGS|" \
    -e "s|{EXTRASOURCES}|$EXTRASOURCES|" \
    < src/Makefile.in > src/Makefile

echo "" > "src/config.h"
echo "#ifndef CKSFV_CONFIG_H" >> "src/config.h"
echo "#define CKSFV_CONFIG_H" >> "src/config.h"

echo "#define VERSION \"$version\"" >> src/config.h

has_stdint="no"
has_inttypes="no"

cat > tmpfile.c <<EOF
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
int main(void) {return 0;}
EOF
$compiler -o tmpfile tmpfile.c >/dev/null 2>/dev/null
if test "$?" = "0" ; then
    has_stdint="yes"
fi

# A slight optimization: test inttypes.h only if there is no stdint.h
if test "$has_stdint" = "no" ; then
    cat > tmpfile.c <<EOF
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
int main(void) {return 0;}
EOF
    $compiler -o tmpfile tmpfile.c >/dev/null 2>/dev/null
    if test "$?" = "0"; then
	has_inttypes="yes"
    fi
fi

rm -f tmpfile tmpfile.c

if test "$has_stdint" = "yes" ; then
    echo "#include <stdint.h>" >> src/config.h
elif test "$has_inttypes" = "yes"; then
    echo "#include <inttypes.h>" >> src/config.h
else
    # no stdint.h or inttypes.h. obsolete environment. but we may hope..
    echo "#include <unistd.h>" >> src/config.h
    has_stdint="no (compilation will probably fail)"
fi

echo "#endif" >> "src/config.h"

echo ""
echo ""
echo ""
echo ""
echo "cksfv development has moved into a Git repository. Read"
echo ""
echo "    http://zakalwe.fi/~shd/foss/Git.instructions.txt"
echo ""
echo "This is not the latest version of cksfv! Sleeping 5 secs."
echo ""
echo ""
echo ""
sleep 5

echo ""
echo "  prefix directory:          $prefix"
echo "  package prefix:            $packageprefix"
echo "  binary directory:          $bindir"
echo "  man directory:             $mandir"
echo "  compiler:                  $compiler"
echo "  has stdint.h:              $has_stdint"
echo "  has inttypes.h:            $has_inttypes"
echo ""
echo "configure succesful."
@


1.29
log
@Added -D_FILE_OFFSET_BITS=64 for 32 bit platforms to support files
large files properly. [PERF] [ADAP]
@
text
@d135 14
@


1.28
log
@1.3.10 release
@
text
@d76 1
a76 3
if test "$os" = "SunOS" ; then
    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
elif test "$os" = "MinGW" ; then
@


1.27
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.9"
@


1.26
log
@*** empty log message ***
@
text
@d71 5
@


1.25
log
@*** empty log message ***
@
text
@d68 1
d73 3
d80 1
@


1.24
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.8"
@


1.23
log
@*** empty log message ***
@
text
@d69 5
@


1.22
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.7"
d64 4
@


1.21
log
@*** empty log message ***
@
text
@d84 1
a84 1
gcc -Wall -O2 -o tmpfile tmpfile.c >/dev/null 2>/dev/null
d97 1
a97 1
    gcc -Wall -O2 -o tmpfile tmpfile.c >/dev/null 2>/dev/null
@


1.20
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.6"
@


1.19
log
@*** empty log message ***
@
text
@d32 2
a33 2
		echo "--prefix dir           install to prefix 'dir'"
 		echo "--package-prefix dest  pretend to install to the prefix,"
d35 3
a37 3
		echo "--bindir dir           install program to 'dir' (PREFIX/bin/)"
		echo "--mandir dir           install man page to 'dir' (PREFIX/share/man/)"
		echo "--compiler program     compile with 'program' (gcc)"
@


1.18
log
@*** empty log message ***
@
text
@d103 2
@


1.17
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.5"
@


1.16
log
@*** empty log message ***
@
text
@d75 3
d85 1
a85 3
if test "$?" != "0" ; then
    has_stdint="no"
else
d89 3
a91 1
cat > tmpfile.c <<EOF
d97 4
a100 5
gcc -Wall -O2 -o tmpfile tmpfile.c >/dev/null 2>/dev/null
if test "$?" != "0"; then
    has_inttypes="no"
else
    has_inttypes="yes"
@


1.15
log
@*** empty log message ***
@
text
@d88 1
a88 1
cat > tmpfile <<EOF
@


1.14
log
@*** empty log message ***
@
text
@d83 14
a96 7
    # no stdint.h. obsolete environment. but we may hope
    echo "#include <unistd.h>" >> src/config.h
    mname="`uname`"
    if test "$mname" = "OpenBSD" ; then
	echo "#include <inttypes.h>" >> src/config.h
    fi
    has_stdint="no (you need luck to succeed)"
d98 4
d103 6
a108 1
    has_stdint="yes"
d120 1
@


1.13
log
@*** empty log message ***
@
text
@d85 4
@


1.12
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.4"
@


1.11
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.3"
@


1.10
log
@*** empty log message ***
@
text
@d36 1
a36 1
		echo "--mandir dir           install man page to 'dir' (PREFIX/share/man/man1/)"
@


1.9
log
@*** empty log message ***
@
text
@d55 1
a55 1
    mandir="$prefix/share/man/man1"
@


1.8
log
@*** empty log message ***
@
text
@d4 1
a4 1
prefix=/usr/local
@


1.7
log
@*** empty log message ***
@
text
@d8 1
d18 4
d35 1
d50 3
a52 1
bindir="$packageprefix$prefix/bin"
d55 1
a55 3
    mandir="$packageprefix$prefix/share/man/man1"
else
    mandir="$packageprefix$mandir"
d58 5
a62 2
sed -e "s|{BINDIR}|$bindir|g" \
    -e "s|{MANDIR}|$mandir|g" \
@


1.6
log
@*** empty log message ***
@
text
@d45 1
d47 1
a47 1
    mandir="$prefix/share/man/man1"
@


1.5
log
@*** empty log message ***
@
text
@d6 2
d17 8
a24 2
	*)
		echo "configure parameter error"
d30 2
d34 3
d45 5
a49 1
mandir="$packageprefix$prefix/share/man/man1"
d55 4
d88 1
@


1.4
log
@*** empty log message ***
@
text
@d3 1
a3 1
version="1.3.2"
a35 1
    -e "s|{VERSION}|$version|g" \
d38 6
d53 1
a53 2
    echo "#include <unistd.h>" > src/stdint.h
    echo "" >> src/stdint.h
d56 1
d60 2
@


1.3
log
@*** empty log message ***
@
text
@d48 3
a50 2
    touch src/stdint.h
    has_stdint="no"
@


1.2
log
@*** empty log message ***
@
text
@d45 1
a45 1
gcc -Wall -O2 -o tmpfile tmpfile.c &>/dev/null
@


1.1
log
@*** empty log message ***
@
text
@d39 15
d59 1
@

