Re: Build error of centerim on x86_64 (gentoo) (was Re: Segmentation fault)

Andreas Niederl <[email protected]> Wed, 21 Feb 2007 00:34:52 +0100
Newsgroups gmane.network.centericq
Message-ID <[email protected]>
Andreas Niederl wrote:
> Stéphane Bisinger wrote:
>> On 18/02/07, Andreas Niederl <[email protected]> wrote:
>>> I can reproduce this with Gentoo on x86 and x86_64 doing a plain
>>> './autogen.sh && ./configure && make' on current git.
>>> It's the same with --without-ssl and --with-ssl.
>> Do you have openssl installed? And what about gnutls?

I found the source of my ssl-related problems: --with-openssl had 'no'
as default value in the top configure.ac, so --with-ssl chose gnutls but
the other configure scripts in connwrap and libgadu wanted to build with
openssl.

I've attached a patch which fixes this by removing the default 'no' to
with-openssl.

Additional changes:
 * --with-gpgme typo
 * reordered ssl output
 * with_ssl=no as default for connwrap and libgadu, so consistent
   behaviour is guaranteed
 * unconditional AC_PROG_CXX in libgadu, libjabber and libyahoo2 for
   fixing the conditional errors when built without one of those libs


Regards,
Andi

_______________________________________________
Cicq mailing list
Cicq-xGejAJT2w6wWP6gT/[email protected]
http://mailman.linuxpl.org/mailman/listinfo/cicq
Questions? Check the FAQ first: http://centericq.de/faq/
centerim-autoconf.patch (text/x-patch, 4.5 KB)
diff -Naur --exclude=.git centerim.orig/configure.ac centerim/configure.ac
--- centerim.orig/configure.ac	2007-02-20 23:19:37.000000000 +0100
+++ centerim/configure.ac	2007-02-20 23:16:15.000000000 +0100
@@ -43,8 +43,8 @@
 
 AC_ARG_WITH(fribidi,  [  --with-fribidi=[DIR]   enable Hebrew and Arabic support using fribidi library in DIR], [with_fribidi=$withval], [with_fribidi=no])
 AC_ARG_WITH(ssl,      [  --with-ssl         enable SSL secured connections using either OpenSSL or GnuTLS], [with_ssl=$withval], [with_ssl=no]) 
-AC_ARG_WITH(openssl,  [  --with-openssl=[DIR]   enable SSL secured connections using the OpenSSL library in DIR (optional)], [with_openssl=$withval], [with_openssl=no])
-AC_ARG_WITH(openssl,  [  --with-gpgme=[PATH]   path to gpgme-config (auto)], [with_gpgme=$withval], [with_gpgme=no])
+AC_ARG_WITH(openssl,  [  --with-openssl=[DIR]   enable SSL secured connections using the OpenSSL library in DIR (optional)], [with_openssl=$withval])
+AC_ARG_WITH(gpgme,  [  --with-gpgme=[PATH]   path to gpgme-config (auto)], [with_gpgme=$withval], [with_gpgme=no])
 AC_ARG_WITH(curl,     [  --with-curl=[PATH]  path to curl-config (auto)], [with_curl=$withval], [with_curl=no])
 AC_ARG_WITH(libjpeg,  [  --without-libjpeg  Compile without JPEG token support (for Gadu-Gadu registration)])
 
@@ -96,19 +96,19 @@
 		if test "$with_openssl" = "yes"; then 
 			with_openssl="/usr"
 		fi
-		CFLAGS="$CFLAGS -I${with_openssl}"
+		AC_MSG_RESULT([found in $with_openssl])
+                CFLAGS="$CFLAGS -I${with_openssl}"
 		AC_DEFINE(HAVE_OPENSSL, 1, [use openssl])
 		AC_CHECK_LIB(crypto, main)
 		AC_CHECK_LIB(ssl, main)
-		AC_MSG_RESULT([found in $with_openssl])
 	else
-		with_ssl="no"
+		AC_MSG_RESULT([not found or disabled])
+	        with_ssl="no"
 
 		AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
 			CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
 			LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra"
 			AC_DEFINE(HAVE_GNUTLS, 1, [use gnutls]) with_ssl="yes" ])
-		AC_MSG_RESULT([not found or disabled])
 	fi
 else 
 	AC_MSG_RESULT([disabled (use --with-ssl=[DIR] to enable)])
diff -Naur --exclude=.git centerim.orig/connwrap/configure.in centerim/connwrap/configure.in
--- centerim.orig/connwrap/configure.in	2007-02-20 23:19:37.000000000 +0100
+++ centerim/connwrap/configure.in	2007-02-20 23:19:35.000000000 +0100
@@ -12,7 +12,7 @@
 
 AC_ARG_WITH(ssl, [  --with-ssl              enable SSL secured connections using either OpenSSL
 			  or GnuTLS],
-	[with_ssl=$withval])
+	[with_ssl=$withval], [with_ssl=no])
 
 if test "$with_ssl" != "no"; then
     AC_ARG_WITH(openssl,
diff -Naur --exclude=.git centerim.orig/libgadu/configure.in centerim/libgadu/configure.in
--- centerim.orig/libgadu/configure.in	2007-02-20 23:19:37.000000000 +0100
+++ centerim/libgadu/configure.in	2007-02-20 23:43:23.000000000 +0100
@@ -3,12 +3,12 @@
 
 AC_PROG_RANLIB
 AC_PROG_CC
+AC_PROG_CXX
 
 AC_ARG_ENABLE(gg, [  --disable-gg   Build without Gadu-Gadu], build_gg="$enableval", build_gg="yes")
 AM_CONDITIONAL(BUILD_GADU, test "x$build_gg" = xyes)
 
 if test "$build_gg" = "yes"; then
-    AC_PROG_CXX
 
     ###
     ###     SSL libs
@@ -16,7 +16,7 @@
 
     AC_ARG_WITH(ssl, [  --with-ssl              enable SSL secured connections using either OpenSSL
 				  or GnuTLS],
-	    [with_ssl=$withval])
+	    [with_ssl=$withval], [with_ssl=no])
 
     if test "$with_ssl" != "no"; then
 	AC_ARG_WITH(openssl,
diff -Naur --exclude=.git centerim.orig/libjabber/configure.in centerim/libjabber/configure.in
--- centerim.orig/libjabber/configure.in	2007-02-20 23:19:37.000000000 +0100
+++ centerim/libjabber/configure.in	2007-02-20 23:43:56.000000000 +0100
@@ -3,12 +3,9 @@
 
 AC_PROG_RANLIB
 AC_PROG_CC
+AC_PROG_CXX
 
 AC_ARG_ENABLE(jabber, [  --disable-jabber   Build without Jabber], build_jabber="$enableval", build_jabber="yes")
 AM_CONDITIONAL(BUILD_JABBER, test "x$build_jabber" = xyes)
 
-if test "$build_jabber" = "yes"; then
-    AC_PROG_CXX
-fi
-
 AC_OUTPUT(Makefile)
diff -Naur --exclude=.git centerim.orig/libyahoo2/configure.in centerim/libyahoo2/configure.in
--- centerim.orig/libyahoo2/configure.in	2007-02-20 23:19:37.000000000 +0100
+++ centerim/libyahoo2/configure.in	2007-02-20 23:44:42.000000000 +0100
@@ -3,12 +3,12 @@
 
 AC_PROG_RANLIB
 AC_PROG_CC
+AC_PROG_CXX
 
 AC_ARG_ENABLE(yahoo, [  --disable-yahoo   Build without Yahoo!], build_yahoo="$enableval", build_yahoo="yes")
 AM_CONDITIONAL(BUILD_YAHOO, test "x$build_yahoo" = xyes)
 
 if test "$build_yahoo" = "yes"; then
-    AC_PROG_CXX
     AC_CHECK_HEADERS(inttypes.h stdint.h)
 
     AC_MSG_CHECKING(endianness)