freeradius-client cross compile fail

Bertrand Jacquin beber at meleeweb.net
Tue Jun 28 18:06:43 CEST 2011


Hi there,

radiusclient-ng configure failed when cross compiling as no fallback
method to handling this :

checking for stricmp... no 
checking for random... yes 
checking for rand... yes 
checking for snprintf... yes 
checking for vsnprintf... yes 
checking for field domainname in struct utsname... configure: error: in
`/usr/i586-geode-linux-gnu/tmp/portage/net-dialup/freeradius-client-1.1.6/work/freeradius-client-1.1.6': 
configure: error: cannot run test program while cross compiling 
See `config.log' for more details

Here is a patch to let user define utsname status by defining
ac_cv_struct_utsname

There is another fix for /dev/urandom that is tested on build host. But
this file can don't exist on target host. So let user define
ac_cv_file__dev_urandom

-- 
Beber
On Lady Voodoo
-------------- next part --------------
--- configure.in.ori	2011-06-28 18:01:12.000000000 +0200
+++ configure.in	2011-06-28 18:01:13.000000000 +0200
@@ -206,32 +206,40 @@
 AC_CHECK_FUNCS(flock fcntl uname gethostname sysinfo getdomainname)
 AC_CHECK_FUNCS(stricmp random rand snprintf vsnprintf)
 
-if test "$ac_cv_func_uname" = 'yes'
-then
-	AC_MSG_CHECKING([for field domainname in struct utsname])
-	AC_TRY_RUN([
-	#include <sys/utsname.h>
+AC_CACHE_CHECK([for field domainname in struct utsname], ac_cv_struct_utsname,
+ [AC_TRY_RUN([
+  #include <sys/utsname.h>
 	
-	main(int argc, char **argv)
-	{
-		struct utsname uts;
-		uts.domainname[0] = '\0';
-	}
-	],
-	AC_MSG_RESULT(yes)
-	AC_DEFINE(HAVE_STRUCT_UTSNAME_DOMAINNAME),
-	AC_MSG_RESULT(no)
-	)
-fi
+  main(int argc, char **argv)
+  {
+    struct utsname uts;
+    uts.domainname[0] = '\0';
+  }
+ ],
+ ac_cv_struct_utsname=yes,
+ ac_cv_struct_utsname=no,
+ [AC_MSG_ERROR([cross-compiling,
+  presetting ac_cv_struct_utsname=(yes|no) will help])]
+ )
+])
+AS_VAR_IF(ac_cv_struct_utsname, yes,
+ [AC_DEFINE(HAVE_STRUCT_UTSNAME_DOMAINNAME)],
+)
 
-AC_MSG_CHECKING([for /dev/urandom])
-if test -c /dev/urandom
-then
-	AC_MSG_RESULT(yes)
-	AC_DEFINE(HAVE_DEV_URANDOM)
-else
-	AC_MSG_RESULT(no)
-fi
+AC_CACHE_CHECK([for /dev/urandom], ac_cv_file__dev_urandom,
+ [AS_IF([test "$cross_compiling" = yes],
+  [AC_MSG_ERROR([cross-compiling,
+   presetting ac_cv_file__dev_urandom=(yes|no) will help])],
+  if test -c /dev/urandom ; then
+    ac_cv_file__dev_urandom=yes
+  else
+    ac_cv_file__dev_urandom=no
+  fi
+ )]
+)
+AS_VAR_IF(ac_cv_file__dev_urandom, yes,
+ [AC_DEFINE(HAVE_DEV_URANDOM)]
+)
 
 dnl Determine PATH setting
 echo $ac_n "using the following PATH setting for exec'ed programs... $ac_c" 1>&6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20110628/a1cf21c4/attachment.pgp>


More information about the Freeradius-Devel mailing list