aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Fabio Bas2008-11-17 11:21:37 +0000
committerGravatar Fabio Bas2008-11-17 11:21:37 +0000
commit5a41cbf05cbedfe7ef749b08e7f3e8fa327df82c (patch)
treea7003b57b4a25bd151cecbf793e9219142988aac
parentfixed dialog.textinput layout (diff)
downloadKVIrc-5a41cbf05cbedfe7ef749b08e7f3e8fa327df82c.tar.gz
KVIrc-5a41cbf05cbedfe7ef749b08e7f3e8fa327df82c.tar.bz2
KVIrc-5a41cbf05cbedfe7ef749b08e7f3e8fa327df82c.zip
re-enabled perl support; patched to work nicely with perl 5.10
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2872 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--CMakeLists.txt20
-rw-r--r--cmake/kvi_sysconfig.h.cmake1
-rw-r--r--cmake/module.rules.txt7
-rw-r--r--src/modules/CMakeLists.txt6
-rw-r--r--src/modules/perlcore/CMakeLists.txt18
-rw-r--r--src/modules/perlcore/libkviperlcore.cpp8
6 files changed, 33 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f5b51ce6..cf995c338 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -523,15 +523,27 @@ ENDIF()
# Check for Perl support
-# FIXME: This shouldn't be required (we should be able to live without it) (note: needed for user documentation generation)
-FIND_PACKAGE(Perl REQUIRED)
+# (note: needed for user documentation generation)
+FIND_PACKAGE(Perl)
OPTION(WANT_PERL "Compile Perl Support" ON)
IF(WITHOUT_PERL)
SET(WANT_PERL OFF)
ENDIF()
IF(WANT_PERL)
- SET(COMPILE_PERL_SUPPORT 1)
- SET(CMAKE_STATUS_PERL_SUPPORT "Yes")
+ IF(PERL_FOUND)
+ SET(COMPILE_PERL_SUPPORT 1)
+ SET(CMAKE_STATUS_PERL_SUPPORT "Yes")
+
+ EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ldopts
+ OUTPUT_VARIABLE PERL_LINK_FLAGS
+ )
+
+ STRING(REGEX REPLACE "(\r?\n)+$" "" PERL_LINK_FLAGS "${PERL_LINK_FLAGS}")
+
+ LIST(APPEND LIBS ${PERL_LINK_FLAGS})
+ ELSE()
+ SET(CMAKE_STATUS_PERL_SUPPORT "No")
+ ENDIF()
ELSE()
LIST(APPEND CMAKE_KVIRC_BUILD_FLAGS WITHOUT_PERL)
SET(CMAKE_STATUS_PERL_SUPPORT "User disabled")
diff --git a/cmake/kvi_sysconfig.h.cmake b/cmake/kvi_sysconfig.h.cmake
index 77a30e7a0..c44cf13b8 100644
--- a/cmake/kvi_sysconfig.h.cmake
+++ b/cmake/kvi_sysconfig.h.cmake
@@ -29,6 +29,7 @@
#cmakedefine COMPILE_WEBKIT_SUPPORT 1
#cmakedefine COMPILE_DBUS_SUPPORT 1
#cmakedefine COMPILE_AUDIOFILE_SUPPORT 1
+#cmakedefine COMPILE_PERL_SUPPORT 1
#cmakedefine COMPILE_DISABLE_DCC_VOICE 1
#cmakedefine HAVE_LINUX_SOUNDCARD_H 1
diff --git a/cmake/module.rules.txt b/cmake/module.rules.txt
index ba5e1eb0b..89c133160 100644
--- a/cmake/module.rules.txt
+++ b/cmake/module.rules.txt
@@ -10,14 +10,11 @@ ENDIF()
ADD_LIBRARY(${kvi_module_name} MODULE ${${kvi_module_name}_SRCS} ${${kvi_module_name}_MOC_SRCS})
IF(WIN32)
- #mingw needs these flags for linking
- IF(MINGW)
- SET_TARGET_PROPERTIES(${kvi_module_name} PROPERTIES LINK_FLAGS "-Wl,--enable-auto-import,--enable-runtime-pseudo-reloc")
- ENDIF()
IF(MSVC)
TARGET_LINK_LIBRARIES(${kvi_module_name} ${KVILIB_BINARYNAME} ${LIBS})
ELSE()
- #mingw, others need to link against kvirc
+ #mingw needs these flags for linking
+ SET_TARGET_PROPERTIES(${kvi_module_name} PROPERTIES LINK_FLAGS "-Wl,--enable-auto-import,--enable-runtime-pseudo-reloc")
TARGET_LINK_LIBRARIES(${kvi_module_name} ${KVILIB_BINARYNAME} ${KVIRC_BINARYNAME} ${LIBS})
ENDIF()
ELSE()
diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt
index fd16ac82b..1acf77274 100644
--- a/src/modules/CMakeLists.txt
+++ b/src/modules/CMakeLists.txt
@@ -31,7 +31,7 @@ SUBDIRS(
mask math mediaplayer mircimport my
notifier
objects options
- popupeditor proxydb
+ perl perlcore popupeditor proxydb
raweditor regchan reguser
serverdb setup sharedfile sharedfileswindow snd socketspy spaste str system
texticons term theme tip tmphighlight toolbar toolbareditor torrent trayicon
@@ -39,10 +39,6 @@ SUBDIRS(
url
window
-
- # modules to deprecate ?
- # perl, perlcore
-
# forgotten ?
# offer
)
diff --git a/src/modules/perlcore/CMakeLists.txt b/src/modules/perlcore/CMakeLists.txt
index 82e1de70a..928949256 100644
--- a/src/modules/perlcore/CMakeLists.txt
+++ b/src/modules/perlcore/CMakeLists.txt
@@ -1,14 +1,5 @@
# CMakeLists for src/modules/perlcore
-IF(UNIX)
- IF(APPLE)
- LIST(APPEND LIBS -lperl)
- ENDIF()
-ELSE()
- # Assume windows
- LIST(APPEND LIBS -lperl58)
-ENDIF()
-
SET(kviperlcore_SRCS
libkviperlcore.cpp
)
@@ -17,4 +8,13 @@ SET(kviperlcore_SRCS
QT4_WRAP_CPP(kviperlcore_MOC_SRCS ${kviperlcore_MOC_HDRS})
SET(kvi_module_name kviperlcore)
+
+EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ccopts
+ OUTPUT_VARIABLE PERL_COMPILE_FLAGS
+)
+
+STRING(REGEX REPLACE "(\r?\n)+$" "" PERL_COMPILE_FLAGS "${PERL_COMPILE_FLAGS}")
+
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
+
+SET_TARGET_PROPERTIES(${kvi_module_name} PROPERTIES COMPILE_FLAGS ${PERL_COMPILE_FLAGS})
diff --git a/src/modules/perlcore/libkviperlcore.cpp b/src/modules/perlcore/libkviperlcore.cpp
index 584e8a2d9..0c66ff6f9 100644
--- a/src/modules/perlcore/libkviperlcore.cpp
+++ b/src/modules/perlcore/libkviperlcore.cpp
@@ -65,7 +65,7 @@
#include <XSUB.h>
#include "ppport.h"
-
+
#include "kvi_kvs_runtimecontext.h"
static KviKvsRunTimeContext * g_pCurrentKvsContext = 0;
@@ -223,12 +223,12 @@ bool KviPerlInterpreter::execute(
szError = __tr2qs_ctx("Internal error: perl interpreter not initialized","perl");
return false;
}
-
+
g_lWarningList.clear();
KviQCString szUtf8 = szCode.toUtf8();
PERL_SET_CONTEXT(m_pInterpreter);
-
+
// clear the _ array
AV * pArgs = get_av("_",1);
SV * pArg = av_shift(pArgs);
@@ -322,7 +322,7 @@ static void perlcore_destroy_interpreter(const QString &szContextName)
static void perlcore_destroy_all_interpreters()
{
KviPointerHashTableIterator<QString,KviPerlInterpreter> it(*g_pInterpreters);
-
+
while(it.current())
{
KviPerlInterpreter * i = it.current();