change libcalc dynamic library to link with libcustcalc

Under macOS, to reduce dependency chains, we remove functions
and data that are unreachable by the entry point or exported
symbols.  In particular, the macOS linker is used with both
"-dead_strip" and "-dead_strip_dylibs".

The libcalc shared library is now linked with libcustcalc.
This commit is contained in:
Landon Curt Noll
2023-08-17 14:23:29 -07:00
parent 3cd8fd7053
commit 4d32b138ed
7 changed files with 58 additions and 51 deletions

View File

@@ -25,17 +25,6 @@
*/
/*
* ISO C requires a translation unit to contain at least one declaration,
* so we declare a global variable whose value is based on if CUSTOM is defined.
*/
#if defined(CUSTOM)
int custtbl_allowed = 1; /* CUSTOM defined */
#else /* CUSTOM */
int custtbl_allowed = 0; /* CUSTOM undefined */
#endif /* CUSTOM */
#include <unistd.h>
#include "../have_const.h"
@@ -46,6 +35,24 @@ int custtbl_allowed = 0; /* CUSTOM undefined */
#include "../banned.h" /* include after system header <> includes */
/*
* custom_compiled - determine if custom functions are compiled into libcustcalc
*
* returns:
s* 1 ==> libcustcalc was compiled with CUSTOM defined
* 0 ==> libcustcalc was compiled with CUSTOM undefined
*/
E_FUNC int
custom_compiled(void)
{
#if defined(CUSTOM)
return 1;
#else /* CUSTOM */
return 0;
#endif /* CUSTOM */
}
/*
* NOTE: See the file HOW_TO_ADD for instructions on how to add custom functions.
*/