2010年5月18日 星期二

Building ipsec-tools-0.6.5

./configure --host=arm-linux --with-openssl=/path/to/openssl --prefix=/path/to/install
if [ ! -e mkinstalldir ] ; then ln -s /usr/share/automake-1.7/mkinstalldirs;fi
make;make install

http://page.dj-inod.com/thirdyear/s5/projet/report/report_linux.pdf

ERROR: sockmisc.c: In function 'saddr2str':
sockmisc.c:824: error: the address of 'addr' will always evaluate as 'true'
sockmisc.c:824: error: the address of 'port' will always evaluate as 'true'
sockmisc.c: In function 'saddrwop2str':
sockmisc.c:841: error: the address of 'addr' will always evaluate as 'true'

This is a complex one. The addresses of local variables are always non-NULL, as required by the C/C++ standards (and common sense). And its often the case expliciting testing in code indicates potential logic error, "assert(&hwparams)" instead of "assert(hwparams)" for example. However, in this particular case, because of the use of a macro, it does apear to be an annoying false negative. The solution was to add -Werror -Wall -Wno-always-true to CFLAGS in corresponding makefiles. Remove Werror flag in corresponding makefiles.


Or change the configure directly
diff --git a/cpl/ipsec-tools-0.6.5/configure b/cpl/ipsec-tools-0.6.5/configure
index a5fffd2..cdfd983 100755
--- a/cpl/ipsec-tools-0.6.5/configure
+++ b/cpl/ipsec-tools-0.6.5/configure
@@ -20752,7 +20752,8 @@ echo "${ECHO_T}$ac_cv_prog_egrep" >&6



-CFLAGS_ADD="$CFLAGS_ADD -Wall -Werror -Wno-unused"
+#CFLAGS_ADD="$CFLAGS_ADD -Wall -Werror -Wno-unused"
+CFLAGS_ADD="$CFLAGS_ADD -Wall -Wno-unused"

case $host in
*netbsd*)


ERROR : ipsec-tools-0.6.7/src/setkey/token.c:1821: undefined reference to `yywrap'

1. Install flex and bison,
2. If you are cross compiling, your lib might not have libfl. Cross-compile flex.

This problem was easily solvedm due to prior experience with flex and bison. Flex is a lexical analyzer and bison a parser, and yywrap a function automatically created by flex when executed. Although it couldn't be found were the compilation used flex and bison, the installation of both fixed the problem.


isakmp.c: In function ‘isakmp_open’:
isakmp.c:1579: error: ‘IPV6_RECVDSTADDR’ undeclared (first use in this function)
isakmp.c:1579: error: (Each undeclared identifier is reported only once
isakmp.c:1579: error: for each function it appears in.)

Re: make failed on fedora 10 GCC 4.3.2
http://www.racoon2.wide.ad.jp/ml/racoon2-users/200903/msg609.html

After configure, patch config.h with following:
--- bak 2010-12-23 16:40:23.482675177 +0800
+++ config.h 2010-12-23 16:40:36.482175342 +0800
@@ -191,7 +191,7 @@
#define INET6

/* Use advanced IPv6 API */
-/* #undef INET6_ADVAPI */
+#define INET6_ADVAPI 1

/* Name of package */
#define PACKAGE "ipsec-tools"


Above fix to config.h or configure could be void for they could be regenerated.
diff --git a/cpl/nitrox-ipsec/ipsec-tools-0.6.5/configure.ac b/cpl/nitrox-ipsec/
index b99c4a1..8d9e3ea 100644
--- a/cpl/nitrox-ipsec/ipsec-tools-0.6.5/configure.ac
+++ b/cpl/nitrox-ipsec/ipsec-tools-0.6.5/configure.ac
@@ -19,7 +19,7 @@ AM_PROG_LEX
AC_SUBST(LEXLIB)
AC_PROG_EGREP

-CFLAGS_ADD="$CFLAGS_ADD -Wall -Werror -Wno-unused"
+CFLAGS_ADD="$CFLAGS_ADD -Wall -Wno-unused"

case $host in
*netbsd*)
@@ -471,17 +471,7 @@ main()
))

if test "$ipv6" = "yes"; then
- AC_DEFINE([INET6], [], [Support IPv6])
- AC_MSG_CHECKING(for advanced API support)
- AC_TRY_COMPILE([#ifndef INET6
-#define INET6
-#endif
-#include
-#include ],
- [struct in6_pktinfo a;],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([INET6_ADVAPI], [], [Use advanced IPv6 API])],
- [AC_MSG_RESULT(no)])
+AC_DEFINE([INET6_ADVAPI], [], [Use advanced IPv6 API])],
fi

RACOON_CHECK_BUGGY_GETADDRINFO

沒有留言: