Mail Archives: djgpp/2010/06/25/03:02:06

X-Authentication-Warning: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Message-ID: <>
Date: Fri, 25 Jun 2010 09:45:22 +0300
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4
MIME-Version: 1.0
To: djgpp AT delorie DOT com
CC: Allan <mu8ja0i AT earthlink DOT net>
Subject: Re: PCRE 8.02 installation difficulty - overcome inelegently
References: <HPadnWk1K8ZWY77RnZ2dnUVZ_vidnZ2d AT earthlink DOT com>
In-Reply-To: <>
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 06/25/2010 03:56 AM, Allan wrote:
> I installed PCRE 8.02 without changing the C source code at all but I 
> did have to edit `config.status' in the top level source code 
> directory. There is a problem in the PCRE 8.02 `configure' script but 
> I was able to run it in one iteration and then create the makefiles by 
> running the `config.status' script after manual editing. It builds 
> cleanly but four of five tests fail. The one line of code in the 
> script that has to be fixed manually is to assign `\r' instead of the 
> null string to `ac_cr' . I have 2.04 beta with all updates on Windows 
> SP SP3. My external Perl is AS ActivePerl version 1007.
Known bug in some versions of autoconf. See attached script for building 
MPFR for example how to workaround the problem (and possibly 
additionally build a packages for DJGPP distribution).


Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;

#! /bin/sh
# This scripts
# 1) unpacks MPFR source archive (tar.gz or tar.bz2)
# 2) generates DJGPP source archive with configured sources
# 3) builds MPFR and run tests
# 4) generates DJGPP binary package of MPFR.
# It is not intended for building MPFR from
# even when it is included there.
email="Andris Pavenis <andris DOT pavenis AT iki DOT fi>"


gcc -v -O2 -x c - -o gmpver__.exe -lgmp -lm <<'EOF'
#include <stdio.h>
#include <gmp.h>
int main(void) { printf("%s\n", gmp_version); return 0; }

test -f gmpver__.exe || exit 1
gcc_ver=$(gcc --version | head -1 | awk '{print $3}')
rm -f gmpver__.exe

mkdir -p gnu || exit 1

rm -rf gnu/mpfr-*

if [ -f $name-$version.tar.bz2 ] ; then
  bzip2 -cd $name-$version.tar.bz2 | ( cd gnu && tar x ) || exit 1
  if [ -f $name-version.tar.gz ] ; then
     gzip -cd $name-$version.tar.gz | ( cd gnu && tar x ) || exit 1
     echo MPFR source archive is not found

djver1=`echo $version | sed -e 's:\.::2g'`
djver2=`echo $version | sed -e 's:\.::g'`

if test x"$djver1" != x"$version"; then
  mv -v gnu/$name-$version $srcdir

#( cd $srcdir && aclocal && autoconf || exit 1 )

# Workaround bug in autoconf-2.63
sed -e 's:\\\\r:\\r:g' $srcdir/configure >$srcdir/
diff -u $srcdir/configure $srcdir/
mv -fv $srcdir/ $srcdir/configure

( cd $srcdir && ./configure i386-pc-msdosdjgpp )

# Write README file for DJGPP to the source directory
cat >gnu/$name-$djver1/readme.djgpp <<EOF
This is DJGPP port of MPFR-$version.

The MPFR library is a C library for multiple-precision floating-point
computations with correct rounding. MPFR requires GMP for use. It is also
required to install MPFR after GMP, as it may replaces part of GMP files

See README and for more information.

Building from sources

LFN support is required for building MPFR for DJGPP. I built MPFR
using GCC-$gcc_ver under Windows Vista Business SP2. DJGPP port of GMP-$gmp_ver
were used when building MPFR-$version. One may need to to rebuild MPFR
if different enough GMP version is being used. 

Sources in mpfr${djver2} are preconfigured for target i386-pc-msdosdjgpp.
Simply running configure script with needed parameters should be enough
to reconfigure if needed.

To build MPFR run 'make'.

To run tests of the MPFR, run 'make check'

To install MPFR run 'make install prefix=where_to_install' (replace
'where_to_install' with real value).


# Write script for building binary packets for DJGPP to the source directory
sed -e "s:@NAME@:$name:" -e "s:@VERSION@:$version:g" >$srcdir/ <<'EOF'
#! /bin/sh


djver1=`echo $version | sed -e 's:\.::2g'`
djver2=`echo $version | sed -e 's:\.::g'`

rm -rf inst.djg
make all check
make check >check.log 2>&1
make install prefix=`pwd`/inst.djg

mkdir -p inst.djg/info
mkdir -p inst.djg/manifest
mkdir -p inst.djg/gnu/$dname

touch inst.djg/manifest/mpfr${djver2}b.mft

cat >inst.djg/manifest/mpfr${djver2}b.ver <<E2
mpfr${djver2} MPFR - C library for multiple-precision floating-point computations (binaries)

mv -v inst.djg/share/info/*.info inst.djg/info/
cp -v authors bugs COPYING* inst.djg/gnu/$dname/
cp -v news readme* todo inst.djg/gnu/$dname/
cp -vf check.log inst.djg/gnu/$dname/
rm -rf inst.djg/share

( cd inst.djg && find . -type f | sed -e 's:^\./::' | sort >manifest/mpfr${djver2}b.mft )
( cd inst.djg && cat manifest/mpfr${djver2}b.mft | zip -9@ ../mpfr${djver2} )

# Write also this script to the source dircetory
cat $0 >$srcdir/`basename $0`

mkdir -p manifest

cat >manifest/mpfr${djver2}s.ver <<EOF
mpfr${djver2} MPFR - C library for multiple-precision floating-point computations (sources)

touch manifest/mpfr${djver2}s.ver

  cd $top
  find gnu -type f
  find manifest -name mpfr${djver2}s'.*'
) | sort >manifest/mpfr${djver2}s.mft

cat manifest/mpfr${djver2}s.mft | zip -9q@ mpfr${djver2}

cd $srcdir && make all check || exit 1

cd $srcdir && ./ || exit 1

mv -v $srcdir/$name${djver2} $top/


- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019