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 --- .Makefile.inc | 28 +++++++++- configure | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 184 insertions(+), 6 deletions(-) diff --git a/.Makefile.inc b/.Makefile.inc index d1e464aaa..870a95bc9 100644 --- a/.Makefile.inc +++ b/.Makefile.inc @@ -6,6 +6,7 @@ # Original Makefile & ./configure by # Small modifications by # +DARWIN = @IS_DARWIN@ CC = @CC@ MAKE = @MAKEPROG@ @@ -55,6 +56,30 @@ install: all @-install -d -m $(INSTMODE) $(BINPATH) @-install -d -m $(INSTMODE) $(CONPATH) @-install -d -m $(INSTMODE) ${MODPATH} +ifeq ($(DARWIN),YES) + -install -m $(INSTMODE) src/libIRCDasyncdns.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDbase.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDchannels.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDcommand_parse.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDcommands.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDconfigreader.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDcull_list.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDdynamic.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDhash.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDhelper.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDinspsocket.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDmode.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDmodules.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDsocket.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDsocketengine.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDstring.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDuserprocess.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDusers.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDwildcard.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDxline.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDtimer.dylib $(LIBPATH) + -install -m $(INSTMODE) src/libIRCDsnomasks.dylib $(LIBPATH) +else -install -m $(INSTMODE) src/libIRCDasyncdns.so $(LIBPATH) -install -m $(INSTMODE) src/libIRCDbase.so $(LIBPATH) -install -m $(INSTMODE) src/libIRCDchannels.so $(LIBPATH) @@ -77,6 +102,7 @@ install: all -install -m $(INSTMODE) src/libIRCDxline.so $(LIBPATH) -install -m $(INSTMODE) src/libIRCDtimer.so $(LIBPATH) -install -m $(INSTMODE) src/libIRCDsnomasks.so $(LIBPATH) +endif -install -m $(INSTMODE) src/inspircd $(BINPATH) -install -m $(INSTMODE) inspircd $(BASE) 2>/dev/null -install -m $(INSTMODE) src/cmd_admin.so $(LIBPATH) @@ -163,7 +189,7 @@ module: clean: @echo Cleaning... - @rm -rvf src/*.so src/*.o src/inspircd src/modules/*.so src/modules/*.o *~ src/*~ src/modules/*~ src/modules/extra/*~ src/modes/*~ src/modes/*.o src/modes/*.a src/modules/*/*.o src/modules/*/*.so + @rm -rvf src/*.dylib src/*.so src/*.o src/inspircd src/modules/*.so src/modules/*.o *~ src/*~ src/modules/*~ src/modules/extra/*~ src/modes/*~ src/modes/*.o src/modes/*.a src/modules/*/*.o src/modules/*/*.so @echo Completed. modclean: 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 <