diff --git a/BUGS b/BUGS index 2a2e6a0..81578b7 100644 --- a/BUGS +++ b/BUGS @@ -68,6 +68,9 @@ of a context diff patch). Known bugs: + The output of the alg_config.cal resource file is bogus. + We would welcome a replacement for this code. + We are sure some more bugs exist. When you find them, please let us know! See the above for details on how to report and were to EMail your bug reports and hopefully patches to fix them. @@ -129,7 +132,7 @@ mis-features in calc: will not. -## Copyright (C) 1999-2013 Landon Curt Noll +## Copyright (C) 1999-2014 Landon Curt Noll ## ## 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 @@ -145,8 +148,8 @@ mis-features in calc: ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -## @(#) $Revision: 30.2 $ -## @(#) $Id: BUGS,v 30.2 2013/08/11 01:09:27 chongo Exp $ +## @(#) $Revision: 30.3 $ +## @(#) $Id: BUGS,v 30.3 2014/09/07 06:20:41 chongo Exp $ ## @(#) $Source: /usr/local/src/bin/calc/RCS/BUGS,v $ ## ## Under source code control: 1994/03/18 14:06:13 diff --git a/CHANGES b/CHANGES index b6cd55c..35c003d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,87 @@ -The following are the changes from calc version 2.12.4.11 to date: +The following are the changes from calc version 2.12.4.14 to date: + + For Apple OS X / Darwin target: + + MACOSX_DEPLOYMENT_TARGET is no longer defined + using clang compiler + + By default, -install-name is used when forming shared libs. + To force -install-name to not be used, set SET_INSTALL_NAME=no. + + The have_stdvs.c test uses and fixed va_start() test call + that didn't use last arg. + + Fixed math_fmt (printf) in value.c where a LEN (SB32) be printed as %d. + + Fixed a significant bug where that resulted in an incorrect + complex number comparison. Thanks goes to David Binderman + for identifying the subtle typo! + + Make minor fixes to the make depend rule. + + Fixed places were calc defined a reserved identifier that + begin with either __ or _[A-Z]. For example, __FILE_H__ has + been replaced with INCLUDE_FILE_H. + + Fixed the addall3 example in the script help file. Thanks for this + fix goes to Igor Furlan . + + We made important fixes to the calc command line history: + + Fixed a bug in the command line history where calc would somtimes + crash. There was code that used memcpy() instead of memmove() + that could corrupt the command line history when entering a + into into history that was similar to a previous entry. Thanks + goes to Einar Lielmanis for first + identifying this mistake. + + The calc command line history code, in general was not robust. + We made use a patch from Mathias Buhr , that while it uses a bit more memory: is much more + flexible, readable and robust. This patch replaced the improer + use of memcpy() (see above) with better code. Thanks! + + The alg_config.cal calc resource file has been reworked to produce + better diagnostics while attempting to determine the ideal values + for mul2, sq2, and pow2. However, it has been shown that this + code is not correct. Suggestions for a replacement are welcome! + + calc -u 'read alg_config; config("user_debug", 2),; best_mul2();' + calc -u 'read alg_config; config("user_debug", 2),; best_sq2();' + calc -u 'read alg_config; config("user_debug", 2),; best_pow2();' + + Fixed a number of pedantic compiler warnings. + + Removed -W and -Wno-comment from the the CCWARN makefile variable. + + Removed no_implicit.arg makefile rule. Removed HAVE_NO_IMPLICIT + makefile variable. Removed no_implicit.c source file. + + Added WNO_IMPLICT makefile variable to hold the compiler flag + -Wno-implicit for use on selective compile lines. + + Added WNO_ERROR_LONG_LONG makefile variable to hold the compiler flag + -Wno-error=long-long for use on selective compile lines. + + Added WNO_LONG_LONG makefile variable to hold the compiler flag + -Wno-long-long for use on selective compile lines. + + The makefile variable ${MKDIR_ARG} has been replaced with just -p. + + Minor fixes were made to the calc.spec.in file. + + The target rpm architecture changed from i686 to x86_64. For those + who do not run machine with x86_64, we continue to release a src + rpm. For those without the ability to process an rpm, we will always + to release src tarball. + + When building the libcalc and libcustcalc shared libraries, + ONLY the .so and .so.${VERSION} files are created. The .so is + a symlink to the .so.${VERSION} file. Here ${VERSION} is the + full "w.x.y.z" calc version. + + +The following are the changes from calc version 2.12.4.11 to 2.12.4.13: Fixed many typos in comments of the Makefile thanks to the review work of Michael Somos. @@ -6960,8 +7043,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. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -## @(#) $Revision: 30.38 $ -## @(#) $Id: CHANGES,v 30.38 2013/09/27 08:59:43 chongo Exp $ +## @(#) $Revision: 30.44 $ +## @(#) $Id: CHANGES,v 30.44 2014/09/22 03:40:07 chongo Exp $ ## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $ ## ## Under source code control: 1993/06/02 18:12:57 diff --git a/Makefile b/Makefile index 745c031..6c947f3 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ # READLINE_LIB= -lreadline # READLINE_EXTRAS= -lhistory -lncurses # -# Copyright (C) 1999-2008 Landon Curt Noll +# Copyright (C) 1999-2014 Landon Curt Noll # # Calc is open software; you can redistribute it and/or modify it under # the terms of version 2.1 of the GNU Lesser General Public License @@ -39,8 +39,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: 30.60 $$ -# @(#) $Id: Makefile.ship,v 30.60 2013/09/27 08:55:27 chongo Exp $ +MAKEFILE_REV= $$Revision: 30.75 $$ +# @(#) $Id: Makefile.ship,v 30.75 2014/09/21 14:09:18 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $ # # Under source code control: 1990/02/15 01:48:41 @@ -545,18 +545,6 @@ HAVE_UNISTD_H= #HAVE_UNISTD_H= YES #HAVE_UNISTD_H= NO -# Determine if our compiler allows the -Wno-implicit flag -# -# HAVE_NO_IMPLICIT= let the Makefile test the -Wno-implicit flag -# HAVE_NO_IMPLICIT= NO Our compiler does not have -Wno-implicit flags -# HAVE_NO_IMPLICIT= YES Our compiler has a -Wno-implicit flag -# -# Select HAVE_NO_IMPLICIT= for DJGPP. -# -HAVE_NO_IMPLICIT= -# HAVE_NO_IMPLICIT= NO -# HAVE_NO_IMPLICIT= YES - # Determine if our compiler allows the unused attribute # # If HAVE_UNUSED is empty, this Makefile will run the have_unused program @@ -957,30 +945,20 @@ LD_DEBUG= # are useful for SGI IRIX people who have 'WorkShop Performance Tools' # and who also set 'LD_DEBUG= -lmalloc_cv' above. # -# If in doubt, use CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom +# If in doubt, use: # -CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ +# CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=. +# +CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. +#CALC_ENV= CALCPATH=./cal DYLD_LIBRARY_PATH=. \ +# MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 LD_LIBRARY_PATH=.:./custom -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ +#CALC_ENV= CALCPATH=./cal DYLD_LIBRARY_PATH=. \ +# MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 MALLOC_CLEAR_FREE=1 \ # MALLOC_CLEAR_MALLOC=1 LD_LIBRARY_PATH=.:./custom -# The install rule uses: -# -# ${MKDIR} ${MKDIR_ARG} -# -# to create directories. Normally this amounts to using mkdir -p dir ... -# Some older systems may not have mkdir -p. If your system does not -# have mkdir -p, then set MKDIR_ARG to empty. -# -# MKDIR_ARG= -p # use mkdir -p when creating paths -# MKDIR_ARG= # use if system does not understand mkdir -p -# -MKDIR_ARG= -p -#MKDIR_ARG= - # Some out of date operating systems require/want an executable to # end with a certain file extension. Some compiler systems such as # windoz build calc as calc.exe. The EXT variable is used to denote @@ -997,15 +975,18 @@ EXT= # The default calc versions # -VERSION= 2.12.4.13 -VERS= 2.12.4 -VER= 2.12 -VE= 2 +VERSION= 2.12.4.14 # Names of shared libraries with versions # LIB_EXT= .so LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} + +# legacy partial versions are no longer used, only removed +# +VERS= 2.12.4 +VER= 2.12 +VE= 2 LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VE= ${LIB_EXT}.${VE} @@ -1113,6 +1094,17 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS} # # CCOPT are flags given to ${CC} for optimization # CCWARN are flags given to ${CC} for warning message control +# +# WNO_IMPLICT, WNO_ERROR_LONG_LONG and WNO_LONG_LONG are given to ${CC} +# when compiling special .o files that may need special compile options +# NOTE: These flags simply turn off certain compiler warnings, +# which is useful only when CCWERR is set to -Werror. +# NOTE: If your compiler does not have these -Wno files, just +# set these variables to nothing as in: +# WNO_IMPLICT= +# WNO_ERROR_LONG_LONG= +# WNO_LONG_LONG= +# # CCWERR are flags given to ${CC} to make warnings fatal errors # NOTE: CCWERR is only set in development Makefiles and must only be # used with ${CC}, not ${LCC}. If you do not want the compiler @@ -1159,7 +1151,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1169,9 +1164,9 @@ CC= ${PURIFY} ${LCC} ${CCWERR} # endif -################################# -# Apple MacOS X / Darwin target # -################################# +############################## +# Apple OS X / Darwin target # +############################## ifeq ($(target),Darwin) # @@ -1180,9 +1175,23 @@ BLD_TYPE= calc-dynamic-only CC_SHARE= -fPIC DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib LD_SHARE= ${DARWIN_ARCH} -LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib +#SET_INSTALL_NAME= no +SET_INSTALL_NAME= yes +ifeq ($(SET_INSTALL_NAME),yes) +LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + -install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} ${DARWIN_ARCH} +else +LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + ${DARWIN_ARCH} +endif ifdef ALLOW_CUSTOM -LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib +ifeq ($(SET_INSTALL_NAME),yes) +LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + -install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${DARWIN_ARCH} +else +LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + ${DARWIN_ARCH} +endif else LIBCUSTCALC_SHLIB= endif @@ -1192,17 +1201,21 @@ LD_STATIC= ${DARWIN_ARCH} LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= ${DARWIN_ARCH} # -LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc +LCC= clang CC= ${PURIFY} ${LCC} ${CCWERR} # # Darwin dynamic shared lib filenames LIB_EXT:= .dylib LIB_EXT_VERSION:= .${VERSION}${LIB_EXT} +# legacy partial versions are no longer used, only removed LIB_EXT_VERS:= .${VERS}${LIB_EXT} LIB_EXT_VER:= .${VER}${LIB_EXT} LIB_EXT_VE:= .${VE}${LIB_EXT} @@ -1211,8 +1224,8 @@ LDCONFIG:= # DARWIN_ARCH= -arch i386 -arch ppc # Universal binary # DARWIN_ARCH= -arch i386 # Intel binary # DARWIN_ARCH= -arch ppc # PPC binary +# DARWIN_ARCH= -arch x86_64 # native 64-bit binary DARWIN_ARCH= # native binary -MACOSX_DEPLOYMENT_TARGET=10.8 # endif @@ -1246,7 +1259,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1289,6 +1305,9 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= # CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1304,7 +1323,6 @@ endif # SunOS target # ################ -# XXX - this needs to be tested ifeq ($(target),SunOS) # BLD_TYPE= calc-dynamic-only @@ -1325,7 +1343,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1359,7 +1380,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1393,7 +1417,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1453,7 +1480,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= -DNOTCYGWIN @@ -1490,7 +1520,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1620,7 +1653,7 @@ UTIL_C_SRC= align32.c endian.c longbits.c have_newstr.c have_uid_t.c \ have_fpos_pos.c have_offscl.c have_posscl.c have_memmv.c \ have_ustat.c have_getsid.c have_getpgid.c \ have_gettime.c have_getprid.c have_rusage.c have_strdup.c \ - no_implicit.c have_unused.c + have_unused.c # these awk and sed tools are used in the process of building BUILD_H_SRC # and BUILD_C_SRC @@ -1637,7 +1670,7 @@ UTIL_OBJS= endian.o longbits.o have_newstr.o have_uid_t.o \ try_strarg.o have_stdvs.o have_varvs.o have_posscl.o have_memmv.o \ have_ustat.o have_getsid.o have_getpgid.o \ have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o \ - no_implicit.o have_unused.o + have_unused.o # these temp files may be created (and removed) during the build of BUILD_C_SRC # @@ -1652,14 +1685,14 @@ UTIL_PROGS= align32${EXT} fposval${EXT} have_uid_t${EXT} have_const${EXT} \ endian${EXT} longbits${EXT} have_newstr${EXT} have_stdvs${EXT} \ have_varvs${EXT} have_ustat${EXT} have_getsid${EXT} \ have_getpgid${EXT} have_gettime${EXT} have_getprid${EXT} \ - ver_calc${EXT} have_strdup${EXT} no_implicit${EXT} \ + ver_calc${EXT} have_strdup${EXT} \ have_unused${EXT} have_fpos${EXT} have_fpos_pos${EXT} \ have_offscl${EXT} have_rusage${EXT} # these utility files and scripts may be created in the process of building # the BUILD_H_SRC file set # -UTIL_FILES= no_implicit.arg have_args.sh +UTIL_FILES= have_args.sh # Any .h files that are needed to compile sample code. # @@ -1738,6 +1771,9 @@ CUSTOM_PASSDOWN= \ TOUCH=${TOUCH} \ TRUE=${TRUE} \ VERSION=${VERSION} \ + VERS=${VERS} \ + VER=${VER} \ + VE=${VE} \ target=${target} # The complete list of Makefile vars passed down to help/Makefile. @@ -1892,14 +1928,11 @@ endif #if 0 /* start of skip for non-Gnu makefiles */ ifdef ALLOW_CUSTOM #endif /* end of skip for non-Gnu makefiles */ -SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \ - libcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VERSION} \ - libcustcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VER} \ - libcustcalc${LIB_EXT_VE} libcustcalc${LIB_EXT} +SYM_DYNAMIC_LIBS= libcalc${LIB_EXT} \ + libcustcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT} #if 0 /* start of skip for non-Gnu makefiles */ else -SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \ - libcalc${LIB_EXT_VERS} +SYM_DYNAMIC_LIBS= libcalc${LIB_EXT} endif #endif /* end of skip for non-Gnu makefiles */ @@ -2056,18 +2089,6 @@ libcalc${LIB_EXT_VERSION}: ${LIBOBJS} ver_calc${EXT} ${MAKE_FILE} ${CC} ${LIBCALC_SHLIB} ${LIBOBJS} \ ${READLINE_LIB} ${READLINE_EXTRAS} -o libcalc${LIB_EXT_VERSION} -libcalc${LIB_EXT_VERS}: libcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcalc${LIB_EXT_VER}: libcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcalc${LIB_EXT_VE}: libcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - libcalc${LIB_EXT}: libcalc${LIB_EXT_VERSION} ${Q} ${RM} -f $@ ${LN} -s $? $@ @@ -2121,7 +2142,7 @@ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ### # -# Special .o files +# Special .o files that may need special compile options # ### @@ -2129,8 +2150,12 @@ hist.o: hist.c ${MAKE_FILE} ${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} \ -c hist.c -seed.o: seed.c no_implicit.arg ${MAKE_FILE} - ${CC} ${CFLAGS} `${CAT} no_implicit.arg` -c seed.c +seed.o: seed.c ${MAKE_FILE} + ${CC} ${CFLAGS} ${WNO_IMPLICT} ${WNO_ERROR_LONG_LONG} \ + ${WNO_LONG_LONG} -c seed.c + +file.o: file.c ${MAKE_FILE} + ${CC} ${CFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} -c file.c ### # @@ -2297,8 +2322,8 @@ have_times.h: ${MAKE_FILE} ${Q} echo ' */' >> have_times.h ${Q} echo '' >> have_times.h ${Q} echo '' >> have_times.h - ${Q} echo '#if !defined(__HAVE_TIMES_H__)' >> have_times.h - ${Q} echo '#define __HAVE_TIMES_H__' >> have_times.h + ${Q} echo '#if !defined(CALC_HAVE_TIMES_H)' >> have_times.h + ${Q} echo '#define CALC_HAVE_TIMES_H' >> have_times.h ${Q} echo '' >> have_times.h ${Q} echo '' >> have_times.h ${Q} echo '/* do we have ? */' >> have_times.h @@ -2348,7 +2373,7 @@ have_times.h: ${MAKE_FILE} fi ${Q} echo '' >> have_times.h ${Q} echo '' >> have_times.h - ${Q} echo '#endif /* !__HAVE_TIMES_H__ */' >> have_times.h + ${Q} echo '#endif /* !CALC_HAVE_TIMES_H */' >> have_times.h ${Q} echo 'have_times.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -2368,8 +2393,8 @@ have_stdlib.h: ${MAKE_FILE} ${Q} echo ' */' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h - ${Q} echo '#if !defined(__HAVE_STDLIB_H__)' >> have_stdlib.h - ${Q} echo '#define __HAVE_STDLIB_H__' >> have_stdlib.h + ${Q} echo '#if !defined(CALC_HAVE_STDLIB_H)' >> have_stdlib.h + ${Q} echo '#define CALC_HAVE_STDLIB_H' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h ${Q} echo '/* do we have ? */' >> have_stdlib.h @@ -2386,7 +2411,7 @@ have_stdlib.h: ${MAKE_FILE} fi ${Q} echo '' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h - ${Q} echo '#endif /* !__HAVE_STDLIB_H__ */' >> have_stdlib.h + ${Q} echo '#endif /* !CALC_HAVE_STDLIB_H */' >> have_stdlib.h ${Q} echo 'have_stdlib.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -2406,8 +2431,8 @@ have_unistd.h: ${MAKE_FILE} ${Q} echo ' */' >> have_unistd.h ${Q} echo '' >> have_unistd.h ${Q} echo '' >> have_unistd.h - ${Q} echo '#if !defined(__HAVE_UNISTD_H__)' >> have_unistd.h - ${Q} echo '#define __HAVE_UNISTD_H__' >> have_unistd.h + ${Q} echo '#if !defined(CALC_HAVE_UNISTD_H)' >> have_unistd.h + ${Q} echo '#define CALC_HAVE_UNISTD_H' >> have_unistd.h ${Q} echo '' >> have_unistd.h ${Q} echo '' >> have_unistd.h ${Q} echo '/* do we have ? */' >> have_unistd.h @@ -2424,7 +2449,7 @@ have_unistd.h: ${MAKE_FILE} fi ${Q} echo '' >> have_unistd.h ${Q} echo '' >> have_unistd.h - ${Q} echo '#endif /* !__HAVE_UNISTD_H__ */' >> have_unistd.h + ${Q} echo '#endif /* !CALC_HAVE_UNISTD_H */' >> have_unistd.h ${Q} echo 'have_unistd.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -2444,8 +2469,8 @@ have_string.h: ${MAKE_FILE} ${Q} echo ' */' >> have_string.h ${Q} echo '' >> have_string.h ${Q} echo '' >> have_string.h - ${Q} echo '#if !defined(__HAVE_STRING_H__)' >> have_string.h - ${Q} echo '#define __HAVE_STRING_H__' >> have_string.h + ${Q} echo '#if !defined(CALC_HAVE_STRING_H)' >> have_string.h + ${Q} echo '#define CALC_HAVE_STRING_H' >> have_string.h ${Q} echo '' >> have_string.h ${Q} echo '' >> have_string.h ${Q} echo '/* do we have ? */' >> have_string.h @@ -2462,7 +2487,7 @@ have_string.h: ${MAKE_FILE} fi ${Q} echo '' >> have_string.h ${Q} echo '' >> have_string.h - ${Q} echo '#endif /* !__HAVE_STRING_H__ */' >> have_string.h + ${Q} echo '#endif /* !CALC_HAVE_STRING_H */' >> have_string.h ${Q} echo 'have_string.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -2546,8 +2571,8 @@ have_fpos.h: have_fpos.c ${MAKE_FILE} ${Q} echo ' */' >> have_fpos.h ${Q} echo '' >> have_fpos.h ${Q} echo '' >> have_fpos.h - ${Q} echo '#if !defined(__HAVE_FPOS_H__)' >> have_fpos.h - ${Q} echo '#define __HAVE_FPOS_H__' >> have_fpos.h + ${Q} echo '#if !defined(CALC_HAVE_FPOS_H)' >> have_fpos.h + ${Q} echo '#define CALC_HAVE_FPOS_H' >> have_fpos.h ${Q} echo '' >> have_fpos.h ${Q} echo '' >> have_fpos.h ${Q} echo '/* do we have fgetpos & fsetpos functions? */' >> have_fpos.h @@ -2567,7 +2592,7 @@ have_fpos.h: have_fpos.c ${MAKE_FILE} fi ${Q} echo '' >> have_fpos.h ${Q} echo '' >> have_fpos.h - ${Q} echo '#endif /* !__HAVE_FPOS_H__ */' >> have_fpos.h + ${Q} echo '#endif /* !CALC_HAVE_FPOS_H */' >> have_fpos.h ${Q} ${RM} -f have_fpos${EXT} have_fpos.o fpos_tmp ${Q} echo 'have_fpos.h formed' -@if [ -z "${Q}" ]; then \ @@ -2589,8 +2614,8 @@ have_fpos_pos.h: have_fpos_pos.c have_fpos.h have_posscl.h ${MAKE_FILE} ${Q} echo ' */' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h - ${Q} echo '#if !defined(__HAVE_FPOS_POS_H__)' >> have_fpos_pos.h - ${Q} echo '#define __HAVE_FPOS_POS_H__' >> have_fpos_pos.h + ${Q} echo '#if !defined(CALC_HAVE_FPOS_POS_H)' >> have_fpos_pos.h + ${Q} echo '#define CALC_HAVE_FPOS_POS_H' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h ${Q} echo '/* do we have fgetpos & fsetpos functions? */' \ @@ -2611,7 +2636,7 @@ have_fpos_pos.h: have_fpos_pos.c have_fpos.h have_posscl.h ${MAKE_FILE} fi ${Q} echo '' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h - ${Q} echo '#endif /* !__HAVE_FPOS_POS_H__ */' >> have_fpos_pos.h + ${Q} echo '#endif /* !CALC_HAVE_FPOS_POS_H */' >> have_fpos_pos.h ${Q} ${RM} -f have_fpos_pos${EXT} have_fpos_pos.o fpos_tmp ${Q} echo 'have_fpos_pos.h formed' -@if [ -z "${Q}" ]; then \ @@ -2668,8 +2693,8 @@ have_const.h: have_const.c ${MAKE_FILE} ${Q} echo ' */' >> have_const.h ${Q} echo '' >> have_const.h ${Q} echo '' >> have_const.h - ${Q} echo '#if !defined(__HAVE_CONST_H__)' >> have_const.h - ${Q} echo '#define __HAVE_CONST_H__' >> have_const.h + ${Q} echo '#if !defined(CALC_HAVE_CONST_H)' >> have_const.h + ${Q} echo '#define CALC_HAVE_CONST_H' >> have_const.h ${Q} echo '' >> have_const.h ${Q} echo '' >> have_const.h ${Q} echo '/* do we have or want const? */' >> have_const.h @@ -2689,7 +2714,7 @@ have_const.h: have_const.c ${MAKE_FILE} fi ${Q} echo '' >> have_const.h ${Q} echo '' >> have_const.h - ${Q} echo '#endif /* !__HAVE_CONST_H__ */' >> have_const.h + ${Q} echo '#endif /* !CALC_HAVE_CONST_H */' >> have_const.h ${Q} ${RM} -f have_const${EXT} have_const.o const_tmp ${Q} echo 'have_const.h formed' -@if [ -z "${Q}" ]; then \ @@ -2710,8 +2735,8 @@ have_offscl.h: have_offscl.c ${MAKE_FILE} ${Q} echo ' */' >> have_offscl.h ${Q} echo '' >> have_offscl.h ${Q} echo '' >> have_offscl.h - ${Q} echo '#if !defined(__HAVE_OFFSCL_H__)' >> have_offscl.h - ${Q} echo '#define __HAVE_OFFSCL_H__' >> have_offscl.h + ${Q} echo '#if !defined(CALC_HAVE_OFFSCL_H)' >> have_offscl.h + ${Q} echo '#define CALC_HAVE_OFFSCL_H' >> have_offscl.h ${Q} echo '' >> have_offscl.h ${Q} echo '' >> have_offscl.h ${Q} ${RM} -f have_offscl.o have_offscl${EXT} @@ -2729,7 +2754,7 @@ have_offscl.h: have_offscl.c ${MAKE_FILE} fi ${Q} echo '' >> have_offscl.h ${Q} echo '' >> have_offscl.h - ${Q} echo '#endif /* !__HAVE_OFFSCL_H__ */' >> have_offscl.h + ${Q} echo '#endif /* !CALC_HAVE_OFFSCL_H */' >> have_offscl.h ${Q} ${RM} -f have_offscl${EXT} have_offscl.o offscl_tmp ${Q} echo 'have_offscl.h formed' -@if [ -z "${Q}" ]; then \ @@ -2750,8 +2775,8 @@ have_posscl.h: have_posscl.c have_fpos.h ${MAKE_FILE} ${Q} echo ' */' >> have_posscl.h ${Q} echo '' >> have_posscl.h ${Q} echo '' >> have_posscl.h - ${Q} echo '#if !defined(__HAVE_POSSCL_H__)' >> have_posscl.h - ${Q} echo '#define __HAVE_POSSCL_H__' >> have_posscl.h + ${Q} echo '#if !defined(CALC_HAVE_POSSCL_H)' >> have_posscl.h + ${Q} echo '#define CALC_HAVE_POSSCL_H' >> have_posscl.h ${Q} echo '' >> have_posscl.h ${Q} echo '' >> have_posscl.h ${Q} ${RM} -f have_posscl.o have_posscl @@ -2769,7 +2794,7 @@ have_posscl.h: have_posscl.c have_fpos.h ${MAKE_FILE} fi ${Q} echo '' >> have_posscl.h ${Q} echo '' >> have_posscl.h - ${Q} echo '#endif /* !__HAVE_POSSCL_H__ */' >> have_posscl.h + ${Q} echo '#endif /* !CALC_HAVE_POSSCL_H */' >> have_posscl.h ${Q} ${RM} -f have_posscl have_posscl.o posscl_tmp ${Q} echo 'have_posscl.h formed' -@if [ -z "${Q}" ]; then \ @@ -2845,8 +2870,8 @@ have_uid_t.h: have_uid_t.c have_unistd.h ${MAKE_FILE} ${Q} echo ' */' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h - ${Q} echo '#if !defined(__HAVE_UID_T_H__)' >> have_uid_t.h - ${Q} echo '#define __HAVE_UID_T_H__' >> have_uid_t.h + ${Q} echo '#if !defined(CALC_HAVE_UID_T_H)' >> have_uid_t.h + ${Q} echo '#define CALC_HAVE_UID_T_H' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h ${Q} echo '/* do we have or want uid_t? */' >> have_uid_t.h @@ -2864,7 +2889,7 @@ have_uid_t.h: have_uid_t.c have_unistd.h ${MAKE_FILE} fi ${Q} echo '' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h - ${Q} echo '#endif /* !__HAVE_UID_T_H__ */' >> have_uid_t.h + ${Q} echo '#endif /* !CALC_HAVE_UID_T_H */' >> have_uid_t.h ${Q} ${RM} -f have_uid_t${EXT} have_uid_t.o uid_tmp ${Q} echo 'have_uid_t.h formed' -@if [ -z "${Q}" ]; then \ @@ -2885,8 +2910,8 @@ have_newstr.h: have_newstr.c ${MAKE_FILE} ${Q} echo ' */' >> have_newstr.h ${Q} echo '' >> have_newstr.h ${Q} echo '' >> have_newstr.h - ${Q} echo '#if !defined(__HAVE_NEWSTR_H__)' >> have_newstr.h - ${Q} echo '#define __HAVE_NEWSTR_H__' >> have_newstr.h + ${Q} echo '#if !defined(CALC_HAVE_NEWSTR_H)' >> have_newstr.h + ${Q} echo '#define CALC_HAVE_NEWSTR_H' >> have_newstr.h ${Q} echo '' >> have_newstr.h ${Q} echo '' >> have_newstr.h ${Q} echo '/* do we have or want memcpy(), memset() & strchr()? */' \ @@ -2905,7 +2930,7 @@ have_newstr.h: have_newstr.c ${MAKE_FILE} fi ${Q} echo '' >> have_newstr.h ${Q} echo '' >> have_newstr.h - ${Q} echo '#endif /* !__HAVE_NEWSTR_H__ */' >> have_newstr.h + ${Q} echo '#endif /* !CALC_HAVE_NEWSTR_H */' >> have_newstr.h ${Q} ${RM} -f have_newstr${EXT} have_newstr.o newstr_tmp ${Q} echo 'have_newstr.h formed' -@if [ -z "${Q}" ]; then \ @@ -2926,8 +2951,8 @@ have_memmv.h: have_memmv.c ${MAKE_FILE} ${Q} echo ' */' >> have_memmv.h ${Q} echo '' >> have_memmv.h ${Q} echo '' >> have_memmv.h - ${Q} echo '#if !defined(__HAVE_MEMMV_H__)' >> have_memmv.h - ${Q} echo '#define __HAVE_MEMMV_H__' >> have_memmv.h + ${Q} echo '#if !defined(CALC_HAVE_MEMMV_H)' >> have_memmv.h + ${Q} echo '#define CALC_HAVE_MEMMV_H' >> have_memmv.h ${Q} echo '' >> have_memmv.h ${Q} echo '' >> have_memmv.h ${Q} echo '/* do we have or want memmove()? */' >> have_memmv.h @@ -2945,7 +2970,7 @@ have_memmv.h: have_memmv.c ${MAKE_FILE} fi ${Q} echo '' >> have_memmv.h ${Q} echo '' >> have_memmv.h - ${Q} echo '#endif /* !__HAVE_MEMMV_H__ */' >> have_memmv.h + ${Q} echo '#endif /* !CALC_HAVE_MEMMV_H */' >> have_memmv.h ${Q} ${RM} -f have_memmv have_memmv.o memmv_tmp ${Q} echo 'have_memmv.h formed' -@if [ -z "${Q}" ]; then \ @@ -2966,8 +2991,8 @@ have_ustat.h: have_ustat.c ${MAKE_FILE} ${Q} echo ' */' >> have_ustat.h ${Q} echo '' >> have_ustat.h ${Q} echo '' >> have_ustat.h - ${Q} echo '#if !defined(__HAVE_USTAT_H__)' >> have_ustat.h - ${Q} echo '#define __HAVE_USTAT_H__' >> have_ustat.h + ${Q} echo '#if !defined(CALC_HAVE_USTAT_H)' >> have_ustat.h + ${Q} echo '#define CALC_HAVE_USTAT_H' >> have_ustat.h ${Q} echo '' >> have_ustat.h ${Q} echo '' >> have_ustat.h ${Q} echo '/* do we have or want ustat()? */' >> have_ustat.h @@ -2985,7 +3010,7 @@ have_ustat.h: have_ustat.c ${MAKE_FILE} fi ${Q} echo '' >> have_ustat.h ${Q} echo '' >> have_ustat.h - ${Q} echo '#endif /* !__HAVE_USTAT_H__ */' >> have_ustat.h + ${Q} echo '#endif /* !CALC_HAVE_USTAT_H */' >> have_ustat.h ${Q} ${RM} -f have_ustat${EXT} have_ustat.o ustat_tmp ${Q} echo 'have_ustat.h formed' -@if [ -z "${Q}" ]; then \ @@ -3006,8 +3031,8 @@ have_getsid.h: have_getsid.c ${MAKE_FILE} ${Q} echo ' */' >> have_getsid.h ${Q} echo '' >> have_getsid.h ${Q} echo '' >> have_getsid.h - ${Q} echo '#if !defined(__HAVE_GETSID_H__)' >> have_getsid.h - ${Q} echo '#define __HAVE_GETSID_H__' >> have_getsid.h + ${Q} echo '#if !defined(CALC_HAVE_GETSID_H)' >> have_getsid.h + ${Q} echo '#define CALC_HAVE_GETSID_H' >> have_getsid.h ${Q} echo '' >> have_getsid.h ${Q} echo '' >> have_getsid.h ${Q} echo '/* do we have or want getsid()? */' >> have_getsid.h @@ -3025,7 +3050,7 @@ have_getsid.h: have_getsid.c ${MAKE_FILE} fi ${Q} echo '' >> have_getsid.h ${Q} echo '' >> have_getsid.h - ${Q} echo '#endif /* !__HAVE_GETSID_H__ */' >> have_getsid.h + ${Q} echo '#endif /* !CALC_HAVE_GETSID_H */' >> have_getsid.h ${Q} ${RM} -f have_getsid${EXT} have_getsid.o getsid_tmp ${Q} echo 'have_getsid.h formed' -@if [ -z "${Q}" ]; then \ @@ -3047,8 +3072,8 @@ have_getpgid.h: have_getpgid.c ${MAKE_FILE} ${Q} echo ' */' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h - ${Q} echo '#if !defined(__HAVE_GETPGID_H__)' >> have_getpgid.h - ${Q} echo '#define __HAVE_GETPGID_H__' >> have_getpgid.h + ${Q} echo '#if !defined(CALC_HAVE_GETPGID_H)' >> have_getpgid.h + ${Q} echo '#define CALC_HAVE_GETPGID_H' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h ${Q} echo '/* do we have or want getpgid()? */' >> have_getpgid.h @@ -3066,7 +3091,7 @@ have_getpgid.h: have_getpgid.c ${MAKE_FILE} fi ${Q} echo '' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h - ${Q} echo '#endif /* !__HAVE_GETPGID_H__ */' >> have_getpgid.h + ${Q} echo '#endif /* !CALC_HAVE_GETPGID_H */' >> have_getpgid.h ${Q} ${RM} -f have_getpgid${EXT} have_getpgid.o getpgid_tmp ${Q} echo 'have_getpgid.h formed' -@if [ -z "${Q}" ]; then \ @@ -3088,8 +3113,8 @@ have_gettime.h: have_gettime.c ${MAKE_FILE} ${Q} echo ' */' >> have_gettime.h ${Q} echo '' >> have_gettime.h ${Q} echo '' >> have_gettime.h - ${Q} echo '#if !defined(__HAVE_GETTIME_H__)' >> have_gettime.h - ${Q} echo '#define __HAVE_GETTIME_H__' >> have_gettime.h + ${Q} echo '#if !defined(CALC_HAVE_GETTIME_H)' >> have_gettime.h + ${Q} echo '#define CALC_HAVE_GETTIME_H' >> have_gettime.h ${Q} echo '' >> have_gettime.h ${Q} echo '' >> have_gettime.h ${Q} echo '/* do we have or want clock_gettime()? */' >> have_gettime.h @@ -3107,7 +3132,7 @@ have_gettime.h: have_gettime.c ${MAKE_FILE} fi ${Q} echo '' >> have_gettime.h ${Q} echo '' >> have_gettime.h - ${Q} echo '#endif /* !__HAVE_GETTIME_H__ */' >> have_gettime.h + ${Q} echo '#endif /* !CALC_HAVE_GETTIME_H */' >> have_gettime.h ${Q} ${RM} -f have_gettime${EXT} have_gettime.o gettime_tmp ${Q} echo 'have_gettime.h formed' -@if [ -z "${Q}" ]; then \ @@ -3129,8 +3154,8 @@ have_getprid.h: have_getprid.c ${MAKE_FILE} ${Q} echo ' */' >> have_getprid.h ${Q} echo '' >> have_getprid.h ${Q} echo '' >> have_getprid.h - ${Q} echo '#if !defined(__HAVE_GETPRID_H__)' >> have_getprid.h - ${Q} echo '#define __HAVE_GETPRID_H__' >> have_getprid.h + ${Q} echo '#if !defined(CALC_HAVE_GETPRID_H)' >> have_getprid.h + ${Q} echo '#define CALC_HAVE_GETPRID_H' >> have_getprid.h ${Q} echo '' >> have_getprid.h ${Q} echo '' >> have_getprid.h ${Q} echo '/* do we have or want getprid()? */' >> have_getprid.h @@ -3148,7 +3173,7 @@ have_getprid.h: have_getprid.c ${MAKE_FILE} fi ${Q} echo '' >> have_getprid.h ${Q} echo '' >> have_getprid.h - ${Q} echo '#endif /* !__HAVE_GETPRID_H__ */' >> have_getprid.h + ${Q} echo '#endif /* !CALC_HAVE_GETPRID_H */' >> have_getprid.h ${Q} ${RM} -f have_getprid${EXT} have_getprid.o getprid_tmp ${Q} echo 'have_getprid.h formed' -@if [ -z "${Q}" ]; then \ @@ -3170,8 +3195,8 @@ have_urandom.h: ${MAKE_FILE} ${Q} echo ' */' >> have_urandom.h ${Q} echo '' >> have_urandom.h ${Q} echo '' >> have_urandom.h - ${Q} echo '#if !defined(__HAVE_URANDOM_H__)' >> have_urandom.h - ${Q} echo '#define __HAVE_URANDOM_H__' >> have_urandom.h + ${Q} echo '#if !defined(CALC_HAVE_URANDOM_H)' >> have_urandom.h + ${Q} echo '#define CALC_HAVE_URANDOM_H' >> have_urandom.h ${Q} echo '' >> have_urandom.h ${Q} echo '' >> have_urandom.h ${Q} echo '/* do we have /dev/urandom? */' >> have_urandom.h @@ -3186,7 +3211,7 @@ have_urandom.h: ${MAKE_FILE} fi ${Q} echo '' >> have_urandom.h ${Q} echo '' >> have_urandom.h - ${Q} echo '#endif /* !__HAVE_URANDOM_H__ */' >> have_urandom.h + ${Q} echo '#endif /* !CALC_HAVE_URANDOM_H */' >> have_urandom.h ${Q} echo 'have_urandom.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -3207,8 +3232,8 @@ have_rusage.h: have_rusage.c ${MAKE_FILE} ${Q} echo ' */' >> have_rusage.h ${Q} echo '' >> have_rusage.h ${Q} echo '' >> have_rusage.h - ${Q} echo '#if !defined(__HAVE_RUSAGE_H__)' >> have_rusage.h - ${Q} echo '#define __HAVE_RUSAGE_H__' >> have_rusage.h + ${Q} echo '#if !defined(CALC_HAVE_RUSAGE_H)' >> have_rusage.h + ${Q} echo '#define CALC_HAVE_RUSAGE_H' >> have_rusage.h ${Q} echo '' >> have_rusage.h ${Q} echo '' >> have_rusage.h ${Q} echo '/* do we have or want getrusage()? */' >> have_rusage.h @@ -3226,7 +3251,7 @@ have_rusage.h: have_rusage.c ${MAKE_FILE} fi ${Q} echo '' >> have_rusage.h ${Q} echo '' >> have_rusage.h - ${Q} echo '#endif /* !__HAVE_RUSAGE_H__ */' >> have_rusage.h + ${Q} echo '#endif /* !CALC_HAVE_RUSAGE_H */' >> have_rusage.h ${Q} ${RM} -f have_rusage${EXT} have_rusage.o rusage_tmp ${Q} echo 'have_rusage.h formed' -@if [ -z "${Q}" ]; then \ @@ -3247,8 +3272,8 @@ have_strdup.h: have_strdup.c ${MAKE_FILE} ${Q} echo ' */' >> have_strdup.h ${Q} echo '' >> have_strdup.h ${Q} echo '' >> have_strdup.h - ${Q} echo '#if !defined(__HAVE_STRDUP_H__)' >> have_strdup.h - ${Q} echo '#define __HAVE_STRDUP_H__' >> have_strdup.h + ${Q} echo '#if !defined(CALC_HAVE_STRDUP_H)' >> have_strdup.h + ${Q} echo '#define CALC_HAVE_STRDUP_H' >> have_strdup.h ${Q} echo '' >> have_strdup.h ${Q} echo '' >> have_strdup.h ${Q} echo '/* do we have or want getstrdup()? */' >> have_strdup.h @@ -3266,7 +3291,7 @@ have_strdup.h: have_strdup.c ${MAKE_FILE} fi ${Q} echo '' >> have_strdup.h ${Q} echo '' >> have_strdup.h - ${Q} echo '#endif /* !__HAVE_STRDUP_H__ */' >> have_strdup.h + ${Q} echo '#endif /* !CALC_HAVE_STRDUP_H */' >> have_strdup.h ${Q} ${RM} -f have_strdup${EXT} have_strdup.o strdup_tmp ${Q} echo 'have_strdup.h formed' -@if [ -z "${Q}" ]; then \ @@ -3392,32 +3417,6 @@ calcerr.c: calcerr.tbl calcerr_c.sed calcerr_c.awk ${MAKE_FILE} ${TRUE}; \ fi -no_implicit.arg: no_implicit.c ${MAKE_FILE} - ${Q} ${RM} -f no_implicit${EXT} no_implicit.o no_implicit.arg - ${Q} echo 'forming no_implicit.arg' - -${Q} if [ X"${HAVE_NO_IMPLICIT}" = X"YES" ]; then \ - echo ""'-Wno-implicit' > no_implicit.arg; \ - elif [ X"${HAVE_NO_IMPLICIT}" = X"NO" ]; then \ - ${TOUCH} no_implicit.arg; \ - else \ - ${LCC} -Wno-implicit ${ICFLAGS} -DHAVE_NO_IMPLICIT \ - no_implicit.c -c >/dev/null 2>&1; \ - ${LCC} ${ILDFLAGS} no_implicit.o -o no_implicit${EXT} \ - >/dev/null 2>&1; \ - ${SHELL} -c "./no_implicit${EXT} > no_implicit.arg 2>/dev/null" \ - >/dev/null 2>&1; ${TRUE}; \ - fi - ${Q} echo 'no_implicit.arg formed' - -@if [ -z "${Q}" ]; then \ - echo ''; \ - echo '=-=-= start of $@ =-=-='; \ - ${CAT} $@; \ - echo '=-=-= end of $@ =-=-='; \ - echo ''; \ - else \ - ${TRUE}; \ - fi - have_unused.h: have_unused.c ${MAKE_FILE} ${Q} ${RM} -f unused_tmp have_unused.h ${Q} echo 'forming have_unused.h' @@ -3426,8 +3425,8 @@ have_unused.h: have_unused.c ${MAKE_FILE} ${Q} echo ' */' >> have_unused.h ${Q} echo '' >> have_unused.h ${Q} echo '' >> have_unused.h - ${Q} echo '#if !defined(__HAVE_UNUSED_H__)' >> have_unused.h - ${Q} echo '#define __HAVE_UNUSED_H__' >> have_unused.h + ${Q} echo '#if !defined(CALC_HAVE_UNUSED_H)' >> have_unused.h + ${Q} echo '#define CALC_HAVE_UNUSED_H' >> have_unused.h ${Q} echo '' >> have_unused.h ${Q} echo '' >> have_unused.h ${Q} echo '/* do we have/want the unused attribute? */' >> have_unused.h @@ -3447,7 +3446,7 @@ have_unused.h: have_unused.c ${MAKE_FILE} fi ${Q} echo '' >> have_unused.h ${Q} echo '' >> have_unused.h - ${Q} echo '#endif /* !__HAVE_UNUSED_H__ */' >> have_unused.h + ${Q} echo '#endif /* !CALC_HAVE_UNUSED_H */' >> have_unused.h ${Q} ${RM} -f have_unused${EXT} have_unused.o unused_tmp ${Q} echo 'have_unused.h formed' -@if [ -z "${Q}" ]; then \ @@ -3472,7 +3471,7 @@ have_unused.h: have_unused.c ${MAKE_FILE} win32_hsrc: win32.mkdef ${MAKE_FILE} ${Q} echo 'forming win32 directory' ${Q} ${RM} -rf win32 - ${Q} ${MKDIR} win32 + ${Q} ${MKDIR} -p win32 ${Q} ${CP} ${UTIL_C_SRC} win32 ${Q} ${CP} ${UTIL_MISC_SRC} win32 ${Q} ${CP} ${MAKE_FILE} win32/${MAKE_FILE} @@ -3571,18 +3570,6 @@ libcustcalc${LIB_EXT_VERSION}: custom/libcustcalc${LIB_EXT_VERSION} ${Q} ${RM} -f $@ ${CP} -p $? $@ -libcustcalc${LIB_EXT_VERS}: custom/libcustcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcustcalc${LIB_EXT_VER}: libcustcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcustcalc${LIB_EXT_VE}: libcustcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - libcustcalc${LIB_EXT}: libcustcalc${LIB_EXT_VERSION} ${Q} ${RM} -f $@ ${LN} -s $? $@ @@ -3656,12 +3643,12 @@ depend: custom/Makefile hsrc ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${Q} echo forming skel ${Q} ${RM} -rf skel - ${Q} ${MKDIR} skel + ${Q} ${MKDIR} -p skel -${Q} for i in ${C_SRC} ${BUILD_C_SRC}; do \ ${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \ ${GREP} -v '\.\./getopt/getopt\.h' > "skel/$$i"; \ done - ${Q} ${MKDIR} skel/custom + ${Q} ${MKDIR} -p skel/custom -${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'`"; \ @@ -3728,6 +3715,28 @@ h_list: # version string. Note that the full version could be 4 # or 3 levels long depending on the minor patch number. # +# version: +# This rule simply echoes the value found in this makefile. +# This rule produces the full version string. Note that the +# full version could be 4 or 3 levels long depending on the +# minor patch number. +# +### + +calc_version: ver_calc${EXT} + @./ver_calc${EXT} + +version: + @echo ${VERSION} + +ver_calc${EXT}: version.c have_unused.h + ${RM} -f $@ + ${LCC} ${ICFLAGS} -DCALC_VER ${ILDFLAGS} version.c -o $@ + +### +# +# legacy partial versions are no longer used, only removed +# # calc_vers: # This rule is the most accurate as it uses calc source to # produce the version value. This rule produces only a @@ -3743,12 +3752,6 @@ h_list: # produce the version value. This rule produces only a # 1 level version string. # -# version: -# This rule simply echoes the value found in this makefile. -# This rule produces the full version string. Note that the -# full version could be 4 or 3 levels long depending on the -# minor patch number. -# # vers: # This rule simply echoes the value found in this makefile. # This rule produces only a 3 level version string. @@ -3763,9 +3766,6 @@ h_list: # ### -calc_version: ver_calc${EXT} - @./ver_calc${EXT} - calc_vers: ver_calc${EXT} @./ver_calc${EXT} -V @@ -3775,9 +3775,6 @@ calc_ver: ver_calc${EXT} calc_ve: ver_calc${EXT} @./ver_calc${EXT} -V | ${SED} -e 's/\.[^.]*\.[^.]*$$//' -version: - @echo ${VERSION} - vers: @echo ${VERS} @@ -3787,10 +3784,6 @@ ver: ve: @echo ${VE} -ver_calc${EXT}: version.c have_unused.h - ${RM} -f $@ - ${LCC} ${ICFLAGS} -DCALC_VER ${ILDFLAGS} version.c -o $@ - ### # # File distribution list generation. You can ignore this section. @@ -3975,7 +3968,6 @@ env: @echo 'HAVE_GETTIME=${HAVE_GETTIME}'; echo '' @echo 'HAVE_MEMMOVE=${HAVE_MEMMOVE}'; echo '' @echo 'HAVE_NEWSTR=${HAVE_NEWSTR}'; echo '' - @echo 'HAVE_NO_IMPLICIT=${HAVE_NO_IMPLICIT}'; echo '' @echo 'HAVE_OFFSCL=${HAVE_OFFSCL}'; echo '' @echo 'HAVE_POSSCL=${HAVE_POSSCL}'; echo '' @echo 'HAVE_STDLIB_H=${HAVE_STDLIB_H}'; echo '' @@ -4023,7 +4015,6 @@ env: @echo 'MANMAKE=${MANMAKE}'; echo '' @echo 'MANMODE=${MANMODE}'; echo '' @echo 'MKDIR=${MKDIR}'; echo '' - @echo 'MKDIR_ARG=${MKDIR_ARG}'; echo '' @echo 'MV=${MV}'; echo '' @echo 'NROFF=${NROFF}'; echo '' @echo 'NROFF_ARG=${NROFF_ARG}'; echo '' @@ -4064,7 +4055,6 @@ env: @echo 'UTIL_PROGS=${UTIL_PROGS}'; echo '' @echo 'UTIL_TMP=${UTIL_TMP}'; echo '' @echo 'V=${V}'; echo '' - @echo 'VERS=${VERS}'; echo '' @echo 'VERSION=${VERSION}'; echo '' @echo 'XARGS=${XARGS}'; echo '' @echo 'target=${target}'; echo '' @@ -4296,14 +4286,8 @@ clobber: custom/Makefile clean ${RM} -rf gen_h skel Makefile.bak tmp.patch ${RM} -f calc.spec inst_files rpm.mk.patch tmp ${RM} -f libcalc${LIB_EXT_VERSION} - ${RM} -f libcalc${LIB_EXT_VERS} - ${RM} -f libcalc${LIB_EXT_VER} - ${RM} -f libcalc${LIB_EXT_VE} ${RM} -f libcalc*${LIB_EXT} ${RM} -f libcustcalc${LIB_EXT_VERSION} - ${RM} -f libcustcalc${LIB_EXT_VERS} - ${RM} -f libcustcalc${LIB_EXT_VER} - ${RM} -f libcustcalc${LIB_EXT_VE} ${RM} -f libcustcalc*${LIB_EXT} ${RM} -f libcustcalc.a ${RM} -f calc-static${EXT} @@ -4322,7 +4306,15 @@ clobber: custom/Makefile clean cd cscript; ${RM} -f all; ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} $@ ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo remove files that are obsolete + ${RM} -f libcalc${LIB_EXT_VERS} + ${RM} -f libcalc${LIB_EXT_VER} + ${RM} -f libcalc${LIB_EXT_VE} + ${RM} -f libcustcalc${LIB_EXT_VERS} + ${RM} -f libcustcalc${LIB_EXT_VER} + ${RM} -f libcustcalc${LIB_EXT_VE} ${RM} -rf win32 build + ${RM} -f no_implicit.arg + ${RM} -f no_implicit.c no_implicit.o no_implicit${EXT} #if 0 /* start of skip for non-Gnu makefiles */ ${RM} -f Makefile.simple ${RM} -f custom/Makefile @@ -4339,55 +4331,55 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' -${Q} if [ ! -z "${T}" ]; then \ if [ ! -d ${T} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}; \ - ${MKDIR} ${MKDIR_ARG} ${T}; \ + echo ${MKDIR} -p ${T}; \ + ${MKDIR} -p ${T}; \ echo ${CHMOD} 0755 ${T}; \ ${CHMOD} 0755 ${T}; \ fi; \ fi -${Q} if [ ! -d ${T}${BINDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${BINDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${BINDIR}; \ + echo ${MKDIR} -p ${T}${BINDIR}; \ + ${MKDIR} -p ${T}${BINDIR}; \ echo ${CHMOD} 0755 ${T}${BINDIR}; \ ${CHMOD} 0755 ${T}${BINDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${INCDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${INCDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${INCDIR}; \ + echo ${MKDIR} -p ${T}${INCDIR}; \ + ${MKDIR} -p ${T}${INCDIR}; \ echo ${CHMOD} 0755 ${T}${INCDIR}; \ ${CHMOD} 0755 ${T}${INCDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${LIBDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${LIBDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${LIBDIR}; \ + echo ${MKDIR} -p ${T}${LIBDIR}; \ + ${MKDIR} -p ${T}${LIBDIR}; \ echo ${CHMOD} 0755 ${T}${LIBDIR}; \ ${CHMOD} 0755 ${T}${LIBDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ - ${MKDIR} ${MKDIR_ARG} ${T}${CALC_SHAREDIR}; \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CALC_SHAREDIR}; \ + ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ + echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ echo ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \ ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${HELPDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${HELPDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${HELPDIR}; \ + echo ${MKDIR} -p ${T}${HELPDIR}; \ + ${MKDIR} -p ${T}${HELPDIR}; \ echo ${CHMOD} 0755 ${T}${HELPDIR}; \ ${CHMOD} 0755 ${T}${HELPDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CALC_INCDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CALC_INCDIR}; \ + echo ${MKDIR} -p ${T}${CALC_INCDIR}; \ + ${MKDIR} -p ${T}${CALC_INCDIR}; \ echo ${CHMOD} 0755 ${T}${CALC_INCDIR}; \ ${CHMOD} 0755 ${T}${CALC_INCDIR}; \ else \ @@ -4397,24 +4389,24 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all ifdef ALLOW_CUSTOM #endif /* end of skip for non-Gnu makefiles */ -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMCALDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMCALDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ + ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ echo ${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \ ${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMHELPDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMHELPDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ + ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ echo ${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \ ${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMINCDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMINCDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ + ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ echo ${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \ ${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \ else \ @@ -4424,8 +4416,8 @@ ifdef ALLOW_CUSTOM endif #endif /* end of skip for non-Gnu makefiles */ -${Q} if [ ! -d ${T}${SCRIPTDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${SCRIPTDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${SCRIPTDIR}; \ + echo ${MKDIR} -p ${T}${SCRIPTDIR}; \ + ${MKDIR} -p ${T}${SCRIPTDIR}; \ echo ${CHMOD} 0755 ${T}${SCRIPTDIR}; \ ${CHMOD} 0755 ${T}${SCRIPTDIR}; \ else \ @@ -4433,8 +4425,8 @@ endif fi -${Q} if [ ! -z "${MANDIR}" ]; then \ if [ ! -d ${T}${MANDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${MANDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${MANDIR}; \ + echo ${MKDIR} -p ${T}${MANDIR}; \ + ${MKDIR} -p ${T}${MANDIR}; \ echo ${CHMOD} 0755 ${T}${MANDIR}; \ ${CHMOD} 0755 ${T}${MANDIR}; \ else \ @@ -4445,8 +4437,8 @@ endif fi -${Q} if [ ! -z "${CATDIR}" ]; then \ if [ ! -d ${T}${CATDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CATDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CATDIR}; \ + echo ${MKDIR} -p ${T}${CATDIR}; \ + ${MKDIR} -p ${T}${CATDIR}; \ echo ${CHMOD} 0755 ${T}${CATDIR}; \ ${CHMOD} 0755 ${T}${CATDIR}; \ else \ @@ -4524,15 +4516,27 @@ endif ${MV} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \ - ${LN} -f -s libcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcalc${LIB_EXT_VERS}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VERS}"; \ - ${LN} -f -s libcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcalc${LIB_EXT_VER}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VER}"; \ - ${LN} -f -s libcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcalc${LIB_EXT_VE}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VE}"; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VERS}" ]; then \ + if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERS}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERS}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcalc${LIB_EXT_VERS}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VER}" ]; then \ + if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VER}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VER}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcalc${LIB_EXT_VER}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VE}" ]; then \ + if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VE}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VE}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcalc${LIB_EXT_VE}"; \ + fi; \ + fi; \ ${LN} -f -s libcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcalc${LIB_EXT}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT}"; \ @@ -4543,15 +4547,27 @@ endif ${MV} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \ - ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}; \ - echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \ - ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}; \ - echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \ - ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VE}"; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VERS}" ]; then \ + if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VER}" ]; then \ + if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VE}" ]; then \ + if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \ + fi; \ + fi; \ ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcustcalc${LIB_EXT}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT}"; \ @@ -5340,6 +5356,7 @@ have_offscl.o: have_offscl.c have_posscl.o: have_fpos.h have_posscl.o: have_posscl.c have_rusage.o: have_rusage.c +have_stdvs.o: have_stdlib.h have_stdvs.o: have_stdvs.c have_stdvs.o: have_string.h have_stdvs.o: have_unistd.h @@ -5582,7 +5599,6 @@ math_error.o: sha1.h math_error.o: str.h math_error.o: value.h math_error.o: zmath.h -no_implicit.o: no_implicit.c obj.o: alloc.h obj.o: block.h obj.o: byteswap.h diff --git a/Makefile.simple b/Makefile.simple index d0a954c..de301f1 100644 --- a/Makefile.simple +++ b/Makefile.simple @@ -23,7 +23,7 @@ # READLINE_LIB= -lreadline # READLINE_EXTRAS= -lhistory -lncurses # -# Copyright (C) 1999-2008 Landon Curt Noll +# Copyright (C) 1999-2014 Landon Curt Noll # # Calc is open software; you can redistribute it and/or modify it under # the terms of version 2.1 of the GNU Lesser General Public License @@ -39,8 +39,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: 30.60 $$ -# @(#) $Id: Makefile.ship,v 30.60 2013/09/27 08:55:27 chongo Exp $ +MAKEFILE_REV= $$Revision: 30.75 $$ +# @(#) $Id: Makefile.ship,v 30.75 2014/09/21 14:09:18 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $ # # Under source code control: 1990/02/15 01:48:41 @@ -530,18 +530,6 @@ HAVE_UNISTD_H= #HAVE_UNISTD_H= YES #HAVE_UNISTD_H= NO -# Determine if our compiler allows the -Wno-implicit flag -# -# HAVE_NO_IMPLICIT= let the Makefile test the -Wno-implicit flag -# HAVE_NO_IMPLICIT= NO Our compiler does not have -Wno-implicit flags -# HAVE_NO_IMPLICIT= YES Our compiler has a -Wno-implicit flag -# -# Select HAVE_NO_IMPLICIT= for DJGPP. -# -HAVE_NO_IMPLICIT= -# HAVE_NO_IMPLICIT= NO -# HAVE_NO_IMPLICIT= YES - # Determine if our compiler allows the unused attribute # # If HAVE_UNUSED is empty, this Makefile will run the have_unused program @@ -934,30 +922,20 @@ LD_DEBUG= # are useful for SGI IRIX people who have 'WorkShop Performance Tools' # and who also set 'LD_DEBUG= -lmalloc_cv' above. # -# If in doubt, use CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom +# If in doubt, use: # -CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ +# CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=. +# +CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. +#CALC_ENV= CALCPATH=./cal DYLD_LIBRARY_PATH=. \ +# MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 LD_LIBRARY_PATH=.:./custom -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ +#CALC_ENV= CALCPATH=./cal DYLD_LIBRARY_PATH=. \ +# MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 MALLOC_CLEAR_FREE=1 \ # MALLOC_CLEAR_MALLOC=1 LD_LIBRARY_PATH=.:./custom -# The install rule uses: -# -# ${MKDIR} ${MKDIR_ARG} -# -# to create directories. Normally this amounts to using mkdir -p dir ... -# Some older systems may not have mkdir -p. If your system does not -# have mkdir -p, then set MKDIR_ARG to empty. -# -# MKDIR_ARG= -p # use mkdir -p when creating paths -# MKDIR_ARG= # use if system does not understand mkdir -p -# -MKDIR_ARG= -p -#MKDIR_ARG= - # Some out of date operating systems require/want an executable to # end with a certain file extension. Some compiler systems such as # windoz build calc as calc.exe. The EXT variable is used to denote @@ -974,15 +952,18 @@ EXT= # The default calc versions # -VERSION= 2.12.4.13 -VERS= 2.12.4 -VER= 2.12 -VE= 2 +VERSION= 2.12.4.14 # Names of shared libraries with versions # LIB_EXT= .so LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} + +# legacy partial versions are no longer used, only removed +# +VERS= 2.12.4 +VER= 2.12 +VE= 2 LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VE= ${LIB_EXT}.${VE} @@ -1082,6 +1063,17 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS} # # CCOPT are flags given to ${CC} for optimization # CCWARN are flags given to ${CC} for warning message control +# +# WNO_IMPLICT, WNO_ERROR_LONG_LONG and WNO_LONG_LONG are given to ${CC} +# when compiling special .o files that may need special compile options +# NOTE: These flags simply turn off certain compiler warnings, +# which is useful only when CCWERR is set to -Werror. +# NOTE: If your compiler does not have these -Wno files, just +# set these variables to nothing as in: +# WNO_IMPLICT= +# WNO_ERROR_LONG_LONG= +# WNO_LONG_LONG= +# # CCWERR are flags given to ${CC} to make warnings fatal errors # NOTE: CCWERR is only set in development Makefiles and must only be # used with ${CC}, not ${LCC}. If you do not want the compiler @@ -1118,7 +1110,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1234,7 +1229,7 @@ UTIL_C_SRC= align32.c endian.c longbits.c have_newstr.c have_uid_t.c \ have_fpos_pos.c have_offscl.c have_posscl.c have_memmv.c \ have_ustat.c have_getsid.c have_getpgid.c \ have_gettime.c have_getprid.c have_rusage.c have_strdup.c \ - no_implicit.c have_unused.c + have_unused.c # these awk and sed tools are used in the process of building BUILD_H_SRC # and BUILD_C_SRC @@ -1251,7 +1246,7 @@ UTIL_OBJS= endian.o longbits.o have_newstr.o have_uid_t.o \ try_strarg.o have_stdvs.o have_varvs.o have_posscl.o have_memmv.o \ have_ustat.o have_getsid.o have_getpgid.o \ have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o \ - no_implicit.o have_unused.o + have_unused.o # these temp files may be created (and removed) during the build of BUILD_C_SRC # @@ -1266,14 +1261,14 @@ UTIL_PROGS= align32${EXT} fposval${EXT} have_uid_t${EXT} have_const${EXT} \ endian${EXT} longbits${EXT} have_newstr${EXT} have_stdvs${EXT} \ have_varvs${EXT} have_ustat${EXT} have_getsid${EXT} \ have_getpgid${EXT} have_gettime${EXT} have_getprid${EXT} \ - ver_calc${EXT} have_strdup${EXT} no_implicit${EXT} \ + ver_calc${EXT} have_strdup${EXT} \ have_unused${EXT} have_fpos${EXT} have_fpos_pos${EXT} \ have_offscl${EXT} have_rusage${EXT} # these utility files and scripts may be created in the process of building # the BUILD_H_SRC file set # -UTIL_FILES= no_implicit.arg have_args.sh +UTIL_FILES= have_args.sh # Any .h files that are needed to compile sample code. # @@ -1352,6 +1347,9 @@ CUSTOM_PASSDOWN= \ TOUCH=${TOUCH} \ TRUE=${TRUE} \ VERSION=${VERSION} \ + VERS=${VERS} \ + VER=${VER} \ + VE=${VE} \ target=${target} # The complete list of Makefile vars passed down to help/Makefile. @@ -1487,10 +1485,8 @@ CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT_VERSION} # Symlinks of dynamic shared libraries # -SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \ - libcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VERSION} \ - libcustcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VER} \ - libcustcalc${LIB_EXT_VE} libcustcalc${LIB_EXT} +SYM_DYNAMIC_LIBS= libcalc${LIB_EXT} \ + libcustcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT} # list of sample programs that need to be built to satisfy sample rule # @@ -1637,18 +1633,6 @@ libcalc${LIB_EXT_VERSION}: ${LIBOBJS} ver_calc${EXT} ${MAKE_FILE} ${CC} ${LIBCALC_SHLIB} ${LIBOBJS} \ ${READLINE_LIB} ${READLINE_EXTRAS} -o libcalc${LIB_EXT_VERSION} -libcalc${LIB_EXT_VERS}: libcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcalc${LIB_EXT_VER}: libcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcalc${LIB_EXT_VE}: libcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - libcalc${LIB_EXT}: libcalc${LIB_EXT_VERSION} ${Q} ${RM} -f $@ ${LN} -s $? $@ @@ -1702,7 +1686,7 @@ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ### # -# Special .o files +# Special .o files that may need special compile options # ### @@ -1710,8 +1694,12 @@ hist.o: hist.c ${MAKE_FILE} ${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} \ -c hist.c -seed.o: seed.c no_implicit.arg ${MAKE_FILE} - ${CC} ${CFLAGS} `${CAT} no_implicit.arg` -c seed.c +seed.o: seed.c ${MAKE_FILE} + ${CC} ${CFLAGS} ${WNO_IMPLICT} ${WNO_ERROR_LONG_LONG} \ + ${WNO_LONG_LONG} -c seed.c + +file.o: file.c ${MAKE_FILE} + ${CC} ${CFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} -c file.c ### # @@ -1872,8 +1860,8 @@ have_times.h: ${MAKE_FILE} ${Q} echo ' */' >> have_times.h ${Q} echo '' >> have_times.h ${Q} echo '' >> have_times.h - ${Q} echo '#if !defined(__HAVE_TIMES_H__)' >> have_times.h - ${Q} echo '#define __HAVE_TIMES_H__' >> have_times.h + ${Q} echo '#if !defined(CALC_HAVE_TIMES_H)' >> have_times.h + ${Q} echo '#define CALC_HAVE_TIMES_H' >> have_times.h ${Q} echo '' >> have_times.h ${Q} echo '' >> have_times.h ${Q} echo '/* do we have ? */' >> have_times.h @@ -1923,7 +1911,7 @@ have_times.h: ${MAKE_FILE} fi ${Q} echo '' >> have_times.h ${Q} echo '' >> have_times.h - ${Q} echo '#endif /* !__HAVE_TIMES_H__ */' >> have_times.h + ${Q} echo '#endif /* !CALC_HAVE_TIMES_H */' >> have_times.h ${Q} echo 'have_times.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -1943,8 +1931,8 @@ have_stdlib.h: ${MAKE_FILE} ${Q} echo ' */' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h - ${Q} echo '#if !defined(__HAVE_STDLIB_H__)' >> have_stdlib.h - ${Q} echo '#define __HAVE_STDLIB_H__' >> have_stdlib.h + ${Q} echo '#if !defined(CALC_HAVE_STDLIB_H)' >> have_stdlib.h + ${Q} echo '#define CALC_HAVE_STDLIB_H' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h ${Q} echo '/* do we have ? */' >> have_stdlib.h @@ -1961,7 +1949,7 @@ have_stdlib.h: ${MAKE_FILE} fi ${Q} echo '' >> have_stdlib.h ${Q} echo '' >> have_stdlib.h - ${Q} echo '#endif /* !__HAVE_STDLIB_H__ */' >> have_stdlib.h + ${Q} echo '#endif /* !CALC_HAVE_STDLIB_H */' >> have_stdlib.h ${Q} echo 'have_stdlib.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -1981,8 +1969,8 @@ have_unistd.h: ${MAKE_FILE} ${Q} echo ' */' >> have_unistd.h ${Q} echo '' >> have_unistd.h ${Q} echo '' >> have_unistd.h - ${Q} echo '#if !defined(__HAVE_UNISTD_H__)' >> have_unistd.h - ${Q} echo '#define __HAVE_UNISTD_H__' >> have_unistd.h + ${Q} echo '#if !defined(CALC_HAVE_UNISTD_H)' >> have_unistd.h + ${Q} echo '#define CALC_HAVE_UNISTD_H' >> have_unistd.h ${Q} echo '' >> have_unistd.h ${Q} echo '' >> have_unistd.h ${Q} echo '/* do we have ? */' >> have_unistd.h @@ -1999,7 +1987,7 @@ have_unistd.h: ${MAKE_FILE} fi ${Q} echo '' >> have_unistd.h ${Q} echo '' >> have_unistd.h - ${Q} echo '#endif /* !__HAVE_UNISTD_H__ */' >> have_unistd.h + ${Q} echo '#endif /* !CALC_HAVE_UNISTD_H */' >> have_unistd.h ${Q} echo 'have_unistd.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -2019,8 +2007,8 @@ have_string.h: ${MAKE_FILE} ${Q} echo ' */' >> have_string.h ${Q} echo '' >> have_string.h ${Q} echo '' >> have_string.h - ${Q} echo '#if !defined(__HAVE_STRING_H__)' >> have_string.h - ${Q} echo '#define __HAVE_STRING_H__' >> have_string.h + ${Q} echo '#if !defined(CALC_HAVE_STRING_H)' >> have_string.h + ${Q} echo '#define CALC_HAVE_STRING_H' >> have_string.h ${Q} echo '' >> have_string.h ${Q} echo '' >> have_string.h ${Q} echo '/* do we have ? */' >> have_string.h @@ -2037,7 +2025,7 @@ have_string.h: ${MAKE_FILE} fi ${Q} echo '' >> have_string.h ${Q} echo '' >> have_string.h - ${Q} echo '#endif /* !__HAVE_STRING_H__ */' >> have_string.h + ${Q} echo '#endif /* !CALC_HAVE_STRING_H */' >> have_string.h ${Q} echo 'have_string.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -2121,8 +2109,8 @@ have_fpos.h: have_fpos.c ${MAKE_FILE} ${Q} echo ' */' >> have_fpos.h ${Q} echo '' >> have_fpos.h ${Q} echo '' >> have_fpos.h - ${Q} echo '#if !defined(__HAVE_FPOS_H__)' >> have_fpos.h - ${Q} echo '#define __HAVE_FPOS_H__' >> have_fpos.h + ${Q} echo '#if !defined(CALC_HAVE_FPOS_H)' >> have_fpos.h + ${Q} echo '#define CALC_HAVE_FPOS_H' >> have_fpos.h ${Q} echo '' >> have_fpos.h ${Q} echo '' >> have_fpos.h ${Q} echo '/* do we have fgetpos & fsetpos functions? */' >> have_fpos.h @@ -2142,7 +2130,7 @@ have_fpos.h: have_fpos.c ${MAKE_FILE} fi ${Q} echo '' >> have_fpos.h ${Q} echo '' >> have_fpos.h - ${Q} echo '#endif /* !__HAVE_FPOS_H__ */' >> have_fpos.h + ${Q} echo '#endif /* !CALC_HAVE_FPOS_H */' >> have_fpos.h ${Q} ${RM} -f have_fpos${EXT} have_fpos.o fpos_tmp ${Q} echo 'have_fpos.h formed' -@if [ -z "${Q}" ]; then \ @@ -2164,8 +2152,8 @@ have_fpos_pos.h: have_fpos_pos.c have_fpos.h have_posscl.h ${MAKE_FILE} ${Q} echo ' */' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h - ${Q} echo '#if !defined(__HAVE_FPOS_POS_H__)' >> have_fpos_pos.h - ${Q} echo '#define __HAVE_FPOS_POS_H__' >> have_fpos_pos.h + ${Q} echo '#if !defined(CALC_HAVE_FPOS_POS_H)' >> have_fpos_pos.h + ${Q} echo '#define CALC_HAVE_FPOS_POS_H' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h ${Q} echo '/* do we have fgetpos & fsetpos functions? */' \ @@ -2186,7 +2174,7 @@ have_fpos_pos.h: have_fpos_pos.c have_fpos.h have_posscl.h ${MAKE_FILE} fi ${Q} echo '' >> have_fpos_pos.h ${Q} echo '' >> have_fpos_pos.h - ${Q} echo '#endif /* !__HAVE_FPOS_POS_H__ */' >> have_fpos_pos.h + ${Q} echo '#endif /* !CALC_HAVE_FPOS_POS_H */' >> have_fpos_pos.h ${Q} ${RM} -f have_fpos_pos${EXT} have_fpos_pos.o fpos_tmp ${Q} echo 'have_fpos_pos.h formed' -@if [ -z "${Q}" ]; then \ @@ -2243,8 +2231,8 @@ have_const.h: have_const.c ${MAKE_FILE} ${Q} echo ' */' >> have_const.h ${Q} echo '' >> have_const.h ${Q} echo '' >> have_const.h - ${Q} echo '#if !defined(__HAVE_CONST_H__)' >> have_const.h - ${Q} echo '#define __HAVE_CONST_H__' >> have_const.h + ${Q} echo '#if !defined(CALC_HAVE_CONST_H)' >> have_const.h + ${Q} echo '#define CALC_HAVE_CONST_H' >> have_const.h ${Q} echo '' >> have_const.h ${Q} echo '' >> have_const.h ${Q} echo '/* do we have or want const? */' >> have_const.h @@ -2264,7 +2252,7 @@ have_const.h: have_const.c ${MAKE_FILE} fi ${Q} echo '' >> have_const.h ${Q} echo '' >> have_const.h - ${Q} echo '#endif /* !__HAVE_CONST_H__ */' >> have_const.h + ${Q} echo '#endif /* !CALC_HAVE_CONST_H */' >> have_const.h ${Q} ${RM} -f have_const${EXT} have_const.o const_tmp ${Q} echo 'have_const.h formed' -@if [ -z "${Q}" ]; then \ @@ -2285,8 +2273,8 @@ have_offscl.h: have_offscl.c ${MAKE_FILE} ${Q} echo ' */' >> have_offscl.h ${Q} echo '' >> have_offscl.h ${Q} echo '' >> have_offscl.h - ${Q} echo '#if !defined(__HAVE_OFFSCL_H__)' >> have_offscl.h - ${Q} echo '#define __HAVE_OFFSCL_H__' >> have_offscl.h + ${Q} echo '#if !defined(CALC_HAVE_OFFSCL_H)' >> have_offscl.h + ${Q} echo '#define CALC_HAVE_OFFSCL_H' >> have_offscl.h ${Q} echo '' >> have_offscl.h ${Q} echo '' >> have_offscl.h ${Q} ${RM} -f have_offscl.o have_offscl${EXT} @@ -2304,7 +2292,7 @@ have_offscl.h: have_offscl.c ${MAKE_FILE} fi ${Q} echo '' >> have_offscl.h ${Q} echo '' >> have_offscl.h - ${Q} echo '#endif /* !__HAVE_OFFSCL_H__ */' >> have_offscl.h + ${Q} echo '#endif /* !CALC_HAVE_OFFSCL_H */' >> have_offscl.h ${Q} ${RM} -f have_offscl${EXT} have_offscl.o offscl_tmp ${Q} echo 'have_offscl.h formed' -@if [ -z "${Q}" ]; then \ @@ -2325,8 +2313,8 @@ have_posscl.h: have_posscl.c have_fpos.h ${MAKE_FILE} ${Q} echo ' */' >> have_posscl.h ${Q} echo '' >> have_posscl.h ${Q} echo '' >> have_posscl.h - ${Q} echo '#if !defined(__HAVE_POSSCL_H__)' >> have_posscl.h - ${Q} echo '#define __HAVE_POSSCL_H__' >> have_posscl.h + ${Q} echo '#if !defined(CALC_HAVE_POSSCL_H)' >> have_posscl.h + ${Q} echo '#define CALC_HAVE_POSSCL_H' >> have_posscl.h ${Q} echo '' >> have_posscl.h ${Q} echo '' >> have_posscl.h ${Q} ${RM} -f have_posscl.o have_posscl @@ -2344,7 +2332,7 @@ have_posscl.h: have_posscl.c have_fpos.h ${MAKE_FILE} fi ${Q} echo '' >> have_posscl.h ${Q} echo '' >> have_posscl.h - ${Q} echo '#endif /* !__HAVE_POSSCL_H__ */' >> have_posscl.h + ${Q} echo '#endif /* !CALC_HAVE_POSSCL_H */' >> have_posscl.h ${Q} ${RM} -f have_posscl have_posscl.o posscl_tmp ${Q} echo 'have_posscl.h formed' -@if [ -z "${Q}" ]; then \ @@ -2420,8 +2408,8 @@ have_uid_t.h: have_uid_t.c have_unistd.h ${MAKE_FILE} ${Q} echo ' */' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h - ${Q} echo '#if !defined(__HAVE_UID_T_H__)' >> have_uid_t.h - ${Q} echo '#define __HAVE_UID_T_H__' >> have_uid_t.h + ${Q} echo '#if !defined(CALC_HAVE_UID_T_H)' >> have_uid_t.h + ${Q} echo '#define CALC_HAVE_UID_T_H' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h ${Q} echo '/* do we have or want uid_t? */' >> have_uid_t.h @@ -2439,7 +2427,7 @@ have_uid_t.h: have_uid_t.c have_unistd.h ${MAKE_FILE} fi ${Q} echo '' >> have_uid_t.h ${Q} echo '' >> have_uid_t.h - ${Q} echo '#endif /* !__HAVE_UID_T_H__ */' >> have_uid_t.h + ${Q} echo '#endif /* !CALC_HAVE_UID_T_H */' >> have_uid_t.h ${Q} ${RM} -f have_uid_t${EXT} have_uid_t.o uid_tmp ${Q} echo 'have_uid_t.h formed' -@if [ -z "${Q}" ]; then \ @@ -2460,8 +2448,8 @@ have_newstr.h: have_newstr.c ${MAKE_FILE} ${Q} echo ' */' >> have_newstr.h ${Q} echo '' >> have_newstr.h ${Q} echo '' >> have_newstr.h - ${Q} echo '#if !defined(__HAVE_NEWSTR_H__)' >> have_newstr.h - ${Q} echo '#define __HAVE_NEWSTR_H__' >> have_newstr.h + ${Q} echo '#if !defined(CALC_HAVE_NEWSTR_H)' >> have_newstr.h + ${Q} echo '#define CALC_HAVE_NEWSTR_H' >> have_newstr.h ${Q} echo '' >> have_newstr.h ${Q} echo '' >> have_newstr.h ${Q} echo '/* do we have or want memcpy(), memset() & strchr()? */' \ @@ -2480,7 +2468,7 @@ have_newstr.h: have_newstr.c ${MAKE_FILE} fi ${Q} echo '' >> have_newstr.h ${Q} echo '' >> have_newstr.h - ${Q} echo '#endif /* !__HAVE_NEWSTR_H__ */' >> have_newstr.h + ${Q} echo '#endif /* !CALC_HAVE_NEWSTR_H */' >> have_newstr.h ${Q} ${RM} -f have_newstr${EXT} have_newstr.o newstr_tmp ${Q} echo 'have_newstr.h formed' -@if [ -z "${Q}" ]; then \ @@ -2501,8 +2489,8 @@ have_memmv.h: have_memmv.c ${MAKE_FILE} ${Q} echo ' */' >> have_memmv.h ${Q} echo '' >> have_memmv.h ${Q} echo '' >> have_memmv.h - ${Q} echo '#if !defined(__HAVE_MEMMV_H__)' >> have_memmv.h - ${Q} echo '#define __HAVE_MEMMV_H__' >> have_memmv.h + ${Q} echo '#if !defined(CALC_HAVE_MEMMV_H)' >> have_memmv.h + ${Q} echo '#define CALC_HAVE_MEMMV_H' >> have_memmv.h ${Q} echo '' >> have_memmv.h ${Q} echo '' >> have_memmv.h ${Q} echo '/* do we have or want memmove()? */' >> have_memmv.h @@ -2520,7 +2508,7 @@ have_memmv.h: have_memmv.c ${MAKE_FILE} fi ${Q} echo '' >> have_memmv.h ${Q} echo '' >> have_memmv.h - ${Q} echo '#endif /* !__HAVE_MEMMV_H__ */' >> have_memmv.h + ${Q} echo '#endif /* !CALC_HAVE_MEMMV_H */' >> have_memmv.h ${Q} ${RM} -f have_memmv have_memmv.o memmv_tmp ${Q} echo 'have_memmv.h formed' -@if [ -z "${Q}" ]; then \ @@ -2541,8 +2529,8 @@ have_ustat.h: have_ustat.c ${MAKE_FILE} ${Q} echo ' */' >> have_ustat.h ${Q} echo '' >> have_ustat.h ${Q} echo '' >> have_ustat.h - ${Q} echo '#if !defined(__HAVE_USTAT_H__)' >> have_ustat.h - ${Q} echo '#define __HAVE_USTAT_H__' >> have_ustat.h + ${Q} echo '#if !defined(CALC_HAVE_USTAT_H)' >> have_ustat.h + ${Q} echo '#define CALC_HAVE_USTAT_H' >> have_ustat.h ${Q} echo '' >> have_ustat.h ${Q} echo '' >> have_ustat.h ${Q} echo '/* do we have or want ustat()? */' >> have_ustat.h @@ -2560,7 +2548,7 @@ have_ustat.h: have_ustat.c ${MAKE_FILE} fi ${Q} echo '' >> have_ustat.h ${Q} echo '' >> have_ustat.h - ${Q} echo '#endif /* !__HAVE_USTAT_H__ */' >> have_ustat.h + ${Q} echo '#endif /* !CALC_HAVE_USTAT_H */' >> have_ustat.h ${Q} ${RM} -f have_ustat${EXT} have_ustat.o ustat_tmp ${Q} echo 'have_ustat.h formed' -@if [ -z "${Q}" ]; then \ @@ -2581,8 +2569,8 @@ have_getsid.h: have_getsid.c ${MAKE_FILE} ${Q} echo ' */' >> have_getsid.h ${Q} echo '' >> have_getsid.h ${Q} echo '' >> have_getsid.h - ${Q} echo '#if !defined(__HAVE_GETSID_H__)' >> have_getsid.h - ${Q} echo '#define __HAVE_GETSID_H__' >> have_getsid.h + ${Q} echo '#if !defined(CALC_HAVE_GETSID_H)' >> have_getsid.h + ${Q} echo '#define CALC_HAVE_GETSID_H' >> have_getsid.h ${Q} echo '' >> have_getsid.h ${Q} echo '' >> have_getsid.h ${Q} echo '/* do we have or want getsid()? */' >> have_getsid.h @@ -2600,7 +2588,7 @@ have_getsid.h: have_getsid.c ${MAKE_FILE} fi ${Q} echo '' >> have_getsid.h ${Q} echo '' >> have_getsid.h - ${Q} echo '#endif /* !__HAVE_GETSID_H__ */' >> have_getsid.h + ${Q} echo '#endif /* !CALC_HAVE_GETSID_H */' >> have_getsid.h ${Q} ${RM} -f have_getsid${EXT} have_getsid.o getsid_tmp ${Q} echo 'have_getsid.h formed' -@if [ -z "${Q}" ]; then \ @@ -2622,8 +2610,8 @@ have_getpgid.h: have_getpgid.c ${MAKE_FILE} ${Q} echo ' */' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h - ${Q} echo '#if !defined(__HAVE_GETPGID_H__)' >> have_getpgid.h - ${Q} echo '#define __HAVE_GETPGID_H__' >> have_getpgid.h + ${Q} echo '#if !defined(CALC_HAVE_GETPGID_H)' >> have_getpgid.h + ${Q} echo '#define CALC_HAVE_GETPGID_H' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h ${Q} echo '/* do we have or want getpgid()? */' >> have_getpgid.h @@ -2641,7 +2629,7 @@ have_getpgid.h: have_getpgid.c ${MAKE_FILE} fi ${Q} echo '' >> have_getpgid.h ${Q} echo '' >> have_getpgid.h - ${Q} echo '#endif /* !__HAVE_GETPGID_H__ */' >> have_getpgid.h + ${Q} echo '#endif /* !CALC_HAVE_GETPGID_H */' >> have_getpgid.h ${Q} ${RM} -f have_getpgid${EXT} have_getpgid.o getpgid_tmp ${Q} echo 'have_getpgid.h formed' -@if [ -z "${Q}" ]; then \ @@ -2663,8 +2651,8 @@ have_gettime.h: have_gettime.c ${MAKE_FILE} ${Q} echo ' */' >> have_gettime.h ${Q} echo '' >> have_gettime.h ${Q} echo '' >> have_gettime.h - ${Q} echo '#if !defined(__HAVE_GETTIME_H__)' >> have_gettime.h - ${Q} echo '#define __HAVE_GETTIME_H__' >> have_gettime.h + ${Q} echo '#if !defined(CALC_HAVE_GETTIME_H)' >> have_gettime.h + ${Q} echo '#define CALC_HAVE_GETTIME_H' >> have_gettime.h ${Q} echo '' >> have_gettime.h ${Q} echo '' >> have_gettime.h ${Q} echo '/* do we have or want clock_gettime()? */' >> have_gettime.h @@ -2682,7 +2670,7 @@ have_gettime.h: have_gettime.c ${MAKE_FILE} fi ${Q} echo '' >> have_gettime.h ${Q} echo '' >> have_gettime.h - ${Q} echo '#endif /* !__HAVE_GETTIME_H__ */' >> have_gettime.h + ${Q} echo '#endif /* !CALC_HAVE_GETTIME_H */' >> have_gettime.h ${Q} ${RM} -f have_gettime${EXT} have_gettime.o gettime_tmp ${Q} echo 'have_gettime.h formed' -@if [ -z "${Q}" ]; then \ @@ -2704,8 +2692,8 @@ have_getprid.h: have_getprid.c ${MAKE_FILE} ${Q} echo ' */' >> have_getprid.h ${Q} echo '' >> have_getprid.h ${Q} echo '' >> have_getprid.h - ${Q} echo '#if !defined(__HAVE_GETPRID_H__)' >> have_getprid.h - ${Q} echo '#define __HAVE_GETPRID_H__' >> have_getprid.h + ${Q} echo '#if !defined(CALC_HAVE_GETPRID_H)' >> have_getprid.h + ${Q} echo '#define CALC_HAVE_GETPRID_H' >> have_getprid.h ${Q} echo '' >> have_getprid.h ${Q} echo '' >> have_getprid.h ${Q} echo '/* do we have or want getprid()? */' >> have_getprid.h @@ -2723,7 +2711,7 @@ have_getprid.h: have_getprid.c ${MAKE_FILE} fi ${Q} echo '' >> have_getprid.h ${Q} echo '' >> have_getprid.h - ${Q} echo '#endif /* !__HAVE_GETPRID_H__ */' >> have_getprid.h + ${Q} echo '#endif /* !CALC_HAVE_GETPRID_H */' >> have_getprid.h ${Q} ${RM} -f have_getprid${EXT} have_getprid.o getprid_tmp ${Q} echo 'have_getprid.h formed' -@if [ -z "${Q}" ]; then \ @@ -2745,8 +2733,8 @@ have_urandom.h: ${MAKE_FILE} ${Q} echo ' */' >> have_urandom.h ${Q} echo '' >> have_urandom.h ${Q} echo '' >> have_urandom.h - ${Q} echo '#if !defined(__HAVE_URANDOM_H__)' >> have_urandom.h - ${Q} echo '#define __HAVE_URANDOM_H__' >> have_urandom.h + ${Q} echo '#if !defined(CALC_HAVE_URANDOM_H)' >> have_urandom.h + ${Q} echo '#define CALC_HAVE_URANDOM_H' >> have_urandom.h ${Q} echo '' >> have_urandom.h ${Q} echo '' >> have_urandom.h ${Q} echo '/* do we have /dev/urandom? */' >> have_urandom.h @@ -2761,7 +2749,7 @@ have_urandom.h: ${MAKE_FILE} fi ${Q} echo '' >> have_urandom.h ${Q} echo '' >> have_urandom.h - ${Q} echo '#endif /* !__HAVE_URANDOM_H__ */' >> have_urandom.h + ${Q} echo '#endif /* !CALC_HAVE_URANDOM_H */' >> have_urandom.h ${Q} echo 'have_urandom.h formed' -@if [ -z "${Q}" ]; then \ echo ''; \ @@ -2782,8 +2770,8 @@ have_rusage.h: have_rusage.c ${MAKE_FILE} ${Q} echo ' */' >> have_rusage.h ${Q} echo '' >> have_rusage.h ${Q} echo '' >> have_rusage.h - ${Q} echo '#if !defined(__HAVE_RUSAGE_H__)' >> have_rusage.h - ${Q} echo '#define __HAVE_RUSAGE_H__' >> have_rusage.h + ${Q} echo '#if !defined(CALC_HAVE_RUSAGE_H)' >> have_rusage.h + ${Q} echo '#define CALC_HAVE_RUSAGE_H' >> have_rusage.h ${Q} echo '' >> have_rusage.h ${Q} echo '' >> have_rusage.h ${Q} echo '/* do we have or want getrusage()? */' >> have_rusage.h @@ -2801,7 +2789,7 @@ have_rusage.h: have_rusage.c ${MAKE_FILE} fi ${Q} echo '' >> have_rusage.h ${Q} echo '' >> have_rusage.h - ${Q} echo '#endif /* !__HAVE_RUSAGE_H__ */' >> have_rusage.h + ${Q} echo '#endif /* !CALC_HAVE_RUSAGE_H */' >> have_rusage.h ${Q} ${RM} -f have_rusage${EXT} have_rusage.o rusage_tmp ${Q} echo 'have_rusage.h formed' -@if [ -z "${Q}" ]; then \ @@ -2822,8 +2810,8 @@ have_strdup.h: have_strdup.c ${MAKE_FILE} ${Q} echo ' */' >> have_strdup.h ${Q} echo '' >> have_strdup.h ${Q} echo '' >> have_strdup.h - ${Q} echo '#if !defined(__HAVE_STRDUP_H__)' >> have_strdup.h - ${Q} echo '#define __HAVE_STRDUP_H__' >> have_strdup.h + ${Q} echo '#if !defined(CALC_HAVE_STRDUP_H)' >> have_strdup.h + ${Q} echo '#define CALC_HAVE_STRDUP_H' >> have_strdup.h ${Q} echo '' >> have_strdup.h ${Q} echo '' >> have_strdup.h ${Q} echo '/* do we have or want getstrdup()? */' >> have_strdup.h @@ -2841,7 +2829,7 @@ have_strdup.h: have_strdup.c ${MAKE_FILE} fi ${Q} echo '' >> have_strdup.h ${Q} echo '' >> have_strdup.h - ${Q} echo '#endif /* !__HAVE_STRDUP_H__ */' >> have_strdup.h + ${Q} echo '#endif /* !CALC_HAVE_STRDUP_H */' >> have_strdup.h ${Q} ${RM} -f have_strdup${EXT} have_strdup.o strdup_tmp ${Q} echo 'have_strdup.h formed' -@if [ -z "${Q}" ]; then \ @@ -2967,32 +2955,6 @@ calcerr.c: calcerr.tbl calcerr_c.sed calcerr_c.awk ${MAKE_FILE} ${TRUE}; \ fi -no_implicit.arg: no_implicit.c ${MAKE_FILE} - ${Q} ${RM} -f no_implicit${EXT} no_implicit.o no_implicit.arg - ${Q} echo 'forming no_implicit.arg' - -${Q} if [ X"${HAVE_NO_IMPLICIT}" = X"YES" ]; then \ - echo ""'-Wno-implicit' > no_implicit.arg; \ - elif [ X"${HAVE_NO_IMPLICIT}" = X"NO" ]; then \ - ${TOUCH} no_implicit.arg; \ - else \ - ${LCC} -Wno-implicit ${ICFLAGS} -DHAVE_NO_IMPLICIT \ - no_implicit.c -c >/dev/null 2>&1; \ - ${LCC} ${ILDFLAGS} no_implicit.o -o no_implicit${EXT} \ - >/dev/null 2>&1; \ - ${SHELL} -c "./no_implicit${EXT} > no_implicit.arg 2>/dev/null" \ - >/dev/null 2>&1; ${TRUE}; \ - fi - ${Q} echo 'no_implicit.arg formed' - -@if [ -z "${Q}" ]; then \ - echo ''; \ - echo '=-=-= start of $@ =-=-='; \ - ${CAT} $@; \ - echo '=-=-= end of $@ =-=-='; \ - echo ''; \ - else \ - ${TRUE}; \ - fi - have_unused.h: have_unused.c ${MAKE_FILE} ${Q} ${RM} -f unused_tmp have_unused.h ${Q} echo 'forming have_unused.h' @@ -3001,8 +2963,8 @@ have_unused.h: have_unused.c ${MAKE_FILE} ${Q} echo ' */' >> have_unused.h ${Q} echo '' >> have_unused.h ${Q} echo '' >> have_unused.h - ${Q} echo '#if !defined(__HAVE_UNUSED_H__)' >> have_unused.h - ${Q} echo '#define __HAVE_UNUSED_H__' >> have_unused.h + ${Q} echo '#if !defined(CALC_HAVE_UNUSED_H)' >> have_unused.h + ${Q} echo '#define CALC_HAVE_UNUSED_H' >> have_unused.h ${Q} echo '' >> have_unused.h ${Q} echo '' >> have_unused.h ${Q} echo '/* do we have/want the unused attribute? */' >> have_unused.h @@ -3022,7 +2984,7 @@ have_unused.h: have_unused.c ${MAKE_FILE} fi ${Q} echo '' >> have_unused.h ${Q} echo '' >> have_unused.h - ${Q} echo '#endif /* !__HAVE_UNUSED_H__ */' >> have_unused.h + ${Q} echo '#endif /* !CALC_HAVE_UNUSED_H */' >> have_unused.h ${Q} ${RM} -f have_unused${EXT} have_unused.o unused_tmp ${Q} echo 'have_unused.h formed' -@if [ -z "${Q}" ]; then \ @@ -3047,7 +3009,7 @@ have_unused.h: have_unused.c ${MAKE_FILE} win32_hsrc: win32.mkdef ${MAKE_FILE} ${Q} echo 'forming win32 directory' ${Q} ${RM} -rf win32 - ${Q} ${MKDIR} win32 + ${Q} ${MKDIR} -p win32 ${Q} ${CP} ${UTIL_C_SRC} win32 ${Q} ${CP} ${UTIL_MISC_SRC} win32 ${Q} ${CP} ${MAKE_FILE} win32/${MAKE_FILE} @@ -3143,18 +3105,6 @@ libcustcalc${LIB_EXT_VERSION}: custom/libcustcalc${LIB_EXT_VERSION} ${Q} ${RM} -f $@ ${CP} -p $? $@ -libcustcalc${LIB_EXT_VERS}: custom/libcustcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcustcalc${LIB_EXT_VER}: libcustcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - -libcustcalc${LIB_EXT_VE}: libcustcalc${LIB_EXT_VERSION} - ${Q} ${RM} -f $@ - ${LN} -s $? $@ - libcustcalc${LIB_EXT}: libcustcalc${LIB_EXT_VERSION} ${Q} ${RM} -f $@ ${LN} -s $? $@ @@ -3219,12 +3169,12 @@ depend: custom/Makefile hsrc ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${Q} echo forming skel ${Q} ${RM} -rf skel - ${Q} ${MKDIR} skel + ${Q} ${MKDIR} -p skel -${Q} for i in ${C_SRC} ${BUILD_C_SRC}; do \ ${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \ ${GREP} -v '\.\./getopt/getopt\.h' > "skel/$$i"; \ done - ${Q} ${MKDIR} skel/custom + ${Q} ${MKDIR} -p skel/custom -${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'`"; \ @@ -3291,6 +3241,28 @@ h_list: # version string. Note that the full version could be 4 # or 3 levels long depending on the minor patch number. # +# version: +# This rule simply echoes the value found in this makefile. +# This rule produces the full version string. Note that the +# full version could be 4 or 3 levels long depending on the +# minor patch number. +# +### + +calc_version: ver_calc${EXT} + @./ver_calc${EXT} + +version: + @echo ${VERSION} + +ver_calc${EXT}: version.c have_unused.h + ${RM} -f $@ + ${LCC} ${ICFLAGS} -DCALC_VER ${ILDFLAGS} version.c -o $@ + +### +# +# legacy partial versions are no longer used, only removed +# # calc_vers: # This rule is the most accurate as it uses calc source to # produce the version value. This rule produces only a @@ -3306,12 +3278,6 @@ h_list: # produce the version value. This rule produces only a # 1 level version string. # -# version: -# This rule simply echoes the value found in this makefile. -# This rule produces the full version string. Note that the -# full version could be 4 or 3 levels long depending on the -# minor patch number. -# # vers: # This rule simply echoes the value found in this makefile. # This rule produces only a 3 level version string. @@ -3326,9 +3292,6 @@ h_list: # ### -calc_version: ver_calc${EXT} - @./ver_calc${EXT} - calc_vers: ver_calc${EXT} @./ver_calc${EXT} -V @@ -3338,9 +3301,6 @@ calc_ver: ver_calc${EXT} calc_ve: ver_calc${EXT} @./ver_calc${EXT} -V | ${SED} -e 's/\.[^.]*\.[^.]*$$//' -version: - @echo ${VERSION} - vers: @echo ${VERS} @@ -3350,10 +3310,6 @@ ver: ve: @echo ${VE} -ver_calc${EXT}: version.c have_unused.h - ${RM} -f $@ - ${LCC} ${ICFLAGS} -DCALC_VER ${ILDFLAGS} version.c -o $@ - ### # # File distribution list generation. You can ignore this section. @@ -3512,7 +3468,6 @@ env: @echo 'HAVE_GETTIME=${HAVE_GETTIME}'; echo '' @echo 'HAVE_MEMMOVE=${HAVE_MEMMOVE}'; echo '' @echo 'HAVE_NEWSTR=${HAVE_NEWSTR}'; echo '' - @echo 'HAVE_NO_IMPLICIT=${HAVE_NO_IMPLICIT}'; echo '' @echo 'HAVE_OFFSCL=${HAVE_OFFSCL}'; echo '' @echo 'HAVE_POSSCL=${HAVE_POSSCL}'; echo '' @echo 'HAVE_STDLIB_H=${HAVE_STDLIB_H}'; echo '' @@ -3560,7 +3515,6 @@ env: @echo 'MANMAKE=${MANMAKE}'; echo '' @echo 'MANMODE=${MANMODE}'; echo '' @echo 'MKDIR=${MKDIR}'; echo '' - @echo 'MKDIR_ARG=${MKDIR_ARG}'; echo '' @echo 'MV=${MV}'; echo '' @echo 'NROFF=${NROFF}'; echo '' @echo 'NROFF_ARG=${NROFF_ARG}'; echo '' @@ -3601,7 +3555,6 @@ env: @echo 'UTIL_PROGS=${UTIL_PROGS}'; echo '' @echo 'UTIL_TMP=${UTIL_TMP}'; echo '' @echo 'V=${V}'; echo '' - @echo 'VERS=${VERS}'; echo '' @echo 'VERSION=${VERSION}'; echo '' @echo 'XARGS=${XARGS}'; echo '' @echo 'target=${target}'; echo '' @@ -3833,14 +3786,8 @@ clobber: custom/Makefile clean ${RM} -rf gen_h skel Makefile.bak tmp.patch ${RM} -f calc.spec inst_files rpm.mk.patch tmp ${RM} -f libcalc${LIB_EXT_VERSION} - ${RM} -f libcalc${LIB_EXT_VERS} - ${RM} -f libcalc${LIB_EXT_VER} - ${RM} -f libcalc${LIB_EXT_VE} ${RM} -f libcalc*${LIB_EXT} ${RM} -f libcustcalc${LIB_EXT_VERSION} - ${RM} -f libcustcalc${LIB_EXT_VERS} - ${RM} -f libcustcalc${LIB_EXT_VER} - ${RM} -f libcustcalc${LIB_EXT_VE} ${RM} -f libcustcalc*${LIB_EXT} ${RM} -f libcustcalc.a ${RM} -f calc-static${EXT} @@ -3859,7 +3806,15 @@ clobber: custom/Makefile clean cd cscript; ${RM} -f all; ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} $@ ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo remove files that are obsolete + ${RM} -f libcalc${LIB_EXT_VERS} + ${RM} -f libcalc${LIB_EXT_VER} + ${RM} -f libcalc${LIB_EXT_VE} + ${RM} -f libcustcalc${LIB_EXT_VERS} + ${RM} -f libcustcalc${LIB_EXT_VER} + ${RM} -f libcustcalc${LIB_EXT_VE} ${RM} -rf win32 build + ${RM} -f no_implicit.arg + ${RM} -f no_implicit.c no_implicit.o no_implicit${EXT} ${RM} -f .static .dynamic calc-dynamic-only calc-static-only ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' @@ -3871,87 +3826,87 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' -${Q} if [ ! -z "${T}" ]; then \ if [ ! -d ${T} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}; \ - ${MKDIR} ${MKDIR_ARG} ${T}; \ + echo ${MKDIR} -p ${T}; \ + ${MKDIR} -p ${T}; \ echo ${CHMOD} 0755 ${T}; \ ${CHMOD} 0755 ${T}; \ fi; \ fi -${Q} if [ ! -d ${T}${BINDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${BINDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${BINDIR}; \ + echo ${MKDIR} -p ${T}${BINDIR}; \ + ${MKDIR} -p ${T}${BINDIR}; \ echo ${CHMOD} 0755 ${T}${BINDIR}; \ ${CHMOD} 0755 ${T}${BINDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${INCDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${INCDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${INCDIR}; \ + echo ${MKDIR} -p ${T}${INCDIR}; \ + ${MKDIR} -p ${T}${INCDIR}; \ echo ${CHMOD} 0755 ${T}${INCDIR}; \ ${CHMOD} 0755 ${T}${INCDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${LIBDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${LIBDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${LIBDIR}; \ + echo ${MKDIR} -p ${T}${LIBDIR}; \ + ${MKDIR} -p ${T}${LIBDIR}; \ echo ${CHMOD} 0755 ${T}${LIBDIR}; \ ${CHMOD} 0755 ${T}${LIBDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ - ${MKDIR} ${MKDIR_ARG} ${T}${CALC_SHAREDIR}; \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CALC_SHAREDIR}; \ + ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ + echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ echo ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \ ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${HELPDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${HELPDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${HELPDIR}; \ + echo ${MKDIR} -p ${T}${HELPDIR}; \ + ${MKDIR} -p ${T}${HELPDIR}; \ echo ${CHMOD} 0755 ${T}${HELPDIR}; \ ${CHMOD} 0755 ${T}${HELPDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CALC_INCDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CALC_INCDIR}; \ + echo ${MKDIR} -p ${T}${CALC_INCDIR}; \ + ${MKDIR} -p ${T}${CALC_INCDIR}; \ echo ${CHMOD} 0755 ${T}${CALC_INCDIR}; \ ${CHMOD} 0755 ${T}${CALC_INCDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMCALDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMCALDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ + ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ echo ${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \ ${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMHELPDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMHELPDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ + ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ echo ${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \ ${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMINCDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CUSTOMINCDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ + ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ echo ${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \ ${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \ else \ ${TRUE}; \ fi -${Q} if [ ! -d ${T}${SCRIPTDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${SCRIPTDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${SCRIPTDIR}; \ + echo ${MKDIR} -p ${T}${SCRIPTDIR}; \ + ${MKDIR} -p ${T}${SCRIPTDIR}; \ echo ${CHMOD} 0755 ${T}${SCRIPTDIR}; \ ${CHMOD} 0755 ${T}${SCRIPTDIR}; \ else \ @@ -3959,8 +3914,8 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all fi -${Q} if [ ! -z "${MANDIR}" ]; then \ if [ ! -d ${T}${MANDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${MANDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${MANDIR}; \ + echo ${MKDIR} -p ${T}${MANDIR}; \ + ${MKDIR} -p ${T}${MANDIR}; \ echo ${CHMOD} 0755 ${T}${MANDIR}; \ ${CHMOD} 0755 ${T}${MANDIR}; \ else \ @@ -3971,8 +3926,8 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all fi -${Q} if [ ! -z "${CATDIR}" ]; then \ if [ ! -d ${T}${CATDIR} ]; then \ - echo ${MKDIR} ${MKDIR_ARG} ${T}${CATDIR}; \ - ${MKDIR} ${MKDIR_ARG} ${T}${CATDIR}; \ + echo ${MKDIR} -p ${T}${CATDIR}; \ + ${MKDIR} -p ${T}${CATDIR}; \ echo ${CHMOD} 0755 ${T}${CATDIR}; \ ${CHMOD} 0755 ${T}${CATDIR}; \ else \ @@ -4044,15 +3999,27 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all ${MV} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \ - ${LN} -f -s libcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcalc${LIB_EXT_VERS}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VERS}"; \ - ${LN} -f -s libcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcalc${LIB_EXT_VER}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VER}"; \ - ${LN} -f -s libcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcalc${LIB_EXT_VE}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VE}"; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VERS}" ]; then \ + if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERS}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERS}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcalc${LIB_EXT_VERS}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VER}" ]; then \ + if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VER}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VER}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcalc${LIB_EXT_VER}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VE}" ]; then \ + if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VE}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VE}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcalc${LIB_EXT_VE}"; \ + fi; \ + fi; \ ${LN} -f -s libcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcalc${LIB_EXT}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT}"; \ @@ -4063,15 +4030,27 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all ${MV} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \ - ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}; \ - echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \ - ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}; \ - echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \ - ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ - ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}; \ - echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VE}"; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VERS}" ]; then \ + if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VER}" ]; then \ + if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \ + fi; \ + fi; \ + if [ "${LIB_EXT_VERSION}" != "${LIB_EXT_VE}" ]; then \ + if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \ + ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}; \ + echo -n "removed legacy and likely out of date: "; \ + echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \ + fi; \ + fi; \ ${LN} -f -s libcustcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcustcalc${LIB_EXT}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT}"; \ @@ -4860,6 +4839,7 @@ have_offscl.o: have_offscl.c have_posscl.o: have_fpos.h have_posscl.o: have_posscl.c have_rusage.o: have_rusage.c +have_stdvs.o: have_stdlib.h have_stdvs.o: have_stdvs.c have_stdvs.o: have_string.h have_stdvs.o: have_unistd.h @@ -5102,7 +5082,6 @@ math_error.o: sha1.h math_error.o: str.h math_error.o: value.h math_error.o: zmath.h -no_implicit.o: no_implicit.c obj.o: alloc.h obj.o: block.h obj.o: byteswap.h diff --git a/alloc.h b/alloc.h index 25b05a2..168e3f0 100644 --- a/alloc.h +++ b/alloc.h @@ -1,7 +1,7 @@ /* * alloc - storage allocation and storage debug macros * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: alloc.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.5 $ + * @(#) $Id: alloc.h,v 30.5 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/alloc.h,v $ * * Under source code control: 1990/02/15 01:48:29 @@ -28,8 +28,8 @@ */ -#if !defined(__ALLOC_H__) -#define __ALLOC_H__ +#if !defined(INCLUDE_ALLOC_H) +#define INCLUDE_ALLOC_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -92,4 +92,4 @@ E_FUNC int strcmp(); E_FUNC void *memmove(void *s1, CONST void *s2, MEMMOVE_SIZE_T n); #endif -#endif /* !__ALLOC_H__ */ +#endif /* !INCLUDE_ALLOC_H */ diff --git a/blkcpy.h b/blkcpy.h index 7389f0d..a1c2099 100644 --- a/blkcpy.h +++ b/blkcpy.h @@ -1,7 +1,7 @@ /* * blkcpy - general values and related routines used by the calculator * - * Copyright (C) 1999-2007 Landon Curt Noll and Ernest Bowen + * Copyright (C) 1999-2007,2014 Landon Curt Noll and Ernest Bowen * * Primary author: Landon Curt Noll * @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: blkcpy.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: blkcpy.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/blkcpy.h,v $ * * Under source code control: 1997/04/18 20:41:25 @@ -30,8 +30,8 @@ */ -#if !defined(__BLKCPY_H__) -#define __BLKCPY_H__ +#if !defined(INCLUDE_BLKCPY_H) +#define INCLUDE_BLKCPY_H /* * the main copy gateway function @@ -59,4 +59,4 @@ E_FUNC int copystr2blk(STRING *, long, long, BLOCK *, long, BOOL); E_FUNC int copystr2file(STRING *, long, long, FILEID, long); E_FUNC int copystr2str(STRING *, long, long, STRING *, long); -#endif /* !__BLKCPY_H__ */ +#endif /* !INCLUDE_BLKCPY_H */ diff --git a/block.h b/block.h index 3b4240d..7e52477 100644 --- a/block.h +++ b/block.h @@ -1,7 +1,7 @@ /* * block - fixed, dynamic, fifo and circular memory blocks * - * Copyright (C) 1999-2007 Landon Curt Noll and Ernest Bowen + * Copyright (C) 1999-2007,2014 Landon Curt Noll and Ernest Bowen * * Primary author: Landon Curt Noll * @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: block.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: block.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/block.h,v $ * * Under source code control: 1997/02/21 05:03:39 @@ -31,8 +31,8 @@ */ -#if !defined(__BLOCK_H__) -#define __BLOCK_H__ +#if !defined(INCLUDE_BLOCK_H) +#define INCLUDE_BLOCK_H /* @@ -222,4 +222,4 @@ E_FUNC int countnblocks(void); E_FUNC void shownblocks(void); -#endif /* !__BLOCK_H__ */ +#endif /* !INCLUDE_BLOCK_H */ diff --git a/byteswap.h b/byteswap.h index 2809f51..571c67d 100644 --- a/byteswap.h +++ b/byteswap.h @@ -1,7 +1,7 @@ /* * byteswap - byte swapping macros * - * Copyright (C) 1999 Landon Curt Noll + * Copyright (C) 1999,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: byteswap.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: byteswap.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/byteswap.h,v $ * * Under source code control: 1995/10/11 04:44:01 @@ -29,8 +29,8 @@ */ -#if !defined(__BYTESWAP_H__) -#define __BYTESWAP_H__ +#if !defined(INCLUDE_BYTESWAP_H) +#define INCLUDE_BYTESWAP_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -178,4 +178,4 @@ #endif /* LONG_BITS == 64 */ -#endif /* !__BYTESWAP_H__ */ +#endif /* !INCLUDE_BYTESWAP_H */ diff --git a/cal/Makefile b/cal/Makefile index 8a682fb..2a23a3e 100644 --- a/cal/Makefile +++ b/cal/Makefile @@ -18,8 +18,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# @(#) $Revision: 30.10 $ -# @(#) $Id: Makefile,v 30.10 2013/09/02 03:02:00 chongo Exp $ +# @(#) $Revision: 30.11 $ +# @(#) $Id: Makefile,v 30.11 2014/09/02 07:14:49 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/cal/RCS/Makefile,v $ # # Under source code control: 1991/07/21 05:00:54 @@ -308,8 +308,8 @@ clobber: clean # install: all -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ - ${MKDIR} ${T}${CALC_SHAREDIR}; \ + echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ + ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ diff --git a/cal/alg_config.cal b/cal/alg_config.cal index 4c2c81b..f16da6f 100644 --- a/cal/alg_config.cal +++ b/cal/alg_config.cal @@ -1,7 +1,7 @@ /* * alg_config - help determine optimal values for algorithm levels * - * Copyright (C) 2006 Landon Curt Noll + * Copyright (C) 2006,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.2 $ - * @(#) $Id: alg_config.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.11 $ + * @(#) $Id: alg_config.cal,v 30.11 2014/09/07 06:13:04 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/alg_config.cal,v $ * * Under source code control: 2006/06/07 14:10:11 @@ -28,8 +28,37 @@ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ */ +static test_time; /* try for this many seconds in loop test */ -global test_time; /* try for this many seconds in loop test */ + +/* + * close_to_one - set to 1 if the ratio is close enough to 1 + * + * given: + * ratio the ratio of time between two algorithms + * + * retuns: + * 1 When ratio is near 1.0 + * 0 otherwise + * + * We consider the range [0.995, 1.005] to be close enough to 1 to be call unity + * because of the precision of the CPU timing. + */ +define close_to_one(ratio) +{ + /* firewall */ + if (!isreal(ratio)) { + quit "close: 1st arg: must be a real number"; + } + + /* check if the ratio is far from unity */ + if ((ratio < 0.995) || (ratio > 1.005)) { + return 0; + } + + /* we are close to unity */ + return 1; +} /* @@ -143,7 +172,7 @@ define mul_loop(repeat, x) * len length in BASEB-bit words to multiply * * return: - * ratio of (1st / 2nd) algorithm rate + * ratio of (1st / 2nd) algorithm rate. * * When want to determine a rate to a precision of 1 part in 1000. * Most systems today return CPU time to at least 10 msec precision. @@ -166,6 +195,7 @@ define mul_ratio(len) local tover; /* est of time for loop overhead */ local alg1_rate; /* loop rate of 1st algorithm */ local alg2_rate; /* loop rate of 2nd algorithm */ + local ret; /* return ratio, or 1.0 */ local i; /* @@ -218,12 +248,12 @@ define mul_ratio(len) * determine the 1st algorithm rate */ loops = max(1, ceil(loops * test_time / tlen)); - if (loops < 8) { + if (loops < 16) { if (config("user_debug") > 1) { - printf(" we must expand loop test time to more than %d secs\n", - ceil(test_time * (8 / loops))); + printf(" we must expand alg1 loop test time to about %d secs\n", + ceil(test_time * (16 / loops))); } - loops = 8; + loops = 16; } if (config("user_debug") > 3) { printf("\t will try alg1 %d loops\n", loops); @@ -264,12 +294,12 @@ define mul_ratio(len) * determine the 2nd algorithm rate */ loops = max(1, ceil(loops * test_time / tlen)); - if (loops < 8) { + if (loops < 16) { if (config("user_debug") > 1) { - printf(" we must expand loop test time to more than %d secs\n", - ceil(test_time * (8 / loops))); + printf(" we must expand alg2 loop test time to about %d secs\n", + ceil(test_time * (16 / loops))); } - loops = 8; + loops = 16; } tlen = mul_loop(loops, &x); if (config("user_debug") > 3) { @@ -298,7 +328,12 @@ define mul_ratio(len) /* * return alg1 / alg2 rate ratio */ - return (alg1_rate / alg2_rate); + ret = alg1_rate / alg2_rate; + if (config("user_debug") > 2) { + printf("\tprecise ratio is: %.f mul_ratio will return: %.3f\n", + alg1_rate / alg2_rate, ret); + } + return ret; } @@ -320,30 +355,39 @@ define best_mul2() { local ratio; /* previously calculated alg1/alg2 ratio */ local low; /* low loop value tested */ - local high; /* low loop value tested */ + local high; /* high loop value tested */ + local mid; /* between low and high */ + local best_val; /* value found with ratio closest to unity */ + local best_ratio; /* cloest ratio found to unity */ local expand; /* how fast to expand the length */ /* * setup */ - test_time = 15.0; - if (config("user_debug") > 0) { - printf("will start with loop test time of %d secs\n", test_time); + test_time = 30.0; + printf("The best_mul2() function will take a LONG time to run!\n"); + printf("It is important that best_mul2() run on an othwewise idle host!\n"); + if (config("user_debug") <= 0) { + printf("To monitor progress, set user_debug to 2: " + "config(\"user_debug\", 2)\n"); } + printf("Starting with loop test time of %d secs\n", test_time); /* * firewall - must have a >1 ratio for the initial length */ high = 16; + best_val = high; if (config("user_debug") > 0) { printf("testing multiply alg1/alg2 ratio for len = %d\n", high); } ratio = mul_ratio(high); + best_ratio = ratio; if (config("user_debug") > 1) { - printf(" multiply alg1/alg2 ratio = %.3f\n", ratio); + printf(" multiply alg1/alg2 ratio = %.6f\n", ratio); } - if (ratio <= 1.0) { - quit "best_mul2: tests imply config(\"mul2\") should be < 4"; + if (ratio < 1.0) { + quit "best_mul2: tests imply mul2 should be < 16, which seems bogus"; } /* @@ -356,7 +400,7 @@ define best_mul2() * We will multiplicatively expand our test level until * the ratio drops below 1.0. */ - expand = ((ratio >= 3.5) ? 16 : 2^round(ratio)); + expand = ((ratio >= 10) ? 1024 : 2^round(ratio)); low = high; high *= expand; if (config("user_debug") > 1) { @@ -368,20 +412,63 @@ define best_mul2() * determine the alg1/alg2 test ratio for this new length */ if (high >= 2^31) { - quit "best_mul2: tests imply config(\"mul2\") should be >= 2^31"; + quit "best_mul2: test implies mul2 >= 2^31, which seems bogus"; } if (config("user_debug") > 0) { printf("testing multiply alg1/alg2 ratio for len = %d\n", high); } ratio = mul_ratio(high); - if (config("user_debug") > 1) { - printf(" multiply alg1/alg2 ratio = %.3f\n", ratio); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = high; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } } - } while (ratio >= 1.0); + if (config("user_debug") > 1) { + printf(" multiply alg1/alg2 ratio = %.6f\n", ratio); + } + } while (ratio > 1.0); + + /* + * If we previously expanded more than by a factor of 2, then + * we may have jumped over the crossover point. So now + * drop down powers of two until the ratio is again >= 1.0 + */ + if (expand > 2) { + do { + + /* + * contract by 2 + */ + high /= 2; + low = high / 2; + if (config("user_debug") > 0) { + printf("retesting multiply alg1/alg2 ratio for len = %d\n", + high); + } + ratio = mul_ratio(high); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = high; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } + } + if (config("user_debug") > 1) { + printf(" multiply alg1/alg2 ratio = %.6f\n", ratio); + } + + } while (ratio <= 1.0); + + /* now that the ratio flipped again, use the previous range */ + low = high; + high = high * 2; + } if (config("user_debug") > 0) { - printf("alg1/alg2 ratio now < 1.0, starting binary search " - "between %d and %d\n", - low, high); + printf("Starting binary search between %d and %d\n", low, high); } /* @@ -390,30 +477,54 @@ define best_mul2() while (low+1 < high) { /* try the mid-point */ + mid = int((low+high)/2); if (config("user_debug") > 0) { - printf("testing multiply alg1/alg2 ratio for len = %d\n", - int((low+high)/2)); + printf("testing multiply alg1/alg2 ratio for len = %d\n", mid); + } + ratio = mul_ratio(mid); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = mid; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } } - ratio = mul_ratio(int((low+high)/2)); if (config("user_debug") > 1) { - printf(" multiply alg1/alg2 ratio = %.3f\n", ratio); + printf(" len %d multiply alg1/alg2 ratio = %.6f\n", mid, ratio); + } + + /* stop search if near unity */ + if (close_to_one(ratio)) { + low = mid; + high = mid; + if (config("user_debug") > 0) { + printf("\twe are close enough to unity ratio at: %d\n", mid); + } + break; } /* bump lower range up if we went over */ - if (ratio >= 1.0) { + if (ratio > 1.0) { if (config("user_debug") > 2) { printf("\tmove low from %d up to %d\n", - low, int((low+high)/2)); + low, mid); } - low = int((low+high)/2); + low = mid; /* drop higher range down if we went under */ } else { if (config("user_debug") > 2) { printf("\tmove high from %d down to %d\n", - high, int((low+high)/2)); + high, mid); } - high = int((low+high)/2); + high = mid; + } + + /* report on test loop progress */ + if (config("user_debug") > 1) { + printf("\tsetting low: %d high: %d diff: %d\n", + low, high, high-low); } } @@ -421,10 +532,15 @@ define best_mul2() * return on the suggested config("mul2") value */ if (config("user_debug") > 0) { - printf("best value of config(\"mul2\") is %d\n", - (ratio >= 1.0) ? high : low); + printf("Best value for multiply is near %d\n", best_val); + printf("Best multiply alg1/alg2 ratio is: %.6f\n", best_ratio); + printf("We suggest placing this line in your .calcrc:\n"); + printf("config(\"mul2\", %d),;\n", best_val); + printf("WARNING: It is believed that the output " + "of this resource file is bogus!\n"); + printf("WARNING: You may NOT wish to follow the above suggeston.\n"); } - return ((ratio >= 1.0) ? high : low); + return mid; } @@ -562,6 +678,7 @@ define sq_ratio(len) local tover; /* est of time for loop overhead */ local alg1_rate; /* loop rate of 1st algorithm */ local alg2_rate; /* loop rate of 2nd algorithm */ + local ret; /* return ratio, or 1.0 */ local i; /* @@ -614,12 +731,12 @@ define sq_ratio(len) * determine the 1st algorithm rate */ loops = max(1, ceil(loops * test_time / tlen)); - if (loops < 8) { + if (loops < 16) { if (config("user_debug") > 1) { - printf(" we must expand loop test time to more than %d secs\n", - ceil(test_time * (8 / loops))); + printf(" we must expand alg1 loop test time to about %d secs\n", + ceil(test_time * (16 / loops))); } - loops = 8; + loops = 16; } tlen = sq_loop(loops, &x); if (config("user_debug") > 3) { @@ -657,12 +774,12 @@ define sq_ratio(len) * determine the 2nd algorithm rate */ loops = max(1, ceil(loops * test_time / tlen)); - if (loops < 8) { + if (loops < 16) { if (config("user_debug") > 1) { - printf(" we must expand loop test time to more than %d secs\n", - ceil(test_time * (8 / loops))); + printf(" we must expand alg2 loop test time to about %d secs\n", + ceil(test_time * (16 / loops))); } - loops = 8; + loops = 16; } tlen = sq_loop(loops, &x); if (config("user_debug") > 3) { @@ -691,7 +808,12 @@ define sq_ratio(len) /* * return alg1 / alg2 rate ratio */ - return (alg1_rate / alg2_rate); + ret = alg1_rate / alg2_rate; + if (config("user_debug") > 2) { + printf("\tprecise ratio is: %.f sq_ratio will return: %.3f\n", + alg1_rate / alg2_rate, ret); + } + return ret; } @@ -713,30 +835,39 @@ define best_sq2() { local ratio; /* previously calculated alg1/alg2 ratio */ local low; /* low loop value tested */ - local high; /* low loop value tested */ + local high; /* high loop value tested */ + local mid; /* between low and high */ + local best_val; /* value found with ratio closest to unity */ + local best_ratio; /* cloest ratio found to unity */ local expand; /* how fast to expand the length */ /* * setup */ - test_time = 15.0; - if (config("user_debug") > 0) { - printf("will start with loop test time of %d secs\n", test_time); + test_time = 30.0; + printf("The best_sq2() function will take a LONG time to run!\n"); + printf("It is important that best_sq2() run on an othwewise idle host!\n"); + if (config("user_debug") <= 0) { + printf("To monitor progress, set user_debug to 2: " + "config(\"user_debug\", 2)\n"); } + printf("Starting with loop test time of %d secs\n", test_time); /* * firewall - must have a >1 ratio for the initial length */ high = 16; + best_val = high; if (config("user_debug") > 0) { printf("testing square alg1/alg2 ratio for len = %d\n", high); } ratio = sq_ratio(high); + best_ratio = ratio; if (config("user_debug") > 1) { printf(" square alg1/alg2 ratio = %.3f\n", ratio); } - if (ratio <= 1.0) { - quit "best_sq2: tests imply config(\"sq2\") should be < 4"; + if (ratio < 1.0) { + quit "best_sq2: test implies sq2 < 16, which seems bogus"; } /* @@ -749,32 +880,75 @@ define best_sq2() * We will multiplicatively expand our test level until * the ratio drops below 1.0. */ - expand = ((ratio >= 3.5) ? 16 : 2^round(ratio)); + expand = ((ratio >= 10) ? 1024 : 2^round(ratio)); low = high; high *= expand; if (config("user_debug") > 1) { printf(" expand the next test range by a factor of %d\n", - expand); + expand); } /* * determine the alg1/alg2 test ratio for this new length */ if (high >= 2^31) { - quit "best_sq2: tests imply config(\"sq2\") should be >= 2^31"; + quit "best_sq2: tests imply sq2 >= 2^31, which seems bogus"; } if (config("user_debug") > 0) { printf("testing square alg1/alg2 ratio for len = %d\n", high); } ratio = sq_ratio(high); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = high; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } + } if (config("user_debug") > 1) { printf(" square alg1/alg2 ratio = %.3f\n", ratio); } - } while (ratio >= 1.0); + } while (ratio > 1.0); + + /* + * If we previously expanded more than by a factor of 2, then + * we may have jumped over the crossover point. So now + * drop down powers of two until the ratio is again >= 1.0 + */ + if (expand > 2) { + do { + + /* + * contract by 2 + */ + high /= 2; + low = high / 2; + if (config("user_debug") > 0) { + printf("retesting multiply alg1/alg2 ratio for len = %d\n", + high); + } + ratio = mul_ratio(high); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = high; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } + } + if (config("user_debug") > 1) { + printf(" multiply alg1/alg2 ratio = %.6f\n", ratio); + } + + } while (ratio <= 1.0); + + /* now that the ratio flipped again, use the previous range */ + low = high; + high = high * 2; + } if (config("user_debug") > 0) { - printf("alg1/alg2 ratio now < 1.0, starting binary search " - "between %d and %d\n", - low, high); + printf("Starting binary search between %d and %d\n", low, high); } /* @@ -783,41 +957,71 @@ define best_sq2() while (low+1 < high) { /* try the mid-point */ + mid = int((low+high)/2); if (config("user_debug") > 0) { - printf("testing square alg1/alg2 ratio for len = %d\n", - int((low+high)/2)); + printf("testing square alg1/alg2 ratio for len = %d\n", mid); + } + ratio = sq_ratio(mid); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = mid; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } } - ratio = sq_ratio(int((low+high)/2)); if (config("user_debug") > 1) { - printf(" square alg1/alg2 ratio = %.3f\n", ratio); + printf(" len %d square alg1/alg2 ratio = %.6f\n", mid, ratio); + } + + /* stop search if near unity */ + if (close_to_one(ratio)) { + low = mid; + high = mid; + if (config("user_debug") > 0) { + printf("\twe are close enough to unity ratio at: %d\n", mid); + } + break; } /* bump lower range up if we went over */ - if (ratio >= 1.0) { + if (ratio > 1.0) { if (config("user_debug") > 2) { printf("\tmove low from %d up to %d\n", - low, int((low+high)/2)); + low, mid); } - low = int((low+high)/2); + low = mid; /* drop higher range down if we went under */ } else { if (config("user_debug") > 2) { printf("\tmove high from %d down to %d\n", - high, int((low+high)/2)); + high, mid); } - high = int((low+high)/2); + high = mid; + } + + /* report on test loop progress */ + if (config("user_debug") > 1) { + printf("\tsetting low: %d high: %d diff: %d\n", + low, high, high-low); } } /* * return on the suggested config("sq2") value */ + mid = int((low+high)/2); if (config("user_debug") > 0) { - printf("best value of config(\"sq2\") is %d\n", - (ratio >= 1.0) ? high : low); + printf("Best value for square is near %d\n", best_val); + printf("Best square alg1/alg2 ratio is: %.6f\n", best_ratio); + printf("We suggest placing this line in your .calcrc:\n"); + printf("config(\"sq2\", %d),;\n", best_val); + printf("WARNING: It is believed that the output " + "of this resource file is bogus!\n"); + printf("WARNING: You may NOT wish to follow the above suggeston.\n"); } - return ((ratio >= 1.0) ? high : low); + return mid; } @@ -968,6 +1172,7 @@ define pow_ratio(len) local alg1_rate; /* loop rate of 1st algorithm */ local alg2_rate; /* loop rate of 2nd algorithm */ local ex; /* exponent to use in pow_loop() */ + local ret; /* return ratio, or 1.0 */ local i; /* @@ -990,7 +1195,7 @@ define pow_ratio(len) /* * setup */ - ex = 5; + ex = 7; /* * initialize x, the values we will pmod @@ -1026,12 +1231,12 @@ define pow_ratio(len) * determine the 1st algorithm rate */ loops = max(1, ceil(loops * test_time / tlen)); - if (loops < 8) { + if (loops < 16) { if (config("user_debug") > 1) { - printf(" we must expand loop test time to more than %d secs\n", - ceil(test_time * (8 / loops))); + printf(" we must expand alg1 loop test time to about %d secs\n", + ceil(test_time * (16 / loops))); } - loops = 8; + loops = 16; } tlen = pow_loop(loops, &x, ex); if (config("user_debug") > 3) { @@ -1070,12 +1275,12 @@ define pow_ratio(len) * determine the 2nd algorithm rate */ loops = max(1, ceil(loops * test_time / tlen)); - if (loops < 8) { + if (loops < 16) { if (config("user_debug") > 1) { - printf(" we must expand loop test time to more than %d secs\n", - ceil(test_time * (8 / loops))); + printf(" we must expand alg2 loop test time to about %d secs\n", + ceil(test_time * (16 / loops))); } - loops = 8; + loops = 16; } tlen = pow_loop(loops, &x, ex); if (config("user_debug") > 3) { @@ -1104,7 +1309,12 @@ define pow_ratio(len) /* * return alg1 / alg2 rate ratio */ - return (alg1_rate / alg2_rate); + ret = alg1_rate / alg2_rate; + if (config("user_debug") > 2) { + printf("\tprecise ratio is: %.f pow_ratio will return: %.3f\n", + alg1_rate / alg2_rate, ret); + } + return ret; } @@ -1126,17 +1336,24 @@ define best_pow2() { local ratio; /* previously calculated alg1/alg2 ratio */ local low; /* low loop value tested */ - local high; /* low loop value tested */ + local high; /* high loop value tested */ + local mid; /* between low and high */ + local best_val; /* value found with ratio closest to unity */ + local best_ratio; /* cloest ratio found to unity */ local expand; /* how fast to expand the length */ local looped; /* 1 ==> we have expanded lengths before */ /* * setup */ - test_time = 15.0; - if (config("user_debug") > 0) { - printf("will start with loop test time of %d secs\n", test_time); + test_time = 60.0; + printf("The best_pow2() function will take a LONG time to run!\n"); + printf("It is important that best_pow2() run on an othwewise idle host!\n"); + if (config("user_debug") <= 0) { + printf("To monitor progress, set user_debug to 2: " + "config(\"user_debug\", 2)\n"); } + printf("Starting with loop test time of %d secs\n", test_time); /* * firewall - must have a >1.02 ratio for the initial length @@ -1147,12 +1364,22 @@ define best_pow2() */ low = 4; high = 4; + best_val = high; + best_ratio = 1e10; /* not a real value */ do { high *= 4; if (config("user_debug") > 0) { printf("testing pmod alg1/alg2 ratio for len = %d\n", high); } ratio = pow_ratio(high); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = high; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } + } if (config("user_debug") > 1) { printf(" pmod alg1/alg2 ratio = %.3f\n", ratio); if (ratio > 1.0 && ratio <= 1.02) { @@ -1199,20 +1426,27 @@ define best_pow2() * determine the alg1/alg2 test ratio for this new length */ if (high >= 2^31) { - quit "best_pow2: tests imply config(\"pow2\") should be >= 2^31"; + quit "best_pow2: test implies pow2 >= 2^31, which seems bogus"; } if (config("user_debug") > 0) { printf("testing pmod alg1/alg2 ratio for len = %d\n", high); } ratio = pow_ratio(high); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = high; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } + } if (config("user_debug") > 1) { - printf(" pmod alg1/alg2 ratio = %.3f\n", ratio); + printf(" pmod alg1/alg2 ratio = %.6f\n", ratio); } looped = 1; - } while (ratio >= 1.0); + } while (ratio > 1.0); if (config("user_debug") > 0) { - printf("alg1/alg2 ratio now < 1.0, starting binary search " - "between %d and %d\n", low, high); + printf("Starting binary search between %d and %d\n", low, high); } /* @@ -1221,39 +1455,69 @@ define best_pow2() while (low+1 < high) { /* try the mid-point */ + mid = int((low+high)/2); if (config("user_debug") > 0) { - printf("testing pmod alg1/alg2 ratio for len = %d\n", - int((low+high)/2)); + printf("testing pow2 alg1/alg2 ratio for len = %d\n", mid); + } + ratio = pow_ratio(mid); + if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) { + best_val = mid; + best_ratio = ratio; + if (config("user_debug") > 1) { + printf(" len %d has a new cloest ratio to unity: %.6f\n", + best_val, best_ratio); + } } - ratio = pow_ratio(int((low+high)/2)); if (config("user_debug") > 1) { - printf(" pmod alg1/alg2 ratio = %.3f\n", ratio); + printf(" len %d pmod alg1/alg2 ratio = %.6f\n", mid, ratio); + } + + /* stop search if near unity */ + if (close_to_one(ratio)) { + low = mid; + high = mid; + if (config("user_debug") > 0) { + printf("\twe are close enough to unity ratio at: %d\n", mid); + } + break; } /* bump lower range up if we went over */ - if (ratio >= 1.0) { + if (ratio > 1.0) { if (config("user_debug") > 2) { printf("\tmove low from %d up to %d\n", - low, int((low+high)/2)); + low, mid); } - low = int((low+high)/2); + low = mid; /* drop higher range down if we went under */ } else { if (config("user_debug") > 2) { printf("\tmove high from %d down to %d\n", - high, int((low+high)/2)); + high, mid); } - high = int((low+high)/2); + high = mid; + } + + /* report on test loop progress */ + if (config("user_debug") > 1) { + printf("\tsetting low: %d high: %d diff: %d\n", + low, high, high-low); } } /* * return on the suggested config("pow2") value */ + mid = int((low+high)/2); if (config("user_debug") > 0) { - printf("best value of config(\"pow2\") is %d\n", - (ratio >= 1.0) ? high : low); + printf("Best value for pmod is near %d\n", best_val); + printf("Best pmod alg1/alg2 ratio is: %.6f\n", best_ratio); + printf("We suggest placing this line in your .calcrc:\n"); + printf("config(\"pow2\", %d),;\n", best_val); + printf("WARNING: It is believed that the output " + "of this resource file is bogus!\n"); + printf("WARNING: You may NOT wish to follow the above suggeston.\n"); } - return ((ratio >= 1.0) ? high : low); + return mid; } diff --git a/calc.h b/calc.h index cc9591f..09f4254 100644 --- a/calc.h +++ b/calc.h @@ -1,7 +1,7 @@ /* * calc - definitions for calculator program * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.4 $ - * @(#) $Id: calc.h,v 30.4 2013/09/01 22:16:21 chongo Exp $ + * @(#) $Revision: 30.6 $ + * @(#) $Id: calc.h,v 30.6 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $ * * Under source code control: 1990/02/15 01:48:31 @@ -28,8 +28,8 @@ */ -#if !defined(__CALC_H__) -#define __CALC_H__ +#if !defined(INCLUDE_CALC_H) +#define INCLUDE_CALC_H #include #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -267,4 +267,4 @@ EXTERN char *Copyright; E_FUNC char *version(void); -#endif /* !__CALC_H__ */ +#endif /* !INCLUDE_CALC_H */ diff --git a/calc.spec.in b/calc.spec.in index 94e93f1..1820cea 100644 --- a/calc.spec.in +++ b/calc.spec.in @@ -1,8 +1,7 @@ -#****h* calc/calc.spec.in # # calc.spec.in - template specfile for calc # -# Copyright (C) 2003-2013 Petteri Kettunen and Landon Curt Noll +# Copyright (C) 2003-2014 Petteri Kettunen and Landon Curt Noll # # 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 @@ -18,8 +17,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# @(#) $Revision: 30.12 $ -# @(#) $Id: calc.spec.in,v 30.12 2013/09/02 03:04:26 chongo Exp $ +# @(#) $Revision: 30.23 $ +# @(#) $Id: calc.spec.in,v 30.23 2014/09/22 05:01:58 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/RCS/calc.spec.in,v $ # # Under source code control: 2003/02/16 20:21:39 @@ -31,13 +30,13 @@ # BUGS # - Uninstalling calc and calc-devel leaves empty dirs /usr/include/calc # and /usr/share/calc and its subdirs. In case e.g. %{_includedir}/calc -# is defined in `%files devel' section, then rpmbuild complains that +# is defined in `files devel' section, then rpmbuild complains that # header files are defined twice - rpmbuild bug or bug in specfile conf??? Summary: Arbitrary precision calculator. Name: calc Version: <<>> -Release: 11 +Release: 12 License: LGPL Group: Applications/Engineering Source: http://www.isthe.com/chongo/src/calc/%{name}-%{version}.tar.bz2 @@ -46,6 +45,8 @@ Vendor: Landon Noll and Associates Packager: Landon Noll and Associates (http://www.isthe.com/chongo/index.html) Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358 BuildRequires: ncurses-devel >= 5.5-24, readline-devel >= 5.1-3 +Provides: libcalc.so.%{version}()(64bit) +Provides: libcustcalc.so.%{version}()(64bit) BuildRoot: %{_tmppath}/build-root %description @@ -61,7 +62,10 @@ For the latest calc release, see the calc project home page: %package devel Summary: Development files and documentation for calc. Group: Applications/Engineering -Requires: calc = %{version}-%{release} +Requires: calc(x86-64) = %{version}-%{release} +Requires: libcalc.so.%{version}()(64bit) +Requires: libcustcalc.so.%{version}()(64bit) +Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358 %description devel This package contains the header files and static libraries for developing @@ -76,63 +80,67 @@ For the latest calc release, see the project home page: %build echo '-=- calc.spec beginning make clobber -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ clobber echo '-=- calc.spec ending make clobber -=-' echo '-=- calc.spec beginning make calc-static-only -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only echo '-=- calc.spec ending make calc-static-only -=-' echo '-=- calc.spec beginning make rpm-hide-static -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static echo '-=- calc.spec ending make rpm-hide-static -=-' echo '-=- calc.spec beginning make clobber (again) -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ clobber echo '-=- calc.spec ending make clobber (again) -=-' echo '-=- calc.spec beginning make calc-dynamic-only -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only \ BLD_TYPE=calc-dynamic-only LD_SHARE= echo '-=- calc.spec ending make calc-dynamic-only -=-' echo '-=- calc.spec beginning make chk -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ chk echo '-=- calc.spec ending make chk -=-' echo '-=- calc.spec beginning make rpm-unhide-static -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static echo '-=- calc.spec ending make rpm-unhide-static -=-' echo '-=- calc.spec beginning make rpm-clean-static -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static echo '-=- calc.spec ending make rpm-clean-static -=-' echo '-=- calc.spec beginning make rpm-chk-static -=-' -make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static echo '-=- calc.spec ending make rpm-chk-static -=-' %install echo '-=- calc.spec beginning make install -=-' -rm -rf %{_buildroot} mkdir -p %{_buildroot} -make T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ +make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ MANDIR=%{_mandir}/man1 EXT= V=@ install echo '-=- calc.spec ending make install -=-' %clean -rm -rf %{_buildroot} +echo '-=- calc.spec beginning make clean -=-' +rm -rf %{_tmppath} +rm -rf %{_builddir} +rm -rf %{_specdir} +rm -rf %{_buildrootdir} +echo '-=- calc.spec beginning make clean -=-' %files %defattr(-, root, root) @@ -148,9 +156,9 @@ rm -rf %{_buildroot} %attr(644, root, root) %{_datadir}/%{name}/*.cal %attr(644, root, root) %{_datadir}/%{name}/set8700.line %attr(644, root, root) %{_libdir}/libcalc.so -%attr(644, root, root) %{_libdir}/libcalc.so.* +%attr(644, root, root) %{_libdir}/libcalc.so.%{version} %attr(644, root, root) %{_libdir}/libcustcalc.so -%attr(644, root, root) %{_libdir}/libcustcalc.so.* +%attr(644, root, root) %{_libdir}/libcustcalc.so.%{version} %files devel %defattr(-, root, root) @@ -161,10 +169,27 @@ rm -rf %{_buildroot} %attr(644, root, root) %{_libdir}/libcustcalc.a %changelog +* Mon Sep 01 2014 Landon Curt Noll http://www.isthe.com/chongo +- Release: 12 +- Removed use of %{?_smp_mflags}. On Ubuntu 14.04, the -j2 + was executing make lines within a rule out of order. Always + use -j1 while building these RPMs to avoid this make bug. + This only impacts the speed of building the rpms. +- Stopped removing %{_buildroot} at the beginning of install + as this, acording to a number of sources, was asking for trouble. +- Clean removes tmp, BUILD, SPEC, and BUILDROOT dirs under topdir. +- Fixed the building of the calc-debuginfo rpm. +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday via BogusDateBot. + Sun May 20 2006 --> Sun May 14 2006 + Sun Sep 01 2007 --> Sun Aug 26 2007 + Sat May 05 2013 --> Sat May 04 2013 + * Sun Sep 01 2013 Landon Curt Noll http://www.isthe.com/chongo - Release: 11 - only list %{_datadir}/%{name}/set8700.line not *.line -* Sat May 05 2013 Landon Curt Noll http://www.isthe.com/chongo + +* Sun May 05 2013 Landon Curt Noll http://www.isthe.com/chongo - Release: 10 - Major bug rpm build process bug fix - Source: is a URL as per rpm requirements @@ -174,37 +199,46 @@ rm -rf %{_buildroot} - Fixed use of %{_buildroot} - Fixed permissions so that rpm build services can modify libraries - Added missing files to files section + * Mon Mar 25 2013 Landon Curt Noll http://www.isthe.com/chongo - Release: 9 (was 1.1) - Removed deprecated PreReq for calc-devel, using Requires -* Sun Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo + +* Sat Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo - Release: 8 - Release of calc-2.12.2 - Calc builds with shared libraries + * Sun Jun 25 2006 Landon Curt Noll http://www.isthe.com/chongo - Release: 7 - Changed Copyright to License as per new rpm v4.4 syntax -* Sun May 20 2006 Landon Curt Noll http://www.isthe.com/chongo + +* Sat May 20 2006 Landon Curt Noll http://www.isthe.com/chongo - Release: 6 - Release of calc-2.12.0 - Added *.line set files to the list of packaged files + * Sun Dec 11 2005 Landon Curt Noll http://www.isthe.com/chongo - Release: 5 - Release of calc-2.11.11 - Fixed description in spec file + * Wed Feb 26 2003 Landon Curt Noll http://www.isthe.com/chongo - Release: 4 - Release of calc-2.11.7-2 - Fixed attributes on include and lib calc-devel files - Added BUGS to calc-devel as well as calc + * Tue Feb 25 2003 Landon Curt Noll http://www.isthe.com/chongo - Release: 3 - Release of calc-2.11.7-1 - Require ncurses, readline and less to install. - Require ncurses-devel and readline-devel to build. + * Tue Feb 18 2003 Landon Curt Noll http://www.isthe.com/chongo - Release: 2 - Misc changes to fit local directory setup + * Sun Feb 16 2003 Petteri Kettunen - Release: 1 - initial RPM build diff --git a/check.awk b/check.awk index f637efa..7879aef 100644 --- a/check.awk +++ b/check.awk @@ -20,7 +20,7 @@ # # @(#) $Revision: 30.2 $ # @(#) $Id: check.awk,v 30.2 2013/08/11 01:08:32 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/check.awk,v $ # # Under source code control: 1996/05/25 22:07:58 # File existed as early as: 1996 diff --git a/cmath.h b/cmath.h index a2e010e..e556ee9 100644 --- a/cmath.h +++ b/cmath.h @@ -1,7 +1,7 @@ /* * cmath - data structures for extended precision complex arithmetic * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: cmath.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: cmath.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/cmath.h,v $ * * Under source code control: 1993/07/30 19:42:45 @@ -28,8 +28,8 @@ */ -#if !defined(__CMATH_H__) -#define __CMATH_H__ +#if !defined(INCLUDE_CMATH_H) +#define INCLUDE_CMATH_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -156,4 +156,4 @@ E_FUNC COMPLEX *swap_HALF_in_COMPLEX(COMPLEX *dest, COMPLEX *src, BOOL all); EXTERN COMPLEX _czero_, _cone_, _conei_; -#endif /* !__CMATH_H__ */ +#endif /* !INCLUDE_CMATH_H */ diff --git a/config.h b/config.h index a431973..b75f5db 100644 --- a/config.h +++ b/config.h @@ -1,7 +1,7 @@ /* * config - configuration routines * - * Copyright (C) 1999-2007 Landon Curt Noll and David I. Bell + * Copyright (C) 1999-2007,2014 Landon Curt Noll and David I. Bell * * Primary author: Landon Curt Noll * @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.2 $ - * @(#) $Id: config.h,v 30.2 2007/09/21 01:27:27 chongo Exp $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: config.h,v 30.4 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/config.h,v $ * * Under source code control: 1995/11/01 22:20:17 @@ -31,8 +31,8 @@ */ -#if !defined(__CONFIG_H__) -#define __CONFIG_H__ +#if !defined(INCLUDE_CONFIG_H) +#define INCLUDE_CONFIG_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -226,4 +226,4 @@ E_FUNC void config_print(CONFIG*); E_FUNC BOOL config_cmp(CONFIG*, CONFIG*); -#endif /* !__CONFIG_H__ */ +#endif /* !INCLUDE_CONFIG_H */ diff --git a/cscript/4dsphere.calc b/cscript/4dsphere.calc index 9bfc35f..9a796b8 100644 --- a/cscript/4dsphere.calc +++ b/cscript/4dsphere.calc @@ -1,4 +1,4 @@ -#!/usr/local/src/cmd/calc/calc -q -s -f +#!/usr/local/src/bin/calc/calc -q -s -f /* * 4dsphere - determine if 6 points lie on the surface of a sphere in R^4 * @@ -10,7 +10,7 @@ * ... ... * x5 y5 z5 w5 point 5 in R^4 * - * Copyright (C) 2001 Landon Curt Noll + * Copyright (C) 2001,2014 Landon Curt Noll * * 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 @@ -26,8 +26,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: 4dsphere.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: 4dsphere.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/4dsphere.calc,v $ * * Under source code control: 2001/05/03 19:02:03 diff --git a/cscript/Makefile b/cscript/Makefile index 9a75550..6de20ba 100644 --- a/cscript/Makefile +++ b/cscript/Makefile @@ -1,7 +1,7 @@ # # cscript - makefile for calc shell script files # -# Copyright (C) 1999-2006 Landon Curt Noll +# Copyright (C) 1999-2006,2014 Landon Curt Noll # # 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 @@ -17,8 +17,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# @(#) $Revision: 30.4 $ -# @(#) $Id: Makefile,v 30.4 2013/08/11 08:41:38 chongo Exp $ +# @(#) $Revision: 30.9 $ +# @(#) $Id: Makefile,v 30.9 2014/09/02 07:14:49 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/Makefile,v $ # # Under source code control: 1999/11/29 11:10:26 @@ -227,7 +227,7 @@ all: ${TARGETS} .all README: README.src @${RM} -f $@ - @${SED} -e "s:#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "s:#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ # used by the upper level Makefile to determine if we have done all # @@ -315,9 +315,8 @@ depend: if [ X"$$i" != X"/dev/null" ]; then \ echo "$$i: $$i.calc"; \ echo ' @$${RM} -f $$@'; \ - echo -n ' @$${SED} -e "1s:'; \ - echo "^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" \ - $$?>$$@'; \ + echo -n ' @$${SED} -e "1s:^#!/usr/local/src/bin/'; \ + echo 'calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \ echo ' @$${CHMOD} +x $$@'; \ fi; \ done >> makedep.out @@ -341,9 +340,9 @@ depend: fi; \ ${MV} ${MAKE_FILE}.tmp ${MAKE_FILE}; \ if [ -d RCS ]; then \ - echo '*****************************************************'; \ - echo 'new sample ${MAKE_FILE} formed -- need to check it in'; \ - echo '*****************************************************'; \ + echo '******************************************************'; \ + echo 'new cscript ${MAKE_FILE} formed -- need to check it in'; \ + echo '******************************************************'; \ fi; \ fi @@ -379,8 +378,8 @@ clobber: clean # install: all -${Q} if [ ! -d ${T}${BINDIR} ]; then \ - echo ${MKDIR} ${T}${BINDIR}; \ - ${MKDIR} ${T}${BINDIR}; \ + echo ${MKDIR} -p ${T}${BINDIR}; \ + ${MKDIR} -p ${T}${BINDIR}; \ if [ ! -d "${T}${BINDIR}" ]; then \ echo ${MKDIR} -p "${T}${BINDIR}"; \ ${MKDIR} -p "${T}${BINDIR}"; \ @@ -391,8 +390,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${SCRIPTDIR} ]; then \ - echo ${MKDIR} ${T}${SCRIPTDIR}; \ - ${MKDIR} ${T}${SCRIPTDIR}; \ + echo ${MKDIR} -p ${T}${SCRIPTDIR}; \ + ${MKDIR} -p ${T}${SCRIPTDIR}; \ if [ ! -d "${T}${SCRIPTDIR}" ]; then \ echo ${MKDIR} -p "${T}${SCRIPTDIR}"; \ ${MKDIR} -p "${T}${SCRIPTDIR}"; \ @@ -446,33 +445,33 @@ uninstall: 4dsphere: 4dsphere.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ fproduct: fproduct.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ mersenne: mersenne.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ piforever: piforever.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ plus: plus.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ powerterm: powerterm.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ simple: simple.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ square: square.calc @${RM} -f $@ - @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ + @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@ @${CHMOD} +x $@ diff --git a/cscript/README.src b/cscript/README.src index a3fec10..72df305 100644 --- a/cscript/README.src +++ b/cscript/README.src @@ -7,7 +7,7 @@ be useful! Please note that calc shell scripts must start with the line: - #!/usr/local/src/cmd/calc/calc -q -f + #!/usr/local/src/bin/calc/calc -q -f The above line MUST start in column 1 of the first line. The first line must also end in -f. The -q is optional, but is recommended to disable @@ -18,7 +18,7 @@ Comments must be /* c-like comment */ or start with a double ## symbol. This is the correct way to form a calc shell script: - #!/usr/local/src/cmd/calc/calc -q -f + #!/usr/local/src/bin/calc/calc -q -f /* a correct comment */ ## another correct comment @@ -36,7 +36,7 @@ For more informaton about calc command lines, see "help usage". This next example WRONG: - #!/usr/local/src/cmd/calc/calc -q + #!/usr/local/src/bin/calc/calc -q # This is not a calc calc comment because it has only a single # # You must to start comments with ## or /* @@ -101,7 +101,7 @@ simple A trivial example of a calc shell script. -## Copyright (C) 1999 Landon Curt Noll +## Copyright (C) 1999,2014 Landon Curt Noll ## ## 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 @@ -117,8 +117,8 @@ simple ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -## @(#) $Revision: 30.1 $ -## @(#) $Id: README.src,v 30.1 2007/03/16 11:12:11 chongo Exp $ +## @(#) $Revision: 30.3 $ +## @(#) $Id: README.src,v 30.3 2014/08/24 22:04:32 chongo Exp $ ## @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/README.src,v $ ## ## Under source code control: 1999/12/17 10:23:40 diff --git a/cscript/fproduct.calc b/cscript/fproduct.calc index 0e8215f..38db2ee 100644 --- a/cscript/fproduct.calc +++ b/cscript/fproduct.calc @@ -1,4 +1,4 @@ -#!/usr/local/src/cmd/calc/calc -q -s -f +#!/usr/local/src/bin/calc/calc -q -s -f /* * fproduct - write the big Endian product of terms to a file * @@ -8,7 +8,7 @@ * filename where to write the product, use - for stdout * term ... terms to multiply * - * Copyright (C) 2001 Landon Curt Noll + * Copyright (C) 2001,2014 Landon Curt Noll * * 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 @@ -24,8 +24,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: fproduct.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: fproduct.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/fproduct.calc,v $ * * Under source code control: 2001/04/07 20:13:11 diff --git a/cscript/mersenne.calc b/cscript/mersenne.calc index 6ab3eb2..8199383 100644 --- a/cscript/mersenne.calc +++ b/cscript/mersenne.calc @@ -1,8 +1,8 @@ -#!/usr/local/src/cmd/calc/calc -q -s -f +#!/usr/local/src/bin/calc/calc -q -s -f /* * mersenne - print the value of a mersenne number * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -18,8 +18,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: mersenne.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: mersenne.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/mersenne.calc,v $ * * Under source code control: 1999/11/30 00:09:01; diff --git a/cscript/piforever.calc b/cscript/piforever.calc index e4cdb9e..85b0e89 100644 --- a/cscript/piforever.calc +++ b/cscript/piforever.calc @@ -1,8 +1,8 @@ -#!/usr/local/src/cmd/calc/calc -q -f +#!/usr/local/src/bin/calc/calc -q -f /* * piforever - print digits of pi forever (or as long as your mem/cpu allow) * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -18,8 +18,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: piforever.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: piforever.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/piforever.calc,v $ * * Under source code control: 1999/11/30 00:11:36 diff --git a/cscript/plus.calc b/cscript/plus.calc index 430f646..f490002 100644 --- a/cscript/plus.calc +++ b/cscript/plus.calc @@ -1,8 +1,8 @@ -#!/usr/local/src/cmd/calc/calc -q -f +#!/usr/local/src/bin/calc/calc -q -f /* * plus - add two or more arguments together * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -18,8 +18,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: plus.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: plus.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/plus.calc,v $ * * Under source code control: 1999/11/29 10:22:37 diff --git a/cscript/powerterm.calc b/cscript/powerterm.calc index 28b8d31..f3868b3 100644 --- a/cscript/powerterm.calc +++ b/cscript/powerterm.calc @@ -1,4 +1,4 @@ -#!/usr/local/src/cmd/calc/calc -q -s -f +#!/usr/local/src/bin/calc/calc -q -s -f /* * powerterm - print the argument as a sum of powers of integers * @@ -8,7 +8,7 @@ * base_limit largest base we will consider (def: 10000) * value value to convert into sums of powers of integers * - * Copyright (C) 2001 Landon Curt Noll + * Copyright (C) 2001,2014 Landon Curt Noll * * Calc is open software; you can redistribute it and/or modify it under * the powerterm of the version 2.1 of the GNU Lesser General Public License @@ -24,8 +24,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: powerterm.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: powerterm.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/powerterm.calc,v $ * * Under source code control: 2001/04/24 23:49:11 diff --git a/cscript/simple.calc b/cscript/simple.calc index 1380b19..95d6583 100644 --- a/cscript/simple.calc +++ b/cscript/simple.calc @@ -1,8 +1,8 @@ -#!/usr/local/src/cmd/calc/calc -q -f +#!/usr/local/src/bin/calc/calc -q -f /* * simple - an example of a simple calc shell script * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -18,8 +18,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: simple.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: simple.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/simple.calc,v $ * * Under source code control: 1999/11/29 10:22:37 diff --git a/cscript/square.calc b/cscript/square.calc index a2df7ac..0298358 100644 --- a/cscript/square.calc +++ b/cscript/square.calc @@ -1,8 +1,8 @@ -#!/usr/local/src/cmd/calc/calc -q -f +#!/usr/local/src/bin/calc/calc -q -f /* * sqaure - print the squares of input values * - * Copyright (C) 2000-2007 Ernest Bowen + * Copyright (C) 2000-2007,2014 Ernest Bowen * * 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 @@ -18,8 +18,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: square.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: square.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/square.calc,v $ * * Under source code control: 2000/12/15 06:52:01 diff --git a/custom/Makefile b/custom/Makefile index cbff418..70a228e 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -2,7 +2,7 @@ # # custom - makefile for calc custom routines # -# Copyright (C) 1999-2006 Landon Curt Noll +# Copyright (C) 1999-2006,2014 Landon Curt Noll # # 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 @@ -18,8 +18,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# @(#) $Revision: 30.31 $ -# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $ +# @(#) $Revision: 30.35 $ +# @(#) $Id: Makefile.head,v 30.35 2014/09/21 14:09:18 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $ # # Under source code control: 1997/03/09 02:28:54 @@ -337,20 +337,6 @@ CALC_ENV= CALCPATH=./cal ALLOW_CUSTOM= -DCUSTOM #ALLOW_CUSTOM= -# The install rule uses: -# -# ${MKDIR} ${MKDIR_ARG} -# -# to create directorties. Normall this amounts to usins mkdir -p dir ... -# Some older systems may not have mkdir -p. If you system does not -# make mkdir -p, then set MKDIR_ARG to empty. -# -# MKDIR_ARG= -p # use mkdir -p when creating paths -# MKDIR_ARG= # use if system does not understand mkdir -p -# -MKDIR_ARG= -p -#MKDIR_ARG= - # Some out of date operating systems require / want an executable to # end with a certain file extension. Some compile systems such as # Cygwin build calc as calc.exe. The EXT variable is used to denote @@ -366,15 +352,18 @@ EXT= # The default calc versions # -VERSION= 2.12.4.13 -VERS= 2.12.4 -VER= 2.12 -VE= 2 +VERSION= 2.12.4.14 # Names of shared libraries with versions # LIB_EXT= .so LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} + +# legacy partial versions are no longer used, only removed +# +VERS= 2.12.4 +VER= 2.12 +VE= 2 LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VE= ${LIB_EXT}.${VE} @@ -489,6 +478,17 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS} # # CCOPT are flags given to ${CC} for optimization # CCWARN are flags given to ${CC} for warning message control +# +# WNO_IMPLICT, WNO_ERROR_LONG_LONG and WNO_LONG_LONG are given to ${CC} +# when compiling special .o files that may need special compile options +# NOTE: These flags simply turn off certain compiler warnings, +# which is useful only when CCWERR is set to -Werror. +# NOTE: If your compiler does not have these -Wno files, just +# set these variables to nothing as in: +# WNO_IMPLICT= +# WNO_ERROR_LONG_LONG= +# WNO_LONG_LONG= +# # CCWERR are flags given to ${CC} to make warnings fatal errors # NOTE: CCWERR is only set in development Makefiles and must only be # used with ${CC}, not ${LCC}. If you do not want the compiler @@ -535,7 +535,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -545,9 +548,9 @@ CC= ${PURIFY} ${LCC} ${CCWERR} # endif -################################# -# Apple MacOS X / Darwin target # -################################# +############################## +# Apple OS X / Darwin target # +############################## ifeq ($(target),Darwin) # @@ -556,9 +559,23 @@ BLD_TYPE= calc-dynamic-only CC_SHARE= -fPIC DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib LD_SHARE= ${DARWIN_ARCH} -LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib +#SET_INSTALL_NAME= no +SET_INSTALL_NAME= yes +ifeq ($(SET_INSTALL_NAME),yes) +LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + -install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} ${DARWIN_ARCH} +else +LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + ${DARWIN_ARCH} +endif ifdef ALLOW_CUSTOM -LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib +ifeq ($(SET_INSTALL_NAME),yes) +LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + -install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${DARWIN_ARCH} +else +LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ + ${DARWIN_ARCH} +endif else LIBCUSTCALC_SHLIB= endif @@ -568,17 +585,21 @@ LD_STATIC= ${DARWIN_ARCH} LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= ${DARWIN_ARCH} # -LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc +LCC= clang CC= ${PURIFY} ${LCC} ${CCWERR} # # Darwin dynamic shared lib filenames LIB_EXT:= .dylib LIB_EXT_VERSION:= .${VERSION}${LIB_EXT} +# legacy partial versions are no longer used, only removed LIB_EXT_VERS:= .${VERS}${LIB_EXT} LIB_EXT_VER:= .${VER}${LIB_EXT} LIB_EXT_VE:= .${VE}${LIB_EXT} @@ -587,8 +608,8 @@ LDCONFIG:= # DARWIN_ARCH= -arch i386 -arch ppc # Universal binary # DARWIN_ARCH= -arch i386 # Intel binary # DARWIN_ARCH= -arch ppc # PPC binary +# DARWIN_ARCH= -arch x86_64 # native 64-bit binary DARWIN_ARCH= # native binary -MACOSX_DEPLOYMENT_TARGET=10.8 # endif @@ -622,7 +643,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -665,6 +689,9 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= # CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -680,7 +707,6 @@ endif # SunOS target # ################ -# XXX - this needs to be tested ifeq ($(target),SunOS) # BLD_TYPE= calc-dynamic-only @@ -701,7 +727,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -735,7 +764,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -769,7 +801,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -829,7 +864,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= -DNOTCYGWIN @@ -866,7 +904,10 @@ LIBCALC_STATIC= LIBCUSTCALC_STATIC= LD_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -1086,8 +1127,8 @@ depend: fi ${Q} echo forming custom/skel ${Q} ${RM} -rf skel - ${Q} ${MKDIR} skel - ${Q} ${MKDIR} skel/custom + ${Q} ${MKDIR} -p skel + ${Q} ${MKDIR} -p skel/custom -${Q} for i in ${C_SRC} /dev/null; do \ if [ X"$$i" != X"/dev/null" ]; then \ ${SED} -n '/^#[ ]*include[ ]*"/p' \ @@ -1198,11 +1239,13 @@ clobber: clean ${RM} -f ${BLD_TYPE} ${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak ${RM} -f libcustcalc${LIB_EXT_VERSION} + ${RM} -f libcustcalc${LIB_EXT} + ${RM} -f libcustcalc.*.dylib + ${RM} -f libcustcalc.a + ${V} echo remove files that are obsolete ${RM} -f libcustcalc${LIB_EXT_VERS} ${RM} -f libcustcalc${LIB_EXT_VER} ${RM} -f libcustcalc${LIB_EXT_VE} - ${RM} -f libcustcalc${LIB_EXT} - ${RM} -f libcustcalc.a #if 0 /* start of skip for non-Gnu makefiles */ ${RM} -f Makefile.simple #endif /* end of skip for non-Gnu makefiles */ @@ -1212,9 +1255,21 @@ clobber: clean # NOTE: Keep the uninstall rule in reverse order to the install rule # install: all + -${Q} if [ ! -d ${T}${LIBDIR} ]; then \ + echo ${MKDIR} -p ${T}${LIBDIR}; \ + ${MKDIR} -p ${T}${LIBDIR}; \ + if [ ! -d "${T}${LIBDIR}" ]; then \ + echo ${MKDIR} -p "${T}${LIBDIR}"; \ + ${MKDIR} -p "${T}${LIBDIR}"; \ + fi; \ + echo ${CHMOD} 0755 ${T}${LIBDIR}; \ + ${CHMOD} 0755 ${T}${LIBDIR}; \ + else \ + ${TRUE}; \ + fi -${Q} if [ ! -d ${T}${INCDIR} ]; then \ - echo ${MKDIR} ${T}${INCDIR}; \ - ${MKDIR} ${T}${INCDIR}; \ + echo ${MKDIR} -p ${T}${INCDIR}; \ + ${MKDIR} -p ${T}${INCDIR}; \ if [ ! -d "${T}${INCDIR}" ]; then \ echo ${MKDIR} -p "${T}${INCDIR}"; \ ${MKDIR} -p "${T}${INCDIR}"; \ @@ -1225,8 +1280,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ - ${MKDIR} ${T}${CALC_SHAREDIR}; \ + echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ + ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ @@ -1237,8 +1292,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_INCDIR}; \ - ${MKDIR} ${T}${CALC_INCDIR}; \ + echo ${MKDIR} -p ${T}${CALC_INCDIR}; \ + ${MKDIR} -p ${T}${CALC_INCDIR}; \ if [ ! -d "${T}${CALC_INCDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \ ${MKDIR} -p "${T}${CALC_INCDIR}"; \ @@ -1249,8 +1304,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${HELPDIR} ]; then \ - echo ${MKDIR} ${T}${HELPDIR}; \ - ${MKDIR} ${T}${HELPDIR}; \ + echo ${MKDIR} -p ${T}${HELPDIR}; \ + ${MKDIR} -p ${T}${HELPDIR}; \ if [ ! -d "${T}${HELPDIR}" ]; then \ echo ${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \ @@ -1261,8 +1316,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMCALDIR}; \ - ${MKDIR} ${T}${CUSTOMCALDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ + ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ @@ -1273,8 +1328,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \ - ${MKDIR} ${T}${CUSTOMHELPDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ + ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ @@ -1285,8 +1340,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMINCDIR}; \ - ${MKDIR} ${T}${CUSTOMINCDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ + ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ diff --git a/custom/Makefile.head b/custom/Makefile.head index 69f05af..38f834c 100644 --- a/custom/Makefile.head +++ b/custom/Makefile.head @@ -2,7 +2,7 @@ # # custom - makefile for calc custom routines # -# Copyright (C) 1999-2006 Landon Curt Noll +# Copyright (C) 1999-2006,2014 Landon Curt Noll # # 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 @@ -18,8 +18,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# @(#) $Revision: 30.31 $ -# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $ +# @(#) $Revision: 30.35 $ +# @(#) $Id: Makefile.head,v 30.35 2014/09/21 14:09:18 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $ # # Under source code control: 1997/03/09 02:28:54 @@ -337,20 +337,6 @@ CALC_ENV= CALCPATH=./cal ALLOW_CUSTOM= -DCUSTOM #ALLOW_CUSTOM= -# The install rule uses: -# -# ${MKDIR} ${MKDIR_ARG} -# -# to create directorties. Normall this amounts to usins mkdir -p dir ... -# Some older systems may not have mkdir -p. If you system does not -# make mkdir -p, then set MKDIR_ARG to empty. -# -# MKDIR_ARG= -p # use mkdir -p when creating paths -# MKDIR_ARG= # use if system does not understand mkdir -p -# -MKDIR_ARG= -p -#MKDIR_ARG= - # Some out of date operating systems require / want an executable to # end with a certain file extension. Some compile systems such as # Cygwin build calc as calc.exe. The EXT variable is used to denote @@ -366,15 +352,18 @@ EXT= # The default calc versions # -VERSION= 2.12.4.13 -VERS= 2.12.4 -VER= 2.12 -VE= 2 +VERSION= 2.12.4.14 # Names of shared libraries with versions # LIB_EXT= .so LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} + +# legacy partial versions are no longer used, only removed +# +VERS= 2.12.4 +VER= 2.12 +VE= 2 LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VE= ${LIB_EXT}.${VE} diff --git a/custom/Makefile.simple b/custom/Makefile.simple index 9af7e5d..f9965e7 100644 --- a/custom/Makefile.simple +++ b/custom/Makefile.simple @@ -2,7 +2,7 @@ # # custom - makefile for calc custom routines # -# Copyright (C) 1999-2006 Landon Curt Noll +# Copyright (C) 1999-2006,2014 Landon Curt Noll # # 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 @@ -18,8 +18,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# @(#) $Revision: 30.31 $ -# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $ +# @(#) $Revision: 30.35 $ +# @(#) $Id: Makefile.head,v 30.35 2014/09/21 14:09:18 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $ # # Under source code control: 1997/03/09 02:28:54 @@ -322,20 +322,6 @@ CALC_ENV= CALCPATH=./cal ALLOW_CUSTOM= -DCUSTOM #ALLOW_CUSTOM= -# The install rule uses: -# -# ${MKDIR} ${MKDIR_ARG} -# -# to create directorties. Normall this amounts to usins mkdir -p dir ... -# Some older systems may not have mkdir -p. If you system does not -# make mkdir -p, then set MKDIR_ARG to empty. -# -# MKDIR_ARG= -p # use mkdir -p when creating paths -# MKDIR_ARG= # use if system does not understand mkdir -p -# -MKDIR_ARG= -p -#MKDIR_ARG= - # Some out of date operating systems require / want an executable to # end with a certain file extension. Some compile systems such as # Cygwin build calc as calc.exe. The EXT variable is used to denote @@ -351,15 +337,18 @@ EXT= # The default calc versions # -VERSION= 2.12.4.13 -VERS= 2.12.4 -VER= 2.12 -VE= 2 +VERSION= 2.12.4.14 # Names of shared libraries with versions # LIB_EXT= .so LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} + +# legacy partial versions are no longer used, only removed +# +VERS= 2.12.4 +VER= 2.12 +VE= 2 LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VE= ${LIB_EXT}.${VE} @@ -449,6 +438,17 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS} # # CCOPT are flags given to ${CC} for optimization # CCWARN are flags given to ${CC} for warning message control +# +# WNO_IMPLICT, WNO_ERROR_LONG_LONG and WNO_LONG_LONG are given to ${CC} +# when compiling special .o files that may need special compile options +# NOTE: These flags simply turn off certain compiler warnings, +# which is useful only when CCWERR is set to -Werror. +# NOTE: If your compiler does not have these -Wno files, just +# set these variables to nothing as in: +# WNO_IMPLICT= +# WNO_ERROR_LONG_LONG= +# WNO_LONG_LONG= +# # CCWERR are flags given to ${CC} to make warnings fatal errors # NOTE: CCWERR is only set in development Makefiles and must only be # used with ${CC}, not ${LCC}. If you do not want the compiler @@ -485,7 +485,10 @@ LD_STATIC= LIBCALC_STATIC= LIBCUSTCALC_STATIC= # -CCWARN= -Wall -W -Wno-comment +CCWARN= -Wall +WNO_IMPLICT= -Wno-implicit +WNO_ERROR_LONG_LONG= -Wno-error=long-long +WNO_LONG_LONG= -Wno-long-long CCWERR= CCOPT= ${DEBUG} CCMISC= @@ -679,8 +682,8 @@ depend: fi ${Q} echo forming custom/skel ${Q} ${RM} -rf skel - ${Q} ${MKDIR} skel - ${Q} ${MKDIR} skel/custom + ${Q} ${MKDIR} -p skel + ${Q} ${MKDIR} -p skel/custom -${Q} for i in ${C_SRC} /dev/null; do \ if [ X"$$i" != X"/dev/null" ]; then \ ${SED} -n '/^#[ ]*include[ ]*"/p' \ @@ -791,20 +794,34 @@ clobber: clean ${RM} -f ${BLD_TYPE} ${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak ${RM} -f libcustcalc${LIB_EXT_VERSION} + ${RM} -f libcustcalc${LIB_EXT} + ${RM} -f libcustcalc.*.dylib + ${RM} -f libcustcalc.a + ${V} echo remove files that are obsolete ${RM} -f libcustcalc${LIB_EXT_VERS} ${RM} -f libcustcalc${LIB_EXT_VER} ${RM} -f libcustcalc${LIB_EXT_VE} - ${RM} -f libcustcalc${LIB_EXT} - ${RM} -f libcustcalc.a # install everything # # NOTE: Keep the uninstall rule in reverse order to the install rule # install: all + -${Q} if [ ! -d ${T}${LIBDIR} ]; then \ + echo ${MKDIR} -p ${T}${LIBDIR}; \ + ${MKDIR} -p ${T}${LIBDIR}; \ + if [ ! -d "${T}${LIBDIR}" ]; then \ + echo ${MKDIR} -p "${T}${LIBDIR}"; \ + ${MKDIR} -p "${T}${LIBDIR}"; \ + fi; \ + echo ${CHMOD} 0755 ${T}${LIBDIR}; \ + ${CHMOD} 0755 ${T}${LIBDIR}; \ + else \ + ${TRUE}; \ + fi -${Q} if [ ! -d ${T}${INCDIR} ]; then \ - echo ${MKDIR} ${T}${INCDIR}; \ - ${MKDIR} ${T}${INCDIR}; \ + echo ${MKDIR} -p ${T}${INCDIR}; \ + ${MKDIR} -p ${T}${INCDIR}; \ if [ ! -d "${T}${INCDIR}" ]; then \ echo ${MKDIR} -p "${T}${INCDIR}"; \ ${MKDIR} -p "${T}${INCDIR}"; \ @@ -815,8 +832,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ - ${MKDIR} ${T}${CALC_SHAREDIR}; \ + echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ + ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ @@ -827,8 +844,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_INCDIR}; \ - ${MKDIR} ${T}${CALC_INCDIR}; \ + echo ${MKDIR} -p ${T}${CALC_INCDIR}; \ + ${MKDIR} -p ${T}${CALC_INCDIR}; \ if [ ! -d "${T}${CALC_INCDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \ ${MKDIR} -p "${T}${CALC_INCDIR}"; \ @@ -839,8 +856,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${HELPDIR} ]; then \ - echo ${MKDIR} ${T}${HELPDIR}; \ - ${MKDIR} ${T}${HELPDIR}; \ + echo ${MKDIR} -p ${T}${HELPDIR}; \ + ${MKDIR} -p ${T}${HELPDIR}; \ if [ ! -d "${T}${HELPDIR}" ]; then \ echo ${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \ @@ -851,8 +868,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMCALDIR}; \ - ${MKDIR} ${T}${CUSTOMCALDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ + ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ @@ -863,8 +880,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \ - ${MKDIR} ${T}${CUSTOMHELPDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ + ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ @@ -875,8 +892,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMINCDIR}; \ - ${MKDIR} ${T}${CUSTOMINCDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ + ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ diff --git a/custom/Makefile.tail b/custom/Makefile.tail index cf73849..6753bb7 100644 --- a/custom/Makefile.tail +++ b/custom/Makefile.tail @@ -177,8 +177,8 @@ depend: fi ${Q} echo forming custom/skel ${Q} ${RM} -rf skel - ${Q} ${MKDIR} skel - ${Q} ${MKDIR} skel/custom + ${Q} ${MKDIR} -p skel + ${Q} ${MKDIR} -p skel/custom -${Q} for i in ${C_SRC} /dev/null; do \ if [ X"$$i" != X"/dev/null" ]; then \ ${SED} -n '/^#[ ]*include[ ]*"/p' \ @@ -289,11 +289,13 @@ clobber: clean ${RM} -f ${BLD_TYPE} ${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak ${RM} -f libcustcalc${LIB_EXT_VERSION} + ${RM} -f libcustcalc${LIB_EXT} + ${RM} -f libcustcalc.*.dylib + ${RM} -f libcustcalc.a + ${V} echo remove files that are obsolete ${RM} -f libcustcalc${LIB_EXT_VERS} ${RM} -f libcustcalc${LIB_EXT_VER} ${RM} -f libcustcalc${LIB_EXT_VE} - ${RM} -f libcustcalc${LIB_EXT} - ${RM} -f libcustcalc.a #if 0 /* start of skip for non-Gnu makefiles */ ${RM} -f Makefile.simple #endif /* end of skip for non-Gnu makefiles */ @@ -303,9 +305,21 @@ clobber: clean # NOTE: Keep the uninstall rule in reverse order to the install rule # install: all + -${Q} if [ ! -d ${T}${LIBDIR} ]; then \ + echo ${MKDIR} -p ${T}${LIBDIR}; \ + ${MKDIR} -p ${T}${LIBDIR}; \ + if [ ! -d "${T}${LIBDIR}" ]; then \ + echo ${MKDIR} -p "${T}${LIBDIR}"; \ + ${MKDIR} -p "${T}${LIBDIR}"; \ + fi; \ + echo ${CHMOD} 0755 ${T}${LIBDIR}; \ + ${CHMOD} 0755 ${T}${LIBDIR}; \ + else \ + ${TRUE}; \ + fi -${Q} if [ ! -d ${T}${INCDIR} ]; then \ - echo ${MKDIR} ${T}${INCDIR}; \ - ${MKDIR} ${T}${INCDIR}; \ + echo ${MKDIR} -p ${T}${INCDIR}; \ + ${MKDIR} -p ${T}${INCDIR}; \ if [ ! -d "${T}${INCDIR}" ]; then \ echo ${MKDIR} -p "${T}${INCDIR}"; \ ${MKDIR} -p "${T}${INCDIR}"; \ @@ -316,8 +330,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ - ${MKDIR} ${T}${CALC_SHAREDIR}; \ + echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ + ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ @@ -328,8 +342,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_INCDIR}; \ - ${MKDIR} ${T}${CALC_INCDIR}; \ + echo ${MKDIR} -p ${T}${CALC_INCDIR}; \ + ${MKDIR} -p ${T}${CALC_INCDIR}; \ if [ ! -d "${T}${CALC_INCDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \ ${MKDIR} -p "${T}${CALC_INCDIR}"; \ @@ -340,8 +354,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${HELPDIR} ]; then \ - echo ${MKDIR} ${T}${HELPDIR}; \ - ${MKDIR} ${T}${HELPDIR}; \ + echo ${MKDIR} -p ${T}${HELPDIR}; \ + ${MKDIR} -p ${T}${HELPDIR}; \ if [ ! -d "${T}${HELPDIR}" ]; then \ echo ${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \ @@ -352,8 +366,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMCALDIR}; \ - ${MKDIR} ${T}${CUSTOMCALDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ + ${MKDIR} -p ${T}${CUSTOMCALDIR}; \ if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ @@ -364,8 +378,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \ - ${MKDIR} ${T}${CUSTOMHELPDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ + ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \ if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ @@ -376,8 +390,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ - echo ${MKDIR} ${T}${CUSTOMINCDIR}; \ - ${MKDIR} ${T}${CUSTOMINCDIR}; \ + echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ + ${MKDIR} -p ${T}${CUSTOMINCDIR}; \ if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \ echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ diff --git a/decl.h b/decl.h index 4ebf34b..016aed1 100644 --- a/decl.h +++ b/decl.h @@ -1,7 +1,7 @@ /* * decl - variable and function declaration macros * - * Copyright (C) 2007 Landon Curt Noll + * Copyright (C) 2007,2014 Landon Curt Noll * * Primary author: Landon Curt Noll * @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.4 $ - * @(#) $Id: decl.h,v 30.4 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.6 $ + * @(#) $Id: decl.h,v 30.6 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/decl.h,v $ * * Under source code control: 2007/02/09 05:24:25 @@ -33,8 +33,8 @@ #include "have_const.h" -#if !defined(__DECL_H__) -#define __DECL_H__ +#if !defined(INCLUDE_DECL_H) +#define INCLUDE_DECL_H /* @@ -106,4 +106,4 @@ # define PRINTF_FORMAT(fmt_idx, arg_idx) #endif -#endif /* !__DECL_H__ */ +#endif /* !INCLUDE_DECL_H */ diff --git a/file.h b/file.h index 3c7e3d9..da5caaa 100644 --- a/file.h +++ b/file.h @@ -1,7 +1,7 @@ /* * file - file I/O routines callable by users * - * Copyright (C) 1999-2007 David I. Bell and Landon Curt Noll + * Copyright (C) 1999-2007,2014 David I. Bell and Landon Curt Noll * * Primary author: David I. Bell * @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: file.h,v 30.3 2013/09/01 22:16:21 chongo Exp $ + * @(#) $Revision: 30.5 $ + * @(#) $Id: file.h,v 30.5 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $ * * Under source code control: 1996/05/24 05:55:58 @@ -31,8 +31,8 @@ */ -#if !defined(__FILE_H__) -#define __FILE_H__ +#if !defined(INCLUDE_FILE_H) +#define INCLUDE_FILE_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -100,4 +100,4 @@ E_FUNC FILE *f_pathopen(char *name, char *mode, char *pathlist, char **openpath); -#endif /* !__FILE_H__ */ +#endif /* !INCLUDE_FILE_H */ diff --git a/func.c b/func.c index 9c4db12..e6d03cd 100644 --- a/func.c +++ b/func.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.9 $ - * @(#) $Id: func.c,v 30.9 2013/09/02 01:38:08 chongo Exp $ + * @(#) $Revision: 30.10 $ + * @(#) $Id: func.c,v 30.10 2014/08/31 14:54:50 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $ * * Under source code control: 1990/02/15 01:48:15 @@ -1241,10 +1241,11 @@ f_primetest(int count, NUMBER **vals) { /* parse args */ switch (count) { - case 1: return itoq((long) qprimetest(vals[0], - qlink(&_qone_), qlink(&_qone_))); - case 2: return itoq((long) qprimetest(vals[0], - vals[1], qlink(&_qone_))); + case 1: qlink(&_qone_); + qlink(&_qone_); + return itoq((long) qprimetest(vals[0], &_qone_, &_qone_)); + case 2: qlink(&_qone_); + return itoq((long) qprimetest(vals[0], vals[1], &_qone_)); default: return itoq((long) qprimetest(vals[0], vals[1], vals[2])); } } @@ -8248,6 +8249,10 @@ f_blkcpy(int count, VALUE **vals) */ args[0] = vals[1]; args[1] = vals[0]; + null_value.v_type = V_NULL; + args[2] = &null_value; + args[3] = &null_value; + args[4] = &null_value; switch(count) { case 5: args[2] = vals[4]; @@ -8258,14 +8263,10 @@ f_blkcpy(int count, VALUE **vals) count = 5; args[4] = vals[3]; args[3] = vals[2]; - null_value.v_type = V_NULL; - args[2] = &null_value; break; case 3: count = 4; args[3] = vals[2]; - null_value.v_type = V_NULL; - args[2] = &null_value; break; } diff --git a/func.h b/func.h index 7e11a62..1f1a6c8 100644 --- a/func.h +++ b/func.h @@ -1,7 +1,7 @@ /* * func - built-in function interface definitions * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: func.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: func.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/func.h,v $ * * Under source code control: 1990/02/15 01:48:33 @@ -28,8 +28,8 @@ */ -#if !defined(__FUNC_H__) -#define __FUNC_H__ +#if !defined(INCLUDE_FUNC_H) +#define INCLUDE_FUNC_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -110,4 +110,4 @@ E_FUNC void freenumbers(FUNC *); E_FUNC void freefunc(FUNC *); -#endif /* !__FUNC_H__ */ +#endif /* !INCLUDE_FUNC_H */ diff --git a/hash.h b/hash.h index 552ea6c..bf43274 100644 --- a/hash.h +++ b/hash.h @@ -1,7 +1,7 @@ /* * hash - one-way hash routines * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.2 $ - * @(#) $Id: hash.h,v 30.2 2007/07/05 17:37:41 chongo Exp $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: hash.h,v 30.4 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/hash.h,v $ * * Under source code control: 1995/11/14 23:57:45 @@ -29,8 +29,8 @@ */ -#if !defined(__HASH_H__) -#define __HASH_H__ +#if !defined(INCLUDE_HASH_H) +#define INCLUDE_HASH_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -132,4 +132,4 @@ E_FUNC HASH* hash_usb8(int, USB8*, int, HASH*); E_FUNC HASH* hash_value(int, void*, HASH*); -#endif /* !__HASH_H__ */ +#endif /* !INCLUDE_HASH_H */ diff --git a/have_stdvs.c b/have_stdvs.c index 8b704f9..e6713ac 100644 --- a/have_stdvs.c +++ b/have_stdvs.c @@ -1,7 +1,7 @@ /* * have_stdvs - try to see if it really works with vsprintf() * - * Copyright (C) 1999 Landon Curt Noll + * Copyright (C) 1999,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.2 $ - * @(#) $Id: have_stdvs.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: have_stdvs.c,v 30.4 2014/08/24 21:57:31 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/have_stdvs.c,v $ * * Under source code control: 1995/09/09 22:41:10 @@ -56,6 +56,11 @@ # include #endif +#include "have_stdlib.h" +#ifdef HAVE_STDLIB_H +# include +#endif + #undef VSPRINTF_SIZE_T #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || \ defined(__cplusplus) @@ -87,7 +92,7 @@ try_nthis(char *fmt, VSPRINTF_SIZE_T size, ...) { va_list ap; - va_start(ap, fmt); + va_start(ap, size); #if !defined(DONT_HAVE_VSPRINTF) vsnprintf(buf, size, fmt, ap); #else diff --git a/help.c b/help.c index c6241c2..f32aea0 100644 --- a/help.c +++ b/help.c @@ -1,7 +1,7 @@ /* * help - display help for calc * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,9 +17,9 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: help.c,v 30.3 2013/08/11 01:08:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/help.c,v $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: help.c,v 30.4 2014/08/24 21:57:31 chongo Exp $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/help.c,v $ * * Under source code control: 1997/09/14 10:58:30 * File existed as early as: 1997 diff --git a/help/Makefile b/help/Makefile index 6f67add..691056a 100644 --- a/help/Makefile +++ b/help/Makefile @@ -18,8 +18,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# @(#) $Revision: 30.9 $ -# @(#) $Id: Makefile,v 30.9 2013/09/02 02:55:19 chongo Exp $ +# @(#) $Revision: 30.10 $ +# @(#) $Id: Makefile,v 30.10 2014/09/02 07:15:58 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/help/RCS/Makefile,v $ # # Under source code control: 1991/07/23 06:47:57 @@ -705,8 +705,8 @@ clobber: clean # install: all -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ - echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ - ${MKDIR} ${T}${CALC_SHAREDIR}; \ + echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ + ${MKDIR} -p ${T}${CALC_SHAREDIR}; \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ @@ -717,8 +717,8 @@ install: all ${TRUE}; \ fi -${Q} if [ ! -d ${T}${HELPDIR} ]; then \ - echo ${MKDIR} ${T}${HELPDIR}; \ - ${MKDIR} ${T}${HELPDIR}; \ + echo ${MKDIR} -p ${T}${HELPDIR}; \ + ${MKDIR} -p ${T}${HELPDIR}; \ if [ ! -d "${T}${HELPDIR}" ]; then \ echo ${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \ diff --git a/help/pound b/help/pound index 0b44a2a..8eb2cb3 100644 --- a/help/pound +++ b/help/pound @@ -2,7 +2,7 @@ NAME # SYNOPSIS - #!/usr/local/src/cmd/calc/calc -q -f + #!/usr/local/src/bin/calc/calc -q -f # x x # y ## comment @@ -52,7 +52,7 @@ DESCRIPTION For example, of an executable file contains: - #!/usr/local/src/cmd/calc/calc -q -f + #!/usr/local/src/bin/calc/calc -q -f /* NOTE: The #! above must start in column 1 of the 1st line */ /* The 1st line must end with -f */ ## Single # shell comments don't work, use two or more @@ -100,7 +100,7 @@ LINK LIBRARY SEE ALSO cscript, unexpected, usage -## Copyright (C) 2007 Landon Curt Noll +## Copyright (C) 2007,2014 Landon Curt Noll ## ## 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 @@ -116,8 +116,8 @@ SEE ALSO ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -## @(#) $Revision: 30.1 $ -## @(#) $Id: pound,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.4 $ +## @(#) $Id: pound,v 30.4 2014/08/24 21:59:45 chongo Exp $ ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/pound,v $ ## ## Under source code control: 2007/02/06 14:09 diff --git a/help/script b/help/script index 2a077d8..516a240 100644 --- a/help/script +++ b/help/script @@ -149,7 +149,7 @@ Calc shell scripts #!/usr/bin/calc -q -s -f global i, n, s; n = argv(); - for (i = 1; i <= n; i++) + for (i = 1; i < n; i++) s += eval(argv(i)); print "sum =", s; @@ -273,7 +273,7 @@ For more information use the following calc commands: help config help cscript -## Copyright (C) 2000 Landon Curt Noll and Ernest Bowen +## Copyright (C) 2000,2014 Landon Curt Noll and Ernest Bowen ## ## 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 @@ -289,8 +289,8 @@ For more information use the following calc commands: ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -## @(#) $Revision: 30.1 $ -## @(#) $Id: script,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: script,v 30.2 2014/08/24 22:38:56 chongo Exp $ ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/script,v $ ## ## Under source code control: 1999/11/30 05:29:48 diff --git a/help/unexpected b/help/unexpected index 3bc3130..aa2318e 100644 --- a/help/unexpected +++ b/help/unexpected @@ -277,7 +277,7 @@ Unexpected A single # is an calc operator, not a comment. However two or more ##'s in a row is a comment. See "help pound" for more information. - #!/usr/local/src/cmd/calc/calc -q -f + #!/usr/local/src/bin/calc/calc -q -f /* a correct comment */ ## another correct comment @@ -289,7 +289,7 @@ Unexpected This next example is WRONG: - #!/usr/local/src/cmd/calc/calc -q -f + #!/usr/local/src/bin/calc/calc -q -f # This is not a calc calc comment because it has only a single # # You must to start comments with ## or /* @@ -404,7 +404,7 @@ Unexpected 64 -## Copyright (C) 1999-2007 Landon Curt Noll +## Copyright (C) 1999-2007,2014 Landon Curt Noll ## ## 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 @@ -420,8 +420,8 @@ Unexpected ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -## @(#) $Revision: 30.4 $ -## @(#) $Id: unexpected,v 30.4 2008/05/10 13:18:09 chongo Exp $ +## @(#) $Revision: 30.6 $ +## @(#) $Id: unexpected,v 30.6 2014/08/24 21:59:45 chongo Exp $ ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/unexpected,v $ ## ## Under source code control: 1997/03/21 13:15:18 diff --git a/hist.c b/hist.c index 62b4a67..ce04b40 100644 --- a/hist.c +++ b/hist.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: hist.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.2 $ + * @(#) $Id: hist.c,v 30.2 2014/08/24 23:57:57 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/hist.c,v $ * * Under source code control: 1993/05/02 20:09:19 @@ -88,7 +88,7 @@ STATIC struct { char *mark; int bufsize; int linelen; - int histcount; + int histcount; /* valid history entries */ int curhist; BOOL virgin_line; /* 1 => never typed chars, 0 => chars typed */ } HS; @@ -199,29 +199,22 @@ STATIC KEY_MAP maps[] = { {esc_map_name, {NULL, NULL}, {NULL, NULL}}, }; - -#define INTROUND (sizeof(int) - 1) -#define HISTLEN(hp) ((((hp)->len + INTROUND) & ~INTROUND) + sizeof(int)) -#define HISTOFFSET(hp) (((char *) (hp)) - histbuf) -#define FIRSTHIST ((HIST *) histbuf) -#define NEXTHIST(hp) ((HIST *) (((char *) (hp)) + HISTLEN(hp))) - - -typedef struct { - int len; /* length of data */ - char data[1]; /* varying length data */ +typedef struct history_entry { + int len; /* length of data */ + char *data; /* varying length data */ + struct history_entry* prev; + struct history_entry* next; } HIST; - STATIC int inited; STATIC int canedit; -STATIC int histused; STATIC int key_count; STATIC int save_len; STATIC KEY_MAP *cur_map; STATIC KEY_MAP *base_map; STATIC KEY_ENT key_table[MAX_KEYS]; -STATIC char histbuf[HIST_SIZE + 1]; +STATIC HIST* hist_first = NULL; +STATIC HIST* hist_last = NULL; STATIC char save_buffer[SAVE_SIZE]; /* declare other static functions */ @@ -399,6 +392,19 @@ hist_term(void) return; } + if (hist_first) { + HIST* hp = hist_first; + HIST* next; + while(hp) { + next = hp->next; + free(hp->data); + free(hp); + hp = next; + } + } + hist_first = NULL; + hist_last = NULL; + /* * restore orignal tty state */ @@ -656,14 +662,18 @@ read_key(void) S_FUNC HIST * get_event(int n) { - register HIST * hp; + register HIST * hp = hist_first; + int i = 0; - if ((n < 0) || (n >= HS.histcount)) - return NULL; - hp = FIRSTHIST; - while (n-- > 0) - hp = NEXTHIST(hp); - return hp; + do { + if(!hp) + break; + if(i == n) + return hp; + ++i; + hp = hp->next; + } while(hp); + return NULL; } @@ -674,11 +684,11 @@ get_event(int n) S_FUNC HIST * find_event(char *pat, int len) { - register HIST * hp; + register HIST * hp = hist_first; - for (hp = FIRSTHIST; hp->len; hp = NEXTHIST(hp)) { - if ((hp->len == len) && (memcmp(hp->data, pat, len) == 0)) - return hp; + for(hp = hist_first; hp != NULL; hp = hp->next) { + if ((hp->len == len) && (memcmp(hp->data, pat, len) == 0)) + return hp; } return NULL; } @@ -694,8 +704,6 @@ void hist_saveline(char *line, int len) { HIST * hp; - HIST * hp2; - int left; if ((len > 0) && (line[len - 1] == '\n')) len--; @@ -709,13 +717,17 @@ hist_saveline(char *line, int len) */ hp = find_event(line, len); if (hp) { - hp2 = NEXTHIST(hp); - left = histused - HISTOFFSET(hp2); - if (left <= 0) + if (hp == hist_last) return; - histused -= HISTLEN(hp); - memcpy(hp, hp2, left + 1); - HS.histcount--; + if (hp->prev) + hp->prev->next = hp->next; + hp->next->prev = hp->prev; + + hist_last->next = hp; + hp->next = NULL; + hp->prev = hist_last; + hist_last = hp; + return; } /* @@ -723,24 +735,34 @@ hist_saveline(char *line, int len) * the new command, then repeatedly delete the earliest command * as many times as necessary in order to make enough room. */ - while ((histused + len) >= HIST_SIZE) { - hp = (HIST *) histbuf; - hp2 = NEXTHIST(hp); - left = histused - HISTOFFSET(hp2); - histused -= HISTLEN(hp); - memcpy(hp, hp2, left + 1); + if (HS.histcount >= HIST_SIZE) { + HIST *new_first = hist_first->next; + free(hist_first->data); + free(hist_first); + new_first->prev = NULL; + hist_first = new_first; HS.histcount--; } /* * Add the line to the end of the history table. */ - hp = (HIST *) &histbuf[histused]; + hp = malloc(sizeof(HIST)); + hp->next = NULL; + hp->prev = NULL; hp->len = len; + hp->data = malloc(len); memcpy(hp->data, line, len); - histused += HISTLEN(hp); - histbuf[histused] = 0; HS.curhist = ++HS.histcount; + if (!hist_first) + hist_first = hp; + if (!hist_last) + hist_last = hp; + else { + hist_last->next = hp; + hp->prev = hist_last; + hist_last = hp; + } } diff --git a/hist.h b/hist.h index 08bf9dc..063aa34 100644 --- a/hist.h +++ b/hist.h @@ -1,7 +1,7 @@ /* * hist - definitions for command history module * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: hist.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: hist.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/hist.h,v $ * * Under source code control: 1993/05/02 20:09:20 @@ -28,8 +28,8 @@ */ -#if !defined(__HIST_H__) -#define __HIST_H__ +#if !defined(INCLUDE_HIST_H) +#define INCLUDE_HIST_H /* @@ -74,4 +74,4 @@ E_FUNC size_t hist_getline(char *prompt, char *buf, size_t len); E_FUNC void hist_saveline(char *line, int len); -#endif /* !__HIST_H__ */ +#endif /* !INCLUDE_HIST_H */ diff --git a/input.c b/input.c index eb2eb82..a00adbe 100644 --- a/input.c +++ b/input.c @@ -1,7 +1,7 @@ /* * input - nested input source file reader * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: input.c,v 30.3 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.6 $ + * @(#) $Id: input.c,v 30.6 2014/08/31 14:54:50 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/input.c,v $ * * Under source code control: 1990/02/15 01:48:16 @@ -51,7 +51,7 @@ #if defined(__MSDOS__) #include #define _fullpath(f,n,s) (_fixpath(n,f),f) -#define _MAX_PATH PATH_MAX +#define MSDOS_MAX_PATH PATH_MAX #endif #include "calc.h" @@ -815,6 +815,7 @@ ttychar(void) */ if (charbuf[0] == '!') { /* do a shell command */ char *cmd; + int ret; cmd = charbuf + 1; if (*cmd == '\0' || *cmd == '\n') @@ -823,7 +824,10 @@ ttychar(void) if (conf->calc_debug & CALCDBG_SYSTEM) { printf("%s\n", cmd); } - system(cmd); + ret = system(cmd); + if (ret < 0) { + fprintf(stderr, "error in cmd: %s\n", cmd); + } } else { fprintf(stderr, "execution disallowed by -m flag\n"); } @@ -977,9 +981,9 @@ isinoderead(struct stat *sbuf) /* scan the entire readset */ for (i=0; i < maxreadset; ++i) { #if defined(_WIN32) || defined(__MSDOS__) - char tmp[_MAX_PATH+1]; - tmp[_MAX_PATH] = '\0'; - if (_fullpath(tmp, cip->i_name, _MAX_PATH) && + char tmp[MSDOS_MAX_PATH+1]; + tmp[MSDOS_MAX_PATH] = '\0'; + if (_fullpath(tmp, cip->i_name, MSDOS_MAX_PATH) && readset[i].active && strcasecmp(readset[i].path, tmp) == 0) { /* found a match */ @@ -1110,7 +1114,7 @@ addreadset(char *name, char *path, struct stat *sbuf) * this new longer path name. */ { - readset[ret].path = _fullpath(NULL, path, _MAX_PATH); + readset[ret].path = _fullpath(NULL, path, MSDOS_MAX_PATH); if (readset[ret].path == NULL) { return -1; } diff --git a/jump.h b/jump.h index 7f55168..5fa7727 100644 --- a/jump.h +++ b/jump.h @@ -1,7 +1,7 @@ /* * jump - trivial prime jump table * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: jump.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: jump.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/jump.h,v $ * * Under source code control: 1994/06/29 04:03:55 @@ -62,8 +62,8 @@ */ -#if !defined(__JUMP_H__) -#define __JUMP_H__ +#if !defined(INCLUDE_JUMP_H) +#define INCLUDE_JUMP_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -107,4 +107,4 @@ EXTERN CONST short jmpindx[]; EXTERN CONST unsigned char jmp[]; EXTERN CONST unsigned char *CONST lastjmp; -#endif /* !__JUMP_H__ */ +#endif /* !INCLUDE_JUMP_H */ diff --git a/label.h b/label.h index 71ce4d3..ade2392 100644 --- a/label.h +++ b/label.h @@ -1,7 +1,7 @@ /* * label - label handling routines * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: label.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: label.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/label.h,v $ * * Under source code control: 1990/02/15 01:48:33 @@ -28,8 +28,8 @@ */ -#if !defined(__LABEL_H__) -#define __LABEL_H__ +#if !defined(INCLUDE_LABEL_H) +#define INCLUDE_LABEL_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -61,4 +61,4 @@ E_FUNC void uselabel(LABEL *lp); E_FUNC void checklabels(void); -#endif /* !__LABEL_H__ */ +#endif /* !INCLUDE_LABEL_H */ diff --git a/lib_calc.h b/lib_calc.h index 4849678..a8baf2f 100644 --- a/lib_calc.h +++ b/lib_calc.h @@ -1,7 +1,7 @@ /* * math_error - a simple libcalc math error routine * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: lib_calc.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: lib_calc.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/lib_calc.h,v $ * * Under source code control: 1997/03/23 18:37:10 @@ -29,8 +29,8 @@ */ -#if !defined(__MATH_ERROR_H__) -#define __MATH_ERROR_H__ +#if !defined(INCLUDE_MATH_ERROR_H) +#define INCLUDE_MATH_ERROR_H #include @@ -78,4 +78,4 @@ EXTERN int calc_print_scanwarn_msg; /* number of parse/scan warnings found */ EXTERN unsigned long calc_warn_cnt; -#endif /* !__MATH_ERROR_H__ */ +#endif /* !INCLUDE_MATH_ERROR_H */ diff --git a/lib_util.h b/lib_util.h index 0eb2835..856b96b 100644 --- a/lib_util.h +++ b/lib_util.h @@ -1,7 +1,7 @@ /* * lib_util - calc link library utility routines * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: lib_util.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: lib_util.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/lib_util.h,v $ * * Under source code control: 1997/04/19 21:38:30 @@ -34,8 +34,8 @@ */ -#if !defined(__LIB_UTIL_H__) -#define __LIB_UTIL_H__ +#if !defined(INCLUDE_LIB_UTIL_H) +#define INCLUDE_LIB_UTIL_H /* external functions in lib_util.c */ EXTERN int lowhex2bin[256]; @@ -44,4 +44,4 @@ E_FUNC ZVALUE convstr2z(char*); E_FUNC ZVALUE convhex2z(char *hex); E_FUNC char *convz2hex(ZVALUE z); -#endif /* __LIB_UTIL_H__ */ +#endif /* INCLUDE_LIB_UTIL_H */ diff --git a/longbits.c b/longbits.c index 5be5cf1..f882df5 100644 --- a/longbits.c +++ b/longbits.c @@ -1,7 +1,7 @@ /* * longbits - Determine the number if bits in a char, short, int or long * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.2 $ - * @(#) $Id: longbits.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: longbits.c,v 30.3 2014/08/24 21:57:31 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/longbits.c,v $ * * Under source code control: 1994/03/18 03:06:18 diff --git a/nametype.h b/nametype.h index 440a5e1..2c480a9 100644 --- a/nametype.h +++ b/nametype.h @@ -1,7 +1,7 @@ /* * nametype - associate names with values * - * Copyright (C) 1999 Landon Curt Noll + * Copyright (C) 1999,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: nametype.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: nametype.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/nametype.h,v $ * * Under source code control: 1997/03/08 13:44:55 @@ -29,8 +29,8 @@ */ -#if !defined(__NAMETYPE_H__) -#define __NAMETYPE_H__ +#if !defined(INCLUDE_NAMETYPE_H) +#define INCLUDE_NAMETYPE_H /* @@ -42,4 +42,4 @@ typedef struct { } NAMETYPE; -#endif /* !__NAMETYPE_H__ */ +#endif /* !INCLUDE_NAMETYPE_H */ diff --git a/no_implicit.c b/no_implicit.c deleted file mode 100644 index 968b68c..0000000 --- a/no_implicit.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * no-implicit - Determine if the compiler allows -Wno-implicit - * - * Copyright (C) 2003 Landon Curt Noll - * - * 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 - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * @(#) $Revision: 30.1 $ - * @(#) $Id: no_implicit.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/bin/calc/RCS/no_implicit.c,v $ - * - * Under source code control: 2003/01/14 01:45:19 - * File existed as early as: 2003 - * - * chongo /\oo/\ http://www.isthe.com/chongo/ - * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ - */ - -/* - * If we are able to compile this program, then we the compiler must - * allow the -Wno-implicit flag so we output the -Wno-implicit symbol. - */ - - -#include - -int -main(void) -{ - /* -Wno-implicit flag is allowed */ - printf("-Wno-implicit\n"); - - /* exit(0); */ - return 0; -} diff --git a/opcodes.c b/opcodes.c index 40ca692..defef7a 100644 --- a/opcodes.c +++ b/opcodes.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.5 $ - * @(#) $Id: opcodes.c,v 30.5 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.6 $ + * @(#) $Id: opcodes.c,v 30.6 2014/08/31 14:54:50 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/opcodes.c,v $ * * Under source code control: 1990/02/15 01:48:19 @@ -3936,7 +3936,7 @@ calculate(FUNC *fp, int argcount) case OPGLB: /* global symbol reference (pointer arg) */ /* ignore Saber-C warning #68 - benign type mismatch */ /* ok to ignore in proc calculate */ - (*op->o_func)(fp, *((char **) &fp->f_opcodes[pc])); + (*op->o_func)(fp, *(&fp->f_opcodes[pc])); pc += PTR_SIZE; break; diff --git a/opcodes.h b/opcodes.h index f976647..d675367 100644 --- a/opcodes.h +++ b/opcodes.h @@ -1,7 +1,7 @@ /* * opcodes - opcode execution module definition * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: opcodes.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: opcodes.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/opcodes.h,v $ * * Under source code control: 1990/02/15 01:48:35 @@ -28,8 +28,8 @@ */ -#if !defined(__OPCODES_H__) -#define __OPCODES_H__ +#if !defined(INCLUDE_OPCODES_H) +#define INCLUDE_OPCODES_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -184,4 +184,4 @@ EXTERN char *funcname; /* function being executed */ EXTERN long funcline; /* function line being executed */ -#endif /* !__OPCODES_H__ */ +#endif /* !INCLUDE_OPCODES_H */ diff --git a/prime.h b/prime.h index 2c8e000..c9093fb 100644 --- a/prime.h +++ b/prime.h @@ -1,7 +1,7 @@ /* * prime - quickly determine if a small number is prime * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: prime.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: prime.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/prime.h,v $ * * Under source code control: 1994/06/04 03:26:15 @@ -29,8 +29,8 @@ */ -#if !defined(__PRIME_H__) -#define __PRIME_H__ +#if !defined(INCLUDE_PRIME_H) +#define INCLUDE_PRIME_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -91,4 +91,4 @@ EXTERN CONST ZVALUE _nxt_prime_; /* 2^32+15 - smallest prime > 2^32 */ EXTERN CONST ZVALUE _jmpmod2_; /* JMPMOD*2 as a ZVALUE */ -#endif /* !__PRIME_H__ */ +#endif /* !INCLUDE_PRIME_H */ diff --git a/qmath.c b/qmath.c index f58ed08..f3408ef 100644 --- a/qmath.c +++ b/qmath.c @@ -1,7 +1,7 @@ /* * qmath - extended precision rational arithmetic primitive routines * - * Copyright (C) 1999-2007 David I. Bell and Ernest Bowen + * Copyright (C) 1999-2007,2014 David I. Bell and Ernest Bowen * * Primary author: David I. Bell * @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.2 $ - * @(#) $Id: qmath.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: qmath.c,v 30.4 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.c,v $ * * Under source code control: 1990/02/15 01:48:21 @@ -1312,7 +1312,7 @@ qcmp(NUMBER *q1, NUMBER *q2) if (q1 == q2) return FALSE; if ((q1->num.sign != q2->num.sign) || (q1->num.len != q2->num.len) || - (q2->den.len != q2->den.len) || (*q1->num.v != *q2->num.v) || + (q1->den.len != q2->den.len) || (*q1->num.v != *q2->num.v) || (*q1->den.v != *q2->den.v)) return TRUE; if (zcmp(q1->num, q2->num)) diff --git a/qmath.h b/qmath.h index 8f94676..688a40d 100644 --- a/qmath.h +++ b/qmath.h @@ -1,7 +1,7 @@ /* * qmath - declarations for extended precision rational arithmetic * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.4 $ - * @(#) $Id: qmath.h,v 30.4 2013/09/01 22:16:21 chongo Exp $ + * @(#) $Revision: 30.6 $ + * @(#) $Id: qmath.h,v 30.6 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.h,v $ * * Under source code control: 1993/07/30 19:42:47 @@ -28,8 +28,8 @@ */ -#if !defined(__QMATH_H__) -#define __QMATH_H__ +#if !defined(INCLUDE_QMATH_H) +#define INCLUDE_QMATH_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -278,4 +278,4 @@ EXTERN NUMBER _qtwo_, _qthree_, _qfour_, _qten_; EXTERN NUMBER * initnumbs[]; -#endif /* !__QMATH_H__ */ +#endif /* !INCLUDE_QMATH_H */ diff --git a/rpm.mk b/rpm.mk index 996351d..d74a875 100644 --- a/rpm.mk +++ b/rpm.mk @@ -3,7 +3,7 @@ # # rpm.mk - Makefile for building rpm packages for calc # -# Copyright (C) 2003 Petteri Kettunen and Landon Curt Noll +# Copyright (C) 2003,2014 Petteri Kettunen and Landon Curt Noll # # 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 @@ -19,8 +19,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -MAKEFILE_REV= $$Revision: 30.11 $$ -# @(#) $Id: rpm.mk,v 30.11 2013/08/11 08:41:38 chongo Exp $ +MAKEFILE_REV= $$Revision: 30.15 $$ +# @(#) $Id: rpm.mk,v 30.15 2014/09/08 00:04:13 chongo Exp $ # @(#) $Source: /usr/local/src/bin/calc/RCS/rpm.mk,v $ # # Under source code control: 2003/02/16 20:21:39 @@ -35,21 +35,22 @@ MAKEFILE_REV= $$Revision: 30.11 $$ # IMPORTANT NOTE: The rpm process assumes that ~/.rpmmacros contains # the following: # +# %_topdir /var/tmp/rpmbuild +# %_tmppath %{_topdir}/tmp +# %_builddir %{_topdir}/BUILD +# %_rpmdir %{_topdir}/RPMS +# %_sourcedir %{_topdir}/SOURCES +# %_specdir %{_topdir}/SPECS +# %_srcrpmdir %{_topdir}/SRPMS +# %_buildroot %{_topdir}/BUILDROOT +# %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm +# +# If you are signing the rpms, you also need: +# # %_signature gpg # %_gpg_path ~/.gnupg # %_gpg_name __YOUR_NAME_HERE__ # %_gpgbin /usr/bin/gpg -# %_topdir %(echo $HOME)/rpm/%{name} -# %_sourcedir %(echo $HOME)/rpm/%{name}/SOURCES -# %_specdir %(echo $HOME)/rpm/%{name}/SPECS -# %_tmppath %(echo $HOME)/rpm/%{name}/tmp -# %_builddir %(echo $HOME)/rpm/%{name}/BUILD -# %_buildroot %(echo $HOME)/rpm/%{name}/tmp/build-root -# %_rpmdir %(echo $HOME)/rpm/%{name}/RPMS -# %_srcrpmdir %(echo $HOME)/rpm/%{name}/SRPMS -# %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm -# %packager __YOUR_NAME_HERE__ -# %vendor __YOUR_ORG_OR_GROUP_OR_COMPANY_HERE__ # IMPORTANT NOTE: Unless the package redhat-rpm-config is installed, # the calc-debuginfo rpm will not be created. @@ -68,8 +69,8 @@ MAKEFILE_REV= $$Revision: 30.11 $$ # SHELL= /bin/sh RPMBUILD_TOOL= rpmbuild -TARCH= i686 -RPMBUILD_OPTION= -ba --target=$(TARCH) +TARCH= x86_64 +RPMBUILD_OPTION= -ba --target=$(TARCH) --buildroot=${RPM_BUILD_ROOT} RPM_TOOL= rpm SED= sed FIND= find @@ -95,11 +96,13 @@ PROJECT_RELEASE= PROJECT= ${PROJECT_NAME}-${PROJECT_VERSION} SPECFILE= ${PROJECT_NAME}.spec TARBALL= ${PROJECT}.${TAR}.bz2 -RPM686= ${PROJECT}-${PROJECT_RELEASE}.${TARCH}.rpm -DRPM686= \ +RPMx86_64= ${PROJECT}-${PROJECT_RELEASE}.${TARCH}.rpm +DRPMx86_64= \ ${PROJECT_NAME}-devel-${PROJECT_VERSION}-${PROJECT_RELEASE}.${TARCH}.rpm SRPM= ${PROJECT}-${PROJECT_RELEASE}.src.rpm -RPM_TOP= ${HOME}/rpm/${NAME} +# NOTE: RPM_TOP must be the same as %_topdir in ~/.rpmmacros +RPM_TOP= /var/tmp/rpmbuild +RPM_BUILD_ROOT= ${RPM_TOP}/BUILDROOT TMPDIR= ${RPM_TOP}/tmp # Makefile debug @@ -149,6 +152,7 @@ calc.spec: calc.spec.in ver_calc srcpkg: make_rhdir ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo RPM_TOP="${RPM_TOP}" + ${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}" ${V} echo PROJECT_VERSION="${PROJECT_VERSION}" ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" ${RM} -rf "$(TMPDIR)/$(PROJECT)" @@ -171,12 +175,13 @@ srcpkg: make_rhdir rpm: srcpkg calc.spec ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo RPM_TOP="${RPM_TOP}" + ${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}" ${V} echo PROJECT_VERSION="${PROJECT_VERSION}" ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" $(MAKE) -f Makefile clean ${CP} "$(SPECFILE)" "$(RPM_TOP)/SPECS/$(SPECFILE)" - ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" - ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" + ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)" + ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)" ${RM} -f "$(RPM_TOP)/SRPMS/$(SRPM)" ${RPMBUILD_TOOL} ${RPMBUILD_OPTION} "$(RPM_TOP)/SPECS/$(SPECFILE)" @if [ ! -f "$(RPM_TOP)/SRPMS/$(SRPM)" ]; then \ @@ -190,6 +195,7 @@ rpm: srcpkg calc.spec make_rhdir: ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo RPM_TOP="${RPM_TOP}" + ${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}" ${V} echo PROJECT_VERSION="${PROJECT_VERSION}" ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" for subdir in "" BUILD RPMS SOURCES SPECS SRPMS tmp; do \ @@ -243,8 +249,8 @@ logdate: .PHONY: chkpkg chkpkg: ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' - for i in "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" \ - "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" \ + for i in "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)" \ + "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)" \ "$(RPM_TOP)/SRPMS/$(SRPM)" ; do \ echo "***** start $$i" ; \ ${RPM_TOOL} -qpi "$$"i ; \ @@ -278,8 +284,8 @@ installrpm: echo "must be root to install RPMs" 1>&2; \ exit 7; \ fi - ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" - ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" + ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)" + ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)" ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' .PHONY: uninstallrpm diff --git a/sha1.c b/sha1.c index d61ffb5..ddd2cf2 100644 --- a/sha1.c +++ b/sha1.c @@ -24,7 +24,7 @@ * * @(#) $Revision: 30.4 $ * @(#) $Id: sha1.c,v 30.4 2013/08/11 01:08:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/sha1.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/sha1.c,v $ * * This file is not covered under version 2.1 of the GNU LGPL. */ diff --git a/sha1.h b/sha1.h index 4614a79..3cf6d71 100644 --- a/sha1.h +++ b/sha1.h @@ -22,16 +22,16 @@ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: sha1.h,v 30.3 2007/07/05 17:37:41 chongo Exp $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: sha1.h,v 30.4 2014/09/02 06:37:39 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/sha1.h,v $ * * This file is not covered under version 2.1 of the GNU LGPL. */ -#if !defined(__SHA1_H__) -#define __SHA1_H__ +#if !defined(INCLUDE_SHA1_H) +#define INCLUDE_SHA1_H /* SHA1_CHUNKSIZE must be a power of 2 - fixed value defined by the algorithm */ @@ -76,4 +76,4 @@ typedef struct { } -#endif /* !__SHA1_H__ */ +#endif /* !INCLUDE_SHA1_H */ diff --git a/str.h b/str.h index a98d599..f1bdaf2 100644 --- a/str.h +++ b/str.h @@ -1,7 +1,7 @@ /* * str - string list routines * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: str.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: str.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/str.h,v $ * * Under source code control: 1990/02/15 01:48:36 @@ -28,8 +28,8 @@ */ -#if !defined(__CALCSTRING_H__) -#define __CALCSTRING_H__ +#if !defined(INCLUDE_CALCSTRING_H) +#define INCLUDE_CALCSTRING_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -79,4 +79,4 @@ E_FUNC void showliterals(void); EXTERN STRING _nullstring_; -#endif /* !__CALCSTRING_H__ */ +#endif /* !INCLUDE_CALCSTRING_H */ diff --git a/symbol.h b/symbol.h index b3729ff..f7739fe 100644 --- a/symbol.h +++ b/symbol.h @@ -1,7 +1,7 @@ /* * symbol - global and local symbol routines * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: symbol.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: symbol.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/symbol.h,v $ * * Under source code control: 1990/02/15 01:48:37 @@ -28,8 +28,8 @@ */ -#if !defined(__SYMBOL_H__) -#define __SYMBOL_H__ +#if !defined(INCLUDE_SYMBOL_H) +#define INCLUDE_SYMBOL_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -107,4 +107,4 @@ E_FUNC void showstatics(void); E_FUNC void freestatics(void); -#endif /* !__SYMBOL_H__ */ +#endif /* !INCLUDE_SYMBOL_H */ diff --git a/token.h b/token.h index 89c2c57..af3185a 100644 --- a/token.h +++ b/token.h @@ -1,7 +1,7 @@ /* * token - token defines * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: token.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.5 $ + * @(#) $Id: token.h,v 30.5 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/token.h,v $ * * Under source code control: 1990/02/15 01:48:37 @@ -28,8 +28,8 @@ */ -#if !defined(__TOKEN_H__) -#define __TOKEN_H__ +#if !defined(INCLUDE_TOKEN_H) +#define INCLUDE_TOKEN_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -183,4 +183,4 @@ E_FUNC void scanerror(int, char *, ...) PRINTF_FORMAT(2, 3); E_FUNC void warning(char *, ...) PRINTF_FORMAT(1, 2); -#endif /* !__TOKEN_H__ */ +#endif /* !INCLUDE_TOKEN_H */ diff --git a/value.c b/value.c index adf27f2..3a225b1 100644 --- a/value.c +++ b/value.c @@ -1,7 +1,7 @@ /* * value - generic value manipulation routines * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.5 $ - * @(#) $Id: value.c,v 30.5 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.8 $ + * @(#) $Id: value.c,v 30.8 2014/08/31 15:43:39 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/value.c,v $ * * Under source code control: 1990/02/15 01:48:25 @@ -2846,13 +2846,13 @@ printvalue(VALUE *vp, int flags) math_fmt("o-ptr: %p", vp->v_octet); break; case V_VPTR: - math_fmt("v-ptr: %p", vp->v_addr); + math_fmt("v-ptr: %p", (void *)vp->v_addr); break; case V_SPTR: - math_fmt("s_ptr: %p", vp->v_str); + math_fmt("s_ptr: %p", (void *)vp->v_str); break; case V_NPTR: - math_fmt("n_ptr: %p", vp->v_num); + math_fmt("n_ptr: %p", (void *)vp->v_num); break; case V_NBLOCK: if (!userfunc("nblk_print", vp)) @@ -2948,7 +2948,7 @@ printestr(VALUE *vp) bp = vp->v_nblock->blk; } i = bp->datalen; - math_fmt("%ld,%ld)", i, bp->blkchunk); + math_fmt("%ld,%d)", i, bp->blkchunk); cp = bp->data; if (i > 0) { math_str("={"); diff --git a/value.h b/value.h index a23e7d8..8f80ccb 100644 --- a/value.h +++ b/value.h @@ -1,7 +1,7 @@ /* * value - definitions of general values and related routines used by calc * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.6 $ - * @(#) $Id: value.h,v 30.6 2013/09/02 01:38:08 chongo Exp $ + * @(#) $Revision: 30.8 $ + * @(#) $Id: value.h,v 30.8 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/value.h,v $ * * Under source code control: 1993/07/30 19:42:47 @@ -28,8 +28,8 @@ */ -#if !defined(__VALUE_H__) -#define __VALUE_H__ +#if !defined(INCLUDE_VALUE_H) +#define INCLUDE_VALUE_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -540,4 +540,4 @@ E_FUNC int stringsetbit(STRING *, long, BOOL); E_FUNC int stringsearch(STRING *, STRING *, long, long, ZVALUE *); E_FUNC int stringrsearch(STRING *, STRING *, long, long, ZVALUE *); -#endif /* !__VALUE_H__ */ +#endif /* !INCLUDE_VALUE_H */ diff --git a/version.c b/version.c index fd25f8e..db2e671 100644 --- a/version.c +++ b/version.c @@ -1,7 +1,7 @@ /* * version - determine the version of calc * - * Copyright (C) 1999-2007 David I. Bell and Landon Curt Noll + * Copyright (C) 1999-2014 David I. Bell and Landon Curt Noll * * Primary author: David I. Bell * @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.22 $ - * @(#) $Id: version.c,v 30.22 2013/09/27 08:59:43 chongo Exp $ + * @(#) $Revision: 30.24 $ + * @(#) $Id: version.c,v 30.24 2014/08/31 15:43:39 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/version.c,v $ * * Under source code control: 1990/05/22 11:00:58 @@ -49,7 +49,7 @@ static char *program; #define MAJOR_VER 2 /* major library version */ #define MINOR_VER 12 /* minor library version */ #define MAJOR_PATCH 4 /* major software level under library version */ -#define MINOR_PATCH 13 /* minor software level or 0 if not patched */ +#define MINOR_PATCH 14 /* minor software level or 0 if not patched */ /* @@ -73,19 +73,20 @@ STATIC char *stored_version = NULL; /* version formed if != NULL */ char *Copyright = "\n" "calc - arbitrary precision calculator\n" "\n" - "@(#) Copyright (C) 2007 David I. Bell, Landon Curt Noll and Ernest Bowen\n" + "@(#) Copyright (C) 1999-2014 David I. Bell, Landon Curt Noll " + "and Ernest Bowen\n" "\n" "Initial author: David I. Bell\n" "\n" "Calc is open software; you can redistribute it and/or modify it under\n" "the terms of the version 2.1 of the GNU Lesser General Public License\n" - "as published by the Free Software Foundation.\n" - "\n" + "as published by the Free Software Foundation.\n"; +char *Usability = "\n" "Calc is distributed in the hope that it will be useful, but WITHOUT\n" "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n" "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\n" - "Public License for more details.\n" - "\n" + "Public License for more details.\n"; +char *COPYING_LGPL = "\n" "A copy of version 2.1 of the GNU Lesser General Public License is\n" "distributed with calc under the filename COPYING-LGPL. You should have\n" "received a copy with calc; if not, write to Free Software Foundation, Inc.\n" diff --git a/win32/have_const.h b/win32/have_const.h index 0ee752f..f128dfc 100644 --- a/win32/have_const.h +++ b/win32/have_const.h @@ -3,8 +3,8 @@ */ -#if !defined(__HAVE_CONST_H__) -#define __HAVE_CONST_H__ +#if !defined(CALC_HAVE_CONST_H) +#define CALC_HAVE_CONST_H /* do we have or want const? */ @@ -13,4 +13,4 @@ #define CONST const /* yes */ -#endif /* !__HAVE_CONST_H__ */ +#endif /* !CALC_HAVE_CONST_H */ diff --git a/win32/have_fpos.h b/win32/have_fpos.h index 9daa655..2fc0f25 100644 --- a/win32/have_fpos.h +++ b/win32/have_fpos.h @@ -3,8 +3,8 @@ */ -#if !defined(__HAVE_FPOS_H__) -#define __HAVE_FPOS_H__ +#if !defined(CALC_HAVE_FPOS_H) +#define CALC_HAVE_FPOS_H /* do we have fgetpos & fsetpos functions? */ @@ -13,4 +13,4 @@ typedef long FILEPOS; -#endif /* !__HAVE_FPOS_H__ */ +#endif /* !CALC_HAVE_FPOS_H */ diff --git a/win32/have_fpos_pos.h b/win32/have_fpos_pos.h index c8ba67b..5077213 100644 --- a/win32/have_fpos_pos.h +++ b/win32/have_fpos_pos.h @@ -3,8 +3,8 @@ */ -#if !defined(__HAVE_FPOS_POS_H__) -#define __HAVE_FPOS_POS_H__ +#if !defined(CALC_HAVE_FPOS_POS_H) +#define CALC_HAVE_FPOS_POS_H /* do we have fgetpos & fsetpos functions? */ @@ -13,4 +13,4 @@ #undef FPOS_POS_LEN -#endif /* !__HAVE_FPOS_POS_H__ */ +#endif /* !CALC_HAVE_FPOS_POS_H */ diff --git a/win32/have_getpgid.h b/win32/have_getpgid.h index 2b98879..6fb8bd2 100644 --- a/win32/have_getpgid.h +++ b/win32/have_getpgid.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_GETPGID_H__) -#define __HAVE_GETPGID_H__ +#if !defined(CALC_HAVE_GETPGID_H) +#define CALC_HAVE_GETPGID_H /* do we have or want getpgid()? */ #undef HAVE_GETPGID /* no */ -#endif /* !__HAVE_GETPGID_H__ */ +#endif /* !CALC_HAVE_GETPGID_H */ diff --git a/win32/have_getprid.h b/win32/have_getprid.h index 67eb83b..6ac72b5 100644 --- a/win32/have_getprid.h +++ b/win32/have_getprid.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_GETPRID_H__) -#define __HAVE_GETPRID_H__ +#if !defined(CALC_HAVE_GETPRID_H) +#define CALC_HAVE_GETPRID_H /* do we have or want getprid()? */ #undef HAVE_GETPRID /* no */ -#endif /* !__HAVE_GETPRID_H__ */ +#endif /* !CALC_HAVE_GETPRID_H */ diff --git a/win32/have_getsid.h b/win32/have_getsid.h index 3629804..d5de8cd 100644 --- a/win32/have_getsid.h +++ b/win32/have_getsid.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_GETSID_H__) -#define __HAVE_GETSID_H__ +#if !defined(CALC_HAVE_GETSID_H) +#define CALC_HAVE_GETSID_H /* do we have or want getsid()? */ #undef HAVE_GETSID /* no */ -#endif /* !__HAVE_GETSID_H__ */ +#endif /* !CALC_HAVE_GETSID_H */ diff --git a/win32/have_gettime.h b/win32/have_gettime.h index 4798e2f..ae1a955 100644 --- a/win32/have_gettime.h +++ b/win32/have_gettime.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_GETTIME_H__) -#define __HAVE_GETTIME_H__ +#if !defined(CALC_HAVE_GETTIME_H) +#define CALC_HAVE_GETTIME_H /* do we have or want clock_gettime()? */ #undef HAVE_GETTIME /* no */ -#endif /* !__HAVE_GETTIME_H__ */ +#endif /* !CALC_HAVE_GETTIME_H */ diff --git a/win32/have_memmv.h b/win32/have_memmv.h index cb42589..fb1f80d 100644 --- a/win32/have_memmv.h +++ b/win32/have_memmv.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_MEMMV_H__) -#define __HAVE_MEMMV_H__ +#if !defined(CALC_HAVE_MEMMV_H) +#define CALC_HAVE_MEMMV_H /* do we have or want memmove()? */ #define HAVE_MEMMOVE /* yes */ -#endif /* !__HAVE_MEMMV_H__ */ +#endif /* !CALC_HAVE_MEMMV_H */ diff --git a/win32/have_newstr.h b/win32/have_newstr.h index 0a8768c..060a6f2 100644 --- a/win32/have_newstr.h +++ b/win32/have_newstr.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_NEWSTR_H__) -#define __HAVE_NEWSTR_H__ +#if !defined(CALC_HAVE_NEWSTR_H) +#define CALC_HAVE_NEWSTR_H /* do we have or want memcpy(), memset() & strchr()? */ #define HAVE_NEWSTR /* yes */ -#endif /* !__HAVE_NEWSTR_H__ */ +#endif /* !CALC_HAVE_NEWSTR_H */ diff --git a/win32/have_offscl.h b/win32/have_offscl.h index 68b5931..0736e02 100644 --- a/win32/have_offscl.h +++ b/win32/have_offscl.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_OFFSCL_H__) -#define __HAVE_OFFSCL_H__ +#if !defined(CALC_HAVE_OFFSCL_H) +#define CALC_HAVE_OFFSCL_H #undef HAVE_OFF_T_SCALAR #define HAVE_OFF_T_SCALAR /* off_t is a simple value */ -#endif /* !__HAVE_OFFSCL_H__ */ +#endif /* !CALC_HAVE_OFFSCL_H */ diff --git a/win32/have_posscl.h b/win32/have_posscl.h index 9fcd49d..78ed523 100644 --- a/win32/have_posscl.h +++ b/win32/have_posscl.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_POSSCL_H__) -#define __HAVE_POSSCL_H__ +#if !defined(CALC_HAVE_POSSCL_H) +#define CALC_HAVE_POSSCL_H #undef HAVE_FILEPOS_SCALAR #define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */ -#endif /* !__HAVE_POSSCL_H__ */ +#endif /* !CALC_HAVE_POSSCL_H */ diff --git a/win32/have_rusage.h b/win32/have_rusage.h index 7fe0114..e2c8800 100644 --- a/win32/have_rusage.h +++ b/win32/have_rusage.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_RUSAGE_H__) -#define __HAVE_RUSAGE_H__ +#if !defined(CALC_HAVE_RUSAGE_H) +#define CALC_HAVE_RUSAGE_H /* do we have or want getrusage()? */ #undef HAVE_GETRUSAGE /* no */ -#endif /* !__HAVE_RUSAGE_H__ */ +#endif /* !CALC_HAVE_RUSAGE_H */ diff --git a/win32/have_stdlib.h b/win32/have_stdlib.h index 5c949ac..662dd48 100644 --- a/win32/have_stdlib.h +++ b/win32/have_stdlib.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_STDLIB_H__) -#define __HAVE_STDLIB_H__ +#if !defined(CALC_HAVE_STDLIB_H) +#define CALC_HAVE_STDLIB_H /* do we have ? */ #define HAVE_STDLIB_H /* yes */ -#endif /* !__HAVE_STDLIB_H__ */ +#endif /* !CALC_HAVE_STDLIB_H */ diff --git a/win32/have_strdup.h b/win32/have_strdup.h index 70a077c..0d0af11 100644 --- a/win32/have_strdup.h +++ b/win32/have_strdup.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_STRDUP_H__) -#define __HAVE_STRDUP_H__ +#if !defined(CALC_HAVE_STRDUP_H) +#define CALC_HAVE_STRDUP_H /* do we have or want getstrdup()? */ #define HAVE_STRDUP /* yes */ -#endif /* !__HAVE_STRDUP_H__ */ +#endif /* !CALC_HAVE_STRDUP_H */ diff --git a/win32/have_string.h b/win32/have_string.h index 092e02f..b3e77f2 100644 --- a/win32/have_string.h +++ b/win32/have_string.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_STRING_H__) -#define __HAVE_STRING_H__ +#if !defined(CALC_HAVE_STRING_H) +#define CALC_HAVE_STRING_H /* do we have ? */ #define HAVE_STRING_H /* yes */ -#endif /* !__HAVE_STRING_H__ */ +#endif /* !CALC_HAVE_STRING_H */ diff --git a/win32/have_times.h b/win32/have_times.h index 2aa3e8d..691688e 100644 --- a/win32/have_times.h +++ b/win32/have_times.h @@ -3,8 +3,8 @@ */ -#if !defined(__HAVE_TIMES_H__) -#define __HAVE_TIMES_H__ +#if !defined(CALC_HAVE_TIMES_H) +#define CALC_HAVE_TIMES_H /* do we have ? */ @@ -14,4 +14,4 @@ #undef HAVE_SYS_TIME_H /* no */ -#endif /* !__HAVE_TIMES_H__ */ +#endif /* !CALC_HAVE_TIMES_H */ diff --git a/win32/have_uid_t.h b/win32/have_uid_t.h index 81a9c32..a7fee29 100644 --- a/win32/have_uid_t.h +++ b/win32/have_uid_t.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_UID_T_H__) -#define __HAVE_UID_T_H__ +#if !defined(CALC_HAVE_UID_T_H) +#define CALC_HAVE_UID_T_H /* do we have or want uid_t? */ #undef HAVE_UID_T /* no */ -#endif /* !__HAVE_UID_T_H__ */ +#endif /* !CALC_HAVE_UID_T_H */ diff --git a/win32/have_unistd.h b/win32/have_unistd.h index edfa3d7..6802dbc 100644 --- a/win32/have_unistd.h +++ b/win32/have_unistd.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_UNISTD_H__) -#define __HAVE_UNISTD_H__ +#if !defined(CALC_HAVE_UNISTD_H) +#define CALC_HAVE_UNISTD_H /* do we have ? */ #undef HAVE_UNISTD_H /* no */ -#endif /* !__HAVE_UNISTD_H__ */ +#endif /* !CALC_HAVE_UNISTD_H */ diff --git a/win32/have_unused.h b/win32/have_unused.h index 986cded..6958062 100644 --- a/win32/have_unused.h +++ b/win32/have_unused.h @@ -3,8 +3,8 @@ */ -#if !defined(__HAVE_UNUSED_H__) -#define __HAVE_UNUSED_H__ +#if !defined(CALC_HAVE_UNUSED_H) +#define CALC_HAVE_UNUSED_H /* do we have/want the unused attribute? */ @@ -13,4 +13,4 @@ #define UNUSED __attribute__((unused)) /* yes */ -#endif /* !__HAVE_UNUSED_H__ */ +#endif /* !CALC_HAVE_UNUSED_H */ diff --git a/win32/have_urandom.h b/win32/have_urandom.h index fc32ad7..e6ac0a0 100644 --- a/win32/have_urandom.h +++ b/win32/have_urandom.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_URANDOM_H__) -#define __HAVE_URANDOM_H__ +#if !defined(CALC_HAVE_URANDOM_H) +#define CALC_HAVE_URANDOM_H /* do we have /dev/urandom? */ #undef HAVE_URANDOM_H /* no */ -#endif /* !__HAVE_URANDOM_H__ */ +#endif /* !CALC_HAVE_URANDOM_H */ diff --git a/win32/have_ustat.h b/win32/have_ustat.h index 65594f0..576129d 100644 --- a/win32/have_ustat.h +++ b/win32/have_ustat.h @@ -3,12 +3,12 @@ */ -#if !defined(__HAVE_USTAT_H__) -#define __HAVE_USTAT_H__ +#if !defined(CALC_HAVE_USTAT_H) +#define CALC_HAVE_USTAT_H /* do we have or want ustat()? */ #undef HAVE_USTAT /* no */ -#endif /* !__HAVE_USTAT_H__ */ +#endif /* !CALC_HAVE_USTAT_H */ diff --git a/zmath.h b/zmath.h index b12a40c..a1bc322 100644 --- a/zmath.h +++ b/zmath.h @@ -1,7 +1,7 @@ /* * zmath - declarations for extended precision integer arithmetic * - * Copyright (C) 1999-2007 David I. Bell + * Copyright (C) 1999-2007,2014 David I. Bell * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: zmath.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ + * @(#) $Revision: 30.5 $ + * @(#) $Id: zmath.h,v 30.5 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/zmath.h,v $ * * Under source code control: 1993/07/30 19:42:48 @@ -34,8 +34,8 @@ */ -#if !defined(__ZMATH_H__) -#define __ZMATH_H__ +#if !defined(INCLUDE_ZMATH_H) +#define INCLUDE_ZMATH_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -669,4 +669,4 @@ typedef struct { } BITSTR; -#endif /* !__ZMATH_H__*/ +#endif /* !INCLUDE_ZMATH_H*/ diff --git a/zrand.h b/zrand.h index 6303a5c..45d10a2 100644 --- a/zrand.h +++ b/zrand.h @@ -1,7 +1,7 @@ /* * zrand - subtractive 100 shuffle generator * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: zrand.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: zrand.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/zrand.h,v $ * * Under source code control: 1995/01/07 09:45:26 @@ -33,8 +33,8 @@ */ -#if !defined(__ZRAND_H__) -#define __ZRAND_H__ +#if !defined(INCLUDE_ZRAND_H) +#define INCLUDE_ZRAND_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -222,4 +222,4 @@ E_FUNC BOOL randcmp(CONST RAND *s1, CONST RAND *s2); E_FUNC void randprint(CONST RAND *state, int flags); -#endif /* !__ZRAND_H__ */ +#endif /* !INCLUDE_ZRAND_H */ diff --git a/zrandom.h b/zrandom.h index f79448e..726398b 100644 --- a/zrandom.h +++ b/zrandom.h @@ -1,7 +1,7 @@ /* * zrandom - Blum-Blum-Shub pseudo-random generator * - * Copyright (C) 1999-2007 Landon Curt Noll + * Copyright (C) 1999-2007,2014 Landon Curt Noll * * 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 @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * @(#) $Revision: 30.1 $ - * @(#) $Id: zrandom.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: zrandom.h,v 30.3 2014/08/24 21:56:51 chongo Exp $ * @(#) $Source: /usr/local/src/bin/calc/RCS/zrandom.h,v $ * * Under source code control: 1997/02/15 04:01:56 @@ -29,8 +29,8 @@ */ -#if !defined(__ZRANDOM_H__) -#define __ZRANDOM_H__ +#if !defined(INCLUDE_ZRANDOM_H) +#define INCLUDE_ZRANDOM_H #if defined(CALC_SRC) /* if we are building from the calc source tree */ @@ -91,4 +91,4 @@ E_FUNC void randomprint(CONST RANDOM *state, int flags); E_FUNC void random_libcalc_cleanup(void); -#endif /* !__ZRANDOM_H__ */ +#endif /* !INCLUDE_ZRANDOM_H */