diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/command.c | 4 | ||||
-rw-r--r-- | lib/frrlua.c | 6 | ||||
-rw-r--r-- | lib/frrlua.h | 7 | ||||
-rw-r--r-- | lib/frrscript.c | 7 | ||||
-rw-r--r-- | lib/frrscript.h | 6 | ||||
-rw-r--r-- | lib/libfrr.c | 2 |
6 files changed, 25 insertions, 7 deletions
diff --git a/lib/command.c b/lib/command.c index 3ca5c5882..b19147ed8 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2281,7 +2281,7 @@ done: return CMD_SUCCESS; } -#ifdef DEV_BUILD +#if defined(DEV_BUILD) && defined(HAVE_SCRIPTING) DEFUN(script, script_cmd, "script SCRIPT", @@ -2399,7 +2399,7 @@ void cmd_init(int terminal) install_element(VIEW_NODE, &echo_cmd); install_element(VIEW_NODE, &autocomplete_cmd); install_element(VIEW_NODE, &find_cmd); -#ifdef DEV_BUILD +#if defined(DEV_BUILD) && defined(HAVE_SCRIPTING) install_element(VIEW_NODE, &script_cmd); #endif diff --git a/lib/frrlua.c b/lib/frrlua.c index bd1e5b00e..cd878eb71 100644 --- a/lib/frrlua.c +++ b/lib/frrlua.c @@ -19,9 +19,11 @@ * with this program; see the file COPYING; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include <zebra.h> -#if defined(HAVE_LUA) +#ifdef HAVE_SCRIPTING + #include "prefix.h" #include "frrlua.h" #include "log.h" @@ -371,4 +373,4 @@ char *frrlua_stackdump(lua_State *L) return result; } -#endif +#endif /* HAVE_SCRIPTING */ diff --git a/lib/frrlua.h b/lib/frrlua.h index a105bd069..8e52931e5 100644 --- a/lib/frrlua.h +++ b/lib/frrlua.h @@ -19,7 +19,9 @@ #ifndef __FRRLUA_H__ #define __FRRLUA_H__ -#if defined(HAVE_LUA) +#include <zebra.h> + +#ifdef HAVE_SCRIPTING #include <lua.h> #include <lualib.h> @@ -166,5 +168,6 @@ char *frrlua_stackdump(lua_State *L); } #endif -#endif /* HAVE_LUA */ +#endif /* HAVE_SCRIPTING */ + #endif /* __FRRLUA_H__ */ diff --git a/lib/frrscript.c b/lib/frrscript.c index 60d3c2fc6..6d03ca119 100644 --- a/lib/frrscript.c +++ b/lib/frrscript.c @@ -16,8 +16,10 @@ * with this program; see the file COPYING; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - #include <zebra.h> + +#ifdef HAVE_SCRIPTING + #include <stdarg.h> #include <lua.h> @@ -27,6 +29,7 @@ #include "hash.h" #include "log.h" + DEFINE_MTYPE_STATIC(LIB, SCRIPT, "Scripting"); /* Codecs */ @@ -267,3 +270,5 @@ void frrscript_init() /* Register core library types */ frrscript_register_type_codecs(frrscript_codecs_lib); } + +#endif /* HAVE_SCRIPTING */ diff --git a/lib/frrscript.h b/lib/frrscript.h index cbc0ca6c5..4206420f4 100644 --- a/lib/frrscript.h +++ b/lib/frrscript.h @@ -19,6 +19,10 @@ #ifndef __FRRSCRIPT_H__ #define __FRRSCRIPT_H__ +#include <zebra.h> + +#ifdef HAVE_SCRIPTING + #include <lua.h> #include "frrlua.h" @@ -128,4 +132,6 @@ void *frrscript_get_result(struct frrscript *fs, } #endif /* __cplusplus */ +#endif /* HAVE_SCRIPTING */ + #endif /* __FRRSCRIPT_H__ */ diff --git a/lib/libfrr.c b/lib/libfrr.c index 8e21ac11b..05e6cf36e 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -718,7 +718,9 @@ struct thread_master *frr_init(void) lib_cmd_init(); frr_pthread_init(); +#ifdef HAVE_SCRIPTING frrscript_init(); +#endif log_ref_init(); log_ref_vty_init(); |