summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 99f68f7)
raw | patch | inline | side by side (parent: 99f68f7)
author | acspike <acspike@users.sourceforge.net> | |
Sun, 7 Jan 2007 17:51:26 +0000 (17:51 +0000) | ||
committer | acspike <acspike@users.sourceforge.net> | |
Sun, 7 Jan 2007 17:51:26 +0000 (17:51 +0000) |
Makefile.am | patch | blob | history | |
acinclude.m4 | [new file with mode: 0644] | patch | blob |
build.xml | patch | blob | history | |
build28.xml | patch | blob | history | |
configure.ac | patch | blob | history | |
m4/Makefile.am | patch | blob | history | |
m4/relaytool.m4 | [new file with mode: 0644] | patch | blob |
packaging/autopackage/default.apspec.in | patch | blob | history | |
src/dom/io/socket.cpp | patch | blob | history | |
src/pedro/pedroutil.cpp | patch | blob | history |
diff --git a/Makefile.am b/Makefile.am
index 650f1d3f820c368e2a4bb9cc538d3f78ee75a751..c06d15db32206316dc2b8f83a6f0a91948eed0d7 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
inkview.1
EXTRA_DIST = \
+ acinclude.m4 \
fix-roff-punct \
intltool-extract.in \
intltool-merge.in \
diff --git a/acinclude.m4 b/acinclude.m4
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,30 @@
+dnl Usage: RELAYTOOL(LIBRARY_NAME, LIBS, CFLAGS, ACTION-IF-WEAK-LINK-IS-POSSIBLE)
+
+dnl Example:
+dnl RELAYTOOL("gtkspell", GTKSPELL_LIBS, GTKSPELL_CFLAGS, gtkspell_weak=yes)
+dnl Will modify GTKSPELL_LIBS to include a call to relaytool if available
+dnl or if not, will modify GTKSPELL_CFLAGS to include -D switches to define
+dnl libgtkspell_is_present=1 and libgtkspell_symbol_is_present=1
+
+AC_DEFUN([RELAYTOOL], [
+ if test -z "$RELAYTOOL_PROG"; then
+ AC_PATH_PROG(RELAYTOOL_PROG, relaytool, no)
+ fi
+
+ AC_MSG_CHECKING(whether we can weak link $1)
+
+ _RELAYTOOL_PROCESSED_NAME=`echo "$1" | sed 's/-/_/g;s/\./_/g;'`
+ _RELAYTOOL_UPPER_NAME=`echo $_RELAYTOOL_PROCESSED_NAME | tr '[[:lower:]]' '[[:upper:]]'`
+
+ if test "$RELAYTOOL_PROG" = "no"; then
+ AC_MSG_RESULT(no)
+ $3="-DRELAYTOOL_${_RELAYTOOL_UPPER_NAME}='static const int lib${_RELAYTOOL_PROCESSED_NAME}_is_present = 1; static int __attribute__((unused)) lib${_RELAYTOOL_PROCESSED_NAME}_symbol_is_present(char *m) { return 1; }' $$3"
+ else
+ AC_MSG_RESULT(yes)
+ $2=`echo $$2|sed 's/\`/\\\\\`/g;'`
+ $2="-Wl,--gc-sections \`relaytool --relay $1 $$2\`"
+ $3="-DRELAYTOOL_${_RELAYTOOL_UPPER_NAME}='extern int lib${_RELAYTOOL_PROCESSED_NAME}_is_present; extern int lib${_RELAYTOOL_PROCESSED_NAME}_symbol_is_present(char *s);' $$3"
+ $4
+ fi
+])
+
diff --git a/build.xml b/build.xml
index 77f89ae6ab7c87b17b82dc5b04501fcbff1310c0..43368b645eb6b4c7fbc71f23e57c539e0420ab86 100644 (file)
--- a/build.xml
+++ b/build.xml
-DHAVE_CONFIG_H
-DXP_WIN <!-- for JS -->
-D_INTL_REDIRECT_INLINE
+ -DRELAYTOOL_SSL='static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }' <!-- inkboard -->
-DWITH_INKBOARD -DHAVE_SSL <!-- inkboard -->
</defines>
<includes>
diff --git a/build28.xml b/build28.xml
index 5acbf67d722062e76b4f4d6bc3612b7c24116823..d4c0262cfe36839aa2fb45871e43aeb52739fb9b 100644 (file)
--- a/build28.xml
+++ b/build28.xml
-DHAVE_CONFIG_H\r
-DXP_WIN <!-- for JS -->\r
-D_INTL_REDIRECT_INLINE\r
+ -DRELAYTOOL_SSL='static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }' <!-- inkboard -->\r
-DWITH_INKBOARD -DHAVE_SSL <!-- inkboard -->\r
</defines>\r
<includes>\r
diff --git a/configure.ac b/configure.ac
index 0eb5d66e1fcff8a51757dfa6b97748e8dfc971f1..639e4746a52c3916a6f42c0a699f166f9fe9d69e 100644 (file)
--- a/configure.ac
+++ b/configure.ac
if test "x$with_inkboard_ssl" = "xyes"; then
dnl OpenSSL found; enable SSL support in Pedro
INKBOARD_CFLAGS="$INKBOARD_CFLAGS -DHAVE_SSL"
+ RELAYTOOL([ssl], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
+ RELAYTOOL([crypto], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
AC_DEFINE(WITH_INKBOARD_SSL,1,[Build in SSL support for Inkboard])
fi
else
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 26e2af705407c51f10af1ab3011161433359cb22..3343be6c528a91d69ffe2db009b74800d5e5c06f 100644 (file)
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
EXTRA_DIST=codeset.m4 glibc21.m4 isc-posix.m4 progtest.m4 gettext.m4 \
- iconv.m4 lcmessage.m4
+ iconv.m4 lcmessage.m4 relaytool.m4
diff --git a/m4/relaytool.m4 b/m4/relaytool.m4
--- /dev/null
+++ b/m4/relaytool.m4
@@ -0,0 +1,30 @@
+dnl Usage: RELAYTOOL(LIBRARY_NAME, LIBS, CFLAGS, ACTION-IF-WEAK-LINK-IS-POSSIBLE)
+
+dnl Example:
+dnl RELAYTOOL("gtkspell", GTKSPELL_LIBS, GTKSPELL_CFLAGS, gtkspell_weak=yes)
+dnl Will modify GTKSPELL_LIBS to include a call to relaytool if available
+dnl or if not, will modify GTKSPELL_CFLAGS to include -D switches to define
+dnl libgtkspell_is_present=1 and libgtkspell_symbol_is_present=1
+
+AC_DEFUN([RELAYTOOL], [
+ if test -z "$RELAYTOOL_PROG"; then
+ AC_PATH_PROG(RELAYTOOL_PROG, relaytool, no)
+ fi
+
+ AC_MSG_CHECKING(whether we can weak link $1)
+
+ _RELAYTOOL_PROCESSED_NAME=`echo "$1" | sed 's/-/_/g;s/\./_/g;'`
+ _RELAYTOOL_UPPER_NAME=`echo $_RELAYTOOL_PROCESSED_NAME | tr '[[:lower:]]' '[[:upper:]]'`
+
+ if test "$RELAYTOOL_PROG" = "no"; then
+ AC_MSG_RESULT(no)
+ $3="-DRELAYTOOL_${_RELAYTOOL_UPPER_NAME}='static const int lib${_RELAYTOOL_PROCESSED_NAME}_is_present = 1; static int __attribute__((unused)) lib${_RELAYTOOL_PROCESSED_NAME}_symbol_is_present(char *m) { return 1; }' $$3"
+ else
+ AC_MSG_RESULT(yes)
+ $2=`echo $$2|sed 's/\`/\\\\\`/g;'`
+ $2="-Wl,--gc-sections \`relaytool --relay $1 $$2\`"
+ $3="-DRELAYTOOL_${_RELAYTOOL_UPPER_NAME}='extern int lib${_RELAYTOOL_PROCESSED_NAME}_is_present; extern int lib${_RELAYTOOL_PROCESSED_NAME}_symbol_is_present(char *s);' $$3"
+ $4
+ fi
+])
+
index 9c332646b68c02e05963bd60b7d5e08c97a9d384..aec1dafdd3d374484cf018b44935caf2b36cd0c6 100644 (file)
if [ ! -x configure ]; then
./autogen.sh
fi
-export APBUILD_STATIC="popt gc gccpp gtkmm-2.4 gdkmm-2.4 atkmm-1.6 pangomm-1.4 glibmm-2.4 sigc-2.0 Xrender lcms cairo Xfixes Xext ssl crypto"
+export APBUILD_STATIC="popt gc gccpp gtkmm-2.4 gdkmm-2.4 atkmm-1.6 pangomm-1.4 glibmm-2.4 sigc-2.0 Xrender lcms cairo Xfixes Xext"
export APBUILD_PROJECTNAME=inkscape
PATH=/usr/local/src/inkscape/extra/static/bin:$PATH
diff --git a/src/dom/io/socket.cpp b/src/dom/io/socket.cpp
index 31eeb56bad3a0a0fd8ac9e2bb9af5ad79fc3d772..22b03b8b3d853869c745de75cd67fdc9466f46ce 100644 (file)
--- a/src/dom/io/socket.cpp
+++ b/src/dom/io/socket.cpp
#ifdef HAVE_SSL
#include <openssl/ssl.h>
#include <openssl/err.h>
+
+RELAYTOOL_SSL
#endif
WSAStartup( wVersionRequested, &wsaData );
#endif
#ifdef HAVE_SSL
- sslStream = NULL;
- sslContext = NULL;
+ if (libssl_is_present)
+ {
+ sslStream = NULL;
+ sslContext = NULL;
CRYPTO_set_locking_callback(cryptoLockCallback);
- CRYPTO_set_id_callback(cryptoIdCallback);
- SSL_library_init();
- SSL_load_error_strings();
+ CRYPTO_set_id_callback(cryptoIdCallback);
+ SSL_library_init();
+ SSL_load_error_strings();
+ }
#endif
tcp_socket_inited = true;
}
bool TcpSocket::startTls()
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
sslStream = NULL;
sslContext = NULL;
}
sslEnabled = true;
+ }
#endif /*HAVE_SSL*/
return true;
}
bool ret = true;
connected = false;
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
if (sslEnabled)
{
if (sslStream)
}
sslStream = NULL;
sslContext = NULL;
+ }
#endif /*HAVE_SSL*/
#ifdef __WIN32__
if (count<=0 && sslEnabled)
{
#ifdef HAVE_SSL
- return SSL_pending(sslStream);
+ if (libssl_is_present)
+ {
+ return SSL_pending(sslStream);
+ }
#endif
}
return count;
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
int r = SSL_write(sslStream, &c, 1);
if (r<=0)
{
return -1;
}
}
+ }
#endif
}
else
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
int r = SSL_write(sslStream, (unsigned char *)str.c_str(), len);
if (r<=0)
{
return -1;
}
}
+ }
#endif
}
else
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
if (!sslStream)
return -1;
int r = SSL_read(sslStream, &ch, 1);
ERR_error_string(ERR_get_error(), NULL));
return -1;
}
+ }
#endif
}
else
index e08bed0a6062a8ea31db59cdac65005c16d7e5f4..13577bf8f716dd1bf99c57492fe7886a08ef5442 100644 (file)
--- a/src/pedro/pedroutil.cpp
+++ b/src/pedro/pedroutil.cpp
#endif /* UNIX */
+#ifdef HAVE_SSL
+RELAYTOOL_SSL
+#endif
namespace Pedro
WSAStartup( wVersionRequested, &wsaData );
#endif
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
sslStream = NULL;
sslContext = NULL;
CRYPTO_set_locking_callback(cryptoLockCallback);
CRYPTO_set_id_callback(cryptoIdCallback);
SSL_library_init();
SSL_load_error_strings();
+ }
#endif
tcp_socket_inited = true;
}
bool TcpSocket::getHaveSSL()
{
#ifdef HAVE_SSL
- return true;
+ if (libssl_is_present)
+ {
+ return true;
+ } else {
+ return false;
+ }
#else
return false;
#endif
"SSL starttls() error: client not compiled with SSL enabled\n");
return false;
#else /*HAVE_SSL*/
-
+ if (!libssl_is_present)
+ {
+ fprintf(stderr,
+ "SSL starttls() error: the correct version of libssl was not found \n");
+ return false;
+ } else {
+
sslStream = NULL;
sslContext = NULL;
sslEnabled = true;
return true;
+ }
#endif /* HAVE_SSL */
}
bool ret = true;
connected = false;
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
if (sslEnabled)
{
if (sslStream)
}
sslStream = NULL;
sslContext = NULL;
+ }
#endif /*HAVE_SSL*/
#ifdef __WIN32__
if (count<=0 && sslEnabled)
{
#ifdef HAVE_SSL
- return SSL_pending(sslStream);
+ if (libssl_is_present)
+ {
+ return SSL_pending(sslStream);
+ }
#endif
}
return count;
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
int r = SSL_write(sslStream, &c, 1);
if (r<=0)
{
return -1;
}
}
+ }
#endif
}
else
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
int r = SSL_write(sslStream, (unsigned char *)str, len);
if (r<=0)
{
return -1;
}
}
+ }
#endif
}
else
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
if (!sslStream)
return -1;
int r = SSL_read(sslStream, &ch, 1);
ERR_error_string(ERR_get_error(), NULL));
return -1;
}
+ }
#endif
}
else