Mail Archives: cygwin/2002/07/30/14:59:40
--------------060306010809080203080908
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Paul Coltrin wrote:
> Does anyone have any tips/advice concerning making and installing ATT ksh
> from source onto Cygwin?
Here is what I do.
Make a directory /usr/local/ast/tgz/2002-06-28 and put the following
in it, downloaded from the AT&T site:
INIT.2002-06-28.tgz
ast-open-locale.2002-06-28.tgz
ast-open.2002-06-28.tgz
Make a symlink /bin/cc that points at /bin/gcc.exe.
Then cd /usr/local/ast and run the attached script to do the build.
I haven't done this in a couple weeks, so there may be some minor
edits needed -- let me know if you have problems.
Joe Buehler
--------------060306010809080203080908
Content-Type: text/plain;
name="build.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="build.sh"
#!/bin/bash
VERSION=2002-06-28
set -x
export CYGWIN="$CYGWIN error_start=f:/cygwin/bin/dumper.exe"
export PATH="/bin"
export SH=/bin/bash
export TMPDIR=/tmp
unset TMPPATH
check_required()
{
# make sure these ARE in PATH
for PROG; do
if [ x$(which $PROG 2>/dev/null)x = "xx" ]; then
echo "$0: $PROG is not in the PATH ($PATH)" >&2
exit 1
fi
done
}
check_excluded()
{
# make sure these are NOT in PATH
for PROG; do
if [ x$(which $PROG 2>/dev/null)x != "xx" ]; then
echo "$0: $PROG is in the PATH ($PATH)" >&2
exit 1
fi
done
}
cleanup()
{
rm -fr -- --* README arch bin installed lib share src
mkdir -p lib/package/tgz
}
patch_INIT()
{
# create this file
touch src/cmd/INIT/LICENSE
# now patch various files
(
sed '/^#/d' |
patch -p0 -N
) <<\!
--- src/cmd/INIT/mamprobe.sh 2002-02-07 09:48:53.000000000 -0500
+++ src/cmd/INIT/mamprobe.sh 2002-07-02 15:07:12.000000000 -0400
@@ -149,7 +149,7 @@
# generate info in a tmp file and rename when finished
tmp=/tmp/mam$$
-trap "cd /; rm -rf $tmp" 0 1 2 3 15
+trap "cd /; exec>/dev/null; rm -rf $tmp" 0 1 2 3 15
mkdir $tmp || exit
cd $tmp || exit
exec < /dev/null > info 2>/dev/null
--- src/cmd/INIT/package.sh 2002-06-27 18:26:18.000000000 -0400
+++ src/cmd/INIT/package.sh 2002-07-02 22:27:12.000000000 -0400
@@ -989,11 +989,13 @@
assign=
for i
do case $i in
+ BOOTSTRAP=*) eval $i
+ ;;
- CC=*) eval $i
+ CC=*) eval "CC=\"${i##CC=}\""
assign="$assign CC=\"\$CC\""
;;
CCFLAGS=*)
- eval $i
+ eval "CCFLAGS=\"${i##CCFLAGS=}\""
assign="$assign CCFLAGS=\"\$CCFLAGS\""
;;
HOSTTYPE=*)
@@ -3793,14 +3793,14 @@
c=$CC
a=$assign
case $HOSTTYPE in
- win32*|cygwin*)
- CC="$CC -D_BLD_STATIC"
- accept="libast"
- case $assign in
- *' CC='*) ;;
- *) assign="$assign CC=\"\$CC\"" ;;
- esac
- ;;
+ #win32*|cygwin*)
+ # CC="$CC -D_BLD_STATIC"
+ # accept="libast"
+ # case $assign in
+ # *' CC='*) ;;
+ # *) assign="$assign CC=\"\$CC\"" ;;
+ # esac
+ # ;;
*) accept=nmake
;;
esac
@@ -3864,6 +3866,11 @@
fi
fi
+ if test "$BOOTSTRAP" = 1
+ then
+ echo "bootstrap early exit"; exit
+ fi
+
# generate ksh next if possible
if test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH
!
}
patch_ast()
{
# patch various files
(
sed '/^#/d' |
patch -p0 -N
) <<\!
--- src/lib/libast/misc/optget.c 2002-03-14 10:15:07.000000000 -0500
+++ src/lib/libast/misc/optget.c 2002-07-03 15:40:20.000000000 -0400
@@ -292,7 +292,7 @@
Opt_t opt_info = { 0,0,0,0,0,0,0,{0},{0},0,&state };
-__EXTERN__(Opt_t, opt_info);
+__EXTERN__(Opt_t, _opt_info_);
/*
* translate with C_LC_MESSAGES_libast[] check
--- src/lib/libast/features/common 2002-02-11 00:56:12.000000000 -0500
+++ src/lib/libast/features/common 2002-07-03 21:07:47.000000000 -0400
@@ -93,7 +93,7 @@
# endif
#endif
#if _dll_import
- # if _BLD_STATIC && !_BLD_DLL
+ # if __CYGWIN__ && !_BLD_DLL
# undef _DLL
# else
# if !_UWIN && !defined(_DLL)
--- src/cmd/ksh93/Makefile 2002-05-15 16:19:02.000000000 -0400
+++ src/cmd/ksh93/Makefile 2002-07-03 21:51:09.000000000 -0400
@@ -101,9 +101,9 @@
$(INCLUDEDIR) :INSTALLPROTO: nval.h shell.h history.h
-suid_exec :: CC.DLL= suid_exec.c +last
+suid_exec :: suid_exec.c +last
-shcomp :: CC.DLL= SH_DICT='"libshell"' shcomp.c -lshell
+shcomp :: SH_DICT='"libshell"' shcomp.c -lshell
$(FUNDIR) :INSTALLDIR: mode=+x dirs popd pushd
--- src/cmd/at/Makefile 2000-02-24 11:29:37.000000000 -0500
+++ src/cmd/at/Makefile 2002-07-04 00:13:34.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1996,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
DEBUG == 1
if CC.HOSTTYPE == "win32*"
--- src/cmd/builtin/Makefile 2002-04-15 23:37:30.000000000 -0400
+++ src/cmd/builtin/Makefile 2002-07-04 00:13:57.000000000 -0400
@@ -6,6 +6,8 @@
LICENSE = since=1992,author=gsf+dgk
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
:ALL:
:: cmdlib.h builtin.c
--- src/cmd/bzip/Makefile 2002-01-10 09:53:19.000000000 -0500
+++ src/cmd/bzip/Makefile 2002-07-04 00:14:25.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = type=special
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
PROTOFLAGS = -s
bzip2 :: bzip2.1 bzip2.c -lbz
--- src/cmd/coshell/Makefile 1999-11-29 10:10:32.000000000 -0500
+++ src/cmd/coshell/Makefile 2002-07-04 00:14:48.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1990,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
DEBUG == 1
PATHCHECK == CO_ID
--- src/cmd/cpp/Makefile 2001-02-05 22:25:42.000000000 -0500
+++ src/cmd/cpp/Makefile 2002-07-04 00:15:15.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1986,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
cpp :: RELEASE HISTORY cpp.1 cpp.c -lpp
$(LIBDIR) :INSTALLDIR: cpp
--- src/cmd/cql/Makefile 2001-02-16 20:08:29.000000000 -0500
+++ src/cmd/cql/Makefile 2002-07-04 00:15:35.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1991,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
DEBUG == 1
cql :: cql.1 cql.h hix.h cql.c decl.c expr.c file.c hix.c -lcdb -ldll -lexpr
--- src/cmd/cs/Makefile 2000-05-12 16:08:02.000000000 -0400
+++ src/cmd/cs/Makefile 2002-07-04 00:15:48.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1990,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
DEBUG ==
cs :: RELEASE cs.c -lcs
@@ -24,9 +24,9 @@
rsh tcp :SERVICE: rsh.c
-tst-old tcp :SERVICE: CCFLAGS=-g tst-old.c
+tst-old tcp :SERVICE: tst-old.c
-tst tcp :SERVICE: CCFLAGS=-g tst.c
+tst tcp :SERVICE: tst.c
6263 tcp :SERVICE: 6263.c
--- src/cmd/diff/Makefile 2000-08-30 15:38:41.000000000 -0400
+++ src/cmd/diff/Makefile 2002-07-04 00:16:01.000000000 -0400
@@ -7,6 +7,8 @@
DEFAULT_EDITOR_PROGRAM == "ed"
PR_PROGRAM == "pr"
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
diff:: diff.c analyze.c dir.c io.c util.c context.c ed.c ifdef.c \
cmpbuf.c normal.c side.c
--- src/cmd/html/Makefile 2000-04-21 22:26:30.000000000 -0400
+++ src/cmd/html/Makefile 2002-07-04 00:16:18.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1996,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
:ALL:
DEBUG == 1
--- src/cmd/mailx/Makefile 2000-05-13 18:42:43.000000000 -0400
+++ src/cmd/mailx/Makefile 2002-07-04 00:16:34.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = type=special
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
clobber = !(mailx)
mailx :: README RELEASE mailx.1 \
--- src/cmd/mam/Makefile 1999-11-06 09:34:36.000000000 -0500
+++ src/cmd/mam/Makefile 2002-07-04 00:16:45.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1989,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
:ALL:
mamdag :: mamdag.sh
--- src/cmd/msgcc/Makefile 2000-05-17 11:06:01.000000000 -0400
+++ src/cmd/msgcc/Makefile 2002-07-04 00:16:59.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=2000,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
msgadmin :: msgadmin.sh
msgcpp :: msgcpp.c -lpp
--- src/cmd/ncsl/Makefile 1999-11-06 09:37:01.000000000 -0500
+++ src/cmd/ncsl/Makefile 2002-07-04 00:17:13.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1994,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
ncsl :: ncsl.c
:: RELEASE
--- src/cmd/nmake/Makefile 2002-06-11 21:43:01.000000000 -0400
+++ src/cmd/nmake/Makefile 2002-07-04 00:17:32.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1984,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
include "Version.mk"
ID = make
--- src/cmd/pack/Makefile 1999-11-06 09:37:09.000000000 -0500
+++ src/cmd/pack/Makefile 2002-07-04 00:17:45.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1993;author=dgk
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
pack :: pack.c libhuff.a
unpack :: unpack.c libhuff.a
--- src/cmd/pax/Makefile 2002-05-07 16:04:15.000000000 -0400
+++ src/cmd/pax/Makefile 2002-07-04 00:17:56.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1987,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
DEBUG == 1
pax :: RELEASE HISTORY PROMO.mm pax.1 pax.1.posix \
--- src/cmd/probe/Makefile 2000-05-11 16:51:16.000000000 -0400
+++ src/cmd/probe/Makefile 2002-07-04 00:15:00.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1989,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
$(LIBDIR)/probe :INSTALLDIR: mode=u+s,+x probe
$(BINDIR) :INSTALLDIR: mode=u+s,+x probe
--- src/cmd/proto/Makefile 2002-03-04 19:13:13.000000000 -0500
+++ src/cmd/proto/Makefile 2002-07-04 00:18:12.000000000 -0400
@@ -6,6 +6,8 @@
LICENSE = since=1990,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
.SOURCE.c : ../INIT ../../lib/libpp
proto :: RELEASE PROMO.mm proto.c
--- src/cmd/pzip/Makefile 2002-02-13 12:57:51.000000000 -0500
+++ src/cmd/pzip/Makefile 2002-07-04 00:18:24.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1998,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
:ALL:
:INSTALLDIR: pcmp r2c
--- src/cmd/re/Makefile 2002-06-27 19:18:54.000000000 -0400
+++ src/cmd/re/Makefile 2002-07-04 00:18:35.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1995,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
:ALL:
ed :: ed.c
--- src/cmd/sort/Makefile 2000-10-18 23:55:52.000000000 -0400
+++ src/cmd/sort/Makefile 2002-07-04 00:18:44.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1996,author=gsf+kpv+doug
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
sort :: README RELEASE PROMO.mm sort.1 main.c -lrecsort -lz
:INSTALLDIR: gen testsort
--- src/cmd/ss/Makefile 2000-08-31 09:55:01.000000000 -0400
+++ src/cmd/ss/Makefile 2002-07-04 00:18:55.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1990,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
ss :: RELEASE ss.1 ss.c -lcs
$(LIBDIR) :INSTALLDIR: group=kmem mode=ug+s,+x preserve=1 ssd
--- src/cmd/std/Makefile 2002-02-04 11:18:00.000000000 -0500
+++ src/cmd/std/Makefile 2002-07-04 00:19:05.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1989,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
:ALL:
:: PROMO.mm README RELEASE ls-color.sh ls-dir.sh
--- src/cmd/tksh/Makefile 2002-03-01 08:45:09.000000000 -0500
+++ src/cmd/tksh/Makefile 2002-07-04 00:20:11.000000000 -0400
@@ -1,6 +1,6 @@
:PACKAGE: tk tcl shell:static ast X11
-CCFLAGS = $(CC.OPTIMIZE)
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
tksh :: tksh.1 uinit.c tkMain.c
--- src/cmd/tw/Makefile 2001-11-07 11:09:45.000000000 -0500
+++ src/cmd/tw/Makefile 2002-07-04 00:20:21.000000000 -0400
@@ -2,6 +2,8 @@
LICENSE = since=1989,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
tw :: RELEASE PROMO.mm tw.1 tw.c expr.c ftwlocal.c cmdarg.c -lexpr
find :: find.c ftwlocal.c cmdarg.o LICENSE=since=1989,author=gsf+dgk
--- src/lib/libpp/Makefile 2002-02-12 08:45:04.000000000 -0500
+++ src/lib/libpp/Makefile 2002-07-05 08:49:04.000000000 -0400
@@ -6,6 +6,8 @@
LICENSE = since=1986,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) -D_BLD_pp $(CC.DLL)
+
ID = pp
DEBUG ==
--- src/lib/libmam/Makefile 2002-06-04 16:14:32.000000000 -0400
+++ src/lib/libmam/Makefile 2002-07-05 08:56:37.000000000 -0400
@@ -7,6 +7,8 @@
LICENSE = since=1989,author=gsf
+CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
+
mam $(VERSION) :LIBRARY: mam.h mam.c
$(INCLUDEDIR) :INSTALLPROTO: mam.h
--- src/lib/libtksh/Makefile 2001-01-30 08:39:35.000000000 -0500
+++ src/lib/libtksh/Makefile 2002-07-05 09:00:21.000000000 -0400
@@ -12,7 +12,7 @@
nvenv == nvprivate[0]
-if CC.HOSTTYPE == "win32.*"
+if CC.HOSTTYPE == "win32.*" || CC.HOSTTYPE == "cygwin.*"
CCFLAGS = $(CC.OPTIMIZE) $(CC.DLLBIG)
else
CCFLAGS = $(CC.OPTIMIZE)
--- src/cmd/pack/Makefile 2002-07-04 19:18:50.000000000 -0400
+++ src/cmd/pack/Makefile 2002-07-05 09:02:25.000000000 -0400
@@ -4,11 +4,11 @@
CCFLAGS = $(CC.OPTIMIZE) $(CC.DLL)
-pack :: pack.c libhuff.a
+pack :: pack.c -lhuff
-unpack :: unpack.c libhuff.a
+unpack :: unpack.c -lhuff
-pcat :: unpack.c libhuff.a
+pcat :: unpack.c -lhuff
huff 1.0 :LIBRARY: huff.3 huffman.h \
huffinit.c huffgethdr.c huffputhdr.c \
--- src/lib/libast/include/sfio.h 2002-06-19 07:58:46.000000000 -0400
+++ src/lib/libast/include/sfio.h 2002-07-05 11:49:56.000000000 -0400
@@ -264,8 +264,6 @@
_BEGIN_EXTERNS_
-extern ssize_t _Sfi;
-
/* standard in/out/err streams */
#if _BLD_sfio && defined(__EXPORT__)
@@ -291,6 +289,8 @@
extern __PUBLIC_DATA__ Sfio_t _Sfstdout;
extern __PUBLIC_DATA__ Sfio_t _Sfstderr;
+extern __PUBLIC_DATA__ ssize_t _Sfi;
+
#undef __PUBLIC_DATA__
#if _BLD_sfio && defined(__EXPORT__)
--- src/lib/libpp/pp.h 2001-04-19 09:00:56.000000000 -0400
+++ src/lib/libpp/pp.h 2002-07-05 11:57:01.000000000 -0400
@@ -429,10 +429,26 @@
* library interface globals
*/
+#if _BLD_pp && defined(__EXPORT__)
+#define __PUBLIC_DATA__ __EXPORT__
+#else
+#if !_BLD_pp && defined(__IMPORT__)
+#define __PUBLIC_DATA__ __IMPORT__
+#else
+#define __PUBLIC_DATA__
+#endif
+#endif
+
#define ppctype _pp_ctype
-extern struct ppglobals pp;
-extern char ppctype[];
+extern __PUBLIC_DATA__ struct ppglobals pp;
+extern __PUBLIC_DATA__ char ppctype[];
+
+#undef __PUBLIC_DATA__
+
+#if _BLD_pp && defined(__EXPORT__)
+#define extern __EXPORT__
+#endif
extern int ppargs(char**, int);
extern void ppcpp(void);
@@ -448,4 +464,6 @@
extern void pppragma(char*, char*, char*, char*, int);
extern int ppprintf(char*, ...);
+#undef extern
+
#endif
--- src/cmd/3d/3d.h 2002-06-18 15:23:49.000000000 -0400
+++ src/cmd/3d/3d.h 2002-07-05 16:50:11.000000000 -0400
@@ -96,6 +96,9 @@
#define LICENSED 1
#endif
+#ifdef __CYGWIN__
+#define off64_t __off64_t
+#else
#if defined(__STDPP__directive) && defined(__STDPP__note)
#if !_typ_off64_t && !noticed(off64_t)
#undef off64_t
@@ -106,6 +109,7 @@
#endif
#endif
#endif
+#endif
struct stat64;
!
}
install_INIT()
{
gunzip <tgz/$VERSION/INIT.$VERSION.tgz | tar xf -
patch_INIT
$SH bin/package read ${SH:+SHELL="$SH"}
$SH bin/package ${debug:+verbose DEBUG} make ${debug:+-D20} ${SH:+SHELL="$SH"}
}
reinstall_INIT()
{
cp tgz/$VERSION/INIT.$VERSION.tgz lib/package/tgz
$SH bin/package read ${SH:+SHELL="$SH"}
patch_INIT
$SH bin/package ${debug:+verbose DEBUG} make ${debug:+-D20} ${SH:+SHELL="$SH"}
}
install_nmake()
{
cp tgz/$VERSION/ast-open.$VERSION.tgz lib/package/tgz
$SH bin/package read ${SH:+SHELL="$SH"}
patch_ast
$SH bin/package ${debug:+verbose DEBUG} make ${debug:+-D20} BOOTSTRAP=1 CC.OPTIMIZE=-g ${SH:+SHELL="$SH"}
exit $?
rm -fr arch/cygwin.i386/src
find arch -name '*.[ao]' -exec rm '{}' \;
$SH bin/package ${debug:+verbose DEBUG} make ${debug:+-D20} CC.OPTIMIZE=-g ${SH:+SHELL="$SH"}
}
install_locale()
{
cp tgz/$VERSION/ast-open-locale.$VERSION.tgz lib/package/tgz
$SH bin/package read ${SH:+SHELL="$SH"}
}
date
check_required cc
check_excluded ksh
check_excluded nmake
cleanup
install_INIT
reinstall_INIT
install_nmake
install_locale
date
find \( -name '*.stackdump' -o -name '*.core' \)
#mkdir -p /usr/local/ast-src/installed
#$SHELL bin/package install flat - /usr/local/ast-src/installed ast-open
#$SHELL bin/package test CC.OPTIMIZE=-g
--------------060306010809080203080908
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
--------------060306010809080203080908--
- Raw text -