]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/openssh/openssh-4.0p1/configure.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / openssh / openssh-4.0p1 / configure.patch
1 Index: openssh-4.0p1/configure.ac
2 ===================================================================
3 --- openssh-4.0p1.orig/configure.ac     2005-03-07 04:21:37.000000000 -0500
4 +++ openssh-4.0p1/configure.ac  2005-03-12 23:43:25.057482040 -0500
5 @@ -718,23 +718,21 @@
6         ]
7  )
8  
9 -AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
10 -AC_RUN_IFELSE(
11 -       [AC_LANG_SOURCE([[
12 -#include <sys/types.h>
13 -#include <dirent.h>
14 -int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
15 -       ]])],
16 -       [AC_MSG_RESULT(yes)],
17 -       [
18 -               AC_MSG_RESULT(no)
19 -               AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
20 -       ],
21 -       [ 
22 -               AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
23 -               AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
24 -       ]
25 -)
26 +AC_CACHE_CHECK([whether struct dirent allocates space for d_name], ac_cv_have_space_d_name_in_struct_dirent, [
27 +               AC_RUN_IFELSE(
28 +                       [AC_LANG_SOURCE([[
29 +                       #include <sys/types.h>
30 +                       #include <dirent.h>
31 +                       int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
32 +                       ]])],
33 +                       [ ac_cv_have_space_d_name_in_struct_dirent="yes" ],
34 +                       [ ac_cv_have_space_d_name_in_struct_dirent="no" ],
35 +               )
36 +])
37 +
38 +if test "x$ac_cv_dirent_have_space_d_name" = "xyes" ; then
39 +       AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
40 +fi
41  
42  AC_MSG_CHECKING([for /proc/pid/fd directory])
43  if test -d "/proc/$$/fd" ; then
44 @@ -987,20 +985,25 @@
45  
46  # Check for broken snprintf
47  if test "x$ac_cv_func_snprintf" = "xyes" ; then
48 -       AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
49 -       AC_RUN_IFELSE(
50 -               [AC_LANG_SOURCE([[
51 -#include <stdio.h>
52 -int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
53 -               ]])],
54 -               [AC_MSG_RESULT(yes)],
55 -               [
56 -                       AC_MSG_RESULT(no)
57 -                       AC_DEFINE(BROKEN_SNPRINTF)
58 -                       AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
59 -               ],
60 -               [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
61 -       )
62 +       AC_CACHE_CHECK([whether snprintf correctly terminates long strings],
63 +               ac_cv_have_broken_snprintf, [
64 +               AC_RUN_IFELSE(
65 +                       [AC_LANG_SOURCE([[
66 +                       #include <stdio.h>
67 +                       int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
68 +                       ]])],
69 +                       [ac_cv_have_broken_snprintf="no"],
70 +                       [ac_cv_have_broken_snprintf="yes"],
71 +                       [
72 +                               AC_MSG_WARN([cross compiling: Assuming working snprintf()])
73 +                               ac_cv_have_broken_snprintf="yes"
74 +                       ]
75 +               )
76 +       ])
77 +       if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
78 +               AC_DEFINE(BROKEN_SNPRINTF)
79 +               AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
80 +       fi
81  fi
82  
83  # Check for missing getpeereid (or equiv) support
84 @@ -1045,49 +1048,49 @@
85  
86  dnl make sure that openpty does not reacquire controlling terminal
87  if test ! -z "$check_for_openpty_ctty_bug"; then
88 -       AC_MSG_CHECKING(if openpty correctly handles controlling tty)
89 -       AC_TRY_RUN(
90 -               [
91 -#include <stdio.h>
92 -#include <sys/fcntl.h>
93 -#include <sys/types.h>
94 -#include <sys/wait.h>
95 -
96 -int
97 -main()
98 -{
99 -       pid_t pid;
100 -       int fd, ptyfd, ttyfd, status;
101 -
102 -       pid = fork();
103 -       if (pid < 0) {          /* failed */
104 -               exit(1);
105 -       } else if (pid > 0) {   /* parent */
106 -               waitpid(pid, &status, 0);
107 -               if (WIFEXITED(status))
108 -                       exit(WEXITSTATUS(status));
109 -               else
110 -                       exit(2);
111 -       } else {                /* child */
112 -               close(0); close(1); close(2);
113 -               setsid();
114 -               openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
115 -               fd = open("/dev/tty", O_RDWR | O_NOCTTY);
116 -               if (fd >= 0)
117 -                       exit(3);        /* Acquired ctty: broken */
118 -               else
119 -                       exit(0);        /* Did not acquire ctty: OK */
120 +       AC_CACHE_CHECK([if openpty acquires controlling terminal],
121 +                       ac_cv_have_openpty_ctty_bug, [
122 +               AC_TRY_RUN(
123 +                       [
124 +       #include <stdio.h>
125 +       #include <sys/fcntl.h>
126 +       #include <sys/types.h>
127 +       #include <sys/wait.h>
128 +       
129 +       int
130 +       main()
131 +       {
132 +               pid_t pid;
133 +               int fd, ptyfd, ttyfd, status;
134 +       
135 +               pid = fork();
136 +               if (pid < 0) {          /* failed */
137 +                       exit(1);
138 +               } else if (pid > 0) {   /* parent */
139 +                       waitpid(pid, &status, 0);
140 +                       if (WIFEXITED(status))
141 +                               exit(WEXITSTATUS(status));
142 +                       else
143 +                               exit(2);
144 +               } else {                /* child */
145 +                       close(0); close(1); close(2);
146 +                       setsid();
147 +                       openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
148 +                       fd = open("/dev/tty", O_RDWR | O_NOCTTY);
149 +                       if (fd >= 0)
150 +                               exit(3);        /* Acquired ctty: broken */
151 +                       else
152 +                               exit(0);        /* Did not acquire ctty: OK */
153 +               }
154         }
155 -}
156 -               ],
157 -               [
158 -                       AC_MSG_RESULT(yes)
159 -               ],
160 -               [
161 -                       AC_MSG_RESULT(no)
162 -                       AC_DEFINE(SSHD_ACQUIRES_CTTY)
163 -               ]
164 -       )
165 +                       ],
166 +                       [ ac_cv_have_openpty_ctty_bug="no" ],
167 +                       [ ac_cv_have_openpty_ctty_bug="yes"]
168 +               )
169 +       ])
170 +       if test "x$ac_cv_have_openpty_ctty_bug" = "xyes" ; then
171 +               AC_DEFINE(SSHD_ACQUIRES_CTTY)
172 +       fi
173  fi
174  
175  if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
176 @@ -2039,8 +2042,12 @@
177         exit 1;
178  else
179  dnl test snprintf (broken on SCO w/gcc)
180 -       AC_RUN_IFELSE(
181 -               [AC_LANG_SOURCE([[
182 +       # No need to check for a broken snprintf if we already know it's broken.
183 +       if test "x$ac_cv_func_snprintf" = "xyes" && test "x$ac_cv_have_broken_snprintf" != "xyes"; then
184 +               AC_CACHE_CHECK([whether snprintf correctly terminates long strings],
185 +                       ac_cv_have_broken_snprintf, [
186 +                       AC_RUN_IFELSE(
187 +                               [AC_LANG_SOURCE([[
188  #include <stdio.h>
189  #include <string.h>
190  #ifdef HAVE_SNPRINTF
191 @@ -2063,9 +2070,20 @@
192  #else
193  main() { exit(0); }
194  #endif
195 -               ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
196 -               AC_MSG_WARN([cross compiling: Assuming working snprintf()])
197 -       )
198 +                               ]])],
199 +                               [ac_cv_have_broken_snprintf="no"],
200 +                               [ac_cv_have_broken_snprintf="yes"],
201 +                               [
202 +                                       AC_MSG_WARN([cross compiling: Assuming working snprintf()])
203 +                                       ac_cv_have_broken_snprintf="yes"
204 +                               ]
205 +                       )
206 +               ])
207 +               if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
208 +                       AC_DEFINE(BROKEN_SNPRINTF)
209 +                       AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
210 +               fi
211 +       fi
212  fi
213  
214  dnl Checks for structure members
215 @@ -2666,12 +2684,15 @@
216  )
217  
218  if test "x$etc_default_login" != "xno"; then
219 -       AC_CHECK_FILE("/etc/default/login",
220 -           [ external_path_file=/etc/default/login ])
221         if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
222         then
223                 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
224 -       elif test "x$external_path_file" = "x/etc/default/login"; then
225 +               external_path_file=/etc/default/login
226 +       else
227 +               AC_CHECK_FILE("/etc/default/login",
228 +                   [ external_path_file=/etc/default/login ])
229 +       fi
230 +       if test "x$external_path_file" = "x/etc/default/login"; then
231                 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
232         fi
233  fi