Add defines for SOUP_PTRACE_ATTACH and SOUP_PTRACE_DETACH to remove
authorAlex Graveley <alex@ximian.com>
Tue, 2 Oct 2001 00:52:54 +0000 (00:52 +0000)
committerAlex Graveley <orph@src.gnome.org>
Tue, 2 Oct 2001 00:52:54 +0000 (00:52 +0000)
2001-10-01  Alex Graveley  <alex@ximian.com>

* src/libsoup/soup-socket-unix.c (soup_address_new): Add defines
for SOUP_PTRACE_ATTACH and SOUP_PTRACE_DETACH to remove
architecture incompatibilities for ptrace() arguments.

* configure.in: Add libdl to OpenSSL LDFLAGS.  Fix NSS header
paths.  Define HAVE_OPENSSL and HAVE_NSS if the libraries are
found successfully.

* src/libsoup/soup-socket.h: Remove soup_gethostbyname and
soup_gethostbyaddr, and move to:
* src/libsoup/soup-private.h: here.

ChangeLog
configure.in
libsoup/soup-private.h
libsoup/soup-socket-unix.c
libsoup/soup-socket.h

index 7afd307..3bec1e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-10-01  Alex Graveley  <alex@ximian.com>
+
+       * src/libsoup/soup-socket-unix.c (soup_address_new): Add defines
+       for SOUP_PTRACE_ATTACH and SOUP_PTRACE_DETACH to remove
+       architecture incompatibilities for ptrace() arguments.
+
+       * configure.in: Add libdl to OpenSSL LDFLAGS.  Fix NSS header
+       paths.  Define HAVE_OPENSSL and HAVE_NSS if the libraries are
+       found successfully.
+
+       * src/libsoup/soup-socket.h: Remove soup_gethostbyname and
+       soup_gethostbyaddr, and move to:
+       * src/libsoup/soup-private.h: here.
+
 2001-09-28  Alex Graveley  <alex@ximian.com>\r
 \r
        * src/libsoup/soup-ntlm.c: Remove redundant alloca define.\r
index 6b41246..868d291 100644 (file)
@@ -320,9 +320,11 @@ enable_nss="no"
 if test "x$enable_ssl" = xyes; then
        save_CPPFLAGS=$CPPFLAGS
        CPPFLAGS="$openssl_inc_prefix"
+       AC_CHECK_LIB(dl, dlopen, DL_LDFLAGS="-ldl", DL_LDFLAGS="")
        AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h,
                         [OPENSSL_CFLAGS="$CPPFLAGS" 
-                         OPENSSL_LIBS="$openssl_prefix -lssl -lcrypto"
+                         OPENSSL_LIBS="$openssl_prefix -lssl -lcrypto $DL_LDFLAGS"
+                         AC_DEFINE(HAVE_OPENSSL)
                          enable_openssl="yes"],
                         [OPENSSL_CFLAGS="" 
                          OPENSSL_LIBS="" 
@@ -334,9 +336,10 @@ if test "x$enable_ssl" = xyes; then
 
        save_CPPFLAGS=$CPPFLAGS
        CPPFLAGS="$nspr_inc_prefix $nss_inc_prefix"
-       AC_CHECK_HEADERS(prthread.h security/ssl.h security/pk11func.h,
+       AC_CHECK_HEADERS(nss.h ssl.h pk11func.h,
                         [NSS_CFLAGS="$CPPFLAGS" 
                          NSS_LIBS="-lpthread $nspr_prefix -lnspr4 $nss_prefix -lnss3 -lssl3"
+                         AC_DEFINE(HAVE_NSS)
                          enable_nss="yes"],
                         [NSS_CFLAGS="" 
                          NSS_LIBS="" 
@@ -376,7 +379,7 @@ dnl *********************************************
 dnl *** Checks for gtk-doc (lifted from glib) ***
 dnl *********************************************
 
-AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
+AC_ARG_WITH(html-dir, [  --with-html-dir=PATH     Path to installed docs ])
 
 if test "x$with_html_dir" = "x" ; then
   HTML_DIR='${datadir}/gtk-doc/html'
@@ -395,7 +398,7 @@ AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
 
 dnl Let people disable the gtk-doc stuff.
 AC_ARG_ENABLE(gtk-doc, 
-             [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], 
+             [  --enable-gtk-doc         Use gtk-doc to build documentation [default=auto]], 
              enable_gtk_doc="$enableval", 
              enable_gtk_doc=auto)
 
index 28ce0c9..2ec6f58 100644 (file)
@@ -147,6 +147,16 @@ gint      soup_substring_index (gchar         *str,
 gchar    *soup_base64_encode   (const gchar   *text,
                                gint           len);
 
+/* from soup-socket.c */
+
+gboolean  soup_gethostbyname (const gchar         *hostname,
+                             struct sockaddr_in  *sa,
+                             gchar              **nicename);
+
+gchar    *soup_gethostbyaddr (const gchar         *addr, 
+                             size_t               length, 
+                             int                  type);
+
 #ifdef __cplusplus
 }
 #endif
index 95b6d5b..2854759 100644 (file)
 #include <sys/sockio.h>
 #endif
 
+#ifndef PTRACE_ATTACH
+#  ifdef PT_ATTACH
+#    define SOUP_PTRACE_ATTACH PT_ATTACH
+#    define SOUP_PTRACE_DETACH PT_DETACH
+#  endif
+#else
+#  define SOUP_PTRACE_ATTACH PTRACE_ATTACH
+#  define SOUP_PTRACE_DETACH PTRACE_DETACH
+#endif
+
 #ifndef socklen_t
 #define socklen_t size_t
 #endif
@@ -673,10 +683,10 @@ soup_address_new (const gchar* name,
        case 0:
                close (pipes [0]);
 
-#ifdef PTRACE_ATTACH
+#ifdef SOUP_PTRACE_ATTACH
                signal (SIGCHLD, SIG_IGN);
 
-               if (ptrace (PTRACE_ATTACH, getppid (), NULL, NULL) == -1) {
+               if (ptrace (SOUP_PTRACE_ATTACH, getppid (), NULL, NULL) == -1) {
                        /* 
                         * Attach failed; it's probably already being
                         * debugged. 
@@ -687,19 +697,19 @@ soup_address_new (const gchar* name,
 
                        _exit (1);
                }
-               
+
                /* 
                 * Wait for the SIGSTOP from PTRACE_ATTACH to arrive at the
                 * parent.  
                 */
                waitpid (getppid (), NULL, 0);
 
-               if (ptrace (PTRACE_DETACH, getppid (), NULL, NULL) == -1)
+               if (ptrace (SOUP_PTRACE_DETACH, getppid (), NULL, NULL) == -1)
                        g_warning ("ptrace: Detach failed: %s", 
                                   strerror(errno));
 
                kill (getppid(), SIGCONT);
-#endif
+#endif /*SOUP_PTRACE_ATTACH*/
 
                /* 
                 * Try to get the host by name (ie, DNS) 
index dac4457..c1a6e5e 100644 (file)
 
 #ifndef SOUP_SOCKET_H
 #define SOUP_SOCKET_H 1
-\r
-#ifdef HAVE_SYS_SOCKET_H\r
-#include <sys/socket.h>\r
-#endif\r
-\r
-#ifdef SOUP_WIN32\r
-#include <winsock.h>\r
-#endif\r
-\r
-#include <glib.h>
-
-gboolean  soup_gethostbyname (const gchar         *hostname,
-                             struct sockaddr_in  *sa,
-                             gchar              **nicename);
 
-gchar    *soup_gethostbyaddr (const gchar         *addr, 
-                             size_t               length, 
-                             int                  type);
+#include <glib.h>
 
 typedef struct _SoupAddress SoupAddress;