summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-21 10:36:01 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-21 10:36:01 +0000
commitd651aeb61a34e047586806a3db434ac6390aad73 (patch)
treeb67832591f22c8eb76f1769c20478055e57258b4
parent86941a017cfbc9a6304c2ef597b6036b3a87493a (diff)
Changed $CompileFlags to seperate $CompileFlags and $LinkerFlags
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2595 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--.inspircd.inc2
-rwxr-xr-xconfigure23
-rw-r--r--src/modules/extra/m_filter_pcre.cpp3
-rw-r--r--src/modules/extra/m_sql.cpp3
4 files changed, 24 insertions, 7 deletions
diff --git a/.inspircd.inc b/.inspircd.inc
index 3fd45f5e2..9b43de327 100644
--- a/.inspircd.inc
+++ b/.inspircd.inc
@@ -21,7 +21,7 @@ my $libpath = "@LIBRARY_DIR@";
my $executable = "@EXECUTABLE@";
my @filesparsed;
-$ENV{"LD_LIBRARY_PATH"} = $ENV{"LD_LIBRARY_PATH"} . ":/usr/local/lib/mysql:/usr/lib/mysql:$libpath";
+$ENV{"LD_LIBRARY_PATH"} = $ENV{"LD_LIBRARY_PATH"} . ":/usr/local/lib/mysql:/usr/lib/mysql";
# Lets see what they want to do.. Set the variable (Cause i'm a lazy coder)
my $arg = $ARGV[0];
diff --git a/configure b/configure
index 21d8fb5c4..9cb4d7518 100755
--- a/configure
+++ b/configure
@@ -872,7 +872,8 @@ EOF
# Create a Modules List..
my $modules = "";
- my $flags = "";
+ my $cmflags = "";
+ my $liflags = "";
if ($config{OSNAME} =~ /CYGWIN/) {
open(MODLIST,">include/modlist.h");
print MODLIST <<HEADER;
@@ -892,7 +893,8 @@ HEADER
foreach $i (@modlist)
{
if ($i !~ /_static$/) {
- $flags = getcompilerflags("src/modules/m_".$i.".cpp");
+ $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
+ $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
if ($config{OSNAME} =~ /CYGWIN/) {
print FILEHANDLE <<EOCHEESE;
m_$i.o: m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h
@@ -918,8 +920,8 @@ EOENT
else {
print FILEHANDLE <<EOCHEESE;
m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/inspircd_io.h
- \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c m_$i.cpp
- \$(CC) \$(FLAGS) -shared $flags -o m_$i.so m_$i.o
+ \$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
+ \$(CC) \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o
\@-rm -f \$(MODPATH)/m_$i.so
cp m_$i.so \$(MODPATH)/
chmod 0700 \$(MODPATH)/m_$i.so
@@ -947,6 +949,19 @@ sub getcompilerflags {
return undef;
}
+sub getlinkerflags {
+ my ($file) = @_;
+ open(FLAGS, $file);
+ while (<FLAGS>) {
+ if ($_ =~ /^\/\* \$LinkerFlags: (.+) \*\/$/) {
+ close(FLAGS);
+ return $1;
+ }
+ }
+ close(FLAGS);
+ return undef;
+}
+
sub show_splash {
print "'\033[1;33m####\033[0m:'\033[1;33m##\033[0m::: \033[1;33m##\033[0m::'\033[1;33m######\033[0m::'\033[1;33m########\033[0m::'\033[1;33m####\033[0m:'\033[1;33m########\033[0m:::'\033[1;33m######\033[0m::'\033[1;33m########\033[0m::\n";
print ". \033[1;33m##\033[0m:: \033[1;33m###\033[0m:: \033[1;33m##\033[0m:'\033[1;33m##\033[0m... \033[1;33m##\033[0m: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:. \033[1;33m##\033[0m:: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:'\033[1;33m##\033[0m... \033[1;33m##\033[0m: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:\n";
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index 0173b9774..c654fd1cf 100644
--- a/src/modules/extra/m_filter_pcre.cpp
+++ b/src/modules/extra/m_filter_pcre.cpp
@@ -29,7 +29,8 @@ using namespace std;
#include "helperfuncs.h"
/* $ModDesc: m_filter with regexps */
-/* $CompileFlags: -I/usr/local/include -L/usr/local/lib -lpcre */
+/* $CompileFlags: -I/usr/local/include */
+/* $LinkerFlags: -L/usr/local/lib -lpcre */
class ModuleFilterPCRE : public Module
{
diff --git a/src/modules/extra/m_sql.cpp b/src/modules/extra/m_sql.cpp
index 7038707f8..8b9f212a0 100644
--- a/src/modules/extra/m_sql.cpp
+++ b/src/modules/extra/m_sql.cpp
@@ -26,7 +26,8 @@ using namespace std;
#include "m_sql.h"
/* $ModDesc: SQL Service Provider module for all other m_sql* modules */
-/* $CompileFlags: -I/usr/local/include/mysql -I/usr/include/mysql -I/usr/local/include -I/usr/include -L/usr/local/lib/mysql -L/usr/lib/mysql -L/usr/local/lib -lmysqlclient */
+/* $CompileFlags: -I/usr/local/include/mysql -I/usr/include/mysql -I/usr/local/include -I/usr/include */
+/* $LinkerFlags: -L/usr/local/lib/mysql -Wl,--rpath -Wl,/usr/local/lib/mysql -L/usr/lib/mysql -Wl,--rpath -Wl,/usr/lib/mysql -lmysqlclient */
/** SQLConnection represents one mysql session.
* Each session has its own persistent connection to the database.