diff --git a/Changes b/Changes index 9635344bc..934cf067b 100644 --- a/Changes +++ b/Changes @@ -368,3 +368,4 @@ - Fixed a double definition (double m_chghost and m_chghost.so) - Moved /sdesc, /setident to modules. - allow { } now supports encrypted passwords -Syzop +- Made static linking a little more possible diff --git a/src/Makefile b/src/Makefile index 584424ec7..c71447d48 100644 --- a/src/Makefile +++ b/src/Makefile @@ -54,6 +54,17 @@ build: ircd mods ircd: $(OBJS) $(CC) $(CFLAGS) $(CRYPTOLIB) -o ircd $(OBJS) $(LDFLAGS) $(IRCDLIBS) $(CRYPTOLIB) +staticircd: $(OBJS) + $(CC) $(CFLAGS) $(CRYPTOLIB) -DSTATIC_LINKING -o ircd.static $(OBJS) \ + modules/l_commands.c \ + modules/m_sethost.c \ + modules/m_chghost.c \ + modules/m_chgident.c \ + modules/m_setname.c \ + modules/m_setident.c \ + modules/m_sdesc.c \ + $(LDFLAGS) $(IRCDLIBS) $(CRYPTOLIB) + mods: @if [ ! -r include ] ; then \ ln -s ../include include; \ diff --git a/src/ircd.c b/src/ircd.c index d2d490b19..d180c9511 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -1074,6 +1074,9 @@ int InitwIRCD(argc, argv) conf_listen->options |= LISTENER_BOUND; me.umodes = conf_listen->options; run_configuration(); +#ifdef STATIC_LINKING + l_commands_init(); +#endif botmotd = (aMotd *) read_file(BPATH, &botmotd); rules = (aMotd *) read_rules(RPATH); opermotd = (aMotd *) read_file(OPATH, &opermotd); diff --git a/src/modules/l_commands.c b/src/modules/l_commands.c index 278a79d02..474d4ad26 100644 --- a/src/modules/l_commands.c +++ b/src/modules/l_commands.c @@ -17,9 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#define DYNAMIC_LINKING #include "config.h" #include "struct.h" #include "common.h" @@ -44,6 +42,11 @@ #ifdef _WIN32 #include "version.h" #endif +#ifndef STATIC_LINKING +#define DYNAMIC_LINKING +#else +#undef DYNAMIC_LINKING +#endif /* Place includes here */ /* replace this with a common name of your module */