From: bill@Celestial.COM (Bill Campbell)
Subject: Re: compiling GNU programs
Organization: Celestial Software, Mercer Island, WA
Date: Fri, 08 Jan 1993 17:03:24 GMT

In <1993Jan7.030654.9182@netcom.com> vancleef@netcom.com (Henry van Cleef) writes:

:In article <9301061806.aa11672@ohriman.ohriman.mi.org> jep@ohriman.mi.org writes:
:I went through the libg-awful-awful compile nightmare on 3.2.2 a while
:back and made notes.   I have not done it on 3.2.4 yet but will
:summarize what it took to get the whole thing to compile before.

Taking notes?  That's against the rules :-).

:1.  You will have to check both the gcc-supplied headers and the libg++
:headers for "M_UNIX" or "_M_UNIX"  3.2.4 gets the leading underscore.  
:Note that I do NOT allow any of GNU's "fixinclude" scripts to play with
:my headers.  

You shouldn't need the fixincludes with 3.2v4 since SCO has made
a major effort to fix many of the problems in the include files.
They didn't always get them right and the include files a a pain
to read with all the #if... used to try to match every
environment, but they're better than they were.

I have fixed many problems with gcc compilation by copying the
SCO header files to /usr/local/include... and adding defined(__GNUC__) 
to several #if statements (the fileno macro was one of the
first).  gcc looks in /usr/local/include before it looks in
/usr/include so these files will be used instead of the stock
ones.  Putting them there insures that they won't get clobbered
on the next update from SCO.  I posted diffs to this newsgroup
several months ago between these and the standard headers.

......
:6.  Remove the ranlib step from all the Makefiles---GNU always assumes
:it is needed if present, but it is a Xenix function on SCO.  

I got tired of screwing with ranlib when going back and forth
between Xenix and Unix systems so I wrote this little perl script
which I put in /usr/local/bin (in my PATH before /bin)
	PATH=/usr/local/bin:/bin:/usr/local/gnubin:/usr/bin:/etc
It checks to see if the archive file needs the real ranlib.
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  /usr/local/bin/ranlib
# Wrapped by bill@beeson1 on Fri Jan  8 09:03:44 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f '/usr/local/bin/ranlib' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'/usr/local/bin/ranlib'\"
else
echo shar: Extracting \"'/usr/local/bin/ranlib'\" \(887 characters\)
sed "s/^X//" >'/usr/local/bin/ranlib' <<'END_OF_FILE'
X#!/usr/local/bin/perl
X
X# $Header: /u/usr/cvs/lbin/getopt.perl,v 1.5 91/05/12 23:59:22 src Exp $
X# $Date: 91/05/12 23:59:22 $
X# @(#) $Id: getopt.perl,v 1.5 91/05/12 23:59:22 src Exp $
X# $Log:	getopt.perl,v $
X
X( $progname = $0 ) =~ s!.*/!!; # save this very early
X
Xdo "/usr/bin/csspath.perl" unless $ENV{'USR_BIN_CSSPATH'};
X
X$USAGE = "
X#
X#   Usage: $progname [-v] [-e var=value]
X#
X# Options   Argument    Description
X#   -v                  Verbose
X#
X";
X
Xsub usage {
X	die join("\n",@_) .
X	"\n$USAGE\n";
X}
X
Xdo "getopts.pl";
X
X&usage("Invalid Option") unless do Getopts("v");
X
X$verbose = '-v' if $opt_v;
X$suffix = $$ unless $verbose;
X
X$\ = "\n";	# use newlines as separators.
X$ranlib = '/bin/ranlib';
X
Xfor ( @ARGV ) {
X	chop($file = `file $_`);
X	next if ($file =~ /(\s+ar|x.out randomized) archive$/) ;
X	$cmd = "$ranlib $_";
X	print STDERR "cmd = >$cmd<" if $verbose;
X	system($cmd);
X}
Xexit(0);
END_OF_FILE
if test 887 -ne `wc -c <'/usr/local/bin/ranlib'`; then
    echo shar: \"'/usr/local/bin/ranlib'\" unpacked with wrong size!
fi
chmod +x '/usr/local/bin/ranlib'
# end of '/usr/local/bin/ranlib'
fi
echo shar: End of shell archive.
exit 0
-- 
INTERNET:  bill@Celestial.COM   Bill Campbell; Celestial Software
UUCP:   ...!thebes!camco!bill   6641 East Mercer Way
             uunet!camco!bill   Mercer Island, WA 98040; (206) 947-5591
SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?
Newsgroups: biz.sco.general