[Bug 321] New: configure does not work when cross compiling
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Sat Jun 29 10:59:22 EST 2002
http://bugzilla.mindrot.org/show_bug.cgi?id=321
Summary: configure does not work when cross compiling
Product: Portable OpenSSH
Version: -current
Platform: MIPS
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Build system
AssignedTo: openssh-unix-dev at mindrot.org
ReportedBy: chua at ayrnetworks.com
configure does not work when cross compiling because of the AC_TRY_RUN macro
without cross-compilation parameters. Most of these can be resolved by
relatively safe guesses, changing them to AC_TRY_LINK, or runtime detection.
Attached is a patch that allows Openssh 3.4p1 to cross-compile.
--- openssh-3.4p1/configure.ac Tue Jun 25 15:35:16 2002
+++ openssh-3.4p1.ayr/configure.ac Fri Jun 28 14:21:34 2002
@@ -463,20 +463,6 @@
]
)
-AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
-AC_TRY_RUN(
-
[
-#include <sys/types.h>
-#include <dirent.h>
-int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
-
],
-
[AC_MSG_RESULT(yes)],
-
[
-
AC_MSG_RESULT(no)
-
AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
-
]
-)
-
# Check whether user wants S/Key support
SKEY_MSG="no"
AC_ARG_WITH(skey,
@@ -505,6 +491,10 @@
[
AC_MSG_RESULT(no)
AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
+
]
+
[
+
AC_MSG_RESULT(no)
+
AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
])
fi
]
@@ -597,6 +587,7 @@
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MMAP_ANON_SHARED)
],
+
[ AC_MSG_RESULT(no) ],
[ AC_MSG_RESULT(no) ]
)
fi
@@ -626,6 +617,7 @@
}
],
[ ac_cv_have_broken_dirname="no" ],
+
[ ac_cv_have_broken_dirname="yes" ],
[ ac_cv_have_broken_dirname="yes" ]
)
LIBS="$save_LIBS"
@@ -670,6 +662,10 @@
AC_MSG_RESULT(no)
AC_DEFINE(BROKEN_SNPRINTF)
AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
+
],
+
[
+
AC_MSG_RESULT(assuming no)
+
AC_DEFINE(BROKEN_SNPRINTF)
]
)
fi
@@ -784,6 +780,10 @@
[
AC_MSG_RESULT(no)
AC_MSG_ERROR(Your OpenSSL headers do not match your library)
+
],
+
[
+
AC_MSG_RESULT(yes)
+
AC_MSG_WARN(Not sure, hoping so)
]
)
@@ -813,6 +813,13 @@
# Default to use of the rand helper if OpenSSL doesn't
# seed itself
USE_RAND_HELPER=yes
+
],
+
[
+
AC_MSG_RESULT(no)
+
# Default to use of the rand helper if OpenSSL doesn't
+
# seed itself
+
USE_RAND_HELPER=yes
+
AC_MSG_WARN(Not sure, assuming no)
]
)
@@ -1417,7 +1424,8 @@
#else
main() { exit(0); }
#endif
-
], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
+
], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
+
[ AC_DEFINE(BROKEN_SNPRINTF) ]
)
fi
AC_SUBST(NO_SFTP)
@@ -1523,13 +1531,16 @@
dnl make sure we're using the real structure members and not defines
AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
ac_cv_have_accrights_in_msghdr, [
-
AC_TRY_RUN(
+
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
+
],
+
[
int main() {
#ifdef msg_accrights
+#error "msg_accrights is a macro"
exit(1);
#endif
struct msghdr m;
@@ -1547,13 +1558,16 @@
AC_CACHE_CHECK([for msg_control field in struct msghdr],
ac_cv_have_control_in_msghdr, [
-
AC_TRY_RUN(
+
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
+
],
+
[
int main() {
#ifdef msg_control
+#error "msg_control is a macro"
exit(1);
#endif
struct msghdr m;
@@ -1860,20 +1874,17 @@
if test -z "$no_dev_ptmx" ; then
if test "x$disable_ptmx_check" != "xyes" ; then
-
AC_CHECK_FILE("/dev/ptmx",
-
[
-
AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
-
have_dev_ptmx=1
-
]
-
)
+
if test -f "/dev/ptc" ; then
+
AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
+
have_dev_ptmx=1
+
fi
fi
fi
-AC_CHECK_FILE("/dev/ptc",
-
[
-
AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
-
have_dev_ptc=1
-
]
-)
+
+if test -f "/dev/ptc" ; then
+
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,
--- openssh-3.4p1/sftp-glob.c Tue Feb 12 19:10:33 2002
+++ openssh-3.4p1.ayr/sftp-glob.c Fri Jun 28 14:02:44 2002
@@ -78,12 +78,9 @@
* Solaris defines dirent->d_name as a one byte array and expects
* you to hack around it.
*/
-#ifdef BROKEN_ONE_BYTE_DIRENT_D_NAME
-
strlcpy(ret->d_name, od->dir[od->offset++]->filename, MAXPATHLEN);
-#else
strlcpy(ret->d_name, od->dir[od->offset++]->filename,
-
sizeof(ret->d_name));
-#endif
+
(sizeof(ret->d_name) <= sizeof(char))?
+
MAXPATHLEN: sizeof(ret->d_name));
#ifdef __GNU_LIBRARY__
/*
* Idiot glibc uses extensions to struct dirent for readdir with
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the openssh-unix-dev
mailing list