X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=5d47bdc7e00f0d1993f76c7d6e3e97beafc0c5c6;hb=621bb9d25dc2e0de898087581864fd25d238d374;hp=ceac058476349881f291d5eb3ca62a17168e4f50;hpb=f9d905204085d8ba66b9f136979a6be959b63e42;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index ceac05847..5d47bdc7e 100755 --- a/configure +++ b/configure @@ -12,7 +12,9 @@ # ######################################## -chomp($topdir = `pwd`); +use Cwd; + +chomp($topdir = getcwd()); $this = resolve_directory($topdir); # PWD, Regardless. @modlist = (); # Declare for Module List.. %config = (); # Initiate Configuration Hash.. @@ -70,15 +72,22 @@ if ($config{GCCVER} eq "") { # Keep my dynamic module experiments here for later # concideration! -if ($config{OSNAME} =~ /CYGWIN/) { +if ($config{OSNAME} =~ /CYGWIN/) +{ $config{OSNAME} = "CYG-STATIC"; } - -if ((!$config{OSNAME}) || ($config{OSNAME} eq "")) { +elsif($config{OSNAME} =~ /^MINGW32/) +{ + $config{OSNAME} = "MINGW32"; +} +elsif ((!$config{OSNAME}) || ($config{OSNAME} eq "")) +{ chomp($config{OSNAME} = `/usr/bin/uname`); - if ((!$config{OSNAME}) || ($config{OSNAME} eq "")){ + + if((!$config{OSNAME}) || ($config{OSNAME} eq "")) + { $config{OSNAME} = "Unknown"; - } + } } if (!$config{MAX_CLIENT_T}) { @@ -828,17 +837,20 @@ sub dir_check { # Convert it to a full path.. $var = resolve_directory($ENV{HOME} . "/" . $1); } - if (substr($var,0,1) ne "/") + elsif ((($config{OSNAME} == "MINGW32") and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/")) { # Assume relative Path was given.. fill in the rest. $var = $this . "/$var"; } + $var = resolve_directory($var); if (! -e $var) { print "$var does not exist. Create it?\n[\033[1;32my\033[0m] "; chomp($tmp = ); if (($tmp eq "") || ($tmp =~ /^y/i)) { # Attempt to Create the Dir.. + + print("mkdir -p \"$var\" >> /dev/null 2>&1"); $chk = system("mkdir -p \"$var\" >> /dev/null 2>&1") / 256; if ($chk != 0) { print "Unable to create directory. ($var)\n\n"; @@ -897,7 +909,9 @@ sub getosflags { $config{STATIC_LINK} = "yes"; } } - if ($config{OSNAME} =~ /SunOS/) { + + if ($config{OSNAME} =~ /SunOS/) + { # solaris/sunos needs these # socket = bsd sockets api # nsl = dns stuff @@ -905,6 +919,12 @@ sub getosflags { # resolv = inet_aton only (why isnt this in nsl?!) $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv"; } + + if($config{OSNAME} eq "MINGW32") + { + # All code is position-independent on windows + $config{FLAGS} =~ s/-fPIC //; + } } sub is_dir { @@ -942,6 +962,7 @@ sub getrevision { return "0"; } my $data = `svn info`; + if ($data eq "") { $no_svn = 1; $rev = "0"; @@ -1002,6 +1023,9 @@ EOF print FILEHANDLE "#define IS_CYGWIN\n"; print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; } + if ($config{OSNAME} eq "MINGW32") { + print FILEHANDLE "#define IS_MINGW\n"; + } if ($config{OSNAME} eq "CYG-STATIC") { print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; } @@ -1443,8 +1467,8 @@ helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/helperfuncs.h ../inc channels.o: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp -mode.o: mode.cpp ../include/base.h ../include/mode.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h \$(RELCPPFILES) - \${MAKE} -C "modes" DIRNAME="src/modes" \$(MAKEARGS) CPPFILES="\$(CPPFILES)" +mode.o: mode.cpp ../include/base.h ../include/mode.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h \$(RELCPPFILES) modes/modeclasses.a + \${MAKE} -C "modes" DIRNAME="src/modes" \$(MAKEARGS) \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp xline.o: xline.cpp ../include/base.h ../include/xline.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h