Re: Kannel & Autoconf
Aarno Syvänen <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi.
1) You must check compiler before libs. Compiler check figures out
how to call the
compiler, and about all tests call the c compiler. So just transfer
the bsd library check
2) Most of these things are were fixed when 1) was fixed. However, in
Darwin, net/if.h
includes sys/socket.h and so sys/socket.h must be tested separately.
Here is the diff:
Index: configure.in
===================================================================
RCS file: /home/cvs/gateway/configure.in,v
retrieving revision 1.155
diff -u -r1.155 configure.in
--- configure.in 30 Aug 2005 00:04:46 -0000 1.155
+++ configure.in 1 Sep 2005 09:27:23 -0000
@@ -154,8 +154,6 @@
;;
*-*-openbsd* | *-*-freebsd*)
CFLAGS="$CFLAGS -pthread"
- AC_CHECK_LIB(c_r, pthread_exit, [LIBS="$LIBS -lc_r";
pthread="yes"])
- AC_CHECK_LIB(kse, pthread_exit, [LIBS="$LIBS -lkse";
pthread="yes"])
;;
esac
AC_SUBST(EXE_EXT)
@@ -201,6 +199,8 @@
AC_CHECK_LIB(nsl, inet_ntoa)
AC_CHECK_LIB(resolv, inet_ntop)
AC_CHECK_LIB(bind, inet_ntop)
+AC_SEARCH_LIBS([pthread_exit], [c_r], [pthread="yes"])
+AC_SEARCH_LIBS([pthread_exit], [kse], [pthread="yes"])
if test -z "$pthread"; then
AC_CHECK_LIB(pthread, pthread_exit, [LIBS="$LIBS -lpthread"])
fi
@@ -211,7 +211,22 @@
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/ioctl.h sys/time.h sys/types.h unistd.h sys/poll.h)
AC_CHECK_HEADERS(pthread.h getopt.h syslog.h iconv.h zlib.h
execinfo.h stdlib.h)
-AC_CHECK_HEADERS(sys/socket.h sys/sockio.h net/if.h netinet/in.h)
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([net/if.h], [], [],
+ [#include <stdio.h>
+ #if STDC_HEADERS
+ # include <stdlib.h>
+ # include <stddef.h>
+ #else
+ # if HAVE_STDLIB_H
+ # include <stdlib.h>
+ # endif
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ ])
+AC_CHECK_HEADERS(sys/sockio.h netinet/in.h)
Note that this is *not* tested with bsds. I hope that someone having
access can test.
But note that add all new library checks to the relevant configure.in
section.
Aarno
On Aug 30, 2005, at 4:46 AM, Andreas Fink wrote:
> Hi folks,
>
> I figured out an issue with Autoconf & Kannel.
> I'm trying to extend it with some additional command line option.
> So I modified configure.in and run autoconf.
> I realize now that whenever you run autoconf 2.53 to build a
> configure script, the resulting configure script is pretty useless.
> the problems you will see while using ./configure after having run
> autoconf 2.53 is that
>
> 1) you will see errors like this
>
> configure: WARNING: openssl/err.h: present but cannot be compiled
> configure: WARNING: openssl/err.h: check for missing
> prerequisite headers?
> configure: WARNING: openssl/err.h: see the Autoconf documentation
> configure: WARNING: openssl/err.h: section "Present But Cannot
> Be Compiled"
> configure: WARNING: openssl/err.h: proceeding with the
> preprocessor's result
> configure: WARNING: openssl/err.h: in the future, the compiler will
> take precedence
> configure: WARNING: ##
> ------------------------------------------ ##
> configure: WARNING: ## Report this to the AC_PACKAGE_NAME
> lists. ##
> configure: WARNING: ##
> ------------------------------------------ ##
>
>
> and things like this
>
> checking for gcc... gcc
> checking whether we are using the GNU C compiler... no
>
> (uh no gcc on Linux and MacOS X? cant be!)
>
>
> suddendly missing headers (the test compilation for those seems to
> fail)
> checking for sys/types.h... no
> checking for sys/stat.h... no
> checking for stdlib.h... no
> checking for string.h... no
> checking for memory.h... no
> checking for strings.h... no
> checking for inttypes.h... no
> checking for stdint.h... no
> checking for unistd.h... no
> checking for short... no
> checking size of short... 0
> checking for int... no
> checking size of int... 0
> checking for long... no
> checking size of long... 0
> checking for long long... no
> checking size of long long... 0
> checking for log in -lm... yes
> checking for accept in -lsocket... no
> checking for inet_ntoa in -lnsl... yes
> checking for inet_ntop in -lresolv... yes
> checking for inet_ntop in -lbind... no
> checking for pthread_exit in -lpthread... yes
> checking for libiconv in -liconv... no
> checking for ANSI C header files... (cached) no
> checking sys/ioctl.h usability... no
> checking sys/ioctl.h presence... yes
>
>
> Anyone having seen similar issues?
> I really dont want to edit configure by hand to get around this...
>
>
>
>
>
> Andreas Fink
> Fink Consulting GmbH
>
> ---------------------------------------------------------------
> Tel: +41-61-6666332 Fax: +41-61-6666331 Mobile: +41-79-2457333
> Address: Clarastrasse 3, 4058 Basel, Switzerland
> E-Mail: [email protected]
> Homepage: http://www.finkconsulting.com
> ---------------------------------------------------------------
>
> ICQ: 101946485 MSN: [email protected] AIM: smsrelay Skype: andreasfink
> Yahoo: finkconsulting SMS: +41792457333
> PGP9: 0714 DF2B A189 A760 6201 5CBD D040 3E71 4DAF 68BB
>
>
>
>