From: Willy Tarreau Date: Wed, 21 Dec 2016 18:04:56 +0000 (+0100) Subject: CLEANUP: lua: use the build options list to report it X-Git-Tag: v1.8-dev1~240 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb57d94a9629c7a1723c88f9173fe7c32ddf98de;p=thirdparty%2Fhaproxy.git CLEANUP: lua: use the build options list to report it This removes 1 #ifdef from haproxy.c. The "build without" version is not reported anymore now. --- diff --git a/src/haproxy.c b/src/haproxy.c index e9dca47334..bf7dfc1d40 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -425,12 +425,6 @@ static void display_build_opts() printf("Built without PCRE support (using libc's regex instead)\n"); #endif -#ifdef USE_LUA - printf("Built with Lua version : %s\n", LUA_RELEASE); -#else - printf("Built without Lua support\n"); -#endif - list_for_each_entry(item, &build_opts_list, list) { puts(item->str); } diff --git a/src/hlua.c b/src/hlua.c index ef1dabfaef..f423c6da3c 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -7703,3 +7703,11 @@ void hlua_init(void) RESET_SAFE_LJMP(gL.T); } + +__attribute__((constructor)) +static void __hlua_init(void) +{ + char *ptr = NULL; + memprintf(&ptr, "Built with Lua version : %s", LUA_RELEASE); + hap_register_build_opts(ptr, 1); +}