delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/22/02:29:33

Date: Tue, 22 Jun 1999 09:27:00 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Edevaldo Pereira (q14792)" <q14792 AT email DOT sps DOT mot DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: TCL Port
In-Reply-To: <376E6E07.31CDC3C4@email.sps.mot.com>
Message-ID: <Pine.SUN.3.91.990622092607.25569H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 21 Jun 1999, Edevaldo Pereira (q14792) wrote:

> 	I'm not sure about this but the ./configure script tries to detect the
> platform in which it is running. It also tries to detect the C compiler
> used and depending on the system there are some includes and sources
> that may change. There are some .c files for each machine (aix, hp, sun
> and others).

This is normal for every configure script, and it works with DJGPP
(after some minor tweaks I mentioned, which the files attached below
will do for you).

> I hope that the default behavior is DJGPP friendly but I
> think that it supports shared libraries by default. To disable it I'll
> probably need to configure it again.

You will definitely need to run the configure script, and it should
detect that shared libraries aren't supported and use static linking
instead.  Several GNU packages do that, so I assume Tcl should as
well.

> PS2.: I appended to this email the readme file that comes in the unix
> directory.

This indicates that Tcl uses the usual GNU-style stuff.  So the files
below should solve the small problems for you.  I usually place them
in a djgpp subdirectory, and some of the file names in the scripts
below depend on that.

With all the files below in place in the djgpp subdirectory of the
main Tcl source directory, type "djgpp\config [Enter]", and it should
configure the package.  If all goes well, you will have to say "make"
after that and watch it build itself.  If you have some problems, post
them here.

Here is a Sed script that you should run on the configure script (I
call it `config.sed'):

------------------- cut here: config.sed -------------------------
# Replace "test -f" with "test -x" so that e.g. gcc.exe is found.
/for ac_dir in \$PATH; do/,/IFS="\$ac_save_[Ii][Ff][Ss]"/ {
  s|test -f \$ac_dir/|test -x $ac_dir/|
}

/IFS="\${IFS=/,/IFS="\$ac_save_ifs"/ {
    s|test -f \$ac_dir/|test -x $ac_dir/|
}

# Replace (command) > /dev/null with `command > /dev/null`, since
# parenthesized commands always return zero status in the ported Bash
# v1.14.7, even if the named command doesn't exist
/if ([^|;]*null/{
  s,(,`,
  s,),,
  s,;  *then,`; then,
}

# po2tbl.sed.in is invalid on MSDOS
s|po2tbl\.sed\.in|po2tbl-sed.in|g

# Additional editing of Makefiles
/ac_given_INSTALL=/,/^CEOF/ {
  /^s%@l@%/a\
  /TEXINPUTS=/s,:,\\\\\\\\\\\\\\;,g\
  /PATH=/s,:,\\\\\\\;,g\
  s,po2tbl\\.sed\\.in,po2tbl-sed.in,g\
  s,config\\.h\\.in,config.h-in,g\
  s,Makefile\\.in\\.in,Makefile.in-in,g\
  s,Makefile\\.am\\.in,Makefile.am-in,g\
}

# Makefile.in.in is renamed to Makefile.in-in...
/^CONFIG_FILES=/,/^EOF/ {
  s|po/Makefile.in|po/Makefile.in:po/Makefile.in-in|
}

# ...and config.h.in into config.h-in
/^ *CONFIG_HEADERS=/,/^EOF/ {
  s|config.h|config.h:config.h-in|
}

# DOS-style absolute file names should be supported as well
/\*) srcdir=/s,/\*,/*|[A-z]:/*,
/\$]\*) INSTALL=/s,\[/\$\]\*,&|[A-z]:/*,
/\$]\*) ac_rel_source=/s,\[/\$\]\*,&|[A-z]:/*,

# Switch the order of the two Sed commands, since DOS path names
# could include a colon
/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1,
-------------------- end of config.sed ------------------------

Here is a batch file, which I call `config.bat', that edits the
configure script and then runs it (it uses `config.sed').  You might
need to add some more optional parameters on the line that begins with
"sh ./configure", e.g. to set the host system type with --host= etc.
Be sure to see to it that config.bat has DOS-style CR-LF pairs at the
end of each line, or else COMMAND.COM won't run it!

-------------------- cut here: config.bat ---------------------
@echo off
echo Configuring Tcl for DJGPP v2.x...

Rem The SmallEnv tests protect against fixed and too small size
Rem of the environment in stock DOS shell.

Rem Find out where the sources are
set XSRC=.
if not "%XSRC%" == "." goto SmallEnv
if "%1" == "" goto InPlace
set XSRC=%1
if not "%XSRC%" == "%1" goto SmallEnv
redir -e /dev/null update %XSRC%/configure.orig ./configure
if not exist configure update %XSRC%/configure ./configure

:InPlace
Rem Update configuration files
echo Updating configuration scripts...
if not exist configure.orig update configure configure.orig
sed -f %XSRC%/djgpp/config.sed configure.orig > configure
if errorlevel 1 goto SedError

Rem Make sure they have a config.site file
set CONFIG_SITE=%XSRC%/djgpp/config.site
if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv

Rem Make sure crucial file names are not munged by unpacking
test -f %XSRC%/config.h.in
if not errorlevel 1 mv -f %XSRC%/config.h.in %XSRC%/config.h-in
test -f %XSRC%/intl/po2tbl.sed.in
if not errorlevel 1 mv -f %XSRC%/intl/po2tbl.sed.in %XSRC%/intl/po2tblsed.in
test -f %XSRC%/intl/po2tblsed.in
if errorlevel 1 mv -f %XSRC%/intl/po2tbl.sed %XSRC%/intl/po2tblsed.in
test -f %XSRC%/po/Makefile.in-in
if errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in

Rem This is required because DOS/Windows are case-insensitive
Rem to file names, and "make install" will do nothing if Make
Rem finds a file called `install'.
if exist INSTALL ren INSTALL INSTALL.txt

Rem install-sh is required by the configure script but clashes with the
Rem various Makefile install-foo targets, so we MUST have it before the
Rem script runs and rename it afterwards
if not exist install-sh if exist install-sh.sh ren install-sh.sh install-sh
echo Running the ./configure script...
sh ./configure --src=%XSRC% --disable-nls
if errorlevel 1 goto CfgError
if not exist install-sh.sh if exist install-sh ren install-sh install-sh.sh
echo Done.
goto End

:SedError
echo ./configure script editing failed!
goto End

:CfgError
echo ./configure script exited abnormally!
goto End

:SmallEnv
echo Your environment size is too small.  Enlarge it and run me again.
echo Configuration NOT done!
:End
set XSRC=
set CONFIG_SITE=
-------------------- end of config.bat -------------------------------

Here is a file config.site that is used by `config.bat':

-------------------- cut here: config.site ---------------------------
#! /bin/sh

# This is the config.site file for configuring GNU packages
# which are to be built with DJGPP tools.

# Include the djgpp subdirectory in PATH, so that the (fake)
# getconf is found.
PATH="$srcdir/djgpp;$PATH"

# These two variables are required, otherwise looking for
# programs along the PATH will not work.
PATH_SEPARATOR=:
PATH_EXPAND=y

# The root of the DJGPP tree serves as the default prefix
test "x$prefix" = xNONE && prefix='${DJDIR}'

# This is required for config.status script to be run, since
# ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh}
CONFIG_SHELL=${CONFIG_SHELL='sh'}

# These are set here so the generated Makefile's will be good
# for every DJGPP installation, not only the one where the
# package was configured.
# $INSTALL must be an absolute path name, otherwise config.status
# will try to prepend ./ and ../ to it when it goes into subdirs.
INSTALL=${INSTALL='${DJDIR}/bin/ginstall -c'}
RANLIB=${RANLIB='ranlib'}
-------------------- end of config.site ----------------------------

Here's the file `getconf' that many configure scripts need:

-------------------- cut here: getconf -----------------------------
#!/bin/sh
exit 0
-------------------- end of getconf --------------------------------

- Raw text -


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