[patch] some buildsystem fixes for crosscompiling

Enrico Weigelt weigelt at metux.de
Tue Dec 28 03:06:28 EST 2004


Hi folks,


here're some quick+dirty fixes to allow sysroot'ed crosscompiling. 
probably not yet very clean, but seems to work.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact at metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------
-------------- next part --------------
--- openssh-3.7.1p2-orig/configure.ac	Tue Sep 23 11:24:21 2003
+++ openssh-3.7.1p2/configure.ac	Sun Oct 26 17:31:06 2003
@@ -467,6 +467,10 @@
 	[
 		AC_MSG_RESULT(no)
 		AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
+	],
+	[
+		AC_MSG_RESULT(yes)
+		AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
 	]
 )
 
@@ -637,6 +641,9 @@
 	[
 		AC_MSG_RESULT(no)
 		AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
+	],
+	[AC_MSG_RESULT(yes)
+	AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
 	]
 )
 
@@ -668,6 +675,9 @@
 				[
 					AC_MSG_RESULT(no)
 					AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
+				],
+				[AC_MSG_RESULT(yes)
+				AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
 				])
 		fi
 	]
@@ -803,6 +813,9 @@
 			AC_MSG_RESULT(no)
 			AC_DEFINE(BROKEN_SNPRINTF)
 			AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
+		],
+		[AC_MSG_RESULT(yes)
+		AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
 		]
 	)
 fi
@@ -876,6 +889,10 @@
 		[
 			AC_MSG_RESULT(no)
 			AC_DEFINE(SSHD_ACQUIRES_CTTY)
+		],
+		[
+			AC_MSG_RESULT(yes)
+			AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
 		]
 	)
 fi
@@ -1011,6 +1028,10 @@
 	[
 		AC_MSG_RESULT(not found)
 		AC_MSG_ERROR(OpenSSL version header not found.)
+	],
+	[
+		ssl_header_ver="VERSION"
+		AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to $ssl_header_ver])
 	]
 )
 
@@ -1044,6 +1065,10 @@
 	[
 		AC_MSG_RESULT(not found)
 		AC_MSG_ERROR(OpenSSL library not found.)
+	],
+	[
+		ssl_library_ver="VERSION"
+		AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to $ssl_library_ver])
 	]
 )
 
@@ -1063,7 +1088,12 @@
 		AC_MSG_ERROR([Your OpenSSL headers do not match your library.
 Check config.log for details.
 Also see contrib/findssl.sh for help identifying header/library mismatches.])
+	],
+	[
+		AC_MSG_RESULT(yes)
+		AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
 	]
+
 )
 
 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the 
@@ -1092,6 +1122,11 @@
 		# Default to use of the rand helper if OpenSSL doesn't
 		# seed itself
 		USE_RAND_HELPER=yes
+	],
+	[
+		OPENSSL_SEEDS_ITSELF=yes
+		AC_MSG_RESULT(yes)
+		AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
 	]
 )
 
@@ -1682,7 +1717,8 @@
 #else
 main() { exit(0); }
 #endif
-		], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
+		], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
+		[ true ]
 	)
 fi
 
@@ -1802,6 +1838,7 @@
 }
 		],
 		[ ac_cv_have_accrights_in_msghdr="yes" ],
+		[ ac_cv_have_accrights_in_msghdr="no" ],
 		[ ac_cv_have_accrights_in_msghdr="no" ]
 	)
 ])
@@ -1826,7 +1863,8 @@
 }
 		],
 		[ ac_cv_have_control_in_msghdr="yes" ],
-		[ ac_cv_have_control_in_msghdr="no" ]
+		[ ac_cv_have_control_in_msghdr="no" ],
+		[ ac_cv_have_control_in_msghdr="yes" ]
 	)
 ])
 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
@@ -2115,13 +2153,14 @@
 		)
 	fi
 fi
+if test "$cross_compiling" != yes; then
 AC_CHECK_FILE("/dev/ptc", 
 	[
 		AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
 		have_dev_ptc=1
 	]
 )
-
+fi
 # Options from here on. Some of these are preset by platform above
 AC_ARG_WITH(mantype,
 	[  --with-mantype=man|cat|doc  Set man page type],
@@ -2215,15 +2254,18 @@
 fi
 
 # check for /etc/default/login and use it if present.
+#if test "$cross_compiling" != yes; then
 AC_ARG_ENABLE(etc-default-login,
 	[  --disable-etc-default-login       Disable using PATH from /etc/default/login [no]],,
 [
-AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
+AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ],,)
 
 if test "x$external_path_file" = "x/etc/default/login"; then
 	AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
 fi
-])
+]
+)
+#fi
 
 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
 if test $ac_cv_func_login_getcapbool = "yes" -a \
diff -ruN openssh-3.9p1.orig/configure openssh-3.9p1/configure
--- openssh-3.9p1.orig/configure	Wed Nov 24 11:21:15 2004
+++ openssh-3.9p1/configure	Wed Nov 24 11:25:06 2004
@@ -4010,10 +4010,7 @@
 
 fi
 
-if test -z "$LD" ; then
-	LD=$CC
-fi
-
+LD="$CC -s"
 
 echo "$as_me:$LINENO: checking for inline" >&5
 echo $ECHO_N "checking for inline... $ECHO_C" >&6
diff -ruN openssh-3.9p1.orig/configure.ac openssh-3.9p1/configure.ac
--- openssh-3.9p1.orig/configure.ac	Wed Nov 24 11:21:15 2004
+++ openssh-3.9p1/configure.ac	Wed Nov 24 11:25:40 2004
@@ -71,9 +71,8 @@
 	AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
 fi
 
-if test -z "$LD" ; then
-	LD=$CC
-fi
+LD="$CC -s"
+
 AC_SUBST(LD)
 	
 AC_C_INLINE
diff -ruN openssh-3.9p1.orig/configure.ac openssh-3.9p1/configure.ac
--- openssh-3.9p1.orig/configure.ac	Tue Dec 14 07:41:04 2004
+++ openssh-3.9p1/configure.ac	Tue Dec 14 07:41:50 2004
@@ -642,34 +642,7 @@
 	]
 )
 
-AC_MSG_CHECKING(for zlib 1.1.4 or greater)
-AC_TRY_RUN([
-#include <zlib.h>
-int main()
-{
-	int a, b, c, v;
-	if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
-		exit(1);
-	v = a*1000000 + b*1000 + c;
-	if (v >= 1001004)
-		exit(0);
-	exit(2);
-}
-	],
-	AC_MSG_RESULT(yes),
-	[ AC_MSG_RESULT(no)
-	  if test -z "$zlib_check_nonfatal" ; then
-		AC_MSG_ERROR([*** zlib too old - check config.log ***
-Your reported zlib version has known security problems.  It's possible your
-vendor has fixed these problems without changing the version number.  If you
-are sure this is the case, you can disable the check by running
-"./configure --without-zlib-version-check".
-If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
-	  else
-		AC_MSG_WARN([zlib version may have security problems])
-	  fi
-	]
-)
+AC_MSG_CHECKING(for zlib 1.1.4 or greater - disabled)
 
 dnl UnixWare 2.x
 AC_CHECK_FUNC(strcasecmp,
diff -ruN openssh-3.9p1.orig/configure.ac openssh-3.9p1/configure.ac
--- openssh-3.9p1.orig/configure.ac	Tue Dec 14 07:43:36 2004
+++ openssh-3.9p1/configure.ac	Tue Dec 14 07:44:15 2004
@@ -867,34 +867,6 @@
 
 AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
 
-AC_CHECK_FUNCS(setresuid, [
-	dnl Some platorms have setresuid that isn't implemented, test for this
-	AC_MSG_CHECKING(if setresuid seems to work)
-	AC_TRY_RUN([
-#include <stdlib.h>
-#include <errno.h>
-int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
-		],
-		[AC_MSG_RESULT(yes)],
-		[AC_DEFINE(BROKEN_SETRESUID)
-		 AC_MSG_RESULT(not implemented)]
-	)
-])
-
-AC_CHECK_FUNCS(setresgid, [
-	dnl Some platorms have setresgid that isn't implemented, test for this
-	AC_MSG_CHECKING(if setresgid seems to work)
-	AC_TRY_RUN([
-#include <stdlib.h>
-#include <errno.h>
-int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
-		],
-		[AC_MSG_RESULT(yes)],
-		[AC_DEFINE(BROKEN_SETRESGID)
-		 AC_MSG_RESULT(not implemented)]
-	)
-])
-
 dnl    Checks for time functions
 AC_CHECK_FUNCS(gettimeofday time)
 dnl    Checks for utmp functions
diff -ruN openssh-3.9p1.orig/configure.ac openssh-3.9p1/configure.ac
--- openssh-3.9p1.orig/configure.ac	Tue Dec 14 07:53:10 2004
+++ openssh-3.9p1/configure.ac	Tue Dec 14 07:53:42 2004
@@ -2359,12 +2359,6 @@
 		)
 	fi
 fi
-AC_CHECK_FILE("/dev/ptc",
-	[
-		AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
-		have_dev_ptc=1
-	]
-)
 
 # Options from here on. Some of these are preset by platform above
 AC_ARG_WITH(mantype,


More information about the openssh-unix-dev mailing list