summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-13 16:30:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-13 16:30:18 +0000
commitc02f21d528bda97a1b87cc6f26773ff49f9f208c (patch)
treede46b5d3b4aa89e149bb8611e035392dcfdb48e9 /configure
parent7ba5119a71112ccbe9027264df9a9e19d4de9058 (diff)
Fix -modupdate to actually work (doesnt force a total rebuild when you add a module)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4378 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure164
1 files changed, 83 insertions, 81 deletions
diff --git a/configure b/configure
index 6886a9828..87e68b080 100755
--- a/configure
+++ b/configure
@@ -106,12 +106,32 @@ if ($arg eq "-update") {
getosflags();
$has_epoll = $config{HAS_EPOLL};
$has_kqueue = $config{HAS_KQUEUE};
- writefiles();
+ writefiles(1);
print "Complete.\n";
exit;
}
}
+if ($arg eq "-modupdate") {
+ # Does the cache file exist?
+ if (!getcache()) {
+ # No, No it doesn't.. *BASH*
+ print "You have not run ./configure before. Please do this before trying to run the update script.\n";
+ exit 0;
+ } else {
+ # We've Loaded the cache file and all our variables..
+ print "Updating Files..\n";
+ getosflags();
+ $has_epoll = $config{HAS_EPOLL};
+ $has_kqueue = $config{HAS_KQUEUE};
+ writefiles(0);
+ print "Complete.\n";
+ exit;
+ }
+}
+
+
+
if ($arg eq "-svnupdate") {
my $fail = 0;
open(FH,"<.svn/entries") or $fail = 1;
@@ -127,28 +147,6 @@ if ($arg eq "-svnupdate") {
exit;
}
-if ($arg eq "-modupdate") {
- # Does the cache file exist?
- if (!getcache()) {
- # No, No it doesn't.. *BASH*
- print "You have not run ./configure before. Please do this before trying to run the update script.\n";
- exit 0;
- } else {
- # We've Loaded the cache file and all our variables..
- print "Updating Files..\n";
- getosflags();
- $has_epoll = $config{HAS_EPOLL};
- $has_kqueue = $config{HAS_KQUEUE};
- if ($config{STATIC_LINK} eq "yes") {
- write_static_modules_makefile();
- } else {
- write_dynamic_modules_makefile();
- }
- print "Complete.\n";
- exit;
- }
-}
-
print "Checking for cache from previous configure...\n";
getcache();
print "Checking operating system version...\n";
@@ -756,7 +754,7 @@ if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) {
getosflags();
makecache();
-writefiles();
+writefiles(1);
print "\n\n";
print "To build your server with these settings, please type '\033[1;32m$config{MAKEPROG}\033[0m' now.\n";
@@ -954,6 +952,7 @@ sub getrevision {
}
sub writefiles {
+ my($writeheader) = @_;
print "Writing \033[1;32minspircd_config.h\033[0m\n";
# First File.. inspircd_config.h
chomp(my $incos = `uname -n -s -r`);
@@ -961,10 +960,12 @@ sub writefiles {
chomp(my $revision = getrevision());
$version = "$version(r$revision)";
chomp(my $revision2 = getrevision());
- open(FILEHANDLE, ">include/inspircd_config.h");
- my $NL = $config{NICK_LENGT}+1;
- my $CL = $config{CHAN_LENGT}+1;
- print FILEHANDLE <<EOF;
+ if ($writeheader == 1)
+ {
+ open(FILEHANDLE, ">include/inspircd_config.h");
+ my $NL = $config{NICK_LENGT}+1;
+ my $CL = $config{CHAN_LENGT}+1;
+ print FILEHANDLE <<EOF;
/* Auto generated by configure, do not modify! */
#ifndef __CONFIGURATION_AUTO__
#define __CONFIGURATION_AUTO__
@@ -990,63 +991,64 @@ sub writefiles {
#define SYSTEM "$incos"
#define MAXBUF 514
EOF
- if ($config{OSNAME} =~ /SunOS/) {
- print FILEHANDLE "#define IS_SOLARIS\n";
- }
- if ($config{OSNAME} =~ /CYGWIN/) {
- print FILEHANDLE "#define IS_CYGWIN\n";
- print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
- }
- if ($config{OSNAME} eq "CYG-STATIC") {
- print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
- }
- if ($config{HAS_EXECINFO} eq "1") {
- print FILEHANDLE "#define HAS_EXECINFO\n";
- }
- if ($config{STATIC_LINK} eq "yes") {
- print FILEHANDLE "#define STATIC_LINK\n";
- }
- if ($config{GCCVER} > 3) {
- print FILEHANDLE "#define GCC3\n";
- print FILEHANDLE "#define GCC34\n";
- }
- else
- {
- if ($config{GCCVER} == 3) {
+ if ($config{OSNAME} =~ /SunOS/) {
+ print FILEHANDLE "#define IS_SOLARIS\n";
+ }
+ if ($config{OSNAME} =~ /CYGWIN/) {
+ print FILEHANDLE "#define IS_CYGWIN\n";
+ print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
+ }
+ if ($config{OSNAME} eq "CYG-STATIC") {
+ print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
+ }
+ if ($config{HAS_EXECINFO} eq "1") {
+ print FILEHANDLE "#define HAS_EXECINFO\n";
+ }
+ if ($config{STATIC_LINK} eq "yes") {
+ print FILEHANDLE "#define STATIC_LINK\n";
+ }
+ if ($config{GCCVER} > 3) {
print FILEHANDLE "#define GCC3\n";
- if ($config{GCC34} > 3) {
- print FILEHANDLE "#define GCC34\n";
+ print FILEHANDLE "#define GCC34\n";
+ }
+ else
+ {
+ if ($config{GCCVER} == 3) {
+ print FILEHANDLE "#define GCC3\n";
+ if ($config{GCC34} > 3) {
+ print FILEHANDLE "#define GCC34\n";
+ }
}
}
+ if ($config{HAS_STRLCPY} eq "true") {
+ print FILEHANDLE "#define HAS_STRLCPY\n";
+ }
+ if ($config{HAS_STDINT} eq "true") {
+ print FILEHANDLE "#define HAS_STDINT\n";
+ }
+ if ($config{THREADED_DNS} =~ /y/i) {
+ print FILEHANDLE "#define THREADED_DNS\n";
+ }
+ if ($config{IPV6} =~/y/i) {
+ print FILEHANDLE "#define IPV6\n";
+ }
+ my $use_hiperf = 0;
+ if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
+ print FILEHANDLE "#define USE_KQUEUE\n";
+ $use_hiperf = 1;
+ }
+ if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
+ print FILEHANDLE "#define USE_EPOLL\n";
+ $use_hiperf = 1;
+ }
+ # user didn't choose either epoll or select for their OS.
+ # default them to USE_SELECT (ewwy puke puke)
+ if (!$use_hiperf) {
+ print FILEHANDLE "#define USE_SELECT\n";
+ }
+ print FILEHANDLE "\n#endif\n";
+ close(FILEHANDLE);
}
- if ($config{HAS_STRLCPY} eq "true") {
- print FILEHANDLE "#define HAS_STRLCPY\n";
- }
- if ($config{HAS_STDINT} eq "true") {
- print FILEHANDLE "#define HAS_STDINT\n";
- }
- if ($config{THREADED_DNS} =~ /y/i) {
- print FILEHANDLE "#define THREADED_DNS\n";
- }
- if ($config{IPV6} =~/y/i) {
- print FILEHANDLE "#define IPV6\n";
- }
- my $use_hiperf = 0;
- if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
- print FILEHANDLE "#define USE_KQUEUE\n";
- $use_hiperf = 1;
- }
- if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
- print FILEHANDLE "#define USE_EPOLL\n";
- $use_hiperf = 1;
- }
- # user didn't choose either epoll or select for their OS.
- # default them to USE_SELECT (ewwy puke puke)
- if (!$use_hiperf) {
- print FILEHANDLE "#define USE_SELECT\n";
- }
- print FILEHANDLE "\n#endif\n";
- close(FILEHANDLE);
# Create a Modules List..
my $modules = "";