From ea47684780e5c2e50eb14cb6f8345ae4df1f4f25 Mon Sep 17 00:00:00 2001 From: peavey Date: Tue, 24 Jul 2007 15:33:29 +0000 Subject: [PATCH] Bye bye Cygwin and static builds o/ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7547 e03df62e-2008-0410-955e-edbf42e46eb7 --- configure | 335 ++---------------------------------------------------- 1 file changed, 7 insertions(+), 328 deletions(-) diff --git a/configure b/configure index 333430c3b..f29f44b7a 100755 --- a/configure +++ b/configure @@ -217,7 +217,6 @@ if (defined $opt_noipv6links) { $config{SUPPORT_IP6LINKS} = "n"; } -$config{STATIC_LINK} = "no"; # are doing static modules? chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version @@ -242,7 +241,6 @@ if (defined $opt_cc) $exec = $config{CC} . " -dumpversion | cut -c 1"; chomp($config{GCCVER} = `$exec`); # Major GCC Version $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 $config{MAX_TOPIC} = "307"; # max topic size @@ -283,15 +281,6 @@ if ($config{GCCVER} eq "") { exit; } -# Minihack! Convert Cygwin to 'Cyg-Static' so i can -# Keep my dynamic module experiments here for later -# consideration! - -if ($config{OSNAME} =~ /CYGWIN/i) -{ - $config{OSNAME} = "CYG-STATIC"; -} - if (!$config{MAX_CLIENT_T}) { $config{MAX_CLIENT_T} = 1024; # Set a reasonable 'Default' $fd_scan_fail = "true"; # Used Later @@ -528,10 +517,6 @@ if ($has_ports) { print "yes\n" if $has_ports == 1; print "no\n" if $has_ports == 0; -if (($config{OSNAME} =~ /CYGWIN/) || ($config{OSNAME} eq "CYG-STATIC")) { - $config{HAS_STRLCPY} = "true"; -} - $config{HAS_EPOLL} = $has_epoll; $config{HAS_KQUEUE} = $has_kqueue; @@ -951,21 +936,6 @@ sub getosflags { $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS}); $config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS}); $config{MAKEPROG} = "make"; - if ($config{OSNAME} =~ /CYGWIN/) { - $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual -Wno-deprecated $config{OPTIMISATI}"; - $config{LDLIBS} = ""; - $config{MAKEPROG} = "/usr/bin/make"; - $config{MAKEORDER} = "ircd mods"; - return "Cygwin"; - } elsif ($config{OSNAME} eq "CYG-STATIC") { - $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual -Wno-deprecated $config{OPTIMISATI}"; - $config{LDLIBS} = ""; - $config{MAKEPROG} = "/usr/bin/make"; - $config{MAKEORDER} = "mods ircd"; - $config{STATICLIBS} = "modules/mods.a"; - $config{STATIC_LINK} = "yes"; - return "Cygwin-Static"; - } } if ($config{OSNAME} =~ /FreeBSD/i) { @@ -1042,19 +1012,9 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; if ($config{OSNAME} =~ /SunOS/i) { print FILEHANDLE "#define IS_SOLARIS\n"; } - if ($config{OSNAME} =~ /CYGWIN/i) { - print FILEHANDLE "#define IS_CYGWIN\n"; - print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; - } if ($config{OSNAME} =~ /MINGW32/i) { print FILEHANDLE "#define IS_MINGW\n"; } - if ($config{OSNAME} =~ /CYG-STATIC/i) { - print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; - } - if ($config{STATIC_LINK} eq "yes") { - print FILEHANDLE "#define STATIC_LINK\n"; - } if ($config{GCCVER} >= 3) { print FILEHANDLE "#define GCC3\n"; } @@ -1116,12 +1076,7 @@ EOF my $modules = ""; foreach $i (@modlist) { - if ($config{STATIC_LINK} eq "yes") { - $modules .= "m_".$i.".o "; - } - else { - $modules .= "m_".$i.".so "; - } + $modules .= "m_".$i.".so "; } chomp($modules); # Remove Redundant whitespace.. @@ -1142,10 +1097,6 @@ EOF my $file = ""; my $exe = "inspircd"; - if ($config{OSNAME} =~ /CYGWIN/i) { - $exe = "inspircd.exe"; - } - opendir(DIRHANDLE, $this); # Do this once here, and cache it in the .*.inc files, @@ -1197,7 +1148,6 @@ EOF $tmp =~ s/\@EXTRA_DIR\@/$config{EXTRA_DIR}/; $tmp =~ s/\@EXECUTABLE\@/$exe/; $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/; - $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/; $tmp =~ s/\@VERSION\@/$version/; print "Writing \033[1;32m$file\033[0m\n"; @@ -1210,130 +1160,15 @@ EOF # Make inspircd executable! chmod 0744, 'inspircd'; - if ($config{STATIC_LINK} eq "yes") { - print "Writing static-build \033[1;32msrc/Makefile\033[0m\n"; - write_static_makefile(); - write_static_modules_makefile(); - } elsif ($config{OSNAME} =~ /CYGWIN/i) { - print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n"; - write_static_makefile(); - write_dynamic_modules_makefile(); - } else { - print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n"; - write_dynamic_makefile(); - write_dynamic_modules_makefile(); - } -} - -sub write_static_modules_makefile { - # Modules Makefile.. - print "Writing \033[1;32msrc/modules/Makefile\033[0m\n"; - open(FILEHANDLE, ">src/modules/Makefile"); - - ### - # Module Makefile Header - ### - print FILEHANDLE < -# for assisting with making this work right. -# -# Automatically Generated by ./configure to add a -# modules please run ./configure --modupdate -################################################### - -all: \$(MODULES) - -EOF - ### - # End Module Makefile Header - ### - - # Create a Modules List.. - my $modules = ""; - my $cmflags = ""; - my $liflags = ""; - - open(MODLIST,">include/modlist.h"); - - ### - # Include File Header - ### - print MODLIST <src/modules/.m_".$i."_static.cpp") or die("Could not create .m_".$i."_static.cpp"); - while (chomp($a = )) { - $a =~ s/init_module/$i\_init/g; - print MUNGED "$a\n"; - } - close(MODULE); - close(MUNGED); - print MODLIST <src/modules/Makefile"); - my $extra = ""; - - if ($config{OSNAME} =~ /CYGWIN/i) { - $extra = "../inspircd.dll.a"; - } ### # Module Makefile Header @@ -1380,12 +1215,12 @@ EOCHEESE if ($config{OSNAME} =~ /darwin/) { print FILEHANDLE <src/Makefile") or die("Could not write src/Makefile!"); - my $i = 0; - my @cmdlist = (); - opendir(DIRHANDLE, "src"); - foreach $name (sort readdir(DIRHANDLE)) { - if ($name =~ /^cmd_(.+)\.cpp$/) { - $cmdlist[$i++] = $1; - } - } - closedir(DIRHANDLE); - my $cmdobjs = ""; - my $srcobjs = ""; - foreach my $cmd (@cmdlist) { - $cmdobjs = $cmdobjs . "cmd_$cmd.o "; - $srcobjs = $srcobjs . "cmd_$cmd.cpp "; - } - print FH < -# for assisting with making this work right. -# -# This file is automagically generated by configure -# Any changes made will be lost on ./configure -################################################### - -CC = im a cheezeball - -CXXFLAGS = -I../include \${FLAGS} -CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn) -RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn) - -EOM - -$se = "socketengine_select"; -if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) { - $se = "socketengine_kqueue"; -} -elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) { - $se = "socketengine_epoll"; -} -elsif (($has_ports) && ($config{USE_PORTS} eq "y")) { - $se = "socketengine_ports"; -} - - ### - # This next section is for cygwin dynamic module builds. - # Basically, what we do, is build the inspircd core as a library - # then the main executable uses that. the library is capable of - # loading / unloading the modules dynamically :) - # Massive thanks to the guys on #cygwin @ irc.freenode.net for helping - # make this work :) - ### - - if ($config{OSNAME} =~ /CYGWIN/i) { - print FH <