X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=e03739820363e1bae9f48d396d788b8af71773cc;hb=33ce32eb8bfddfc1cb04668a03c9b795d33eb9c0;hp=8783c5865dc39c7d1a5394f524b57187f382e16b;hpb=04b09e3b2cfd929b42dccc40626b07679c7eff09;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 8783c5865..e03739820 100755 --- a/configure +++ b/configure @@ -98,7 +98,7 @@ our %extraobjects = (); our %extrasources = (); our ($opt_use_gnutls, $opt_rebuild, $opt_use_openssl, $opt_nointeractive, $opt_ports, - $opt_epoll, $opt_kqueue, $opt_noports, $opt_noepoll, $opt_nokqueue, $opt_disablerpath, + $opt_epoll, $opt_kqueue, $opt_noports, $opt_noepoll, $opt_nokqueue, $opt_ipv6, $opt_ipv6links, $opt_noipv6links, $opt_maxbuf, $opt_disable_debug, $opt_freebsd_port); @@ -125,7 +125,6 @@ GetOptions ( 'disable-ports' => \$opt_noports, 'disable-epoll' => \$opt_noepoll, 'disable-kqueue' => \$opt_nokqueue, - 'disable-rpath' => \$opt_disablerpath, 'enable-ipv6' => \$opt_ipv6, 'enable-remote-ipv6' => \$opt_ipv6links, 'disable-remote-ipv6' => \$opt_noipv6links, @@ -1071,7 +1070,7 @@ sub getosflags { $config{LDLIBS} = "-pthread -lstdc++"; $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall $config{OPTIMISATI}"; $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -Wformat=2 -Wmissing-format-attribute -g"; - $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared" unless defined $opt_disablerpath; + $SHARED = "-shared"; $config{MAKEPROG} = "make"; if ($config{OSNAME} =~ /darwin/i) { @@ -1498,6 +1497,8 @@ sub write_dynamic_makefile my $i = 0; my @cmdlist = (); my %existing_install_list = (); + my %core_files_list = (); + opendir(DIRHANDLE, "src/commands"); foreach my $name (sort readdir(DIRHANDLE)) { @@ -1523,6 +1524,9 @@ sub write_dynamic_makefile $config{USE_PORTS} = 0; } + # formerly generated below this foreach, now it's not! magic. + my $all_core = ""; + foreach my $dir (("src","src/commands","src/modes","src/socketengines","src/modules")) { print "Scanning \e[1;32m$dir\e[0m for core files "; @@ -1538,7 +1542,18 @@ sub write_dynamic_makefile chomp($line); if ($line =~ /\/\* \$Core: (\w+) \*\//i) { - $filelist{$name} = $1; + my $sname = $name; + $sname =~ s/\.cpp$/.o/; + + # append it to list to be built + $all_core = $all_core . $sname . " "; + $filelist{$name} = $sname; + + # mark it as a core file, so it won't get shared object cflags + if (!exists($core_files_list{$name})) + { + $core_files_list{$name} = 1; + } } elsif ($line =~ /\/\* \$ExtraDeps: (.*?) \*\//i) { @@ -1604,36 +1619,24 @@ sub write_dynamic_makefile print " done!\n"; } + # modes need to be compiled in too + $all_core = $all_core . "modes/modeclasses.a"; + my $freebsd4libs = (defined $config{CRAQ} ? $config{CRAQ} : ""); - my $all = "all: "; - my $all_libsonly = ""; my $libraryext = ""; - my $othercrap = ""; - my $RPATH = ""; + my $binary_rule = ""; if ($config{IS_DARWIN} eq "YES") { $libraryext = "dylib"; - $othercrap = " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp\n \@../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o " + $binary_rule = " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp\n \@../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o " } else { $libraryext = "so"; - $RPATH = "-Wl,--rpath -Wl,$config{LIBRARY_DIR}" unless defined $opt_disablerpath; - $othercrap = " \@../make/run-cc.pl \$(CC) -pipe -I../include $RPATH \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) "; - } - - foreach my $cpp (sort keys %filelist) - { - $all = $all . $filelist{$cpp} . "." . $libraryext . " "; - $all_libsonly = $all_libsonly . $filelist{$cpp} . "." . $libraryext . " "; - $install_list = $install_list . " -install -m \$(INSTMODE) src/" . $filelist{$cpp} . "." . $libraryext . " \$(LIBPATH)\n"; - $uninstall_list = $uninstall_list . " -rm \$(LIBPATH)/" . $filelist{$cpp} . "." . $libraryext . "\n"; + $binary_rule = " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) "; } - $all = $all . "moo inspircd\n"; - - $othercrap = $othercrap . " $all_libsonly\n\n"; open(FH,">src/Makefile") or die("Could not write src/Makefile"); print FH <