From 2710741e10eb856f341e866bdc274e8a89463587 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 23 Jan 2007 23:31:29 +0000 Subject: Integrate OSX patches from BuildSmart, plus a few tweaks and fixes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6428 e03df62e-2008-0410-955e-edbf42e46eb7 --- configure | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 157 insertions(+), 5 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 735f10ca3..8e7c062b0 100755 --- a/configure +++ b/configure @@ -215,7 +215,8 @@ 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 $config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue -$config{OSNAME} = $^O; # Operating System Name +$config{OSNAME} = $^O; # Operating System Name +$config{IS_DARWIN} = "NO"; # Is OSX? $config{CC} = "g++"; # C++ compiler if (defined $opt_cc) { @@ -264,6 +265,11 @@ if ($config{GCCVER} eq "") { exit; } +if ($config{OSNAME} =~ /darwin/) +{ + $config{IS_DARWIN} = "YES"; +} + # Minihack! Convert Cygwin to 'Cyg-Static' so i can # Keep my dynamic module experiments here for later # consideration! @@ -840,6 +846,7 @@ sub getosflags { $config{LDLIBS} = "-lstdc++"; $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{MAKEPROG} = "make"; + $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared"; if ($config{OSNAME} =~ /OpenBSD/i) { $config{MAKEPROG} = "gmake"; @@ -854,6 +861,10 @@ sub getosflags { return "OpenBSD"; } + if ($config{OSNAME} =~ /darwin/i) { + $SHARED = "-bundle -undefined dynamic_lookup"; + $config{LDLIBS} = "-ldl -lstdc++"; + } if ($config{OSNAME} =~ /Linux/i) { $config{LDLIBS} = "-ldl -lstdc++"; $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; @@ -1082,6 +1093,7 @@ EOF $tmp =~ s/\@EXECUTABLE\@/$exe/; $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/; $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/; + $tmp =~ s/\@IS_DARWIN\@/$config{IS_DARWIN}/; $tmp =~ s/\@VERSION\@/$version/; print "Writing \033[1;32m$file\033[0m\n"; @@ -1254,9 +1266,19 @@ EOF print FILEHANDLE <