chomp($config{GCC34} = `gcc -dumpversion | cut -c 3`); # Minor GCC Version
chomp($config{OSNAME} = `/bin/uname`); # Operating System Name
$config{CC} = "g++"; # C++ compiler
-$config{MAKEORDER} = "ircd mods config bininst"; # build order
+$config{MAKEORDER} = "ircd mods"; # build order
$config{STATICLIBS} = ""; # library archive path
$config{MAX_IDENT} = "12"; # max ident size
$config{MAX_QUIT} = "255"; # max quit message size
}
}
+if ($arg eq "-svnupdate") {
+ system("svn update");
+ system("perl configure -update");
+ if ($ARGV[1] eq "rebuild") {
+ system("make install");
+ }
+ exit;
+}
+
if ($arg eq "-modupdate") {
# Does the cache file exist?
if (!getcache()) {
$fail = 0;
open(EPOLL, "</usr/include/sys/epoll.h") or $fail = 1;
if (!$fail) {
- while (chomp($line = <EPOLL>)) {
- # try and find the declaration of:
- # extern int epoll_create (int __size) __THROW;
- if (($line =~ /int(\0x9|\s)+epoll_create(\0x9|\s)+\(/) || ($line =~ /int(\0x9|\s)+epoll_create\(/)) {
- $has_epoll = 1;
- }
- }
+ $has_epoll = 1;
close(EPOLL);
}
if ($has_epoll) {
$config{CHANGE_COMPILER} = "n";
print "I have detected the following compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
-if ($config{GCCVER} < 3) {
+while (($config{GCCVER} < 3) || ($config{GCCVER} eq "")) {
print "\033[1;32mIMPORTANT!\033[0m A GCC 2.x compiler has been detected, and
-should NOT be used. You should probably specify a newer compiler.\n";
-}
-yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
-if ($config{CHANGE_COMPILER} =~ /y/i) {
- print "What command do you want to use to invoke your compiler?\n";
- print "[\033[1;32m$config{CC}\033[0m] -> ";
- chomp($config{CC} = <STDIN>);
- if ($config{CC} eq "") {
- $config{CC} = "g++";
- }
- chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
- if ($foo ne "") {
- chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change
- chomp($config{GCC34} = `$config{CC} -dumpversion | cut -c 3`); # the compiler path
- print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
- }
- else {
- print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
+should NOT be used. You should probably specify a newer compiler.\n\n";
+ yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
+ if ($config{CHANGE_COMPILER} =~ /y/i) {
+ print "What command do you want to use to invoke your compiler?\n";
+ print "[\033[1;32m$config{CC}\033[0m] -> ";
+ chomp($config{CC} = <STDIN>);
+ if ($config{CC} eq "") {
+ $config{CC} = "g++";
+ }
+ chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
+ if ($foo ne "") {
+ chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change
+ chomp($config{GCC34} = `$config{CC} -dumpversion | cut -c 3`); # the compiler path
+ print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
+ if ($config{GCCVER} < 3) {
+ print "\033[1;32mGCC 2.x WILL NOT WORK!\033[0m. Let's try that again, shall we?\n";
+ }
+ }
+ else {
+ print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
+ }
}
}
close(TMP);
if ($failed) {
print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n";
- system("cd src/modules");
+ chdir("src/modules");
system("ln -s extra/m_ssl_gnutls.cpp");
- system("cd ../..");
+ chdir("../..");
}
getmodules();
$failed = 0;
close(TMP);
if ($failed) {
print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n";
- system("cd src/modules");
+ chdir("src/modules");
system("ln -s extra/m_ssl_openssl.cpp");
- system("cd ../..");
+ chdir("../..");
}
getmodules();
$failed = 0;
$config{FLAGS} = "-frtti -Wall -Woverloaded-virtual $config{OPTIMISATI}";
$config{LDLIBS} = "";
$config{MAKEPROG} = "/usr/bin/make";
- $config{MAKEORDER} = "ircd mods config bininst";
+ $config{MAKEORDER} = "ircd mods";
} elsif ($config{OSNAME} eq "CYG-STATIC") {
$config{FLAGS} = "-frtti -Wall -Woverloaded-virtual $config{OPTIMISATI}";
$config{LDLIBS} = "";
$config{MAKEPROG} = "/usr/bin/make";
- $config{MAKEORDER} = "mods ircd config bininst";
+ $config{MAKEORDER} = "mods ircd";
$config{STATICLIBS} = "modules/mods.a";
$config{STATIC_LINK} = "yes";
}
}
sub writefiles {
-
print "Writing \033[1;32minspircd_config.h\033[0m\n";
# First File.. inspircd_config.h
chomp(my $incos = `uname -n -s -r`);
chomp(my $version = `sh ./src/version.sh`);
+ chomp(my $revision = `./src/svn-rev.sh`);
+ $version = "$version(r$revision)";
+ chomp(my $revision2 = `./src/svn-rev.sh`);
open(FILEHANDLE, ">include/inspircd_config.h");
my $NL = $config{NICK_LENGT}+1;
my $CL = $config{CHAN_LENGT}+1;
#define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
#define MOD_PATH "$config{MODULE_DIR}"
#define VERSION "$version"
+#define REVISION "$revision2"
#define MAXCLIENTS $config{MAX_CLIENT}
#define MAX_DESCRIPTORS $config{MAX_DESCRIPTORS}
#define NICKMAX $NL
open(MUNGED,">src/modules/m_".$i."_static.cpp") or die("Could not create m_".$i."_static.cpp");
while (chomp($a = <MODULE>)) {
$a =~ s/init_module/$i\_init/g;
- $a =~ s/Srv/$i\Srv/g;
print MUNGED "$a\n";
}
close(MODULE);
my $modules = "";
my $cmflags = "";
my $liflags = "";
+ my $crud = "";
foreach $i (@modlist) {
###
m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/inspircd_io.h
\$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
\$(CC) \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
- \@-rm -f \$(MODPATH)/m_$i.so
- install -v -m 0700 m_$i.so \$(MODPATH)
EOCHEESE
+ $crud = $crud . " install -v -m 0700 m_$i.so \$(MODPATH)\n";
###
# End Write Entry to the MakeFile
###
}
+ print FILEHANDLE "modinst:\n \@echo \"Installing modules...\"\n" . $crud;
}
if ($config{OSNAME} =~ /CYGWIN/) {
print FH <<EOM;
-all: aes.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o inspircd.exe
+all: timer.o aes.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o inspircd.exe
inspircd.exe: inspircd.dll.a
\$(CC) -o \$@ \$^
-inspircd.dll inspircd.dll.a: inspircd.o channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o aes.o
+inspircd.dll inspircd.dll.a: inspircd.o channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o aes.o timer.o
\$(CC) -shared -Wl,--out-implib=inspircd.dll.a -o inspircd.dll \$^
EOM
} else {
print FH <<EOM;
-all: aes.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o \$(MODULES) inspircd.exe
+all: timer.o aes.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o \$(MODULES) inspircd.exe
inspircd.exe: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/base.h
- \$(CC) -I../include \$(FLAGS) inspircd.cpp -o inspircd.exe \$(LDLIBS) channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o aes.o \$(MODULES)
+ \$(CC) -I../include \$(FLAGS) inspircd.cpp -o inspircd.exe \$(LDLIBS) channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_io.o message.o $cmdobjs commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o aes.o timer.o \$(MODULES)
EOM
}
aes.o: aes.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c aes.cpp
+timer.o: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
+ \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
+
EOM
foreach my $cmd (@cmdlist) {
print FH <<ITEM;
CXXFLAGS = -I../include \${FLAGS}
-all: libIRCDaes.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDio.so libIRCDmessage.so $cmdobjs libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so inspircd
+all: libIRCDtimer.so libIRCDaes.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDio.so libIRCDmessage.so $cmdobjs libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so inspircd
inspircd: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/socket.h
- \$(CC) -I../include -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDio.so libIRCDmessage.so libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so libIRCDaes.so
+ \$(CC) -I../include -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDio.so libIRCDmessage.so libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so libIRCDaes.so libIRCDtimer.so
libIRCDsocketengine.so: socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c aes.cpp
\$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDaes.so aes.o
+libIRCDtimer.so: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
+ \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
+ \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDtimer.so timer.o
+
EOM
foreach my $cmd (@cmdlist) {
print FH <<ITEM;