checkpoint on ALLOW_CUSTOM use

Updated comments in Makefile.local for how to Diagnosing memory,
thread, and crash issues under RHEL and macOS.

We no longer support the Makefile variable ${ALLOW_CUSTOM} to be empty.
Normally ${ALLOW_CUSTOM} is:

    ALLOW_CUSTOM= -DCUSTOM

Now, to disable custom disable custom even if -C is given, use:

    ALLOW_CUSTOM="-UCUSTOM"

Added comments in Makefile.local for how to reduce dependency chains
under macOS.  XXX - this doesn't yet work so don't uncomment - XXX.
This commit is contained in:
Landon Curt Noll
2023-08-13 16:17:10 -07:00
parent 77405e1d84
commit b408b59d8d
10 changed files with 65 additions and 40 deletions

11
CHANGES
View File

@@ -22,8 +22,17 @@ The following are the changes from calc version 2.14.3.1 to date:
Updated comments in Makefile.local for how to Diagnosing memory, Updated comments in Makefile.local for how to Diagnosing memory,
thread, and crash issues under RHEL and macOS. thread, and crash issues under RHEL and macOS.
We no longer support the Makefile variable ${ALLOW_CUSTOM} to be empty.
Normally ${ALLOW_CUSTOM} is:
ALLOW_CUSTOM= -DCUSTOM
Now, to disable custom disable custom even if -C is given, use:
ALLOW_CUSTOM="-UCUSTOM"
Added comments in Makefile.local for how to reduce dependency chains Added comments in Makefile.local for how to reduce dependency chains
under macOS under macOS. XXX - this doesn't yet work so don't uncomment - XXX.
The following are the changes from calc version 2.14.2.1 to 2.14.3.0: The following are the changes from calc version 2.14.2.1 to 2.14.3.0:

View File

@@ -1158,12 +1158,12 @@ CATMODE= 0444
# disable custom builtin functions by not compiling any custom code # disable custom builtin functions by not compiling any custom code
# #
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given # ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
# ALLOW_CUSTOM= # disable custom even if -C is given # ALLOW_CUSTOM= -UCUSTOM # disable custom even if -C is given
# #
# If in doubt, use ALLOW_CUSTOM= -DCUSTOM # If in doubt, use ALLOW_CUSTOM= -DCUSTOM
# #
ALLOW_CUSTOM= -DCUSTOM ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM= -UCUSTOM
# If the $CALCPATH environment variable is not defined, then the following # If the $CALCPATH environment variable is not defined, then the following
# path will be searched for calc resource file routines. # path will be searched for calc resource file routines.
@@ -1173,13 +1173,13 @@ ALLOW_CUSTOM= -DCUSTOM
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef RPM_TOP ifdef RPM_TOP
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR} CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR}
else else
CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR} CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}
endif endif
else else
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
CALCPATH= .:./cal:~/.cal:${T}${CALC_SHAREDIR}:${T}${CUSTOMCALDIR} CALCPATH= .:./cal:~/.cal:${T}${CALC_SHAREDIR}:${T}${CUSTOMCALDIR}
@@ -1375,8 +1375,16 @@ LD_DEBUG=
# #
# CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=. # CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=.
# #
#if 0 /* start of skip for non-Gnu makefiles */
#
ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help \ CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help \
CALCCUSTOMHELP=./custom CALCCUSTOMHELP=./custom
else
CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help
endif
#
#endif /* end of skip for non-Gnu makefiles */
# Some out of date operating systems require/want an executable to # Some out of date operating systems require/want an executable to
# end with a certain file extension. Some compiler systems such as # end with a certain file extension. Some compiler systems such as
@@ -1486,7 +1494,7 @@ ARCH_CFLAGS=
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} \ COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} \
@@ -1606,7 +1614,7 @@ DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}" "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}" LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}" LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
else else
LIBCUSTCALC_SHLIB= LIBCUSTCALC_SHLIB=
@@ -1676,7 +1684,7 @@ else
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
${ARCH_CFLAGS} ${ARCH_CFLAGS}
endif endif
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
ifeq ($(SET_INSTALL_NAME),yes) ifeq ($(SET_INSTALL_NAME),yes)
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \ LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
-install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${ARCH_CFLAGS} -install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${ARCH_CFLAGS}
@@ -1746,7 +1754,7 @@ DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}" "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}" LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}" LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
else else
LIBCUSTCALC_SHLIB= LIBCUSTCALC_SHLIB=
@@ -1807,7 +1815,7 @@ DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}" "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}" LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}" LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
else else
LIBCUSTCALC_SHLIB= LIBCUSTCALC_SHLIB=
@@ -1862,7 +1870,7 @@ DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}" "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}" LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}" LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
else else
LIBCUSTCALC_SHLIB= LIBCUSTCALC_SHLIB=
@@ -1972,7 +1980,7 @@ DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}" "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}" LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}" LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
else else
LIBCUSTCALC_SHLIB= LIBCUSTCALC_SHLIB=
@@ -2474,7 +2482,7 @@ OBJS= ${LIBOBJS} ${CALCOBJS} ${UTIL_OBJS} ${SAMPLE_OBJ}
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
CALC_STATIC_LIBS= libcalc.a libcustcalc.a CALC_STATIC_LIBS= libcalc.a libcustcalc.a
@@ -2490,7 +2498,7 @@ endif
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT_VERSION} CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT_VERSION}
@@ -2506,7 +2514,7 @@ endif
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
@@ -2551,7 +2559,7 @@ STATIC_FIRST_TARGETS= ${LICENSE} .static
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
EARLY_TARGETS= hsrc .hsrc custom/.all custom/Makefile EARLY_TARGETS= hsrc .hsrc custom/.all custom/Makefile
@@ -2857,7 +2865,7 @@ endif
${Q} echo '' >> $@ ${Q} echo '' >> $@
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
${Q} echo '/* the location of the custom help directory */' >> $@ ${Q} echo '/* the location of the custom help directory */' >> $@
@@ -4620,7 +4628,7 @@ ${CSCRIPT_TARGETS}: cscript/Makefile
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
custom/.all: custom/Makefile custom/.all: custom/Makefile
@@ -4675,7 +4683,7 @@ libcalc.a: ${LIBOBJS} ${MAKE_FILE} ${LOC_MKF}
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
custom/libcustcalc.a: custom/Makefile custom/libcustcalc.a: custom/Makefile
@@ -5102,6 +5110,7 @@ env:
@echo 'DIFF=${DIFF}'; echo '' @echo 'DIFF=${DIFF}'; echo ''
@echo 'DISTLIST=${DISTLIST}'; echo '' @echo 'DISTLIST=${DISTLIST}'; echo ''
@echo 'E=${E}'; echo '' @echo 'E=${E}'; echo ''
@echo 'EARLY_TARGETS=${EARLY_TARGETS}'; echo ''
@echo 'EXT=${EXT}'; echo '' @echo 'EXT=${EXT}'; echo ''
@echo 'FMT=${FMT}'; echo '' @echo 'FMT=${FMT}'; echo ''
@echo 'FPOS_BITS=${FPOS_BITS}'; echo '' @echo 'FPOS_BITS=${FPOS_BITS}'; echo ''
@@ -5152,6 +5161,7 @@ env:
@echo 'INCDIR=${INCDIR}'; echo '' @echo 'INCDIR=${INCDIR}'; echo ''
@echo 'INODE_BITS=${INODE_BITS}'; echo '' @echo 'INODE_BITS=${INODE_BITS}'; echo ''
@echo 'LANG=${LANG}'; echo '' @echo 'LANG=${LANG}'; echo ''
@echo 'LATE_TARGETS=${LATE_TARGETS}'; echo ''
@echo 'LCC=${LCC}'; echo '' @echo 'LCC=${LCC}'; echo ''
@echo 'LDCONFIG=${LDCONFIG}'; echo '' @echo 'LDCONFIG=${LDCONFIG}'; echo ''
@echo 'LDFLAGS=${LDFLAGS}'; echo '' @echo 'LDFLAGS=${LDFLAGS}'; echo ''
@@ -5591,7 +5601,7 @@ install: ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all custom/Makefile
fi fi
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
@@ -5707,7 +5717,7 @@ endif
${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
# #
ifdef ALLOW_CUSTOM ifeq ($(ALLOW_CUSTOM),-DCUSTOM)
# #
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
${V} echo '=-=-=-=-= Invoking $@ rule for custom =-=-=-=-=' ${V} echo '=-=-=-=-= Invoking $@ rule for custom =-=-=-=-='

View File

@@ -1035,12 +1035,12 @@ CATMODE= 0444
# disable custom builtin functions by not compiling any custom code # disable custom builtin functions by not compiling any custom code
# #
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given # ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
# ALLOW_CUSTOM= # disable custom even if -C is given # ALLOW_CUSTOM= -UCUSTOM # disable custom even if -C is given
# #
# If in doubt, use ALLOW_CUSTOM= -DCUSTOM # If in doubt, use ALLOW_CUSTOM= -DCUSTOM
# #
ALLOW_CUSTOM= -DCUSTOM ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM= -UCUSTOM
# If the $CALCPATH environment variable is not defined, then the following # If the $CALCPATH environment variable is not defined, then the following
# path will be searched for calc resource file routines. # path will be searched for calc resource file routines.
@@ -1220,8 +1220,6 @@ LD_DEBUG=
# #
# CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=. # CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=.
# #
CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help \
CALCCUSTOMHELP=./custom
# Some out of date operating systems require/want an executable to # Some out of date operating systems require/want an executable to
# end with a certain file extension. Some compiler systems such as # end with a certain file extension. Some compiler systems such as
@@ -4389,6 +4387,7 @@ env:
@echo 'DIFF=${DIFF}'; echo '' @echo 'DIFF=${DIFF}'; echo ''
@echo 'DISTLIST=${DISTLIST}'; echo '' @echo 'DISTLIST=${DISTLIST}'; echo ''
@echo 'E=${E}'; echo '' @echo 'E=${E}'; echo ''
@echo 'EARLY_TARGETS=${EARLY_TARGETS}'; echo ''
@echo 'EXT=${EXT}'; echo '' @echo 'EXT=${EXT}'; echo ''
@echo 'FMT=${FMT}'; echo '' @echo 'FMT=${FMT}'; echo ''
@echo 'FPOS_BITS=${FPOS_BITS}'; echo '' @echo 'FPOS_BITS=${FPOS_BITS}'; echo ''
@@ -4439,6 +4438,7 @@ env:
@echo 'INCDIR=${INCDIR}'; echo '' @echo 'INCDIR=${INCDIR}'; echo ''
@echo 'INODE_BITS=${INODE_BITS}'; echo '' @echo 'INODE_BITS=${INODE_BITS}'; echo ''
@echo 'LANG=${LANG}'; echo '' @echo 'LANG=${LANG}'; echo ''
@echo 'LATE_TARGETS=${LATE_TARGETS}'; echo ''
@echo 'LCC=${LCC}'; echo '' @echo 'LCC=${LCC}'; echo ''
@echo 'LDCONFIG=${LDCONFIG}'; echo '' @echo 'LDCONFIG=${LDCONFIG}'; echo ''
@echo 'LDFLAGS=${LDFLAGS}'; echo '' @echo 'LDFLAGS=${LDFLAGS}'; echo ''

View File

@@ -1,7 +1,7 @@
/* /*
* custom - interface for custom software and hardware interfaces * custom - interface for custom software and hardware interfaces
* *
* Copyright (C) 1999-2007,2021 Landon Curt Noll * Copyright (C) 1999-2007,2021,2023 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -26,7 +26,7 @@
/* /*
* Be careful what you put in this file, upper .c files include * Be careful what you put in this file, upper .c files include
* this file even when CUSTOM is not defined (ALLOW_CUSTOM is empty). * this file even when CUSTOM is not defined (ALLOW_CUSTOM="-UCUSTOM").
* *
* Don't include anything, let the including .c file bring in: * Don't include anything, let the including .c file bring in:
* *

View File

@@ -19,6 +19,10 @@ must be invoked with a -C argument:
when it is run. when it is run.
To disable custom even if -C is given, calc must be built with:
ALLOW_CUSTOM="-UCUSTOM"
See the ../cal/README or "help resource" for information about See the ../cal/README or "help resource" for information about
calc resource standards and guidelines. calc resource standards and guidelines.
@@ -41,7 +45,7 @@ pzasusb8.cal
Run custom("pzasusb8") on a standard set of data, print Endian Run custom("pzasusb8") on a standard set of data, print Endian
related information and print value size information. related information and print value size information.
## Copyright (C) 1999,2021 Landon Curt Noll ## Copyright (C) 1999,2021,2023 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## 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 ## the terms of the version 2.1 of the GNU Lesser General Public License

View File

@@ -168,8 +168,7 @@ Step 5: Write your custom function
#endif /* CUSTOM */ #endif /* CUSTOM */
This allows this code to 'go away' when the upper Makefile This allows this code to 'go away' when the upper Makefile
disables the custom code (because ALLOW_CUSTOM no longer disables the custom code when CUSTOM is not defined.
has the -DCUSTOM define).
b) The function type must be: b) The function type must be:

View File

@@ -453,12 +453,13 @@ CALC_ENV= CALCPATH=./cal
# disable custom builtin functions by not compiling any of code # disable custom builtin functions by not compiling any of code
# #
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given # ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
# ALLOW_CUSTOM= # disable custom even if -C is given # ALLOW_CUSTOM= -UCUSTOM # disable custom even if -C is given
# #
# If in doubt, use ALLOW_CUSTOM= -DCUSTOM # If in doubt, use ALLOW_CUSTOM= -DCUSTOM
# #
ALLOW_CUSTOM= -DCUSTOM ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM= -UCUSTOM
# Some out of date operating systems require / want an executable to # Some out of date operating systems require / want an executable to
# end with a certain file extension. Some compile systems such as # end with a certain file extension. Some compile systems such as
@@ -1079,7 +1080,7 @@ install: all
${RM} -f ${T}${CUSTOMCALDIR}/libcustcalc.a; \ ${RM} -f ${T}${CUSTOMCALDIR}/libcustcalc.a; \
echo "removed old ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ echo "removed old ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
fi fi
-${Q} if [ ! -z ${ALLOW_CUSTOM} ]; then \ -${Q} if [ X"${ALLOW_CUSTOM}" = "X-DCUSTOM" ]; then \
if [ -f libcustcalc.a ]; then \ if [ -f libcustcalc.a ]; then \
if ${CMP} -s libcustcalc.a ${T}${LIBDIR}/libcustcalc.a; then \ if ${CMP} -s libcustcalc.a ${T}${LIBDIR}/libcustcalc.a; then \
${TRUE}; \ ${TRUE}; \

View File

@@ -423,12 +423,13 @@ CALC_ENV= CALCPATH=./cal
# disable custom builtin functions by not compiling any of code # disable custom builtin functions by not compiling any of code
# #
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given # ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
# ALLOW_CUSTOM= # disable custom even if -C is given # ALLOW_CUSTOM= -UCUSTOM # disable custom even if -C is given
# #
# If in doubt, use ALLOW_CUSTOM= -DCUSTOM # If in doubt, use ALLOW_CUSTOM= -DCUSTOM
# #
ALLOW_CUSTOM= -DCUSTOM ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM= -UCUSTOM
# Some out of date operating systems require / want an executable to # Some out of date operating systems require / want an executable to
# end with a certain file extension. Some compile systems such as # end with a certain file extension. Some compile systems such as
@@ -1073,7 +1074,7 @@ install: all
${RM} -f ${T}${CUSTOMCALDIR}/libcustcalc.a; \ ${RM} -f ${T}${CUSTOMCALDIR}/libcustcalc.a; \
echo "removed old ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ echo "removed old ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
fi fi
-${Q} if [ ! -z ${ALLOW_CUSTOM} ]; then \ -${Q} if [ X"${ALLOW_CUSTOM}" = "X-DCUSTOM" ]; then \
if [ -f libcustcalc.a ]; then \ if [ -f libcustcalc.a ]; then \
if ${CMP} -s libcustcalc.a ${T}${LIBDIR}/libcustcalc.a; then \ if ${CMP} -s libcustcalc.a ${T}${LIBDIR}/libcustcalc.a; then \
${TRUE}; \ ${TRUE}; \

View File

@@ -832,7 +832,7 @@ DESCRIPTION
Returns TRUE if you calc was compiled with -DCUSTOM. By default, Returns TRUE if you calc was compiled with -DCUSTOM. By default,
the calc Makefile uses ALLOW_CUSTOM= -DCUSTOM so by default the calc Makefile uses ALLOW_CUSTOM= -DCUSTOM so by default
config("compile_custom") is TRUE. If, however, calc is compiled config("compile_custom") is TRUE. If, however, calc is compiled
without -DCUSTOM, then config("compile_custom") will be FALSE. with ALLOW_CUSTOM="-UCUSTOM", then config("compile_custom") will be FALSE.
The config("compile_custom") value is only affected by compile The config("compile_custom") value is only affected by compile
flags. The calc -D runtime command line option does not change flags. The calc -D runtime command line option does not change
@@ -1042,7 +1042,7 @@ LINK LIBRARY
SEE ALSO SEE ALSO
custom, custom_cal, display, epsilon, fprintf, printf, strprintf, usage custom, custom_cal, display, epsilon, fprintf, printf, strprintf, usage
## Copyright (C) 1999-2007,2018,2021 Landon Curt Noll ## Copyright (C) 1999-2007,2018,2021,2023 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## 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 ## the terms of the version 2.1 of the GNU Lesser General Public License

View File

@@ -68,7 +68,8 @@ DESCRIPTION
help contrib help contrib
EXAMPLE EXAMPLE
If calc compiled with ALLOW_CUSTOM= (custom disabled): If calc compiled with ALLOW_CUSTOM="-UCUSTOM", the custom system
is disabled, even when -C is used on the command line:
; print custom("sysinfo", "baseb") ; print custom("sysinfo", "baseb")
Calc was built with custom functions disabled Calc was built with custom functions disabled
@@ -94,7 +95,7 @@ LINK LIBRARY
SEE ALSO SEE ALSO
custom_cal, new_custom, contrib custom_cal, new_custom, contrib
## Copyright (C) 1999 Landon Curt Noll ## Copyright (C) 1999,2023 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## 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 ## the terms of the version 2.1 of the GNU Lesser General Public License