updated configure.ac to capture configure command and arguments
All checks were successful
continuous-integration/drone Build is passing

> used the captured info in bin/main.c
This commit is contained in:
2023-10-08 00:51:07 +09:00
parent 206df863cf
commit fe2b9456f4
10 changed files with 101 additions and 59 deletions

View File

@ -335,6 +335,11 @@ static void set_signal_to_default (int sig)
/* ========================================================================= */
static void print_info (void)
{
printf ("Configured with: %s %s\n", HCL_CONFIGURE_CMD, HCL_CONFIGURE_ARGS);
}
static void print_synerr (hcl_t* hcl)
{
hcl_synerr_t synerr;
@ -494,6 +499,7 @@ int main (int argc, char* argv[])
#endif
{ ":heapsize", '\0' },
{ ":log", 'l' },
{ ":info", '\0' },
{ HCL_NULL, '\0' }
};
@ -507,6 +513,7 @@ int main (int argc, char* argv[])
hcl_oow_t heapsize = DEFAULT_HEAPSIZE;
int cflags;
int verbose = 0;
int show_info = 0;
/*int experimental = 0;*/
#if defined(HCL_BUILD_DEBUG)
@ -552,6 +559,11 @@ int main (int argc, char* argv[])
break;
}
#endif
else if (hcl_comp_bcstr(opt.lngopt, "info") == 0)
{
show_info = 1;
break;
}
goto print_usage;
@ -622,6 +634,13 @@ int main (int argc, char* argv[])
}
#endif
if (show_info)
{
print_info ();
return 0;
}
if (hcl_ignite(hcl, heapsize) <= -1)
{
hcl_logbfmt (hcl, HCL_LOG_STDERR, "cannot ignite hcl - [%d] %js\n", hcl_geterrnum(hcl), hcl_geterrmsg(hcl));