Compare commits

...

3 Commits

Author SHA1 Message Date
Landon Curt Noll
383290a844 Release calc version 2.11.5.8 2017-05-21 15:38:42 -07:00
Landon Curt Noll
7e40db44e3 Release calc version 2.11.5.7 2017-05-21 15:38:42 -07:00
Landon Curt Noll
a57ee19ca5 Release calc version 2.11.5.6 2017-05-21 15:38:42 -07:00
27 changed files with 1293 additions and 468 deletions

45
BUGS
View File

@@ -75,9 +75,18 @@ Known bugs:
Problems with known work-a-rounds:
* The gcc as shipped with Redhat 7 perhaps other Linux distributions
has a bug causes calc to dump core on startup of it is
compiled BOTH optimized (-O, -O1, -O2 or -O3) as well as
with debugging (-g or -g3.
has a bug causes calc to dump core on startup when calc is:
compiled optimized (-O, -O1, -O2 or -O3)
AND
compiled with debugging (-g or -g3)
AND
when calc is compiled with readline (see USE_READLINE,
READLINE_LIB and READLINE_INCLUDE in the Makefile)
On Redhat, the gcc -v which has this problem is:
@@ -85,13 +94,33 @@ Problems with known work-a-rounds:
there may be other gcc versions that also suffer this fate.
The work-a-round is to change the DEBUG Makefile variable to either:
The readlines associated with problem are:
compile for speed: -O3
compile to debug: -g3
readline-4.1-5
readline2.2.1-2.2.1-2
readline-devel-4.1-5
One work-a-round is to compile calc WITHOUT readline. In the
Makefile be sure that:
USE_READLINE=
READLINE_LIB=
READLINE_INCLUDE=
i.e., these Makefile vars are empty.
If you must use readline, then an alternate work-a-round is to
change the DEBUG Makefile variable to either:
compile for speed: -O3 (or -O2 if you do not have -O3)
compile to debug: -g3 (or -g if you do not have -g3)
but not both.
See RH bug #57889 for details:
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57889
* There is a bug in gcc-2.95 that causes calc, when compiled with -O2,
to fail the regression test. The work-a-round is to compile with -O
or to use gcc-2.96 or later.
@@ -259,8 +288,8 @@ Problems with known work-a-rounds:
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.14 $
## @(#) $Id: BUGS,v 29.14 2001/12/11 03:18:21 chongo Exp $
## @(#) $Revision: 29.17 $
## @(#) $Id: BUGS,v 29.17 2001/12/31 22:12:35 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $
##
## Under source code control: 1994/03/18 14:06:13

46
CHANGES
View File

@@ -15,10 +15,48 @@ The following are the changes from calc version 2.11.5.5 to date:
we recommend it. But if not, you should set the USE_READLINE,
READLINE_LIB, and READLINE_INCLUDE Makefile variables to empty.
NOTE: See the BUGS file for a Linux issue when compiling calc
with -O (or -O2 or -O3) AND with -g (or -g3) AND with readline.
Calc compiles without -g or -g3 by default use to recent gcc
bugs related to -O* and -g*. *sigh*
Removed an obsolete reference to TOPDIR. This was fixed thanks to
a bug report by Clifford Kite <kite_public1 at ev1 dot net>.
Fixed other inconsistencies related to things like BINDIR.
Fixed calc man page so that is refers to -f instead of the old -S flag.
Fixed thanks to Clifford Kite <kite_public1 at ev1 dot net> for
point this out.
All for loops end with /dev/null to avoid any problems related
to systems that cannot grok empty for loops.
Changed the libcalc functions creal and cimag to c_real and c_imag
to about conflicts with new libc such as those used by gcc v3.
Thanks Eli Zaretskii <eliz at is dot elta dot co dot il> and
Martin Buck <m at rtin-buck dot de> for alerting us to this conflict.
The Makefile no longer hard code's /usr/include. Instead it uses
the ${INCDIR} Makefile variable. Thanks goes to Eli Zaretskii
<eliz at is dot elta dot co dot il> for pointing out this inconsistency.
Added mods to support compilation under DJGPP. DJGPP runs on 386
and newer PCs running DOS or dos-compatible operating systems.
See http://www.delorie.com/djgpp/. Thanks goes to Eli Zaretskii
<eliz at is dot elta dot co dot il> for sending in these mods.
Updated README.WINDOWS to include information on building with DJGPP.
The pld folks are building RPMs based on our calc distrbutions.
See: ftp://ftp.pld.org.pl/dists/ra/PLD/i686/PLD/RPMS or
http://ftp.pld.org.pl/dists/ra/PLD/i686/PLD/RPMS more information.
We appreciate their work in this regard. In the next release, we
plan to also build and release our own RPMs based on their efforts.
Changed the Makefile variable CUSTOMLIBDIR to CUSTOMCALDIR.
Changed the Makefile variable CSHAREDIR to CALC_SHAREDIR.
Changed the Makefile variable INCDIRCALC to CALC_INCDIR.
Removed the Makefile variable SHAREDIR.
Updated the HOWTO.INSTALL and README.WINDOWS files.
The following are the changes from calc version 2.11.5t4.1 to 2.11.5t4.4:
@@ -5380,8 +5418,8 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1:
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.42 $
## @(#) $Id: CHANGES,v 29.42 2001/12/11 02:51:00 chongo Exp $
## @(#) $Revision: 29.48 $
## @(#) $Id: CHANGES,v 29.48 2002/03/14 00:28:28 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $
##
## Under source code control: 1993/06/02 18:12:57

View File

@@ -1,41 +1,105 @@
Installing calc in 4 easy steps:
1) Look at the makefile, and adjust it to suit your needs.
1) Look at the makefile, and adjust it to suit your needs.
Here are some Makefile hints:
The Makefile, as shipped, is suitable for installation under
Linux and Un*x-like environments. For the most part, the default
values should work. If in doubt, follow the 'When in doubt'
suggestion.
Select a compiler set by commenting in the appropriate set
of cc options. As shipped the Makefile assumes a gcc-like
environment such as Linux. If a more appropriate cc set if
found below, comment out the Linux set and comment in that
set or edit the gcc set or the common cc set as needed.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! If you are building under Windoz or a Windoz-like environment !
! (such as Cygwin or DJGPP), read the README.WINDOWS file. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You may or may not need RANLIB when building libraries.
As shipped the Makefile assumes RANLIB is needed.
Comment the in/out the RANLIB value if ranlib does
not work or does not exist.
You should determine if these Makefile variables are reasonable:
You may want to change the default pager used by calc.
As shipped the Makefile assumes 'more'. On your system
you may find 'less' to be a better pager.
INCDIR Where the system include (.h) files are kept.
BINDIR Where to install calc binary files.
LIBDIR Where to install calc link library (*.a) files.
CALC_SHAREDIR Where to install calc help, .cal, startup, and
config files.
Set TOPDIR to be the place under which help files, calc,
include files and calc libs are to be installed. As shipped
the Makefile assumes a TOPDIR of /usr/local/lib.
You may want to change the default installation locations for
these values, which are based on the 4 values listed above:
Set BINDIR to the place where calc is installed. As shipped
the Makefile assumes a BINDIR /usr/local/bin.
HELPDIR where the help directory is installed
CALC_INCDIR where the calc include files are installed
CUSTOMCALDIR where custom *.cal files are installed
CUSTOMHELPDIR where custom help files are installed
CUSTOMINCPDIR where custom .h files are installed
SCRIPTDIR where calc shell scripts are installed
Some compilers (to put it mildly) have bugs. Sometimes the
DEBUG Makefile variable causes the compiler / optimizer to
produce bad code. Other compilers do just fine. If possible
try to use DEBUG=-O3 -g3 (maximum optimization and debug symbols).
If the calc test fails (see step 3), try lowering either the
-O value and/or the -g3. Also try using -Osomething without -g.
If you want to install calc files under a top level directory,
then set the T value:
The calc install is performed under $T, the calc build is
performed under /. The purpose for $T is to allow someone
to install calc somewhere other than into the system area.
For example, if:
BINDIR= /usr/bin
LIBDIR= /usr/lib
CALC_SHAREDIR= /usr/share/calc
and if:
T= /var/tmp/testing
Then the installation locations will be:
calc binary files: /var/tmp/testing/usr/bin
calc link library: /var/tmp/testing/usr/lib
calc help, .cal ...: /var/tmp/testing/usr/share/calc
... etc ... /var/tmp/testing/...
If $T is empty, calc is installed under /, which is the same
top of tree for which it was built. If $T is non-empty, then
calc is installed under $T, as if one had to chroot under
$T for calc to operate.
Look for the section that starts:
################
# compiler set #
################
Select a compiler set by commenting in the appropriate set
of cc options. As shipped the Makefile assumes a gcc-like
environment such as Linux. If a more appropriate cc set if
found below, comment out the Linux set and comment in that
set or edit the gcc set or the common cc set as needed.
You may want to change these Makrfile variables from their defaults:
RANLIB
You may or may not need RANLIB when building libraries.
As shipped the Makefile assumes RANLIB is needed.
Comment the in/out the RANLIB value if ranlib does
not work or does not exist.
CALCPAGER
You may want to change the default pager used by calc.
As shipped the Makefile assumes 'more'. On your system
you may find 'less' to be a better pager.
DEBUG
Some compilers (to put it mildly) have bugs. Sometimes the
DEBUG Makefile variable causes the compiler / optimizer to
produce bad code. Other compilers do just fine.
If possible try to use DEBUG=-O3 -g3 (maximum optimization
and debug symbols). If the calc test fails (see step 3),
try lowering either the -O value and/or the -g3. Also try
using -Osomething without -g.
Adjust other Makefile variables as needed.
2) build calc:
2) build calc:
make all
@@ -43,13 +107,14 @@ Installing calc in 4 easy steps:
you may find. See the BUGS file if you find any compiler
warning or errors.
3) test calc:
3) test calc:
make check
==> If you run into problems, follow the BUGS file instructions.
==> If you run into problems, read the BUGS file and follow
the instructions found in there.
4) install calc:
4) install calc:
make install
@@ -72,8 +137,8 @@ the calc help subsystem. See the README file for details.
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.3 $
## @(#) $Id: HOWTO.INSTALL,v 29.3 2001/12/11 02:51:00 chongo Exp $
## @(#) $Revision: 29.6 $
## @(#) $Id: HOWTO.INSTALL,v 29.6 2002/03/14 00:28:28 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $
##
## Under source code control: 1999/09/27 20:48:44

452
Makefile
View File

@@ -20,8 +20,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
MAKEFILE_REV= $$Revision: 29.38 $$
# @(#) $Id: Makefile.ship,v 29.38 2001/12/11 02:35:43 chongo Exp $
MAKEFILE_REV= $$Revision: 29.47 $$
# @(#) $Id: Makefile.ship,v 29.47 2002/03/14 00:28:28 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $
#
# Under source code control: 1990/02/15 01:48:41
@@ -47,6 +47,8 @@ MAKEFILE_REV= $$Revision: 29.38 $$
# -DUSE_SGTTY use struct sgttyb from <sys/ioctl.h>
# -DUSE_NOTHING windoz system, don't use any of them
#
# Select TERMCONTROL= -DUSE_TERMIOS for DJGPP.
#
# If in doubt, leave TERMCONTROL empty.
#
TERMCONTROL=
@@ -87,6 +89,8 @@ HAVE_VSPRINTF=
# a make clobber and try -DLITTLE_ENDIAN. If that fails, ask a wizard
# for help.
#
# Select BYTE_ORDER= -DLITTLE_ENDIAN for DJGPP.
#
BYTE_ORDER=
#BYTE_ORDER= -DBIG_ENDIAN
#BYTE_ORDER= -DLITTLE_ENDIAN
@@ -99,9 +103,11 @@ BYTE_ORDER=
# In order to avoid make brain damage in some systems, we avoid placing
# a space after the ='s below.
#
# Select LONG_BITS= 32 for DJGPP.
#
LONG_BITS=
#LONG_BITS=32
#LONG_BITS=64
#LONG_BITS= 32
#LONG_BITS= 64
# Determine if your compiler supports the long long type and if so, its length
#
@@ -119,6 +125,8 @@ LONG_BITS=
# If in doubt, try to leave LONGLONG_BITS empty. Do a 'make check'
# and change to 'LONGLONG_BITS= 0' if you encounter problems.
#
# Select LONGLONG_BITS= 64 for DJGPP.
#
#LONGLONG_BITS= 0
LONGLONG_BITS=
#LONGLONG_BITS= 64
@@ -141,6 +149,8 @@ HAVE_FPOS=
# to determine if fpos_t has a __pos structure element. If HAVE_FPOS_POS
# is set to -DHAVE_NO_FPOS_POS, then calc assume there is no __pos element.
#
# Select HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS for DJGPP.
#
# If in doubt, leave HAVE_FPOS_POS empty and this Makefile will figure it out.
#
HAVE_FPOS_POS=
@@ -151,11 +161,11 @@ HAVE_FPOS_POS=
# If FPOS_POS_BITS is empty, then the Makefile will determine the size of
# the file position value of the __pos element.
#
# If in doubt, leave FPOS_POS_BITS empty and this Makefile will figure it out.
#
# If there is no __pos element in fpos_t (say because fpos_t is a scalar),
# leave FPOS_POS_BITS blank.
#
# If in doubt, leave FPOS_POS_BITS empty and this Makefile will figure it out.
#
FPOS_POS_BITS=
#FPOS_POS_BITS= 32
#FPOS_POS_BITS= 64
@@ -165,6 +175,8 @@ FPOS_POS_BITS=
# If FPOS_BITS is empty, then the Makefile will determine the size of
# the file position value.
#
# Select FPOS_BITS= 32 for DJGPP.
#
# If in doubt, leave FPOS_BITS empty and this Makefile will figure it out.
#
FPOS_BITS=
@@ -176,6 +188,8 @@ FPOS_BITS=
# If OFF_T_BITS is empty, then the Makefile will determine the size of
# the file offset value.
#
# Select OFF_T_BITS= 32 for DJGPP.
#
# If in doubt, leave OFF_T_BITS empty and this Makefile will figure it out.
#
OFF_T_BITS=
@@ -187,6 +201,8 @@ OFF_T_BITS=
# If DEV_BITS is empty, then the Makefile will determine the size of
# the dev_t device value
#
# Select DEV_BITS= 32 for DJGPP.
#
# If in doubt, leave DEV_BITS empty and this Makefile will figure it out.
#
DEV_BITS=
@@ -199,6 +215,8 @@ DEV_BITS=
# If INODE_BITS is empty, then the Makefile will determine the size of
# the ino_t inode value
#
# Select INODE_BITS= 32 for DJGPP.
#
# If in doubt, leave INODE_BITS empty and this Makefile will figure it out.
#
INODE_BITS=
@@ -291,6 +309,8 @@ HAVE_MEMMOVE=
# -DHAVE_NO_USTAT, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes.
#
# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP.
#
# If in doubt, leave HAVE_USTAT empty and this Makefile will figure it out.
#
HAVE_USTAT=
@@ -303,6 +323,8 @@ HAVE_USTAT=
# -DHAVE_NO_GETSID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes.
#
# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP.
#
# If in doubt, leave HAVE_GETSID empty and this Makefile will figure it out.
#
HAVE_GETSID=
@@ -315,6 +337,8 @@ HAVE_GETSID=
# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes.
#
# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP.
#
# If in doubt, leave HAVE_GETPGID empty and this Makefile will figure it out.
#
HAVE_GETPGID=
@@ -327,6 +351,8 @@ HAVE_GETPGID=
# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes.
#
# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP.
#
# If in doubt, leave HAVE_GETTIME empty and this Makefile will figure it out.
#
HAVE_GETTIME=
@@ -339,6 +365,8 @@ HAVE_GETTIME=
# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes.
#
# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP.
#
# If in doubt, leave HAVE_GETPRID empty and this Makefile will figure it out.
#
HAVE_GETPRID=
@@ -350,6 +378,8 @@ HAVE_GETPRID=
# HAVE_URANDOM_H= YES assume that /dev/urandom exists
# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist
#
# Select HAVE_URANDOM_H= NO for DJGPP.
#
# When in doubt, leave HAVE_URANDOM_H empty.
#
HAVE_URANDOM_H=
@@ -391,10 +421,12 @@ HAVE_STRDUP=
# ALIGN32= -DMUST_ALIGN32 force 32 bit alignment
# ALIGN32= -UMUST_ALIGN32 allow non-alignment of 32 bit accesses
#
# Select ALIGN32= -UMUST_ALIGN32 for DJGPP.
#
# When in doubt, be safe and pick ALIGN32=-DMUST_ALIGN32.
#
#ALIGN32=
ALIGN32= -DMUST_ALIGN32
ALIGN32=
#ALIGN32= -DMUST_ALIGN32
#ALIGN32= -UMUST_ALIGN32
# Determine if we have the <malloc.h> include file.
@@ -403,6 +435,8 @@ ALIGN32= -DMUST_ALIGN32
# HAVE_MALLOC_H= YES assume that the include file exists
# HAVE_MALLOC_H= NO assume that the include file does not exist
#
# Select HAVE_MALLOC_H= YES for DJGPP.
#
# When in doubt, leave HAVE_MALLOC_H empty.
#
HAVE_MALLOC_H=
@@ -415,6 +449,8 @@ HAVE_MALLOC_H=
# HAVE_STDLIB_H= YES assume that the include file exists
# HAVE_STDLIB_H= NO assume that the include file does not exist
#
# Select HAVE_STDLIB_H= YES for DJGPP.
#
# When in doubt, leave HAVE_STDLIB_H empty.
#
HAVE_STDLIB_H=
@@ -427,6 +463,8 @@ HAVE_STDLIB_H=
# HAVE_STRING_H= YES assume that the include file exists
# HAVE_STRING_H= NO assume that the include file does not exist
#
# Select HAVE_STRING_H= YES for DJGPP.
#
# When in doubt, leave HAVE_STRING_H empty.
#
HAVE_STRING_H=
@@ -439,6 +477,8 @@ HAVE_STRING_H=
# HAVE_TIMES_H= YES assume that the include file exists
# HAVE_TIMES_H= NO assume that the include file does not exist
#
# Select HAVE_TIMES_H= NO for DJGPP.
#
# When in doubt, leave HAVE_TIMES_H empty.
#
HAVE_TIMES_H=
@@ -451,6 +491,8 @@ HAVE_TIMES_H=
# HAVE_SYS_TIMES_H= YES assume that the include file exists
# HAVE_SYS_TIMES_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_TIMES_H= YES for DJGPP.
#
# When in doubt, leave HAVE_SYS_TIMES_H empty.
#
HAVE_SYS_TIMES_H=
@@ -463,6 +505,8 @@ HAVE_SYS_TIMES_H=
# HAVE_TIME_H= YES assume that the include file exists
# HAVE_TIME_H= NO assume that the include file does not exist
#
# Select HAVE_TIME_H= YES for DJGPP.
#
# When in doubt, leave HAVE_TIME_H empty.
#
HAVE_TIME_H=
@@ -475,6 +519,8 @@ HAVE_TIME_H=
# HAVE_SYS_TIME_H= YES assume that the include file exists
# HAVE_SYS_TIME_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_TIME_H= YES for DJGPP.
#
# When in doubt, leave HAVE_SYS_TIME_H empty.
#
HAVE_SYS_TIME_H=
@@ -487,101 +533,144 @@ HAVE_SYS_TIME_H=
# HAVE_UNISTD_H= YES assume that the include file exists
# HAVE_UNISTD_H= NO assume that the include file does not exist
#
# Select HAVE_UNISTD_H= YES for DJGPP.
#
# When in doubt, leave HAVE_UNISTD_H empty.
#
HAVE_UNISTD_H=
#HAVE_UNISTD_H= YES
#HAVE_UNISTD_H= NO
# where to install the *.cal, *.h and *.a files
# System include files
#
# These 4 values control where things are installed
# -------------------------------------------------
# ${BINDIR} where to install binary files
# ${SHAREDIR} where most common shared files are kept
# ${INCDIR} where most .h files are kept
# ${LIBDIR} where *.a files are installed
# ${INCDIR} where the system include (.h) files are kept
#
# For DJGPP, select:
#
# INCDIR= /dev/env/DJDIR/include
#
# If in doubt, set:
#
# INCDIR= /usr/include
#
#INCDIR= /usr/local/include
#INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include
# Where to install calc realted things
#
# ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# For DJGPP, select:
#
# BINDIR= /dev/env/DJDIR/bin
# LIBDIR= /dev/env/DJDIR/lib
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
#
# If in doubt, set:
#
# BINDIR= /usr/bin
# SHAREDIR= /usr/share
# INCDIR= /usr/include
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
#BINDIR= /usr/local/bin
#BINDIR= /dev/env/DJDIR/bin
BINDIR= /usr/bin
#SHAREDIR= /usr/local/lib
SHAREDIR= /usr/share
#INCDIR= /usr/local/include
INCDIR= /usr/include
#LIBDIR= /usr/local/lib
#LIBDIR= /dev/env/DJDIR/lib
LIBDIR= /usr/lib
# By default, these values are based on the above 4 values
# --------------------------------------------------------
# ${CSHAREDIR} where most common shared calc files are kept
#CALC_SHAREDIR= /usr/local/lib/calc
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
CALC_SHAREDIR= /usr/share/calc
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
# ---------------------------------------------------------------
# ${HELPDIR} where the help directory is installed
# ${INCDIRCALC} where the calc include files are installed
# ${CUSTOMLIBDIR} where custom *.cal files are installed
# ${CALC_INCDIR} where the calc include files are installed
# ${CUSTOMCALDIR} where custom *.cal files are installed
# ${CUSTOMHELPDIR} where custom help files are installed
# ${CUSTOMINCPDIR} where custom .h files are installed
# ${SCRIPTDIR} where calc shell scripts are installed
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# If in doubt, set:
#
# CSHAREDIR= ${SHAREDIR}/calc
# HELPDIR= ${CSHAREDIR}/help
# INCDIRCALC= ${INCDIR}/calc
# CUSTOMLIBDIR= ${CSHAREDIR}/custom
# CUSTOMHELPDIR= ${CSHAREDIR}/custhelp
# CUSTOMINCDIR= ${INCDIRCALC}/custom
# HELPDIR= ${CALC_SHAREDIR}/help
# CALC_INCDIR= ${INCDIR}/calc
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
# SCRIPTDIR= ${BINDIR}/cscript
#
CSHAREDIR= ${SHAREDIR}/calc
HELPDIR= ${CSHAREDIR}/help
INCDIRCALC= ${INCDIR}/calc
CUSTOMLIBDIR= ${CSHAREDIR}/custom
CUSTOMHELPDIR= ${CSHAREDIR}/custhelp
CUSTOMINCDIR= ${INCDIRCALC}/custom
HELPDIR= ${CALC_SHAREDIR}/help
CALC_INCDIR= ${INCDIR}/calc
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
CUSTOMINCDIR= ${CALC_INCDIR}/custom
SCRIPTDIR= ${BINDIR}/cscript
# T - top level directory under which calc will be installed
#
# The calc install is performed under $T, the calc build is
# performed under /. For example, calc is built with its help
# directory being ${HELPDIR}. Howeever calc help files are
# installed under $T${HELPDIR}.
# performed under /. The purpose for $T is to allow someone
# to install calc somewhere other than into the system area.
#
# For example, if:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
# and if:
#
# T= /var/tmp/testing
#
# Then the installation locations will be:
#
# calc binary files: /var/tmp/testing/usr/bin
# calc link library: /var/tmp/testing/usr/lib
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
# ... etc ... /var/tmp/testing/...
#
# If $T is empty, calc is installed under /, which is the same
# top of tree for which it was built. If $T is non-empty, then
# calc is installed under $T, as if one had to chroot under
# $T for calc to operate.
#
# The purpose for $T is to allow someone to install calc
# somewhere other than into the system area. For example when
# forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
#
# If in doubt, use T=
#
T=
# where man pages are installed
#
# Select MANDIR= /dev/env/DJDIR/man/man1 for DJGPP.
#
# Use MANDIR= to disable installation of the calc man (source) page.
#
#MANDIR=
#MANDIR= /usr/local/man/man1
#MANDIR= /usr/man/man1
MANDIR= /usr/share/man/man1
#MANDIR= /dev/env/DJDIR/man/man1
#MANDIR= /usr/man/u_man/man1
#MANDIR= /usr/contrib/man/man1
# where cat (formatted man) pages are installed
#
# Select CATDIR= /dev/env/DJDIR/man/cat1 for DJGPP.
#
# Use CATDIR= to disable installation of the calc cat (formatted) page.
#
CATDIR=
@@ -589,6 +678,7 @@ CATDIR=
#CATDIR= /usr/local/catman/cat1
#CATDIR= /usr/man/cat1
#CATDIR= /usr/share/man/cat1
#CATDIR= /dev/env/DJDIR/man/cat1
#CATDIR= /var/cache/man/cat1
#CATDIR= /usr/man/u_man/cat1
#CATDIR= /usr/contrib/man/cat1
@@ -626,6 +716,8 @@ CATEXT= 1
#
# The cat page is not built or installed
#
# Select NROFF= groff for DJGPP.
#
# If in doubt and you don't want to fool with man pages, set MANDIR
# and CATDIR to empty and ignore the NROFF, NROFF_ARG and MANMAKE
# lines below.
@@ -643,12 +735,18 @@ CATMODE= 0444
# If the $CALCPATH environment variable is not defined, then the following
# path will be search for calc resource file routines.
#
CALCPATH= .:./cal:~/.cal:${CSHAREDIR}:${CUSTOMLIBDIR}
# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP.
#
CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR}
#CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR}
# If the $CALCRC environment variable is not defined, then the following
# path will be search for calc resource files.
#
CALCRC= ${CSHAREDIR}/startup:~/.calcrc:./.calcinit
# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP.
#
CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit
#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
# Determine of the GNU-readline facility will be used instead of the
# built-in calc binding method.
@@ -683,13 +781,18 @@ READLINE_INCLUDE=
# If $PAGER is not set, use this program to display a help file
#
# Select CALCPAGER= less.exe -ci for DJGPP.
#
CALCPAGER= more
#CALCPAGER= pg
#CALCPAGER= cat
#CALCPAGER= less
#CALCPAGER= less.exe -ci
# Debug/Optimize options for ${CC} and ${LCC}
#
# Select DEBUG= -O2 -gstabs+ for DJGPP.
#
#DEBUG=
#
#DEBUG= -O
@@ -700,8 +803,8 @@ CALCPAGER= more
#DEBUG= -O1 -g
#DEBUG= -O1 -g3
#
DEBUG= -O2
#DEBUG= -O2 -g
#DEBUG= -O2
DEBUG= -O2 -g
#DEBUG= -O2 -g3
#DEBUG= -O2 -ipa
#DEBUG= -O2 -g3 -ipa
@@ -718,6 +821,8 @@ DEBUG= -O2
#DEBUG= -g3
#DEBUG= -gx
#DEBUG= -WM,-g
#
#DEBUG= -O2 -gstabs+
# On systems that have dynamic shared link libs, you may want want to disable
# them for faster calc startup.
@@ -759,7 +864,7 @@ RANLIB=ranlib
# Normally certain files depend on the Makefile. If the Makefile is
# changed, then certain steps should be redone. If MAKE_FILE is
# set to Makefile, then these files will depend on Makefile. If
# MAKE_FILE is empty, they they wont.
# MAKE_FILE is empty, then they wont.
#
# If in doubt, set MAKE_FILE to Makefile
#
@@ -819,7 +924,9 @@ CALC_ENV= CALCPATH=./cal
ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM=
###
################
# compiler set #
################
#
# Select your compiler type by commenting out one of the cc sets below:
#
@@ -1048,8 +1155,13 @@ XARGS= xargs
CMP= cmp
# assume the X11 makedepend tool for the depend rule
MAKEDEPEND= makedepend
# echo command location
#
# Select ECHO= echo for DJGPP.
#
ECHO= /bin/echo
#ECHO= echo
# Makefile debug
#
@@ -1168,14 +1280,16 @@ UTIL_PROGS= align32 fposval have_uid_t longlong have_const \
# The complete list of Makefile vars passed down to custom/Makefile.
#
CUSTOM_PASSDOWN= Q="${Q}" \
SHAREDIR="${SHAREDIR}" \
INCDIR="${INCDIR}" \
CSHAREDIR="${CSHAREDIR}" \
BINDIR="${BINDIR}" \
LIBDIR="${LIBDIR}" \
CALC_SHAREDIR="${CALC_SHAREDIR}" \
HELPDIR="${HELPDIR}" \
INCDIRCALC="${INCDIRCALC}" \
CUSTOMLIBDIR="${CUSTOMLIBDIR}" \
CALC_INCDIR="${CALC_INCDIR}" \
CUSTOMCALDIR="${CUSTOMCALDIR}" \
CUSTOMHELPDIR="${CUSTOMHELPDIR}" \
CUSTOMINCDIR="${CUSTOMINCDIR}" \
SCRIPTDIR="${SCRIPTDIR}" \
DEBUG="${DEBUG}" \
NO_SHARED="${NO_SHARED}" \
RANLIB="${RANLIB}" \
@@ -1202,12 +1316,16 @@ CUSTOM_PASSDOWN= Q="${Q}" \
# The complete list of Makefile vars passed down to sample/Makefile.
#
SAMPLE_PASSDOWN= Q="${Q}" \
BINDIR="${BINDIR}" \
SHAREDIR="${SHAREDIR}" \
INCDIR="${INCDIR}" \
BINDIR="${BINDIR}" \
LIBDIR="${LIBDIR}" \
CSHAREDIR="${CSHAREDIR}" \
CALC_SHAREDIR="${CALC_SHAREDIR}" \
HELPDIR="${HELPDIR}" \
CALC_INCDIR="${CALC_INCDIR}" \
CUSTOMCALDIR="${CUSTOMCALDIR}" \
CUSTOMHELPDIR="${CUSTOMHELPDIR}" \
CUSTOMINCDIR="${CUSTOMINCDIR}" \
SCRIPTDIR="${SCRIPTDIR}" \
DEBUG="${DEBUG}" \
NO_SHARED="${NO_SHARED}" \
RANLIB="${RANLIB}" \
@@ -1235,12 +1353,16 @@ SAMPLE_PASSDOWN= Q="${Q}" \
# The compelte list of Makefile vars passed down to help/Makefile.
#
HELP_PASSDOWN= Q="${Q}" \
SHAREDIR="${SHAREDIR}" \
INCDIR="${INCDIR}" \
BINDIR="${BINDIR}" \
LIBDIR="${LIBDIR}" \
CSHAREDIR="${CSHAREDIR}" \
CALC_SHAREDIR="${CALC_SHAREDIR}" \
HELPDIR="${HELPDIR}" \
INCDIRCALC="${INCDIRCALC}" \
CALC_INCDIR="${CALC_INCDIR}" \
CUSTOMCALDIR="${CUSTOMCALDIR}" \
CUSTOMHELPDIR="${CUSTOMHELPDIR}" \
CUSTOMINCDIR="${CUSTOMINCDIR}" \
SCRIPTDIR="${SCRIPTDIR}" \
ICFLAGS="${ICFLAGS}" \
ILDFLAGS="${ILDFLAGS}" \
LCC="${LCC}" \
@@ -1255,8 +1377,16 @@ HELP_PASSDOWN= Q="${Q}" \
# The compelte list of Makefile vars passed down to cal/Makefile.
#
CAL_PASSDOWN= Q="${Q}" \
SHAREDIR="${SHAREDIR}" \
CSHAREDIR="${CSHAREDIR}" \
INCDIR="${INCDIR}" \
BINDIR="${BINDIR}" \
LIBDIR="${LIBDIR}" \
CALC_SHAREDIR="${CALC_SHAREDIR}" \
HELPDIR="${HELPDIR}" \
CALC_INCDIR="${CALC_INCDIR}" \
CUSTOMCALDIR="${CUSTOMCALDIR}" \
CUSTOMHELPDIR="${CUSTOMHELPDIR}" \
CUSTOMINCDIR="${CUSTOMINCDIR}" \
SCRIPTDIR="${SCRIPTDIR}" \
MAKE_FILE=${MAKE_FILE} \
CHMOD=${CHMOD} \
CMP=${CMP} \
@@ -1266,7 +1396,15 @@ CAL_PASSDOWN= Q="${Q}" \
# The compelte list of Makefile vars passed down to cscript/Makefile.
#
CSCRIPT_PASSDOWN= Q="${Q}" \
INCDIR="${INCDIR}" \
BINDIR="${BINDIR}" \
LIBDIR="${LIBDIR}" \
CALC_SHAREDIR="${CALC_SHAREDIR}" \
HELPDIR="${HELPDIR}" \
CALC_INCDIR="${CALC_INCDIR}" \
CUSTOMCALDIR="${CUSTOMCALDIR}" \
CUSTOMHELPDIR="${CUSTOMHELPDIR}" \
CUSTOMINCDIR="${CUSTOMINCDIR}" \
SCRIPTDIR="${SCRIPTDIR}" \
MAKE_FILE=${MAKE_FILE} \
CHMOD=${CHMOD} \
@@ -1360,8 +1498,8 @@ calc.1: calc.man ${MAKE_FILE}
-e 's,$${BINDIR},${BINDIR},g' \
-e 's,$${CALCPATH},${CALCPATH},g' \
-e 's,$${SCRIPTDIR},${SCRIPTDIR},g' \
-e 's,$${INCDIRCALC},${INCDIRCALC},g' \
-e 's,$${CUSTOMLIBDIR},${CUSTOMLIBDIR},g' \
-e 's,$${CALC_INCDIR},${CALC_INCDIR},g' \
-e 's,$${CUSTOMCALDIR},${CUSTOMCALDIR},g' \
-e 's,$${CUSTOMINCDIR},${CUSTOMINCDIR},g' \
-e 's,$${CUSTOMHELPDIR},${CUSTOMHELPDIR},g' \
-e 's,$${CALCRC},${CALCRC},g' < calc.man > calc.1
@@ -1475,7 +1613,16 @@ endian_calc.h: endian ${MAKE_FILE}
${Q}echo '' >> endian_calc.h
${Q}echo '/* what byte order are we? */' >> endian_calc.h
-${Q}if [ X"${BYTE_ORDER}" = X ]; then \
if [ -f /usr/include/endian.h ]; then \
if [ -f ${INCDIR}/endian.h ]; then \
echo '#include <endian.h>' >> endian_calc.h; \
echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \
elif [ -f ${INCDIR}/machine/endian.h ]; then \
echo '#include <machine/endian.h>' >> endian_calc.h; \
echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \
elif [ -f ${INCDIR}/sys/endian.h ]; then \
echo '#include <sys/endian.h>' >> endian_calc.h; \
echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \
elif [ -f /usr/include/endian.h ]; then \
echo '#include <endian.h>' >> endian_calc.h; \
echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \
elif [ -f /usr/include/machine/endian.h ]; then \
@@ -1543,11 +1690,13 @@ have_malloc.h: ${MAKE_FILE}
${Q}echo '#define __HAVE_MALLOC_H__' >> have_malloc.h
${Q}echo '' >> have_malloc.h
${Q}echo '' >> have_malloc.h
${Q}echo '/* do we have /usr/include/malloc.h? */' >> have_malloc.h
${Q}echo '/* do we have <malloc.h>? */' >> have_malloc.h
-${Q}if [ X"${HAVE_MALLOC_H}" = X"YES" ]; then \
echo '#define HAVE_MALLOC_H /* yes */' >> have_malloc.h; \
elif [ X"${HAVE_MALLOC_H}" = X"NO" ]; then \
echo '#undef HAVE_MALLOC_H /* no */' >> have_malloc.h; \
elif [ -f ${INCDIR}/malloc.h ]; then \
echo '#define HAVE_MALLOC_H /* yes */' >> have_malloc.h; \
elif [ -f /usr/include/malloc.h ]; then \
echo '#define HAVE_MALLOC_H /* yes */' >> have_malloc.h; \
else \
@@ -1579,11 +1728,13 @@ have_times.h: ${MAKE_FILE}
${Q}echo '#define __HAVE_TIMES_H__' >> have_times.h
${Q}echo '' >> have_times.h
${Q}echo '' >> have_times.h
${Q}echo '/* do we have /usr/include/times.h? */' >> have_times.h
${Q}echo '/* do we have <times.h>? */' >> have_times.h
-${Q}if [ X"${HAVE_TIMES_H}" = X"YES" ]; then \
echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \
elif [ X"${HAVE_TIMES_H}" = X"NO" ]; then \
echo '#undef HAVE_TIMES_H /* no */' >> have_times.h; \
elif [ -f ${INCDIR}/times.h ]; then \
echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \
elif [ -f /usr/include/times.h ]; then \
echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \
else \
@@ -1593,6 +1744,8 @@ have_times.h: ${MAKE_FILE}
echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \
elif [ X"${HAVE_SYS_TIMES_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_TIMES_H /* no */' >> have_times.h; \
elif [ -f ${INCDIR}/sys/times.h ]; then \
echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \
elif [ -f /usr/include/sys/times.h ]; then \
echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \
else \
@@ -1602,6 +1755,8 @@ have_times.h: ${MAKE_FILE}
echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \
elif [ X"${HAVE_TIME_H}" = X"NO" ]; then \
echo '#undef HAVE_TIME_H /* no */' >> have_times.h; \
elif [ -f ${INCDIR}/time.h ]; then \
echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \
elif [ -f /usr/include/time.h ]; then \
echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \
else \
@@ -1611,6 +1766,8 @@ have_times.h: ${MAKE_FILE}
echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \
elif [ X"${HAVE_SYS_TIME_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_TIME_H /* no */' >> have_times.h; \
elif [ -f ${INCDIR}/sys/time.h ]; then \
echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \
elif [ -f /usr/include/sys/time.h ]; then \
echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \
else \
@@ -1642,11 +1799,13 @@ have_stdlib.h: ${MAKE_FILE}
${Q}echo '#define __HAVE_STDLIB_H__' >> have_stdlib.h
${Q}echo '' >> have_stdlib.h
${Q}echo '' >> have_stdlib.h
${Q}echo '/* do we have /usr/include/stdlib.h? */' >> have_stdlib.h
${Q}echo '/* do we have <stdlib.h>? */' >> have_stdlib.h
-${Q}if [ X"${HAVE_STDLIB_H}" = X"YES" ]; then \
echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \
elif [ X"${HAVE_STDLIB_H}" = X"NO" ]; then \
echo '#undef HAVE_STDLIB_H /* no */' >> have_stdlib.h; \
elif [ -f ${INCDIR}/stdlib.h ]; then \
echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \
elif [ -f /usr/include/stdlib.h ]; then \
echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \
else \
@@ -1678,11 +1837,13 @@ have_unistd.h: ${MAKE_FILE}
${Q}echo '#define __HAVE_UNISTD_H__' >> have_unistd.h
${Q}echo '' >> have_unistd.h
${Q}echo '' >> have_unistd.h
${Q}echo '/* do we have /usr/include/unistd.h? */' >> have_unistd.h
${Q}echo '/* do we have <unistd.h>? */' >> have_unistd.h
-${Q}if [ X"${HAVE_UNISTD_H}" = X"YES" ]; then \
echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \
elif [ X"${HAVE_UNISTD_H}" = X"NO" ]; then \
echo '#undef HAVE_UNISTD_H /* no */' >> have_unistd.h; \
elif [ -f ${INCDIR}/unistd.h ]; then \
echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \
elif [ -f /usr/include/unistd.h ]; then \
echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \
else \
@@ -1714,11 +1875,13 @@ have_string.h: ${MAKE_FILE}
${Q}echo '#define __HAVE_STRING_H__' >> have_string.h
${Q}echo '' >> have_string.h
${Q}echo '' >> have_string.h
${Q}echo '/* do we have /usr/include/string.h? */' >> have_string.h
${Q}echo '/* do we have <string.h>? */' >> have_string.h
-${Q}if [ X"${HAVE_STRING_H}" = X"YES" ]; then \
echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \
elif [ X"${HAVE_STRING_H}" = X"NO" ]; then \
echo '#undef HAVE_STRING_H /* no */' >> have_string.h; \
elif [ -f ${INCDIR}/string.h ]; then \
echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \
elif [ -f /usr/include/string.h ]; then \
echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \
else \
@@ -1759,6 +1922,16 @@ terminal.h: ${MAKE_FILE}
echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \
echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \
echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \
elif [ -f ${INCDIR}/termios.h ]; then \
echo '/* use termios */' >> terminal.h; \
echo '#define USE_TERMIOS /* <termios.h> */' >> terminal.h; \
echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \
echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \
elif [ -f ${INCDIR}/termio.h ]; then \
echo '/* use termio */' >> terminal.h; \
echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \
echo '#define USE_TERMIO /* <termio.h> */' >> terminal.h; \
echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \
elif [ -f /usr/include/termios.h ]; then \
echo '/* use termios */' >> terminal.h; \
echo '#define USE_TERMIOS /* <termios.h> */' >> terminal.h; \
@@ -2815,13 +2988,15 @@ bsdi: ${LIB_H_SRC} ${BUILD_H_SRC} calc.1
else \
true; \
fi
-${Q}for i in ${LIB_H_SRC} ${BUILD_H_SRC}; do \
-${Q}for i in ${LIB_H_SRC} ${BUILD_H_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo rm -f gen_h/$$i; \
rm -f gen_h/$$i; \
echo cp $$i gen_h; \
cp $$i gen_h; \
echo ${CHMOD} 0444 gen_h/$$i; \
${CHMOD} 0444 gen_h/$$i; \
fi; \
done
cd help; ${MAKE} -f Makefile ${HELP_PASSDOWN} bsdi
${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-='
@@ -2858,13 +3033,15 @@ depend: hsrc
${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" > "skel/$$i"; \
done
${Q}mkdir skel/custom
-${Q}for i in ${H_SRC} ${BUILD_H_SRC} custom.h; do \
-${Q}for i in ${H_SRC} ${BUILD_H_SRC} custom.h /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
echo "#if !defined($$tag)" > "skel/$$i"; \
echo "#define $$tag" >> "skel/$$i"; \
${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \
LANG=C ${SORT} -u >> "skel/$$i"; \
echo '#endif /* '"$$tag"' */' >> "skel/$$i"; \
fi; \
done
-${Q}rm -f skel/makedep.out
${Q}echo skel formed
@@ -2873,8 +3050,10 @@ depend: hsrc
skel/makedep.out
${Q}cd skel; \
${MAKEDEPEND} -w 1 -f makedep.out ${C_SRC} ${BUILD_C_SRC}
-${Q}for i in ${C_SRC} ${BUILD_C_SRC}; do \
-${Q}for i in ${C_SRC} ${BUILD_C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
fi; \
done >> skel/makedep.out
${Q}echo dependency list formed
${Q}echo forming new Makefile
@@ -2894,8 +3073,10 @@ depend: hsrc
# generate the list of h files for lower level depend use
#
h_list:
-${Q}for i in ${H_SRC} ${BUILD_H_SRC}; do \
-${Q}for i in ${H_SRC} ${BUILD_H_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo $$i; \
fi; \
done
# print the calc version
@@ -2914,11 +3095,15 @@ ver_calc: version.c
##
distlist: ${DISTLIST}
${Q}(for i in ${DISTLIST}; do \
${Q}(for i in ${DISTLIST} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo $$i; \
fi; \
done; \
for i in ${BUILD_H_SRC} ${BUILD_C_SRC}; do \
for i in ${BUILD_H_SRC} ${BUILD_C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo win32/$$i; \
fi; \
done; \
(cd help; ${MAKE} ${HELP_PASSDOWN} $@); \
(cd cal; ${MAKE} ${CAL_PASSDOWN} $@); \
@@ -2936,8 +3121,10 @@ distdir:
(cd sample; ${MAKE} ${SAMPLE_PASSDOWN} $@)) | LANG=C ${SORT}
calcliblist:
${Q}(for i in ${CALCLIBLIST}; do \
${Q}(for i in ${CALCLIBLIST} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo $$i; \
fi; \
done; \
(cd help; ${MAKE} ${HELP_PASSDOWN} $@); \
(cd cal; ${MAKE} ${CAL_PASSDOWN} $@); \
@@ -3009,11 +3196,10 @@ env:
@echo 'HAVE_URANDOM=${HAVE_URANDOM}'; echo ''
@echo 'ALIGN32=${ALIGN32}'; echo ''
@echo 'BINDIR=${BINDIR}'; echo ''
@echo 'SHAREDIR=${SHAREDIR}'; echo ''
@echo 'CSHAREDIR=${CSHAREDIR}'; echo ''
@echo 'CALC_SHAREDIR=${CALC_SHAREDIR}'; echo ''
@echo 'LIBDIR=${LIBDIR}'; echo ''
@echo 'HELPDIR=${HELPDIR}'; echo ''
@echo 'CUSTOMLIBDIR=${CUSTOMLIBDIR}'; echo ''
@echo 'CUSTOMCALDIR=${CUSTOMCALDIR}'; echo ''
@echo 'CUSTOMINCDIR=${CUSTOMINCDIR}'; echo ''
@echo 'CUSTOMHELPDIR=${CUSTOMHELPDIR}'; echo ''
@echo 'SCRIPTDIR=${SCRIPTDIR}'; echo ''
@@ -3161,13 +3347,12 @@ calc.spec: spec-template ${MAKE_FILE} help/Makefile cal/Makefile \
${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-='
${Q}rm -f calc.spec calc.spec.sed
${Q}echo 's,$${BINDIR},${BINDIR},g' >> calc.spec.sed
${Q}echo 's:$${SHAREDIR}:${SHAREDIR}:g' >> calc.spec.sed
${Q}echo 's,$${INCDIR},${INCDIR},g' >> calc.spec.sed
${Q}echo 's:$${LIBDIR}:${LIBDIR}:g' >> calc.spec.sed
${Q}echo 's:$${CSHAREDIR}:${CSHAREDIR}:g' >> calc.spec.sed
${Q}echo 's:$${CALC_SHAREDIR}:${CALC_SHAREDIR}:g' >> calc.spec.sed
${Q}echo 's,$${HELPDIR},${HELPDIR},g' >> calc.spec.sed
${Q}echo 's,$${INCDIRCALC},${INCDIRCALC},g' >> calc.spec.sed
${Q}echo 's,$${CUSTOMLIBDIR},${CUSTOMLIBDIR},g' >> calc.spec.sed
${Q}echo 's,$${CALC_INCDIR},${CALC_INCDIR},g' >> calc.spec.sed
${Q}echo 's,$${CUSTOMCALDIR},${CUSTOMCALDIR},g' >> calc.spec.sed
${Q}echo 's,$${CUSTOMINCDIR},${CUSTOMINCDIR},g' >> calc.spec.sed
${Q}echo 's,$${CUSTOMHELPDIR},${CUSTOMHELPDIR},g' >> calc.spec.sed
${Q}echo 's,$${SCRIPTDIR},${SCRIPTDIR},g' >> calc.spec.sed
@@ -3211,8 +3396,10 @@ inst_files: ${MAKE_FILE} help/Makefile cal/Makefile custom/Makefile \
${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q}echo ${LIBDIR}/libcalc.a >> inst_files
${Q}for i in ${LIB_H_SRC} ${BUILD_H_SRC}; do \
echo ${INCDIRCALC}/$$i; \
${Q}for i in ${LIB_H_SRC} ${BUILD_H_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo ${CALC_INCDIR}/$$i; \
fi; \
done >> inst_files
${Q}if [ ! -z "${MANDIR}" ]; then \
echo ${MANDIR}/calc.${MANEXT}; \
@@ -3249,7 +3436,7 @@ rpm.mk.patch: Makefile.linux ${MAKE_FILE}
# The olduninstall rule will remove calc files from the older, histroic
# locations under the /usr/local directory. If you are using the
# new default values for ${BINDIR}, ${SHAREDIR}, ${INCDIR} and ${LIBDIR}
# new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR}
# then you can use this rule to clean out the older calc stuff under
# the /usr/local directory.
#
@@ -3257,13 +3444,12 @@ olduninstall:
-rm -f inst_files
${MAKE} -f Makefile \
BINDIR=/usr/local/bin \
SHAREDIR=/usr/local/lib \
INCDIR=/usr/local/include \
LIBDIR=/usr/local/lib/calc \
CSHAREDIR=/usr/local/lib/calc \
CALC_SHAREDIR=/usr/local/lib/calc \
HELPDIR=/usr/local/lib/calc/help \
INCDIRCALC=/usr/local/include/calc \
CUSTOMLIBDIR=/usr/local/lib/calc/custom \
CALC_INCDIR=/usr/local/include/calc \
CUSTOMCALDIR=/usr/local/lib/calc/custom \
CUSTOMHELPDIR=/usr/local/lib/calc/help/custhelp \
CUSTOMINCDIR=/usr/local/lib/calc/custom \
SCRIPTDIR=/usr/local/bin/cscript \
@@ -3377,18 +3563,6 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1
else \
true; \
fi
-${Q}if [ ! -d $T${SHAREDIR} ]; then \
echo mkdir $T${SHAREDIR}; \
mkdir $T${SHAREDIR}; \
if [ ! -d "$T${SHAREDIR}" ]; then \
echo mkdir -p "$T${SHAREDIR}"; \
mkdir -p "$T${SHAREDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${SHAREDIR}; \
${CHMOD} 0755 $T${SHAREDIR}; \
else \
true; \
fi
-${Q}if [ ! -d $T${INCDIR} ]; then \
echo mkdir $T${INCDIR}; \
mkdir $T${INCDIR}; \
@@ -3413,16 +3587,15 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1
else \
true; \
fi
-${Q}if [ ! -d $T${CSHAREDIR} ]; then \
mkdir $T${CSHAREDIR}; \
echo mkdir $T${CSHAREDIR}; \
if [ ! -d "$T${CSHAREDIR}" ]; then \
echo mkdir -p "$T${CSHAREDIR}"; \
mkdir -p "$T${CSHAREDIR}"; \
-${Q}if [ ! -d $T${CALC_SHAREDIR} ]; then \
mkdir $T${CALC_SHAREDIR}; \
echo mkdir $T${CALC_SHAREDIR}; \
if [ ! -d "$T${CALC_SHAREDIR}" ]; then \
echo mkdir -p "$T${CALC_SHAREDIR}"; \
mkdir -p "$T${CALC_SHAREDIR}"; \
fi; \
mkdir $T${CSHAREDIR}; \
echo ${CHMOD} 0755 $T${CSHAREDIR}; \
${CHMOD} 0755 $T${CSHAREDIR}; \
echo ${CHMOD} 0755 $T${CALC_SHAREDIR}; \
${CHMOD} 0755 $T${CALC_SHAREDIR}; \
else \
true; \
fi
@@ -3438,27 +3611,27 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1
else \
true; \
fi
-${Q}if [ ! -d $T${INCDIRCALC} ]; then \
echo mkdir $T${INCDIRCALC}; \
mkdir $T${INCDIRCALC}; \
if [ ! -d "$T${INCDIRCALC}" ]; then \
echo mkdir -p "$T${INCDIRCALC}"; \
mkdir -p "$T${INCDIRCALC}"; \
-${Q}if [ ! -d $T${CALC_INCDIR} ]; then \
echo mkdir $T${CALC_INCDIR}; \
mkdir $T${CALC_INCDIR}; \
if [ ! -d "$T${CALC_INCDIR}" ]; then \
echo mkdir -p "$T${CALC_INCDIR}"; \
mkdir -p "$T${CALC_INCDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${INCDIRCALC}; \
${CHMOD} 0755 $T${INCDIRCALC}; \
echo ${CHMOD} 0755 $T${CALC_INCDIR}; \
${CHMOD} 0755 $T${CALC_INCDIR}; \
else \
true; \
fi
-${Q}if [ ! -d $T${CUSTOMLIBDIR} ]; then \
echo mkdir $T${CUSTOMLIBDIR}; \
mkdir $T${CUSTOMLIBDIR}; \
if [ ! -d "$T${CUSTOMLIBDIR}" ]; then \
echo mkdir -p "$T${CUSTOMLIBDIR}"; \
mkdir -p "$T${CUSTOMLIBDIR}"; \
-${Q}if [ ! -d $T${CUSTOMCALDIR} ]; then \
echo mkdir $T${CUSTOMCALDIR}; \
mkdir $T${CUSTOMCALDIR}; \
if [ ! -d "$T${CUSTOMCALDIR}" ]; then \
echo mkdir -p "$T${CUSTOMCALDIR}"; \
mkdir -p "$T${CUSTOMCALDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${CUSTOMLIBDIR}; \
${CHMOD} 0755 $T${CUSTOMLIBDIR}; \
echo ${CHMOD} 0755 $T${CUSTOMCALDIR}; \
${CHMOD} 0755 $T${CUSTOMCALDIR}; \
else \
true; \
fi
@@ -3564,17 +3737,20 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1
${CHMOD} 0444 $T${LIBDIR}/libcalc.a; \
echo "installed $T${LIBDIR}/libcalc.a"; \
fi
-${Q}for i in ${LIB_H_SRC} ${BUILD_H_SRC}; do \
-${Q}for i in ${LIB_H_SRC} ${BUILD_H_SRC} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
rm -f tmp; \
${SED} -e 's/^\(#[ ]*include[ ][ ]*\)"/\1"calc\//' $$i > tmp; \
if ${CMP} -s tmp $T${INCDIRCALC}/$$i; then \
if ${CMP} -s tmp $T${CALC_INCDIR}/$$i; then \
true; \
else \
rm -f $T${INCDIRCALC}/$$i.new; \
cp -f tmp $T${INCDIRCALC}/$$i.new; \
${CHMOD} 0444 $T${INCDIRCALC}/$$i.new; \
mv -f $T${INCDIRCALC}/$$i.new $T${INCDIRCALC}/$$i; \
echo "installed $T${INCDIRCALC}/$$i"; \
rm -f $T${CALC_INCDIR}/$$i.new; \
cp -f tmp $T${CALC_INCDIR}/$$i.new; \
${CHMOD} 0444 $T${CALC_INCDIR}/$$i.new; \
mv -f $T${CALC_INCDIR}/$$i.new $T${CALC_INCDIR}/$$i; \
echo "installed $T${CALC_INCDIR}/$$i"; \
fi; \
done
${Q}rm -f tmp

View File

@@ -3,15 +3,6 @@ Dear calc user on a Windoz based system,
See the HOWTO.INSTALL file for information on how to build and install calc.
See also the README file.
NOTE: The Windoz port is extremely experimental, untested and perhaps
incomplete. We are in the process of making it easier. The
following should help anyone who is trying to make a go of this
under the current code conditions.
NOTE: We are currently ONLY making an effort to support building under
Windoz using the Cygwin project (http://sources.redhat.com/cygwin/)
with the GCC compiler and Un*x tools for Windows.
NOTE: The main developers do not have access to a Windoz based platform.
While we will make an effort to not break calc Windoz based system,
our lack of a Windoz test environment will mean we will make mistakes
@@ -19,7 +10,68 @@ NOTE: The main developers do not have access to a Windoz based platform.
Of course you are welcome to send us any patches that fix your
Windoz build environment.
=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-= compiling under DJGPP =-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
You might want to try using the DJGPP system to compile calc. See:
http://www.delorie.com/djgpp/
for DJGPP details and availability.
To compile with DJGPP, one needs to select a number of Makefile
variable changes. Eli Zaretskii <eliz at is dot elta dot co dot il>
recommends the following settings:
TERMCONTROL= -DUSE_TERMIOS
BYTE_ORDER= -DLITTLE_ENDIAN
LONG_BITS= 32
LONGLONG_BITS= 64
HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS
FPOS_BITS= 32
OFF_T_BITS= 32
DEV_BITS= 32
INODE_BITS= 32
HAVE_USTAT= -DHAVE_NO_USTAT
HAVE_GETSID= -DHAVE_NO_GETSID
HAVE_GETPGID= -DHAVE_NO_GETPGID
HAVE_GETTIME= -DHAVE_NO_GETTIME
HAVE_GETPRID= -DHAVE_NO_GETPRID
HAVE_URANDOM_H= NO
ALIGN32= -UMUST_ALIGN32
HAVE_MALLOC_H= YES
HAVE_STDLIB_H= YES
HAVE_STRING_H= YES
HAVE_TIMES_H= NO
HAVE_SYS_TIMES_H= YES
HAVE_TIME_H= YES
HAVE_SYS_TIME_H= YES
HAVE_UNISTD_H= YES
BINDIR= /dev/env/DJDIR/bin
INCDIR= /dev/env/DJDIR/include
LIBDIR= /dev/env/DJDIR/lib
MANDIR= /dev/env/DJDIR/man/man1
CATDIR= /dev/env/DJDIR/man/cat1
NROFF= groff
CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR}
CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
CALCPAGER= less.exe -ci
DEBUG= -O2 -gstabs+
The 'Linux set' or 'gcc set' (see the Select your compiler type section)
should work for DJGPP systems if you set the above Makefile variables.
Look for Makefile comments of the form:
# Select ...something... for DJGPP.
Follow those recommendations. In cases where they conflict with
the above Makefile list, follow the recommendation in the Makefile.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-= compiling with Cygwin =-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
An effort is being made to allow windows users to compile calc using the
Cygwin project (http://sources.redhat.com/cygwin/) with the GCC compiler
@@ -61,8 +113,6 @@ needs. Just copy the win32/*.[ch] files up into the top level calc
source directory, edited (if needed) and build using the Cygwin GCC
compiler.
=-=
People who maintain calc need to keep in mind the following:
The following was added to opcodes.h, config.h, zmath.h and value.h:
@@ -89,7 +139,7 @@ was changed to:
DLL extern int configtype(char*);
## Copyright (C) 2001 Landon Curt Noll and Thomas Jones-Low
## Copyright (C) 2002 Landon Curt Noll and Thomas Jones-Low
##
## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License
@@ -105,8 +155,8 @@ was changed to:
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.6 $
## @(#) $Id: README.WINDOWS,v 29.6 2001/04/08 22:13:38 chongo Exp $
## @(#) $Revision: 29.8 $
## @(#) $Id: README.WINDOWS,v 29.8 2002/03/14 00:28:28 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/README.WINDOWS,v $
##
## Under source code control: 2001/02/25 14:00:05

View File

@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# @(#) $Revision: 29.12 $
# @(#) $Id: Makefile,v 29.12 2001/06/08 22:38:53 chongo Exp $
# @(#) $Revision: 29.14 $
# @(#) $Id: Makefile,v 29.14 2002/03/14 00:28:28 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $
#
# Under source code control: 1991/07/21 05:00:54
@@ -36,23 +36,111 @@
SHELL = /bin/sh
MAKE_FILE = Makefile
####
# Normally, the upper level makefile will set these values. We provide
# a default here just in case you want to build from this directory.
#
# where to install things
#SHAREDIR= /usr/local/lib
#SHAREDIR= /usr/lib
SHAREDIR= /usr/share
#SHAREDIR= /usr/libdata
####
CSHAREDIR= ${SHAREDIR}/calc
# Where the system include (.h) files are kept
#
# For DJGPP, select:
#
# INCDIR= /dev/env/DJDIR/include
#
# If in doubt, set:
#
# INCDIR= /usr/include
#
#INCDIR= /usr/local/include
#INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include
# where to install calc realted things
#
# ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# For DJGPP, select:
#
# BINDIR= /dev/env/DJDIR/bin
# LIBDIR= /dev/env/DJDIR/lib
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
#
# If in doubt, set:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
#BINDIR= /usr/local/bin
#BINDIR= /dev/env/DJDIR/bin
BINDIR= /usr/bin
#LIBDIR= /usr/local/lib
#LIBDIR= /dev/env/DJDIR/lib
LIBDIR= /usr/lib
#CALC_SHAREDIR= /usr/local/lib/calc
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
CALC_SHAREDIR= /usr/share/calc
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
# ---------------------------------------------------------------
# ${HELPDIR} where the help directory is installed
# ${CALC_INCDIR} where the calc include files are installed
# ${CUSTOMCALDIR} where custom *.cal files are installed
# ${CUSTOMHELPDIR} where custom help files are installed
# ${CUSTOMINCPDIR} where custom .h files are installed
# ${SCRIPTDIR} where calc shell scripts are installed
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# If in doubt, set:
#
# HELPDIR= ${CALC_SHAREDIR}/help
# CALC_INCDIR= ${INCDIR}/calc
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
# SCRIPTDIR= ${BINDIR}/cscript
#
HELPDIR= ${CALC_SHAREDIR}/help
CALC_INCDIR= ${INCDIR}/calc
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
CUSTOMINCDIR= ${CALC_INCDIR}/custom
SCRIPTDIR= ${BINDIR}/cscript
# T - top level directory under which calc will be installed
#
# The calc install is performed under $T, the calc build is
# performed under /. The purpose for $T is to allow someone to
# install calc somewhere other than into the system area. For example
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
# performed under /. The purpose for $T is to allow someone
# to install calc somewhere other than into the system area.
#
# For example, if:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
# and if:
#
# T= /var/tmp/testing
#
# Then the installation locations will be:
#
# calc binary files: /var/tmp/testing/usr/bin
# calc link library: /var/tmp/testing/usr/lib
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
# ... etc ... /var/tmp/testing/...
#
# If $T is empty, calc is installed under /, which is the same
# top of tree for which it was built. If $T is non-empty, then
@@ -120,8 +208,10 @@ all: ${CALC_FILES} ${MAKE_FILE} .all
##
distlist: ${DISTLIST}
${Q}for i in ${DISTLIST}; do \
${Q}for i in ${DISTLIST} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo cal/$$i; \
fi; \
done
distdir:
@@ -141,8 +231,10 @@ calcliblist:
##
echo_inst_files:
${Q}for i in ${CALC_FILES}; do \
echo __file__ ${CSHAREDIR}/$$i; \
${Q}for i in ${CALC_FILES} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo __file__ ${CALC_SHAREDIR}/$$i; \
fi; \
done
##
@@ -157,38 +249,29 @@ clobber:
rm -f .all
install: all
-${Q}if [ ! -d $T${SHAREDIR} ]; then \
echo mkdir $T${SHAREDIR}; \
mkdir $T${SHAREDIR}; \
if [ ! -d "$T${SHAREDIR}" ]; then \
echo mkdir -p "$T${SHAREDIR}"; \
mkdir -p "$T${SHAREDIR}"; \
-${Q}if [ ! -d $T${CALC_SHAREDIR} ]; then \
echo mkdir $T${CALC_SHAREDIR}; \
mkdir $T${CALC_SHAREDIR}; \
if [ ! -d "$T${CALC_SHAREDIR}" ]; then \
echo mkdir -p "$T${CALC_SHAREDIR}"; \
mkdir -p "$T${CALC_SHAREDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${SHAREDIR}; \
${CHMOD} 0755 $T${SHAREDIR}; \
echo ${CHMOD} 0755 $T${CALC_SHAREDIR}; \
${CHMOD} 0755 $T${CALC_SHAREDIR}; \
else \
true; \
fi
-${Q}if [ ! -d $T${CSHAREDIR} ]; then \
echo mkdir $T${CSHAREDIR}; \
mkdir $T${CSHAREDIR}; \
if [ ! -d "$T${CSHAREDIR}" ]; then \
echo mkdir -p "$T${CSHAREDIR}"; \
mkdir -p "$T${CSHAREDIR}"; \
${Q}for i in ${CALC_FILES} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
echo ${CHMOD} 0755 $T${CSHAREDIR}; \
${CHMOD} 0755 $T${CSHAREDIR}; \
else \
true; \
fi
${Q}for i in ${CALC_FILES}; do \
if ${CMP} -s $$i $T${CSHAREDIR}/$$i; then \
if ${CMP} -s $$i $T${CALC_SHAREDIR}/$$i; then \
true; \
else \
rm -f $T${CSHAREDIR}/$$i.new; \
cp -f $$i $T${CSHAREDIR}/$$i.new; \
${CHMOD} 0444 $T${CSHAREDIR}/$$i.new; \
mv -f $T${CSHAREDIR}/$$i.new $T${CSHAREDIR}/$$i; \
echo "installed $T${CSHAREDIR}/$$i"; \
rm -f $T${CALC_SHAREDIR}/$$i.new; \
cp -f $$i $T${CALC_SHAREDIR}/$$i.new; \
${CHMOD} 0444 $T${CALC_SHAREDIR}/$$i.new; \
mv -f $T${CALC_SHAREDIR}/$$i.new $T${CALC_SHAREDIR}/$$i; \
echo "installed $T${CALC_SHAREDIR}/$$i"; \
fi; \
done

8
calc.h
View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.9 $
* @(#) $Id: calc.h,v 29.9 2001/12/11 02:28:47 chongo Exp $
* @(#) $Revision: 29.10 $
* @(#) $Id: calc.h,v 29.10 2002/03/12 09:40:57 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $
*
* Under source code control: 1990/02/15 01:48:31
@@ -60,7 +60,11 @@
#define HOMECHAR '~' /* char which indicates home directory */
#define DOTCHAR '.' /* char which indicates current directory */
#define PATHCHAR '/' /* char which separates path components */
#if defined(__MSDOS__) || defined(__WIN32)
#define LISTCHAR ';' /* char which separates paths in a list */
#else
#define LISTCHAR ':' /* char which separates paths in a list */
#endif
#define MAXCMD 16384 /* maximum length of command invocation */
#define MAXERROR 512 /* maximum length of error message string */

View File

@@ -15,8 +15,8 @@
.\" received a copy with calc; if not, write to Free Software Foundation, Inc.
.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
.\"
.\" @(#) $Revision: 29.7 $
.\" @(#) $Id: calc.man,v 29.7 2001/06/01 11:26:53 chongo Exp $
.\" @(#) $Revision: 29.9 $
.\" @(#) $Id: calc.man,v 29.9 2002/03/14 00:28:28 chongo Exp $
.\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $
.\"
.\" Under source code control: 1991/07/23 05:48:26
@@ -54,7 +54,7 @@ calc \- arbitrary precision calculator
.RB [ calc_cmd\ \&.\|.\|. ]
.in -5n
.sp
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ [other_flags\ \&...]
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ [other_flags\ \&...]
.SH DESCRIPTION
\&
.br
@@ -514,8 +514,8 @@ searches in succession:
./myfile.cal
${LIBDIR}/myfile
${LIBDIR}/myfile.cal
${CUSTOMLIBDIR}/myfile
${CUSTOMLIBDIR}/myfile.cal
${CUSTOMCALDIR}/myfile
${CUSTOMCALDIR}/myfile.cal
.fi
.in -5n
.sp 1
@@ -572,27 +572,25 @@ If first line of an executable file begins
followed by the absolute pathname of the
.B calc
program and the flag
.B \-S
.B \-f
as in:
.sp 1
.in +5n
.nf
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ [other_flags\ \&...]
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ [other_flags\ \&...]
.fi
.in -5n
.sp 1
the rest of the file will be processed in
.BR "shell script mode" .
Note that
.B \-S
(UPPER CASE
.BR \-S )
.B \-f
must be the first \-flag on the ``#!'' line.
Any other optional
.B "other_flags"
must come after
the
.BR \-S .
.BR \-f .
.sp 1
In
.B "shell script mode"
@@ -625,7 +623,7 @@ the file
.sp 1
.in +5n
.nf
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ \&\fB\-q\fP
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ \&\fB\-q\fP
#
# mersenne - an example of a calc \fBshell script file\fP
@@ -839,7 +837,7 @@ ${LIBDIR}/bindings
non-GNU-readline command line editor bindings
.sp 1
.TP 5
${INCDIRCALC}/*.h
${CALC_INCDIR}/*.h
include files for C interface use
.sp 1
.TP 5
@@ -851,7 +849,7 @@ ${LIBDIR}/libcustcalc.a
custom binary link library
.sp 1
.TP 5
${CUSTOMLIBDIR}/*.cal
${CUSTOMCALDIR}/*.cal
custom resource files
.sp 1
.TP 5

View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.5 $
* @(#) $Id: cmath.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
* @(#) $Revision: 29.6 $
* @(#) $Id: cmath.h,v 29.6 2002/03/12 09:38:26 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $
*
* Under source code control: 1993/07/30 19:42:45
@@ -62,6 +62,7 @@ extern void cprintfr(COMPLEX *c);
/*
* Basic numeric routines.
*/
extern COMPLEX *cadd(COMPLEX *c1, COMPLEX *c2);
extern COMPLEX *csub(COMPLEX *c1, COMPLEX *c2);
extern COMPLEX *cmul(COMPLEX *c1, COMPLEX *c2);
@@ -74,8 +75,8 @@ extern COMPLEX *cscale(COMPLEX *c, long i);
extern COMPLEX *cshift(COMPLEX *c, long i);
extern COMPLEX *csquare(COMPLEX *c);
extern COMPLEX *cconj(COMPLEX *c);
extern COMPLEX *creal(COMPLEX *c);
extern COMPLEX *cimag(COMPLEX *c);
extern COMPLEX *c_real(COMPLEX *c);
extern COMPLEX *c_imag(COMPLEX *c);
extern COMPLEX *cneg(COMPLEX *c);
extern COMPLEX *cinv(COMPLEX *c);
extern COMPLEX *cint(COMPLEX *c);

View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.2 $
* @(#) $Id: commath.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Revision: 29.3 $
* @(#) $Id: commath.c,v 29.3 2002/03/12 09:38:26 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $
*
* Under source code control: 1990/02/15 01:48:10
@@ -381,7 +381,7 @@ cconj(COMPLEX *c)
* Return the real part of a complex number.
*/
COMPLEX *
creal(COMPLEX *c)
c_real(COMPLEX *c)
{
COMPLEX *r;
@@ -400,7 +400,7 @@ creal(COMPLEX *c)
* Return the imaginary part of a complex number as a real.
*/
COMPLEX *
cimag(COMPLEX *c)
c_imag(COMPLEX *c)
{
COMPLEX *r;

View File

@@ -17,8 +17,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# @(#) $Revision: 29.20 $
# @(#) $Id: Makefile,v 29.20 2001/06/10 19:35:02 chongo Exp $
# @(#) $Revision: 29.22 $
# @(#) $Id: Makefile,v 29.22 2002/03/14 00:28:28 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $
#
# Under source code control: 1999/11/29 11:10:26
@@ -36,21 +36,111 @@
SHELL= /bin/sh
MAKE_FILE = Makefile
####
# Normally, the upper level makefile will set these values. We provide
# a default here just in case you want to build from this directory.
####
# Where the system include (.h) files are kept
#
# For DJGPP, select:
#
# INCDIR= /dev/env/DJDIR/include
#
# If in doubt, set:
#
# INCDIR= /usr/include
#
#INCDIR= /usr/local/include
#INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include
# where to install calc realted things
#
# ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# For DJGPP, select:
#
# BINDIR= /dev/env/DJDIR/bin
# LIBDIR= /dev/env/DJDIR/lib
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
#
# If in doubt, set:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
#BINDIR= /usr/local/bin
#BINDIR= /dev/env/DJDIR/bin
BINDIR= /usr/bin
#BINDIR= /usr/contrib/bin
#LIBDIR= /usr/local/lib
#LIBDIR= /dev/env/DJDIR/lib
LIBDIR= /usr/lib
#CALC_SHAREDIR= /usr/local/lib/calc
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
CALC_SHAREDIR= /usr/share/calc
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
# ---------------------------------------------------------------
# ${HELPDIR} where the help directory is installed
# ${CALC_INCDIR} where the calc include files are installed
# ${CUSTOMCALDIR} where custom *.cal files are installed
# ${CUSTOMHELPDIR} where custom help files are installed
# ${CUSTOMINCPDIR} where custom .h files are installed
# ${SCRIPTDIR} where calc shell scripts are installed
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# If in doubt, set:
#
# HELPDIR= ${CALC_SHAREDIR}/help
# CALC_INCDIR= ${INCDIR}/calc
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
# SCRIPTDIR= ${BINDIR}/cscript
#
HELPDIR= ${CALC_SHAREDIR}/help
CALC_INCDIR= ${INCDIR}/calc
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
CUSTOMINCDIR= ${CALC_INCDIR}/custom
SCRIPTDIR= ${BINDIR}/cscript
# T - top level directory under which calc will be installed
#
# The calc install is performed under $T, the calc build is
# performed under /. The purpose for $T is to allow someone to
# install calc somewhere other than into the system area. For example
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
# performed under /. The purpose for $T is to allow someone
# to install calc somewhere other than into the system area.
#
# For example, if:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
# and if:
#
# T= /var/tmp/testing
#
# Then the installation locations will be:
#
# calc binary files: /var/tmp/testing/usr/bin
# calc link library: /var/tmp/testing/usr/lib
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
# ... etc ... /var/tmp/testing/...
#
# If $T is empty, calc is installed under /, which is the same
# top of tree for which it was built. If $T is non-empty, then
@@ -139,8 +229,10 @@ all: ${TARGETS} .all
##
distlist: ${DISTLIST}
${Q}for i in ${DISTLIST}; do \
${Q}for i in ${DISTLIST} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo cscript/$$i; \
fi; \
done | LANG=C ${SORT}
distdir:
@@ -152,23 +244,27 @@ calcliblist:
#
detaillist:
${Q}-(echo "xxxxxxx"; \
for i in ${SCRIPT}; do \
for i in ${SCRIPT} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
if [ ! -f RCS/$$i.calc,v ]; then \
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
else \
echo $$i; \
fi; \
fi; \
done | LANG=C ${SORT}) | ${FMT} -70 | \
${SED} -e '1s/xxxxxxx/SCRIPT=/' -e '2,$$s/^/ /' \
-e 's/$$/ \\/' -e '$$s/ \\$$//'
${Q}echo
${Q}-(echo "xxxxxxxxxxx"; \
for i in ${SCRIPT}; do \
for i in ${SCRIPT} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
if [ ! -f RCS/$$i.calc,v ]; then \
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
else \
echo $$i.calc; \
fi; \
fi; \
done | LANG=C ${SORT}) | ${FMT} -70 | \
${SED} -e '1s/xxxxxxxxxxx/SCRIPT_SRC=/' -e '2,$$s/^/ /' \
-e 's/$$/ \\/' -e '$$s/ \\$$//'
@@ -197,11 +293,13 @@ depend:
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
makedep.out
${Q}echo "" >> makedep.out
${Q}for i in ${SCRIPT}; do \
${Q}for i in ${SCRIPT} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i: $$i.calc"; \
echo ' rm -f $$@'; \
echo ' $${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
echo ' $${CHMOD} +x $$@'; \
fi; \
done >> makedep.out
${Q}echo sample dependency list formed
${Q}echo forming new cscript/Makefile
@@ -233,8 +331,10 @@ depend:
##
echo_inst_files:
${Q}for i in ${SCRIPT}; do \
echo __file__ ${SCRIPTDIR}/$$i; \
${Q}for i in ${SCRIPT} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo __file__ ${SCRIPTDIR}/$$i; \
fi; \
done
##
@@ -274,7 +374,10 @@ install: all
else \
true; \
fi
${Q}for i in ${SCRIPT}; do \
${Q}for i in ${SCRIPT} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
if ${CMP} -s $$i $T${SCRIPTDIR}/$$i; then \
true; \
else \

View File

@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# @(#) $Revision: 29.17 $
# @(#) $Id: Makefile,v 29.17 2001/06/08 22:38:53 chongo Exp $
# @(#) $Revision: 29.19 $
# @(#) $Id: Makefile,v 29.19 2002/03/14 00:28:28 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $
#
# Under source code control: 1997/03/09 02:28:54
@@ -88,40 +88,111 @@ CUSTOM_OBJ= c_argv.o c_devnull.o c_help.o c_sysinfo.o c_pzasusb8.o
#Q=
Q=@
####
# Normally, the upper level makefile will set these values. We provide
# a default here just in case you want to build from this directory.
####
# Where the system include (.h) files are kept
#
# where to install things
# For DJGPP, select:
#
# ${SHAREDIR} where most common shared files are kept
# ${INCDIR} where most .h files are kept
# INCDIR= /dev/env/DJDIR/include
#
# ${CSHAREDIR} where most common shared calc files are kept
# ${HELPDIR} where the help directory is installed.
# ${INCDIRCALC} where the calc include files are installed
# ${CUSTOMLIBDIR} where custom *.cal files & libcustcalc.a are installed.
# ${CUSTOMHELPDIR} where custom help files are installed.
# ${CUSTOMINCPDIR} where custom .h files are installed.
# If in doubt, set:
#
#SHAREDIR= /usr/local/lib
SHAREDIR= /usr/share
# INCDIR= /usr/include
#
#INCDIR= /usr/local/include
#INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include
# where to install calc realted things
#
CSHAREDIR= ${SHAREDIR}/calc
HELPDIR= ${CSHAREDIR}/help
INCDIRCALC= ${INCDIR}/calc
CUSTOMLIBDIR= ${CSHAREDIR}/custom
CUSTOMHELPDIR= ${CSHAREDIR}/custhelp
CUSTOMINCDIR= ${INCDIRCALC}/custom
# ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# For DJGPP, select:
#
# BINDIR= /dev/env/DJDIR/bin
# LIBDIR= /dev/env/DJDIR/lib
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
#
# If in doubt, set:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
#BINDIR= /usr/local/bin
#BINDIR= /dev/env/DJDIR/bin
BINDIR= /usr/bin
#LIBDIR= /usr/local/lib
#LIBDIR= /dev/env/DJDIR/lib
LIBDIR= /usr/lib
#CALC_SHAREDIR= /usr/local/lib/calc
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
CALC_SHAREDIR= /usr/share/calc
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
# ---------------------------------------------------------------
# ${HELPDIR} where the help directory is installed
# ${CALC_INCDIR} where the calc include files are installed
# ${CUSTOMCALDIR} where custom *.cal files are installed
# ${CUSTOMHELPDIR} where custom help files are installed
# ${CUSTOMINCPDIR} where custom .h files are installed
# ${SCRIPTDIR} where calc shell scripts are installed
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# If in doubt, set:
#
# HELPDIR= ${CALC_SHAREDIR}/help
# CALC_INCDIR= ${INCDIR}/calc
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
# SCRIPTDIR= ${BINDIR}/cscript
#
HELPDIR= ${CALC_SHAREDIR}/help
CALC_INCDIR= ${INCDIR}/calc
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
CUSTOMINCDIR= ${CALC_INCDIR}/custom
SCRIPTDIR= ${BINDIR}/cscript
# T - top level directory under which calc will be installed
#
# The calc install is performed under $T, the calc build is
# performed under /. The purpose for $T is to allow someone to
# install calc somewhere other than into the system area. For example
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
# performed under /. The purpose for $T is to allow someone
# to install calc somewhere other than into the system area.
#
# For example, if:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
# and if:
#
# T= /var/tmp/testing
#
# Then the installation locations will be:
#
# calc binary files: /var/tmp/testing/usr/bin
# calc link library: /var/tmp/testing/usr/lib
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
# ... etc ... /var/tmp/testing/...
#
# If $T is empty, calc is installed under /, which is the same
# top of tree for which it was built. If $T is non-empty, then
@@ -279,7 +350,7 @@ REQUIRED_SRC= custtbl.c
#
REQUIRED_OBJ= custtbl.o
# These .h files are installed under ${CUSTOMLIBDIR} by the install rule.
# These .h files are installed under ${CUSTOMCALDIR} by the install rule.
#
INSTALL_H_SRC= ${CUSTOM_H_SRC}
@@ -381,8 +452,10 @@ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
##
distlist: ${DISTLIST}
${Q}for i in ${DISTLIST}; do \
${Q}for i in ${DISTLIST} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo custom/$$i; \
fi; \
done
distdir:
@@ -418,11 +491,13 @@ depend:
-${Q}rm -rf skel
${Q}mkdir skel
${Q}mkdir skel/custom
-${Q}for i in ${C_SRC}; do \
-${Q}for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
${SED} -n '/^#[ ]*include[ ]*"/p' \
"$$i" > "skel/custom/$$i"; \
fi; \
done
-${Q}for i in /dev/null ${H_SRC}; do \
-${Q}for i in ${H_SRC} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
@@ -437,7 +512,10 @@ depend:
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
${SED} -e '/Entering directory/d' \
-e '/Nothing to be done/d' \
-e '/Leaving directory/d'`; do \
-e '/Leaving directory/d'` /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
echo "#if !defined($$tag)" > "skel/$$i"; \
echo "#define $$tag" >> "skel/$$i"; \
@@ -451,8 +529,10 @@ depend:
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
skel/custom/makedep.out
${Q}cd skel/custom; ${MAKEDEPEND} -w 1 -f makedep.out ${C_SRC}
-${Q}for i in ${C_SRC}; do \
-${Q}for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
fi; \
done >> skel/custom/makedep.out
${Q}echo custom dependency list formed
${Q}echo forming new custom/Makefile
@@ -485,17 +565,25 @@ depend:
##
echo_inst_files:
${Q}for i in ${INSTALL_H_SRC}; do \
echo __file__ ${CUSTOMINCDIR}/$$i; \
${Q}for i in ${INSTALL_H_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo __file__ ${CUSTOMINCDIR}/$$i; \
fi; \
done
${Q}for i in ${CUSTOM_HELP}; do \
echo __file__ ${CUSTOMHELPDIR}/$$i; \
${Q}for i in ${CUSTOM_HELP} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo __file__ ${CUSTOMHELPDIR}/$$i; \
fi; \
done
${Q}for i in ${CUSTOM_CALC_FILES}; do \
echo __file__ ${CUSTOMLIBDIR}/$$i; \
${Q}for i in ${CUSTOM_CALC_FILES} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo __file__ ${CUSTOMCALDIR}/$$i; \
fi; \
done
${Q}for i in ${CALC_LIBCUSTOM}; do \
echo __file__ ${CUSTOMLIBDIR}/$$i; \
${Q}for i in ${CALC_LIBCUSTOM} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo __file__ ${CUSTOMCALDIR}/$$i; \
fi; \
done
##
@@ -512,18 +600,6 @@ clobber:
rm -f .all Makefile.tmp Makefile.bak
install: all
-${Q}if [ ! -d $T${SHAREDIR} ]; then \
echo mkdir $T${SHAREDIR}; \
mkdir $T${SHAREDIR}; \
if [ ! -d "$T${SHAREDIR}" ]; then \
echo mkdir -p "$T${SHAREDIR}"; \
mkdir -p "$T${SHAREDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${SHAREDIR}; \
${CHMOD} 0755 $T${SHAREDIR}; \
else \
true; \
fi
-${Q}if [ ! -d $T${INCDIR} ]; then \
echo mkdir $T${INCDIR}; \
mkdir $T${INCDIR}; \
@@ -536,27 +612,27 @@ install: all
else \
true; \
fi
-${Q}if [ ! -d $T${CSHAREDIR} ]; then \
echo mkdir $T${CSHAREDIR}; \
mkdir $T${CSHAREDIR}; \
if [ ! -d "$T${CSHAREDIR}" ]; then \
echo mkdir -p "$T${CSHAREDIR}"; \
mkdir -p "$T${CSHAREDIR}"; \
-${Q}if [ ! -d $T${CALC_SHAREDIR} ]; then \
echo mkdir $T${CALC_SHAREDIR}; \
mkdir $T${CALC_SHAREDIR}; \
if [ ! -d "$T${CALC_SHAREDIR}" ]; then \
echo mkdir -p "$T${CALC_SHAREDIR}"; \
mkdir -p "$T${CALC_SHAREDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${CSHAREDIR}; \
${CHMOD} 0755 $T${CSHAREDIR}; \
echo ${CHMOD} 0755 $T${CALC_SHAREDIR}; \
${CHMOD} 0755 $T${CALC_SHAREDIR}; \
else \
true; \
fi
-${Q}if [ ! -d $T${INCDIRCALC} ]; then \
echo mkdir $T${INCDIRCALC}; \
mkdir $T${INCDIRCALC}; \
if [ ! -d "$T${INCDIRCALC}" ]; then \
echo mkdir -p "$T${INCDIRCALC}"; \
mkdir -p "$T${INCDIRCALC}"; \
-${Q}if [ ! -d $T${CALC_INCDIR} ]; then \
echo mkdir $T${CALC_INCDIR}; \
mkdir $T${CALC_INCDIR}; \
if [ ! -d "$T${CALC_INCDIR}" ]; then \
echo mkdir -p "$T${CALC_INCDIR}"; \
mkdir -p "$T${CALC_INCDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${INCDIRCALC}; \
${CHMOD} 0755 $T${INCDIRCALC}; \
echo ${CHMOD} 0755 $T${CALC_INCDIR}; \
${CHMOD} 0755 $T${CALC_INCDIR}; \
else \
true; \
fi
@@ -572,15 +648,15 @@ install: all
else \
true; \
fi
-${Q}if [ ! -d $T${CUSTOMLIBDIR} ]; then \
echo mkdir $T${CUSTOMLIBDIR}; \
mkdir $T${CUSTOMLIBDIR}; \
if [ ! -d "$T${CUSTOMLIBDIR}" ]; then \
echo mkdir -p "$T${CUSTOMLIBDIR}"; \
mkdir -p "$T${CUSTOMLIBDIR}"; \
-${Q}if [ ! -d $T${CUSTOMCALDIR} ]; then \
echo mkdir $T${CUSTOMCALDIR}; \
mkdir $T${CUSTOMCALDIR}; \
if [ ! -d "$T${CUSTOMCALDIR}" ]; then \
echo mkdir -p "$T${CUSTOMCALDIR}"; \
mkdir -p "$T${CUSTOMCALDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${CUSTOMLIBDIR}; \
${CHMOD} 0755 $T${CUSTOMLIBDIR}; \
echo ${CHMOD} 0755 $T${CUSTOMCALDIR}; \
${CHMOD} 0755 $T${CUSTOMCALDIR}; \
else \
true; \
fi
@@ -608,7 +684,10 @@ install: all
else \
true; \
fi
-${Q}for i in ${INSTALL_H_SRC}; do \
-${Q}for i in ${INSTALL_H_SRC} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
if ${CMP} -s tmp $T${CUSTOMINCDIR}/$$i; then \
true; \
else \
@@ -620,18 +699,24 @@ install: all
fi; \
done
-${Q}rm -f tmp
-${Q}for i in ${CUSTOM_CALC_FILES}; do \
if ${CMP} -s $$i $T${CUSTOMLIBDIR}/$$i; then \
-${Q}for i in ${CUSTOM_CALC_FILES} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
if ${CMP} -s $$i $T${CUSTOMCALDIR}/$$i; then \
true; \
else \
rm -f $T${CUSTOMLIBDIR}/$$i.new; \
cp -f $$i $T${CUSTOMLIBDIR}/$$i.new; \
${CHMOD} 0444 $T${CUSTOMLIBDIR}/$$i.new; \
mv -f $T${CUSTOMLIBDIR}/$$i.new $T${CUSTOMLIBDIR}/$$i; \
echo "installed $T${CUSTOMLIBDIR}/$$i"; \
rm -f $T${CUSTOMCALDIR}/$$i.new; \
cp -f $$i $T${CUSTOMCALDIR}/$$i.new; \
${CHMOD} 0444 $T${CUSTOMCALDIR}/$$i.new; \
mv -f $T${CUSTOMCALDIR}/$$i.new $T${CUSTOMCALDIR}/$$i; \
echo "installed $T${CUSTOMCALDIR}/$$i"; \
fi; \
done
-${Q}for i in ${CUSTOM_HELP}; do \
-${Q}for i in ${CUSTOM_HELP} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
if ${CMP} -s $$i $T${CUSTOMHELPDIR}/$$i; then \
true; \
else \
@@ -643,16 +728,16 @@ install: all
fi; \
done
-${Q}if [ ! -z ${ALLOW_CUSTOM} ]; then \
if ${CMP} -s libcustcalc.a $T${CUSTOMLIBDIR}/libcustcalc.a; then \
if ${CMP} -s libcustcalc.a $T${CUSTOMCALDIR}/libcustcalc.a; then \
true; \
else \
rm -f $T${CUSTOMLIBDIR}/libcustcalc.a.new; \
cp -f libcustcalc.a $T${CUSTOMLIBDIR}/libcustcalc.a.new; \
${CHMOD} 0644 $T${CUSTOMLIBDIR}/libcustcalc.a.new; \
mv -f $T${CUSTOMLIBDIR}/libcustcalc.a.new \
$T${CUSTOMLIBDIR}/libcustcalc.a; \
${RANLIB} $T${CUSTOMLIBDIR}/libcustcalc.a; \
echo "installed $T${CUSTOMLIBDIR}/libcustcalc.a"; \
rm -f $T${CUSTOMCALDIR}/libcustcalc.a.new; \
cp -f libcustcalc.a $T${CUSTOMCALDIR}/libcustcalc.a.new; \
${CHMOD} 0644 $T${CUSTOMCALDIR}/libcustcalc.a.new; \
mv -f $T${CUSTOMCALDIR}/libcustcalc.a.new \
$T${CUSTOMCALDIR}/libcustcalc.a; \
${RANLIB} $T${CUSTOMCALDIR}/libcustcalc.a; \
echo "installed $T${CUSTOMCALDIR}/libcustcalc.a"; \
fi; \
fi

View File

@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# @(#) $Revision: 29.18 $
# @(#) $Id: Makefile,v 29.18 2001/06/08 22:57:54 chongo Exp $
# @(#) $Revision: 29.20 $
# @(#) $Id: Makefile,v 29.20 2002/03/14 00:28:28 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $
#
# Under source code control: 1991/07/23 06:47:57
@@ -36,33 +36,111 @@
SHELL= /bin/sh
MAKE_FILE = Makefile
# ${SHAREDIR} where most common shared files are kept
# ${INCDIR} where most .h files are kept
# ${LIBDIR} where *.a files are installed
####
# Normally, the upper level makefile will set these values. We provide
# a default here just in case you want to build from this directory.
####
# Where the system include (.h) files are kept
#
# ${CSHAREDIR} where most common shared calc files are kept
# ${HELPDIR} where the help directory is installed.
# ${INCDIRCALC} where the calc include files are installed
# For DJGPP, select:
#
# INCDIR= /dev/env/DJDIR/include
#
# If in doubt, set:
#
# INCDIR= /usr/include
#
#SHAREDIR= /usr/local/lib
SHAREDIR= /usr/share
#INCDIR= /usr/local/include
#INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include
# where to install calc realted things
#
# ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# For DJGPP, select:
#
# BINDIR= /dev/env/DJDIR/bin
# LIBDIR= /dev/env/DJDIR/lib
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
#
# If in doubt, set:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
#BINDIR= /usr/local/bin
#BINDIR= /dev/env/DJDIR/bin
BINDIR= /usr/bin
#LIBDIR= /usr/local/lib
#LIBDIR= /dev/env/DJDIR/lib
LIBDIR= /usr/lib
CSHAREDIR= ${SHAREDIR}/calc
HELPDIR= ${CSHAREDIR}/help
INCDIRCALC= ${INCDIR}/calc
#CALC_SHAREDIR= /usr/local/lib/calc
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
CALC_SHAREDIR= /usr/share/calc
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
# ---------------------------------------------------------------
# ${HELPDIR} where the help directory is installed
# ${CALC_INCDIR} where the calc include files are installed
# ${CUSTOMCALDIR} where custom *.cal files are installed
# ${CUSTOMHELPDIR} where custom help files are installed
# ${CUSTOMINCPDIR} where custom .h files are installed
# ${SCRIPTDIR} where calc shell scripts are installed
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# If in doubt, set:
#
# HELPDIR= ${CALC_SHAREDIR}/help
# CALC_INCDIR= ${INCDIR}/calc
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
# SCRIPTDIR= ${BINDIR}/cscript
#
HELPDIR= ${CALC_SHAREDIR}/help
CALC_INCDIR= ${INCDIR}/calc
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
CUSTOMINCDIR= ${CALC_INCDIR}/custom
SCRIPTDIR= ${BINDIR}/cscript
# T - top level directory under which calc will be installed
#
# The calc install is performed under $T, the calc build is
# performed under /. The purpose for $T is to allow someone to
# install calc somewhere other than into the system area. For example
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
# performed under /. The purpose for $T is to allow someone
# to install calc somewhere other than into the system area.
#
# For example, if:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
# and if:
#
# T= /var/tmp/testing
#
# Then the installation locations will be:
#
# calc binary files: /var/tmp/testing/usr/bin
# calc link library: /var/tmp/testing/usr/lib
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
# ... etc ... /var/tmp/testing/...
#
# If $T is empty, calc is installed under /, which is the same
# top of tree for which it was built. If $T is non-empty, then
@@ -267,7 +345,7 @@ changes: ../CHANGES
libcalc: ../LIBRARY
rm -f $@
${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' \
-e 's:$${INCDIRCALC}:${INCDIRCALC}:g' < ../LIBRARY > $@
-e 's:$${CALC_INCDIR}:${CALC_INCDIR}:g' < ../LIBRARY > $@
${CHMOD} 0444 $@
-@if [ -z "${Q}" ]; then \
echo ''; \
@@ -418,11 +496,13 @@ full: ${FULL_HELP_FILES} ${MAKE_FILE}
# Singular files are the same files as their plural form.
#
${SINGULAR_FILES}: ${PLURAL_FILES}
${Q}for i in ${SINGULAR_FILES}; do \
echo "rm -f $${i}"; \
rm -f $${i}; \
echo "cp $${i}s $${i}"; \
cp $${i}s $${i}; \
${Q}for i in ${SINGULAR_FILES} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo "rm -f $${i}"; \
rm -f $${i}; \
echo "cp $${i}s $${i}"; \
cp $${i}s $${i}; \
fi; \
done
-@if [ -z "${Q}" ]; then \
echo ''; \
@@ -482,8 +562,10 @@ builtin: builtin.top builtin.end ../func.c funclist.sed
##
distlist: ${DISTLIST}
${Q}for i in ${DISTLIST}; do \
${Q}for i in ${DISTLIST} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo help/$$i; \
fi; \
done | LANG=C ${SORT}
distdir:
@@ -508,12 +590,14 @@ bsdi: all
#
detaillist:
${Q}-(echo "xxxxx"; \
for i in ${DETAIL_HELP}; do \
for i in ${DETAIL_HELP} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
if [ ! -f RCS/$$i,v ]; then \
echo "WARNING: $$i not under RCS control" 1>&2; \
else \
echo $$i; \
fi; \
fi; \
done | LANG=C ${SORT}) | ${FMT} -70 | \
${SED} -e '1s/xxxxx/DETAIL_HELP=/' -e '2,$$s/^/ /' \
-e 's/$$/ \\/' -e '$$s/ \\$$//'
@@ -526,8 +610,10 @@ detaillist:
echo_inst_files:
${Q}for i in ${STD_HELP_FILES} full ${BLT_HELP_FILES} \
builtin ${DETAIL_HELP} ${SINGULAR_FILES}; do \
echo __file__ ${HELPDIR}/$$i; \
builtin ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo __file__ ${HELPDIR}/$$i; \
fi; \
done
${Q}echo __file__ ${HELPDIR}/obj
@@ -548,27 +634,15 @@ clobber:
rm -f ${SINGULAR_FILES} ${DETAIL_CLONE}
install: all
-${Q}if [ ! -d ${SHAREDIR} ]; then \
echo mkdir $T${SHAREDIR}; \
mkdir $T${SHAREDIR}; \
if [ ! -d "$T${SHAREDIR}" ]; then \
echo mkdir -p "$T${SHAREDIR}"; \
mkdir -p "$T${SHAREDIR}"; \
-${Q}if [ ! -d $T${CALC_SHAREDIR} ]; then \
echo mkdir $T${CALC_SHAREDIR}; \
mkdir $T${CALC_SHAREDIR}; \
if [ ! -d "$T${CALC_SHAREDIR}" ]; then \
echo mkdir -p "$T${CALC_SHAREDIR}"; \
mkdir -p "$T${CALC_SHAREDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${SHAREDIR}; \
${CHMOD} 0755 $T${SHAREDIR}; \
else \
true; \
fi
-${Q}if [ ! -d $T${CSHAREDIR} ]; then \
echo mkdir $T${CSHAREDIR}; \
mkdir $T${CSHAREDIR}; \
if [ ! -d "$T${CSHAREDIR}" ]; then \
echo mkdir -p "$T${CSHAREDIR}"; \
mkdir -p "$T${CSHAREDIR}"; \
fi; \
echo ${CHMOD} 0755 $T${CSHAREDIR}; \
${CHMOD} 0755 $T${CSHAREDIR}; \
echo ${CHMOD} 0755 $T${CALC_SHAREDIR}; \
${CHMOD} 0755 $T${CALC_SHAREDIR}; \
else \
true; \
fi
@@ -585,7 +659,10 @@ install: all
true; \
fi
-${Q}for i in ${STD_HELP_FILES} ${BLT_HELP_FILES} builtin \
full ${DETAIL_HELP} ${SINGULAR_FILES}; do \
full ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
if [ "$$i" = "/dev/null" ]; then \
continue; \
fi; \
if ${CMP} -s $$i $T${HELPDIR}/$$i; then \
true; \
else \

View File

@@ -20,7 +20,7 @@ LIMITS
none
LINK LIBRARY
COMPLEX *cimag(COMPLEX *x)
COMPLEX *c_imag(COMPLEX *x)
SEE ALSO
re
@@ -41,8 +41,8 @@ SEE ALSO
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.2 $
## @(#) $Id: im,v 29.2 2000/06/07 14:02:33 chongo Exp $
## @(#) $Revision: 29.3 $
## @(#) $Id: im,v 29.3 2002/03/12 09:38:26 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/im,v $
##
## Under source code control: 1995/10/05 04:52:26

View File

@@ -20,7 +20,7 @@ LIMITS
none
LINK LIBRARY
COMPLEX *cimag(COMPLEX *x)
COMPLEX *c_imag(COMPLEX *x)
SEE ALSO
im
@@ -41,8 +41,8 @@ SEE ALSO
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.2 $
## @(#) $Id: re,v 29.2 2000/06/07 14:02:33 chongo Exp $
## @(#) $Revision: 29.3 $
## @(#) $Id: re,v 29.3 2002/03/12 09:38:26 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/re,v $
##
## Under source code control: 1995/10/05 04:52:27

View File

@@ -249,8 +249,8 @@ Calc command line
./myfile.cal
${LIBDIR}/myfile
${LIBDIR}/myfile.cal
${CUSTOMLIBDIR}/myfile
${CUSTOMLIBDIR}/myfile.cal
${CUSTOMCALDIR}/myfile
${CUSTOMCALDIR}/myfile.cal
If the file is found, the search stops and the commands in
the file are executed. It is an error if no readable file
@@ -354,7 +354,7 @@ For more information use the following calc commands:
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.3 $
## @(#) $Id: usage,v 29.3 2000/06/07 14:02:33 chongo Exp $
## @(#) $Id: usage,v 29.3 2000/06/07 14:02:33 chongo Exp chongo $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/usage,v $
##
## Under source code control: 1991/07/21 04:37:25

8
hist.h
View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.3 $
* @(#) $Id: hist.h,v 29.3 2001/03/17 21:31:47 chongo Exp $
* @(#) $Revision: 29.4 $
* @(#) $Id: hist.h,v 29.4 2002/03/12 09:40:57 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.h,v $
*
* Under source code control: 1993/05/02 20:09:20
@@ -50,7 +50,11 @@
#define HOMECHAR '~' /* char which indicates home directory */
#define DOTCHAR '.' /* char which indicates current directory */
#define PATHCHAR '/' /* char which separates path components */
#if defined(__MSDOS__) || defined(__WIN32)
#define LISTCHAR ';' /* char which separates paths in a list */
#else
#define LISTCHAR ':' /* char which separates paths in a list */
#endif
/*

29
input.c
View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.5 $
* @(#) $Id: input.c,v 29.5 2001/03/17 21:31:47 chongo Exp $
* @(#) $Revision: 29.6 $
* @(#) $Id: input.c,v 29.6 2002/03/12 09:40:57 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/input.c,v $
*
* Under source code control: 1990/02/15 01:48:16
@@ -46,6 +46,12 @@
#include <unistd.h>
#endif
#if defined(__MSDOS__)
#include <limits.h>
#define _fullpath(f,n,s) (_fixpath(n,f),f)
#define _MAX_PATH PATH_MAX
#endif
#include "calc.h"
#include "conf.h"
#include "hist.h"
@@ -816,11 +822,12 @@ runrcfiles(void)
* given:
* sbuf stat of the inode in question
*/
static int
isinoderead(struct stat *sbuf)
{
int i;
#if defined(_WIN32)
#if defined(_WIN32) || defined(__MSDOS__)
char fullpathname[_MAX_PATH];
#endif
@@ -832,11 +839,11 @@ isinoderead(struct stat *sbuf)
/* scan the entire readset */
for (i=0; i < maxreadset; ++i) {
#if defined(_WIN32)
#if defined(_WIN32) || defined(__MSDOS__)
if (readset[i].active &&
strcmp(readset[i].path,
_fullpath(fullpathname,cip->i_name,
_MAX_PATH)) == 0) {
strcasecmp(readset[i].path,
_fullpath(fullpathname,cip->i_name,
_MAX_PATH)) == 0) {
/* found a match */
return i;
}
@@ -954,14 +961,18 @@ addreadset(char *name, char *path, struct stat *sbuf)
return -1;
}
strcpy(readset[ret].name, name);
#if defined(_WIN32)
#if defined(_WIN32) || defined(__MSDOS__)
/*
* For WIN32, _fullpath expands the path to a fully qualified
* path name, which under WIN32 FAT and NTFS is unique, just
* like UNIX inodes. _fullpath also allocated the memory for
* this new longer path name.
*/
readset[ret].path = _fullpath(NULL, path, 0);
{
char fullpathname[_MAX_PATH];
readset[ret].path = _fullpath(fullpathname, path, _MAX_PATH);
}
#else /* Windoz free systems */
readset[ret].path = (char *)malloc(strlen(path)+1);
if (readset[ret].path == NULL) {

View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.7 $
* @(#) $Id: lib_calc.c,v 29.7 2001/04/08 22:05:40 chongo Exp $
* @(#) $Revision: 29.8 $
* @(#) $Id: lib_calc.c,v 29.8 2002/03/12 09:40:57 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_calc.c,v $
*
* Under source code control: 1996/06/17 18:06:19
@@ -217,6 +217,11 @@ libcalc_call_me_first(void)
*/
if (program != NULL) {
p = strrchr(program, '/');
#if defined(_WIN32) || defined(__MSDOS__)
if (p == NULL) {
p = strrchr(program, '\\');
}
#endif
if (p == NULL) {
base_name = program;
} else {

View File

@@ -17,8 +17,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# @(#) $Revision: 29.14 $
# @(#) $Id: Makefile,v 29.14 2001/06/08 22:38:53 chongo Exp $
# @(#) $Revision: 29.16 $
# @(#) $Id: Makefile,v 29.16 2002/03/14 00:28:28 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $
#
# Under source code control: 1997/04/19 22:46:49
@@ -75,41 +75,111 @@ SAMPLE_OBJ= many_random.o test_random.o
#Q=
Q=@
####
# Normally, the upper level makefile will set these values. We provide
# a default here just in case you want to build from this directory.
####
# Where the system include (.h) files are kept
#
# where things go
# For DJGPP, select:
#
# ${BINDIR} where to install binary files
# ${SHAREDIR} where most common shared files are kept
# ${INCDIR} where most .h files are kept
# ${LIBDIR} where *.a files are installed
# INCDIR= /dev/env/DJDIR/include
#
# ${CSHAREDIR} where most common shared calc files are kept
# ${HELPDIR} where the help directory is installed.
# If in doubt, set:
#
# INCDIR= /usr/include
#
#INCDIR= /usr/local/include
#INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include
# where to install calc realted things
#
# ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# For DJGPP, select:
#
# BINDIR= /dev/env/DJDIR/bin
# LIBDIR= /dev/env/DJDIR/lib
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
#
# If in doubt, set:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
#BINDIR= /usr/local/bin
#BINDIR= /dev/env/DJDIR/bin
BINDIR= /usr/bin
#BINDIR= /usr/contrib/bin
#
#SHAREDIR= /usr/local/lib
SHAREDIR= /usr/share
#
#INCDIR= /usr/local/include
INCDIR= /usr/include
#
#LIBDIR= /usr/local/lib
#LIBDIR= /dev/env/DJDIR/lib
LIBDIR= /usr/lib
CSHAREDIR= ${SHAREDIR}/calc
HELPDIR= ${LIBDIR}/help
#CALC_SHAREDIR= /usr/local/lib/calc
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
CALC_SHAREDIR= /usr/share/calc
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
# ---------------------------------------------------------------
# ${HELPDIR} where the help directory is installed
# ${CALC_INCDIR} where the calc include files are installed
# ${CUSTOMCALDIR} where custom *.cal files are installed
# ${CUSTOMHELPDIR} where custom help files are installed
# ${CUSTOMINCPDIR} where custom .h files are installed
# ${SCRIPTDIR} where calc shell scripts are installed
#
# NOTE: The install rule prepends installation paths with $T, which
# by default is empty. If $T is non-empty, then installation
# locations will be relative to the $T directory.
#
# If in doubt, set:
#
# HELPDIR= ${CALC_SHAREDIR}/help
# CALC_INCDIR= ${INCDIR}/calc
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
# SCRIPTDIR= ${BINDIR}/cscript
#
HELPDIR= ${CALC_SHAREDIR}/help
CALC_INCDIR= ${INCDIR}/calc
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
CUSTOMINCDIR= ${CALC_INCDIR}/custom
SCRIPTDIR= ${BINDIR}/cscript
# T - top level directory under which calc will be installed
#
# The calc install is performed under $T, the calc build is
# performed under /. The purpose for $T is to allow someone to
# install calc somewhere other than into the system area. For example
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
# performed under /. The purpose for $T is to allow someone
# to install calc somewhere other than into the system area.
#
# For example, if:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
#
# and if:
#
# T= /var/tmp/testing
#
# Then the installation locations will be:
#
# calc binary files: /var/tmp/testing/usr/bin
# calc link library: /var/tmp/testing/usr/lib
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
# ... etc ... /var/tmp/testing/...
#
# If $T is empty, calc is installed under /, which is the same
# top of tree for which it was built. If $T is non-empty, then
@@ -359,8 +429,10 @@ many_random: many_random.o ../libcalc.a
##
distlist: ${DISTLIST}
${Q}for i in ${DISTLIST}; do \
${Q}for i in ${DISTLIST} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo sample/$$i; \
fi; \
done
distdir:
@@ -396,11 +468,14 @@ depend:
-${Q}rm -rf skel
${Q}mkdir skel
${Q}mkdir skel/sample
-${Q}for i in ${C_SRC}; do \
-${Q}for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
${SED} -n '/^#[ ]*include[ ]*"/p' \
"$$i" > "skel/sample/$$i"; \
fi; \
done
-${Q}for i in ${H_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
if [ X"$$i" != X"/dev/null" ]; then \
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
echo "#if !defined($$tag)" > "skel/sample/$$i"; \
@@ -409,18 +484,21 @@ depend:
>> "skel/sample/$$i"; \
echo '#endif /* '"$$tag"' */' >> "skel/sample/$$i"; \
fi; \
fi; \
done
${Q}(cd ..; ${MAKE} hsrc)
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
${SED} -e '/Entering directory/d' \
-e '/Nothing to be done/d' \
-e '/Leaving directory/d'`; do \
-e '/Leaving directory/d'` /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
echo "#if !defined($$tag)" > "skel/$$i"; \
echo "#define $$tag" >> "skel/$$i"; \
${SED} -n '/^#[ ]*include[ ]*"/p' "../$$i" \
>> "skel/$$i"; \
echo '#endif /* '"$$tag"' */' >> "skel/$$i"; \
fi; \
done
-${Q}rm -f skel/sample/makedep.out
${Q}echo sample/skel formed
@@ -428,8 +506,10 @@ depend:
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
skel/sample/makedep.out
${Q}cd skel/sample; ${MAKEDEPEND} -w 1 -f makedep.out -I.. ${C_SRC}
-${Q}for i in ${C_SRC}; do \
-${Q}for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
fi; \
done >> skel/sample/makedep.out
${Q}echo sample dependency list formed
${Q}echo forming new sample/Makefile

View File

@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.34 $
* @(#) $Id: version.c,v 29.34 2001/12/11 02:54:14 chongo Exp $
* @(#) $Revision: 29.39 $
* @(#) $Id: version.c,v 29.39 2002/03/14 00:28:28 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $
*
* Under source code control: 1990/05/22 11:00:58
@@ -46,7 +46,7 @@ static char *program;
#define MAJOR_VER 2 /* major version */
#define MINOR_VER 11 /* minor version */
#define MAJOR_PATCH 5 /* patch level or 0 if no patch */
#define MINOR_PATCH 5 /* test number or 0 if no minor patch */
#define MINOR_PATCH 8 /* test number or 0 if no minor patch */
/*
@@ -93,6 +93,22 @@ char *Copyright = "\n"
"\n";
#if !defined(HAVE_SNPRINTF)
/* Simulate snprintf with vsprintf, hoping that BUFSIZ is large enough. */
#include <stdarg.h>
int
snprintf (char *buf, size_t n, const char *fmt, ...)
{
int retval;
va_list arg;
va_start (arg, fmt);
retval = vsprintf (buf, fmt, arg);
va_end (arg);
return retval;
}
#endif
/*
* version - return version string
*

View File

@@ -36,8 +36,8 @@ HAVE_UNISTD_H=NO
LIBDIR=/lib/calc
HELPDIR=/lib/calc/help
INCDIRCALC=/include/calc
CUSTOMLIBDIR=/lib/calc/custom
CALC_INCDIR=/include/calc
CUSTOMCALDIR=/lib/calc/custom
CUSTOMHELPDIR=/lib/calc/help/custhelp
SCRIPTDIR=/lib/calc/cscript
MANDIR=

View File

@@ -7,7 +7,7 @@
#define __HAVE_MALLOC_H__
/* do we have /usr/include/malloc.h? */
/* do we have <malloc.h>? */
#define HAVE_MALLOC_H /* yes */

View File

@@ -7,7 +7,7 @@
#define __HAVE_STDLIB_H__
/* do we have /usr/include/stdlib.h? */
/* do we have <stdlib.h>? */
#define HAVE_STDLIB_H /* yes */

View File

@@ -7,7 +7,7 @@
#define __HAVE_STRING_H__
/* do we have /usr/include/string.h? */
/* do we have <string.h>? */
#define HAVE_STRING_H /* yes */

View File

@@ -7,7 +7,7 @@
#define __HAVE_TIMES_H__
/* do we have /usr/include/times.h? */
/* do we have <times.h>? */
#undef HAVE_TIMES_H /* no */
#undef HAVE_SYS_TIMES_H /* no */
#define HAVE_TIME_H /* yes */

View File

@@ -7,7 +7,7 @@
#define __HAVE_UNISTD_H__
/* do we have /usr/include/unistd.h? */
/* do we have <unistd.h>? */
#undef HAVE_UNISTD_H /* no */