diff --git a/configure.ac b/configure.ac index 1ed528fa3..9b34f8d4e 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,10 @@ AC_ARG_ENABLE([help], AC_ARG_ENABLE([xgraph], [AS_HELP_STRING([--enable-xgraph], [Enable xgraph compilation.])]) +# --enable-devlib: Enable Dynamic Library Load (experimental) +AC_ARG_ENABLE([devlib], + [AS_HELP_STRING([--enable-devlib], [Enable Dynamic Library Load (experimental)])]) + # --with-readline: Includes GNU readline support into CLI. Default is "no". AC_ARG_WITH([readline], [AS_HELP_STRING([--with-readline[=yes/no]], [Enable GNU readline support for CLI. Default=no.])]) @@ -801,6 +805,12 @@ fi AC_SUBST([XGRAPHDIR]) AC_SUBST([NOTXGRAPH]) +if test "x$enable_devlib" = xyes; then + AC_DEFINE([DEVLIB], [], [Define Dynamic Load Function (experimental)]) + AC_MSG_RESULT([WARNING: Dynamic Load Function (experimental) ENABLED]) +fi +AM_CONDITIONAL([DEVLIB_WANTED], [test "x$enable_devlib" = xyes]) + AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc]) ################# XSPICE ################################################## diff --git a/src/frontend/Makefile.am b/src/frontend/Makefile.am index 2a21a84f7..5fbe042b8 100644 --- a/src/frontend/Makefile.am +++ b/src/frontend/Makefile.am @@ -31,8 +31,6 @@ libfte_la_SOURCES = \ com_compose.c \ com_compose.h \ com_commands.h \ - com_dl.c \ - com_dl.h \ com_display.c \ com_display.h \ com_dump.c \ @@ -186,6 +184,24 @@ libfte_la_SOURCES = \ where.c \ where.h + +### com_dl ### +if XSPICE_WANTED +if DEVLIB_WANTED +libfte_la_SOURCES += com_dl.c \ + com_dl.h +else +libfte_la_SOURCES += com_dl.c \ + com_dl.h +endif +else +if DEVLIB_WANTED +libfte_la_SOURCES += com_dl.c \ + com_dl.h +endif +endif + + # TESTS = testcommands # # bin_PROGRAMS = testcommands diff --git a/src/frontend/com_dl.c b/src/frontend/com_dl.c index b120cf246..c5efcbc7e 100644 --- a/src/frontend/com_dl.c +++ b/src/frontend/com_dl.c @@ -1,8 +1,10 @@ +#if defined(XSPICE) || defined(DEVLIB) #include "ngspice/ngspice.h" /* for wl */ #include "ngspice/ftedefs.h" #include "ngspice/devdefs.h" /* solve deps in dev.h*/ #include "../spicelib/devices/dev.h" /* for load library commands */ #include "com_dl.h" +#endif #ifdef XSPICE