gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUnet-developers] [patch] use autoconf2.5, config.guesss, #include


From: Blake Matheny
Subject: Re: [GNUnet-developers] [patch] use autoconf2.5, config.guesss, #include <config.h>
Date: Mon, 13 May 2002 19:58:00 -0500
User-agent: Mutt/1.3.99i

> although i notice it links to openssl which has problems being linkled to
> from GPL'ed binaries,
Could you explain what you mean?

>im also not too sure about using libgdbm as a database format since it
>isnt being maintianed anymore.
The storage format that is being used for GNUnet is really
inconsequential. GNUnet is a _framework_ for a p2p system. The
abstraction layer being coded (or being planned on) will allow a
GNUnet user to use any storage backend that they like. Currently
gdbm is just what GNUnet happens to default to using.

> When building it on my debian machine it wasnt compiling in the code
> within #ifdef LINUX, im pretty sure you need to #include "config.h" in
> files the #define LINUX in order to passed the variables from ./configure
> to the source code.
We're currently not using the autoheader/config.h style of
defines. Although we could, we currently aren't. This sounds like
potentially something went wrong with the way you compiled GNUnet
as I know that at least one developer is using Debian. Could you
send the config.log to me off list? The AC_DEFINE_UNQUOTED is
used to create a shell variable (-DLINUX=1 in the case of
detecting Linux).

> As i was playing around with it i updated it to the autoconf2.5 style
> configure.ac i just ran autoscan to get most of the tests, not sure if all
> those tests are actually needed.
Unfortunately autoconf 2.1.3 (or around there) is still the
default on many many systems. Since ~2.1 obviously is not
forwards compatible (and ~2.5 is backwards compatible) it makes
sense to just stick with mostly 2.1 syntax in order to support
old and new autoconf versions.

> I made it use configure.guess instead of uname to determien host type as
> its more of a standard, i only tested it on my linux machine, not sure if
> im testing for the right values for Sun and *BSD machines.
Yeah, I was originally using that (I maintain the BSD ports) but
I found that different systems were behaving differently based on
autoconf version, and decided to stick with a generic method
(just standard sh/autoconf valid syntax) to try to get this info.
I'll play with your method and see if it's better then what we
originally had, hopefully it is :-)

> A patch against CVS that implements the above is attached.
The patch breaks some things because of an existing config.h and the
fact that /usr/lib/libgdbm.a is not necessarily a standard
location for the library (could be /opt/gdbm/lib, /usr/local/lib,
etc.). A better method for finding the gdbm lib would be to
export your CPPFLAG and LDFLAG environment variables. The
suggestions/patches are great, thanks. I'll look into the method
you suggested for OS detection. Thanks.

-Blake

> diff -U 3 -r -N ./GNUnet.orig/autogen.sh ./GNUnet.new/autogen.sh
> --- ./GNUnet.orig/autogen.sh  Tue May  7 16:52:23 2002
> +++ ./GNUnet.new/autogen.sh   Mon May 13 20:45:05 2002
> @@ -4,4 +4,5 @@
>  read
>  aclocal
>  autoconf
> +autoheader
>  automake -a
> diff -U 3 -r -N ./GNUnet.orig/configure.ac ./GNUnet.new/configure.ac
> --- ./GNUnet.orig/configure.ac        Thu Jan  1 10:00:00 1970
> +++ ./GNUnet.new/configure.ac Mon May 13 19:59:13 2002
> @@ -0,0 +1,105 @@
> +# Process this file with autoconf to produce a configure script.
> +AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
> +AC_CONFIG_SRCDIR([src/util/checksum.c])
> +AM_CONFIG_HEADER([config.h])
> +AM_INIT_AUTOMAKE(gnunet, 0.3.3)
> +
> +# Check the system type
> +AC_CANONICAL_HOST
> +
> +# Checks for programs.
> +AC_PROG_CC
> +AC_PROG_INSTALL
> +AC_PROG_AWK
> +AC_PROG_RANLIB
> +
> +# Checks for libraries.
> +# FIXME: Replace `main' with a function in `-le':
> +AC_CHECK_LIB([e], [main])
> +# FIXME: Replace `main' with a function in `-links':
> +AC_CHECK_LIB([inks], [main])
> +AC_CHECK_LIB(pthread, pthread_create)
> +AC_CHECK_LIB(nsl, gethostbyname)
> +AC_CHECK_LIB(socket, socket)
> +AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GNUnet needs GTK))
> +AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(GNUnet needs glib),gthread)
> +
> +# Checks for header files.
> +AC_HEADER_DIRENT
> +AC_HEADER_STDC
> +AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h 
> stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
> +
> +# Checks for typedefs, structures, and compiler characteristics.
> +AC_C_CONST
> +AC_C_INLINE
> +AC_TYPE_OFF_T
> +AC_TYPE_PID_T
> +AC_TYPE_SIZE_T
> +AC_HEADER_TIME
> +
> +# Checks for library functions.
> +AC_FUNC_FORK
> +AC_FUNC_GETLOADAVG
> +AC_PROG_GCC_TRADITIONAL
> +AC_FUNC_MALLOC
> +AC_FUNC_MEMCMP
> +AC_FUNC_MMAP
> +AC_TYPE_SIGNAL
> +AC_FUNC_STAT
> +AC_FUNC_VPRINTF
> +AC_CHECK_FUNCS([bzero fdatasync ftruncate gethostbyname gettimeofday 
> inet_ntoa memset mkdir munmap socket strchr strerror strstr])
> +
> +AC_MSG_CHECKING(where crypto development files are)
> +AC_ARG_WITH(crypto, [  --with-crypto=PFX       Base of OpenSSL Directory])
> +
> +if test -n "$with_crypto" ; then
> +     AC_MSG_RESULT("$with_crypto")
> +     LDFLAGS="$LDFLAGS -L$with_crypto/lib"
> +     CPPFLAGS="$CPPFLAGS -I$with_crypto/include"
> +     AC_CHECK_LIB([crypto], [RSA_generate_key])
> +     AC_CHECK_HEADERS(openssl/rsa.h openssl/blowfish.h)
> +else
> +     AC_MSG_RESULT(no)
> +     AC_CHECK_LIB(crypto, RSA_generate_key)
> +     AC_CHECK_HEADERS(openssl/rsa.h openssl/blowfish.h)
> +fi
> +
> +# Do OS specific stuff
> +case "$host_os" in
> +linux-gnu)
> +     AC_DEFINE(LINUX,1,[This is a Linux system])
> +     ;;
> +freebsd)
> +     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a FreeBSD system])
> +     AC_CHECK_LIB(c_r, pthread_create)
> +     ;;
> +openbsd*)
> +     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a OpenBSD system])
> +     AC_CHECK_LIB(c_r, pthread_create)
> +     ;;
> +netbsd*)
> +     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a NetBSD system])
> +     AC_CHECK_LIB(c_r, pthread_create)
> +     ;;
> +sun*)
> +     AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
> +     AC_CHECK_LIB(resolv, res_init)
> +     ;;
> +*)
> +     AC_MSG_RESULT(Unrecognised OS $host_os)
> +     AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
> +     AC_MSG_RESULT(otheros)
> +     ;;
> +esac
> +
> +AC_CONFIG_FILES([Makefile
> +                 doc/Makefile
> +                 doc/man/Makefile
> +                 src/Makefile
> +                 src/common/Makefile
> +                 src/gtkui/Makefile
> +                 src/server/Makefile
> +                 src/test/Makefile
> +                 src/textui/Makefile
> +                 src/util/Makefile])
> +AC_OUTPUT
> diff -U 3 -r -N ./GNUnet.orig/configure.in ./GNUnet.new/configure.in
> --- ./GNUnet.orig/configure.in        Tue May  7 09:50:00 2002
> +++ ./GNUnet.new/configure.in Thu Jan  1 10:00:00 1970
> @@ -1,75 +0,0 @@
> -dnl Process this file with autoconf to produce a configure script.
> -AC_INIT(src/server/gnet.c)
> -AM_INIT_AUTOMAKE(gnunet, 0.3.3)
> -
> -dnl Checks for programs.
> -AC_PROG_AWK
> -AC_PROG_CC
> -AC_PROG_INSTALL
> -AC_PROG_LN_S
> -AC_PROG_MAKE_SET
> -AC_PROG_RANLIB
> -
> -AC_CHECK_HEADERS(fcntl.h strings.h unistd.h sys/time.h)
> -
> -AC_CHECK_PROG(system,uname,`uname`,unknown)
> -if test "x$system" = xLinux; then
> -    AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
> -elif test "x$system" = xFreeBSD; then
> -    AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a FreeBSD system])
> -    AC_CHECK_LIB(c_r, pthread_create)
> -elif test "x$system" = xOpenBSD; then
> -    AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a OpenBSD system])
> -    AC_CHECK_LIB(c_r, pthread_create)
> -elif test "x$system" = xNetBSD; then
> -    AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a NetBSD system])
> -    AC_CHECK_LIB(c_r, pthread_create)
> -elif test "x$system" = xSunOS; then
> -    AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
> -    AC_CHECK_LIB(resolv, res_init)
> -else
> -    AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
> -    AC_MSG_RESULT(otheros)
> -fi
> -
> -AC_MSG_CHECKING(where crypto development files are)
> -AC_ARG_WITH(crypto, [  --with-crypto=PFX       Base of OpenSSL Directory])
> -
> -if test -n "$with_crypto" ; then
> -    AC_MSG_RESULT("$with_crypto")
> -    LDFLAGS="$LDFLAGS -L$with_crypto/lib"
> -    CPPFLAGS="$CPPFLAGS -I$with_crypto/include"
> -    AC_CHECK_LIB([crypto], [RSA_generate_key])
> -    AC_CHECK_HEADERS(openssl/rsa.h openssl/blowfish.h)
> -else
> -    AC_MSG_RESULT(no)
> -    AC_CHECK_LIB(crypto, RSA_generate_key)
> -    AC_CHECK_HEADERS(openssl/rsa.h openssl/blowfish.h)
> -fi
> -
> -dnl Replace `main' with a function in -lpthread:
> -AC_CHECK_LIB(pthread, pthread_create)
> -AC_CHECK_LIB(nsl, gethostbyname)
> -AC_CHECK_LIB(socket, socket)
> -AC_CHECK_LIB(gdbm, gdbm_open,,AC_MSG_ERROR(GNUnet needs gdbm))
> -AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GNUnet needs GTK))
> -AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(GNUnet needs glib),gthread)
> -
> -dnl Checks for header files.
> -AC_HEADER_DIRENT
> -AC_HEADER_STDC
> -AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GNUnet needs GTK))
> -
> -dnl Checks for typedefs, structures, and compiler characteristics.
> -AC_C_CONST
> -
> -dnl Checks for library functions.
> -AC_FUNC_MEMCMP
> -AC_FUNC_VPRINTF
> -AC_CHECK_FUNCS(socket strerror getloadavg fdatasync)
> -
> -
> -AC_SUBST(CPPFLAGS)
> -AC_SUBST(LDFLAGS)
> -
> -AC_OUTPUT(Makefile src/util/Makefile src/common/Makefile src/server/Makefile 
> src/test/Makefile src/textui/Makefile src/Makefile doc/Makefile 
> doc/man/Makefile src/gtkui/Makefile)
> diff -U 3 -r -N ./GNUnet.orig/src/server/Makefile.am 
> ./GNUnet.new/src/server/Makefile.am
> --- ./GNUnet.orig/src/server/Makefile.am      Sat May  4 13:37:39 2002
> +++ ./GNUnet.new/src/server/Makefile.am       Mon May 13 20:54:27 2002
> @@ -1,7 +1,8 @@
>  INCLUDES = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/include/util
>  LDADD    = $(top_builddir)/src/util/libgnunetutil.a  \
>   $(top_builddir)/src/common/libgnunetcommon.a \
> - $(top_builddir)/src/util/libgnunetutil.a  
> + $(top_builddir)/src/util/libgnunetutil.a \
> + /usr/lib/libgdbm.a
>  bin_PROGRAMS = gnunetd
>  gnunetd_SOURCES = \
>   gnet.c \
> diff -U 3 -r -N ./GNUnet.orig/src/server/tcpserver.c 
> ./GNUnet.new/src/server/tcpserver.c
> --- ./GNUnet.orig/src/server/tcpserver.c      Sun May 12 13:15:40 2002
> +++ ./GNUnet.new/src/server/tcpserver.c       Mon May 13 21:20:32 2002
> @@ -33,6 +33,7 @@
>  #include <sys/socket.h>
>  #include <netinet/in.h> 
>  
> +#include "config.h"
>  #include "server/tcpserver.h"
>  
>  
> diff -U 3 -r -N ./GNUnet.orig/src/textui/Makefile.am 
> ./GNUnet.new/src/textui/Makefile.am
> --- ./GNUnet.orig/src/textui/Makefile.am      Sun May 12 13:15:40 2002
> +++ ./GNUnet.new/src/textui/Makefile.am       Mon May 13 21:13:14 2002
> @@ -1,8 +1,8 @@
>  INCLUDES =  -I$(top_srcdir)/src/include -I$(top_srcdir)/src/include/util
>  LDADD    =   $(top_builddir)/src/util/libgnunetutil.a \
>               $(top_builddir)/src/common/libgnunetcommon.a \
> -             $(top_builddir)/src/util/libgnunetutil.a
> -
> +             $(top_builddir)/src/util/libgnunetutil.a \
> +             /usr/lib/libgdbm.a
>  bin_PROGRAMS = gnunet-insert gnunet-insert-mp3 gnunet-search gnunet-download
>  lib_LIBRARIES = libgnunetfilesharing.a
>  
> diff -U 3 -r -N ./GNUnet.orig/src/util/Makefile.am 
> ./GNUnet.new/src/util/Makefile.am
> --- ./GNUnet.orig/src/util/Makefile.am        Mon May 13 04:22:20 2002
> +++ ./GNUnet.new/src/util/Makefile.am Mon May 13 21:04:51 2002
> @@ -1,6 +1,6 @@
>  INCLUDES = -I$(top_srcdir)/src/include/util -I$(top_srcdir)/src/include
>  SUBDIRS  = .
> -
> +LDADD = /usr/lib/libgdbm.a
>  lib_LIBRARIES = libgnunetutil.a
>  libgnunetutil_a_SOURCES = \
>    xmalloc.c xmalloc.h \
> diff -U 3 -r -N ./GNUnet.orig/src/util/statuscalls.c 
> ./GNUnet.new/src/util/statuscalls.c
> --- ./GNUnet.orig/src/util/statuscalls.c      Sun May 12 13:42:33 2002
> +++ ./GNUnet.new/src/util/statuscalls.c       Mon May 13 21:20:08 2002
> @@ -33,6 +33,7 @@
>  #include <unistd.h>
>  #include <errno.h>
>  
> +#include "config.h"
>  #include "statuscalls.h"
>  
>  /**
> diff -U 3 -r -N ./GNUnet.orig/src/util/tcpio.c ./GNUnet.new/src/util/tcpio.c
> --- ./GNUnet.orig/src/util/tcpio.c    Sun May 12 16:13:06 2002
> +++ ./GNUnet.new/src/util/tcpio.c     Mon May 13 21:19:46 2002
> @@ -25,6 +25,7 @@
>  
>  #include "tcpio.h"
>  #include "xmalloc.h"
> +#include "config.h"
>  
>  #include <sys/types.h>
>  #include <sys/socket.h>




-- 
Blake Matheny
address@hidden
PGP-Key http://www.dbaseiv.net/purdue.key



reply via email to

[Prev in Thread] Current Thread [Next in Thread]