#
###################################################
-require 5.6.0;
+require 5.8.0;
use Socket;
use Cwd;
use Getopt::Long;
{
# Suggestion from nenolod, weed out odd systems which have glibc built
# against 2.4 kernels (ick)
-
+ my $kernel_arch = `uname -p`;
+ chomp($kernel_arch);
$libcv = 0.0;
$kernelv = 0.0;
- open (FH,"/lib/libc.so.6|") or $has_epoll = 0;
+ if ($kernel_arch =~ /x86_64/) {
+ open (FH,"/lib64/libc.so.6|") or $has_epoll = 0;
+ }
+ else {
+ open (FH,"/lib/libc.so.6|") or $has_epoll = 0;
+ }
if ($has_epoll)
{
while (chomp($line = <FH>))
if ($line =~ /GNU C Library .* version (.*?) /)
{
$libcv = $1;
- $libcv =~ /([0-9\.\-])+/;
+ $libcv =~ /(\d+\.\d+)/;
$libcv = $1;
}
elsif ($line =~ /Compiled on a Linux (.*?\..*?)\.* system/)
{
$kernelv = $1;
# Fix for some retarded libc builds, strip off >> and << etc.
- $kernelv =~ /([0-9\.\-])+/;
+ $kernelv =~ /(\d+\.\d+)/;
$kernelv = $1;
}
}
$config{HAS_OPENSSL} = "n";
}
+printf "Checking if you are running an ancient, unsupported OS... ";
+if ($config{OSNAME} =~ /FreeBSD/i)
+{
+ $version = `uname -r`;
+ if ($version =~ /^4\./)
+ {
+ $foundit = `ls -l /usr/local/lib/libgnugetopt* | wc -l`;
+ if ($foundit > 0)
+ {
+ # ICKY ICKY ICK, FREEBSD 4.x! GET AN UPGRADE!
+ $config{CRAQ} = "-L/usr/local/lib -lgnugetopt -DHAVE_DECL_GETOPT=1";
+ print "yes\n";
+ }
+ else
+ {
+ print "\n\nERROR: You require libgnugetopt (from ports or packages) to build InspIRCd on FreeBSD 4.11.\n";
+ }
+ }
+ else
+ {
+ $config{CRAQ} = " ";
+ print "no ($version)\n";
+ }
+}
+else
+{
+ $config{CRAQ} = " ";
+ print "no ($config{OSNAME})\n";
+}
+
################################################################################
# BEGIN INTERACTIVE PART #
################################################################################
$se = "socketengine_ports";
}
+ $freebsd4libs = $config{CRAQ};
+
open(FH,">src/Makefile") or die("Could not write src/Makefile");
print FH <<EOM;
###################################################
all: libIRCDtimer.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so libIRCDsnomasks.so libIRCDserver.so libIRCDfilelogger.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 libIRCDtimer.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDsnomasks.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so libIRCDserver.so libIRCDfilelogger.so
- \$(CC) -pipe -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 libIRCDconfigreader.so libIRCDinspsocket.so libIRCDcommands.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 libIRCDtimer.so libIRCDsnomasks.so libIRCDserver.so libIRCDfilelogger.so
+ \$(CC) -pipe -I../include -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so libIRCDcommands.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 libIRCDtimer.so libIRCDsnomasks.so libIRCDserver.so libIRCDfilelogger.so
libIRCDsocketengine.so: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp