Lines 583-593
if test x$zsh_cv_c_have_union_init = xye
Link Here
|
583 |
fi |
583 |
fi |
584 |
|
584 |
|
585 |
dnl Checking if compiler correctly cast signed to unsigned. |
585 |
dnl Checking if compiler correctly cast signed to unsigned. |
586 |
AC_CACHE_CHECK(if signed to unsigned casting is broken, |
586 |
AC_CACHE_CHECK(if signed to unsigned casting is broken, |
587 |
zsh_cv_c_broken_signed_to_unsigned_casting, |
587 |
zsh_cv_c_broken_signed_to_unsigned_casting, |
588 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])]) |
588 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])]) |
589 |
AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING], |
589 |
AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING], |
590 |
[Define to 1 if compiler incorrectly cast signed to unsigned.]) |
590 |
[Define to 1 if compiler incorrectly cast signed to unsigned.]) |
591 |
if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then |
591 |
if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then |
592 |
AC_DEFINE(BROKEN_SIGNED_TO_UNSIGNED_CASTING) |
592 |
AC_DEFINE(BROKEN_SIGNED_TO_UNSIGNED_CASTING) |
593 |
fi |
593 |
fi |
Lines 1044-1064
if test x$zsh_cv_long_is_64_bit = xyes;
Link Here
|
1044 |
else |
1044 |
else |
1045 |
AC_CACHE_CHECK(if off_t is 64 bit, zsh_cv_off_t_is_64_bit, |
1045 |
AC_CACHE_CHECK(if off_t is 64 bit, zsh_cv_off_t_is_64_bit, |
1046 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1046 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1047 |
#include <sys/types.h> |
1047 |
#include <sys/types.h> |
1048 |
|
1048 |
|
1049 |
main() { return sizeof(off_t) < 8; } |
1049 |
int main() { return sizeof(off_t) < 8; } |
1050 |
]])],[zsh_cv_off_t_is_64_bit=yes],[zsh_cv_off_t_is_64_bit=no],[zsh_cv_off_t_is_64_bit=no])]) |
1050 |
]])],[zsh_cv_off_t_is_64_bit=yes],[zsh_cv_off_t_is_64_bit=no],[zsh_cv_off_t_is_64_bit=no])]) |
1051 |
if test x$zsh_cv_off_t_is_64_bit = xyes; then |
1051 |
if test x$zsh_cv_off_t_is_64_bit = xyes; then |
1052 |
AC_DEFINE(OFF_T_IS_64_BIT) |
1052 |
AC_DEFINE(OFF_T_IS_64_BIT) |
1053 |
fi |
1053 |
fi |
1054 |
|
1054 |
|
1055 |
AC_CACHE_CHECK(if ino_t is 64 bit, zsh_cv_ino_t_is_64_bit, |
1055 |
AC_CACHE_CHECK(if ino_t is 64 bit, zsh_cv_ino_t_is_64_bit, |
1056 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1056 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1057 |
#include <sys/types.h> |
1057 |
#include <sys/types.h> |
1058 |
|
1058 |
|
1059 |
main() { return sizeof(ino_t) < 8; } |
1059 |
int main() { return sizeof(ino_t) < 8; } |
1060 |
]])],[zsh_cv_ino_t_is_64_bit=yes],[zsh_cv_ino_t_is_64_bit=no],[zsh_cv_ino_t_is_64_bit=no])]) |
1060 |
]])],[zsh_cv_ino_t_is_64_bit=yes],[zsh_cv_ino_t_is_64_bit=no],[zsh_cv_ino_t_is_64_bit=no])]) |
1061 |
if test x$zsh_cv_ino_t_is_64_bit = xyes; then |
1061 |
if test x$zsh_cv_ino_t_is_64_bit = xyes; then |
1062 |
AC_DEFINE(INO_T_IS_64_BIT) |
1062 |
AC_DEFINE(INO_T_IS_64_BIT) |
1063 |
fi |
1063 |
fi |
1064 |
|
1064 |
|
Lines 1394-1415
zsh_cv_func_tgetent_accepts_null,
Link Here
|
1394 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1394 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1395 |
#include <fcntl.h> |
1395 |
#include <fcntl.h> |
1396 |
#include <stdlib.h> |
1396 |
#include <stdlib.h> |
1397 |
int tgetent(char *, char *); |
1397 |
int tgetent(char *, char *); |
1398 |
char *tgetstr(char *, char **); |
1398 |
char *tgetstr(char *, char **); |
1399 |
main() |
1399 |
int main() |
1400 |
{ |
1400 |
{ |
1401 |
char buf[4096]; |
1401 |
char buf[4096]; |
1402 |
int r1 = tgetent(buf, "vt100"); |
1402 |
int r1 = tgetent(buf, "vt100"); |
1403 |
int r2 = tgetent((char*)0,"vt100"); |
1403 |
int r2 = tgetent((char*)0,"vt100"); |
1404 |
if (r1 >= 0 && r1 == r2) { |
1404 |
if (r1 >= 0 && r1 == r2) { |
1405 |
char tbuf[1024], *u; |
1405 |
char tbuf[1024], *u; |
1406 |
u = tbuf; |
1406 |
u = tbuf; |
1407 |
tgetstr("cl", &u); |
1407 |
tgetstr("cl", &u); |
1408 |
creat("conftest.tgetent", 0640); |
1408 |
creat("conftest.tgetent", 0640); |
1409 |
} |
1409 |
} |
1410 |
exit((r1 != r2) || r2 == -1); |
1410 |
return((r1 != r2) || r2 == -1); |
1411 |
} |
1411 |
} |
1412 |
]])],[if test -f conftest.tgetent; then |
1412 |
]])],[if test -f conftest.tgetent; then |
1413 |
zsh_cv_func_tgetent_accepts_null=yes |
1413 |
zsh_cv_func_tgetent_accepts_null=yes |
1414 |
else |
1414 |
else |
1415 |
zsh_cv_func_tgetent_accepts_null=no |
1415 |
zsh_cv_func_tgetent_accepts_null=no |
Lines 1422-1443
zsh_cv_func_tgetent_zero_success,
Link Here
|
1422 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1422 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1423 |
#include <fcntl.h> |
1423 |
#include <fcntl.h> |
1424 |
#include <stdlib.h> |
1424 |
#include <stdlib.h> |
1425 |
int tgetent(char *, char*); |
1425 |
int tgetent(char *, char*); |
1426 |
char *tgetstr(char *, char **); |
1426 |
char *tgetstr(char *, char **); |
1427 |
main() |
1427 |
int main() |
1428 |
{ |
1428 |
{ |
1429 |
char buf[4096]; |
1429 |
char buf[4096]; |
1430 |
int r1 = tgetent(buf, "!@#$%^&*"); |
1430 |
int r1 = tgetent(buf, "!@#$%^&*"); |
1431 |
int r2 = tgetent(buf, "vt100"); |
1431 |
int r2 = tgetent(buf, "vt100"); |
1432 |
if (r1 < 0 && r2 == 0) { |
1432 |
if (r1 < 0 && r2 == 0) { |
1433 |
char tbuf[1024], *u; |
1433 |
char tbuf[1024], *u; |
1434 |
u = tbuf; |
1434 |
u = tbuf; |
1435 |
tgetstr("cl", &u); |
1435 |
tgetstr("cl", &u); |
1436 |
creat("conftest.tgetent0", 0640); |
1436 |
creat("conftest.tgetent0", 0640); |
1437 |
} |
1437 |
} |
1438 |
exit(r1 == r2); |
1438 |
return(r1 == r2); |
1439 |
} |
1439 |
} |
1440 |
]])],[if test -f conftest.tgetent0; then |
1440 |
]])],[if test -f conftest.tgetent0; then |
1441 |
zsh_cv_func_tgetent_zero_success=yes |
1441 |
zsh_cv_func_tgetent_zero_success=yes |
1442 |
else |
1442 |
else |
1443 |
zsh_cv_func_tgetent_zero_success=no |
1443 |
zsh_cv_func_tgetent_zero_success=no |
Lines 1860-1886
zsh_cv_rlim_t_is_longer,
Link Here
|
1860 |
#ifdef HAVE_SYS_TIME_H |
1860 |
#ifdef HAVE_SYS_TIME_H |
1861 |
#include <sys/time.h> |
1861 |
#include <sys/time.h> |
1862 |
#endif |
1862 |
#endif |
1863 |
#include <sys/resource.h> |
1863 |
#include <sys/resource.h> |
1864 |
#include <stdlib.h> |
1864 |
#include <stdlib.h> |
1865 |
main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])]) |
1865 |
int main(){struct rlimit r;return(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])]) |
1866 |
if test x$zsh_cv_rlim_t_is_longer = xyes; then |
1866 |
if test x$zsh_cv_rlim_t_is_longer = xyes; then |
1867 |
AC_CACHE_CHECK(if rlim_t is a quad, |
1867 |
AC_CACHE_CHECK(if rlim_t is a quad, |
1868 |
zsh_cv_rlim_t_is_quad_t, |
1868 |
zsh_cv_rlim_t_is_quad_t, |
1869 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1869 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1870 |
#ifdef HAVE_SYS_TIME_H |
1870 |
#ifdef HAVE_SYS_TIME_H |
1871 |
#include <sys/time.h> |
1871 |
#include <sys/time.h> |
1872 |
#endif |
1872 |
#endif |
1873 |
#include <stdio.h> |
1873 |
#include <stdio.h> |
1874 |
#include <sys/resource.h> |
1874 |
#include <sys/resource.h> |
1875 |
#include <stdlib.h> |
1875 |
#include <stdlib.h> |
1876 |
main() { |
1876 |
int main() { |
1877 |
struct rlimit r; |
1877 |
struct rlimit r; |
1878 |
char buf[20]; |
1878 |
char buf[20]; |
1879 |
r.rlim_cur = 0; |
1879 |
r.rlim_cur = 0; |
1880 |
sprintf(buf, "%qd", r.rlim_cur); |
1880 |
sprintf(buf, "%qd", r.rlim_cur); |
1881 |
exit(strcmp(buf, "0")); |
1881 |
return(strcmp(buf, "0")); |
1882 |
}]])],[zsh_cv_rlim_t_is_quad_t=yes],[zsh_cv_rlim_t_is_quad_t=no],[zsh_cv_rlim_t_is_quad_t=no])]) |
1882 |
}]])],[zsh_cv_rlim_t_is_quad_t=yes],[zsh_cv_rlim_t_is_quad_t=no],[zsh_cv_rlim_t_is_quad_t=no])]) |
1883 |
if test x$zsh_cv_rlim_t_is_quad_t = xyes; then |
1883 |
if test x$zsh_cv_rlim_t_is_quad_t = xyes; then |
1884 |
AC_DEFINE(RLIM_T_IS_QUAD_T) |
1884 |
AC_DEFINE(RLIM_T_IS_QUAD_T) |
1885 |
DEFAULT_RLIM_T=quad_t |
1885 |
DEFAULT_RLIM_T=quad_t |
1886 |
else |
1886 |
else |
Lines 1894-1904
else
Link Here
|
1894 |
#ifdef HAVE_SYS_TIME_H |
1894 |
#ifdef HAVE_SYS_TIME_H |
1895 |
#include <sys/time.h> |
1895 |
#include <sys/time.h> |
1896 |
#endif |
1896 |
#endif |
1897 |
#include <sys/resource.h> |
1897 |
#include <sys/resource.h> |
1898 |
#include <stdlib.h> |
1898 |
#include <stdlib.h> |
1899 |
main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])]) |
1899 |
int main(){struct rlimit r;r.rlim_cur=-1;return(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])]) |
1900 |
if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then |
1900 |
if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then |
1901 |
AC_DEFINE(RLIM_T_IS_UNSIGNED) |
1901 |
AC_DEFINE(RLIM_T_IS_UNSIGNED) |
1902 |
DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T" |
1902 |
DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T" |
1903 |
fi |
1903 |
fi |
1904 |
fi |
1904 |
fi |
Lines 2175-2185
zsh_cv_sys_fifo,
Link Here
|
2175 |
#include <fcntl.h> |
2175 |
#include <fcntl.h> |
2176 |
#include <signal.h> |
2176 |
#include <signal.h> |
2177 |
#include <unistd.h> |
2177 |
#include <unistd.h> |
2178 |
#include <stdlib.h> |
2178 |
#include <stdlib.h> |
2179 |
#include <sys/stat.h> |
2179 |
#include <sys/stat.h> |
2180 |
main() |
2180 |
int main() |
2181 |
{ |
2181 |
{ |
2182 |
char c; |
2182 |
char c; |
2183 |
int fd; |
2183 |
int fd; |
2184 |
int pid, ret; |
2184 |
int pid, ret; |
2185 |
unlink("/tmp/fifo$$"); |
2185 |
unlink("/tmp/fifo$$"); |
Lines 2189-2207
main()
Link Here
|
2189 |
if(mknod("/tmp/fifo$$", 0010600, 0) < 0) |
2189 |
if(mknod("/tmp/fifo$$", 0010600, 0) < 0) |
2190 |
#endif |
2190 |
#endif |
2191 |
exit(1); |
2191 |
exit(1); |
2192 |
pid = fork(); |
2192 |
pid = fork(); |
2193 |
if(pid < 0) |
2193 |
if(pid < 0) |
2194 |
exit(1); |
2194 |
return(1); |
2195 |
if(pid) { |
2195 |
if(pid) { |
2196 |
fd = open("/tmp/fifo$$", O_RDONLY); |
2196 |
fd = open("/tmp/fifo$$", O_RDONLY); |
2197 |
exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); |
2197 |
return(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); |
2198 |
} |
2198 |
} |
2199 |
fd = open("/tmp/fifo$$", O_WRONLY); |
2199 |
fd = open("/tmp/fifo$$", O_WRONLY); |
2200 |
ret = (fd < 0 || write(fd, "x", 1) < 1); |
2200 |
ret = (fd < 0 || write(fd, "x", 1) < 1); |
2201 |
unlink("/tmp/fifo$$"); |
2201 |
unlink("/tmp/fifo$$"); |
2202 |
exit(ret); |
2202 |
return(ret); |
2203 |
} |
2203 |
} |
2204 |
]])],[zsh_cv_sys_fifo=yes],[zsh_cv_sys_fifo=no],[zsh_cv_sys_fifo=yes]) |
2204 |
]])],[zsh_cv_sys_fifo=yes],[zsh_cv_sys_fifo=no],[zsh_cv_sys_fifo=yes]) |
2205 |
]) |
2205 |
]) |
2206 |
AH_TEMPLATE([HAVE_FIFOS], |
2206 |
AH_TEMPLATE([HAVE_FIFOS], |
2207 |
[Define to 1 if system has working FIFOs.]) |
2207 |
[Define to 1 if system has working FIFOs.]) |
Lines 2276-2299
AC_CACHE_CHECK(if link() works,
Link Here
|
2276 |
zsh_cv_sys_link, |
2276 |
zsh_cv_sys_link, |
2277 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2277 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2278 |
#include <unistd.h> |
2278 |
#include <unistd.h> |
2279 |
#include <fcntl.h> |
2279 |
#include <fcntl.h> |
2280 |
#include <stdlib.h> |
2280 |
#include <stdlib.h> |
2281 |
main() |
2281 |
int main() |
2282 |
{ |
2282 |
{ |
2283 |
int ret; |
2283 |
int ret; |
2284 |
char *tmpfile, *newfile; |
2284 |
char *tmpfile, *newfile; |
2285 |
tmpfile="/tmp/zsh.linktest$$"; |
2285 |
tmpfile="/tmp/zsh.linktest$$"; |
2286 |
newfile="/tmp/zsh.linktest2$$"; |
2286 |
newfile="/tmp/zsh.linktest2$$"; |
2287 |
unlink(tmpfile); |
2287 |
unlink(tmpfile); |
2288 |
unlink(newfile); |
2288 |
unlink(newfile); |
2289 |
if(creat(tmpfile, 0644) < 0) |
2289 |
if(creat(tmpfile, 0644) < 0) |
2290 |
exit(1); |
2290 |
return(1); |
2291 |
ret = link(tmpfile, newfile); |
2291 |
ret = link(tmpfile, newfile); |
2292 |
unlink(tmpfile); |
2292 |
unlink(tmpfile); |
2293 |
unlink(newfile); |
2293 |
unlink(newfile); |
2294 |
exit(ret<0); |
2294 |
return(ret<0); |
2295 |
} |
2295 |
} |
2296 |
]])],[zsh_cv_sys_link=yes],[zsh_cv_sys_link=no],[zsh_cv_sys_link=yes])]) |
2296 |
]])],[zsh_cv_sys_link=yes],[zsh_cv_sys_link=no],[zsh_cv_sys_link=yes])]) |
2297 |
AH_TEMPLATE([HAVE_LINK], |
2297 |
AH_TEMPLATE([HAVE_LINK], |
2298 |
[Define to 1 if system has working link().]) |
2298 |
[Define to 1 if system has working link().]) |
2299 |
if test x$zsh_cv_sys_link = xyes; then |
2299 |
if test x$zsh_cv_sys_link = xyes; then |
Lines 2309-2323
zsh_cv_sys_killesrch,
Link Here
|
2309 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2309 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2310 |
#include <unistd.h> |
2310 |
#include <unistd.h> |
2311 |
#include <signal.h> |
2311 |
#include <signal.h> |
2312 |
#include <errno.h> |
2312 |
#include <errno.h> |
2313 |
#include <stdlib.h> |
2313 |
#include <stdlib.h> |
2314 |
main() |
2314 |
int main() |
2315 |
{ |
2315 |
{ |
2316 |
int pid = (getpid() + 10000) & 0xffffff; |
2316 |
int pid = (getpid() + 10000) & 0xffffff; |
2317 |
while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1; |
2317 |
while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1; |
2318 |
exit(errno!=ESRCH); |
2318 |
return(errno!=ESRCH); |
2319 |
} |
2319 |
} |
2320 |
]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])]) |
2320 |
]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])]) |
2321 |
AH_TEMPLATE([BROKEN_KILL_ESRCH], |
2321 |
AH_TEMPLATE([BROKEN_KILL_ESRCH], |
2322 |
[Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51.]) |
2322 |
[Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51.]) |
2323 |
if test x$zsh_cv_sys_killesrch = xno; then |
2323 |
if test x$zsh_cv_sys_killesrch = xno; then |
Lines 2339-2349
if test x$signals_style = xPOSIX_SIGNALS
Link Here
|
2339 |
#include <stdlib.h> |
2339 |
#include <stdlib.h> |
2340 |
int child=0; |
2340 |
int child=0; |
2341 |
void handler(sig) |
2341 |
void handler(sig) |
2342 |
int sig; |
2342 |
int sig; |
2343 |
{if(sig==SIGCHLD) child=1;} |
2343 |
{if(sig==SIGCHLD) child=1;} |
2344 |
main() { |
2344 |
int main() { |
2345 |
struct sigaction act; |
2345 |
struct sigaction act; |
2346 |
sigset_t set; |
2346 |
sigset_t set; |
2347 |
int pid, ret; |
2347 |
int pid, ret; |
2348 |
act.sa_handler = &handler; |
2348 |
act.sa_handler = &handler; |
2349 |
sigfillset(&act.sa_mask); |
2349 |
sigfillset(&act.sa_mask); |
Lines 2354-2364
main() {
Link Here
|
2354 |
pid=fork(); |
2354 |
pid=fork(); |
2355 |
if(pid==0) return 0; |
2355 |
if(pid==0) return 0; |
2356 |
if(pid>0) { |
2356 |
if(pid>0) { |
2357 |
sigemptyset(&set); |
2357 |
sigemptyset(&set); |
2358 |
ret=sigsuspend(&set); |
2358 |
ret=sigsuspend(&set); |
2359 |
exit(child==0); |
2359 |
return(child==0); |
2360 |
} |
2360 |
} |
2361 |
} |
2361 |
} |
2362 |
]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])]) |
2362 |
]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])]) |
2363 |
if test x$zsh_cv_sys_sigsuspend = xno; then |
2363 |
if test x$zsh_cv_sys_sigsuspend = xno; then |
2364 |
AC_DEFINE(BROKEN_POSIX_SIGSUSPEND) |
2364 |
AC_DEFINE(BROKEN_POSIX_SIGSUSPEND) |
Lines 2387-2404
case "x$zsh_working_tcsetpgrp" in
Link Here
|
2387 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2387 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2388 |
#include <sys/types.h> |
2388 |
#include <sys/types.h> |
2389 |
#include <unistd.h> |
2389 |
#include <unistd.h> |
2390 |
#include <fcntl.h> |
2390 |
#include <fcntl.h> |
2391 |
#include <stdlib.h> |
2391 |
#include <stdlib.h> |
2392 |
main() { |
2392 |
int main() { |
2393 |
int fd; |
2393 |
int fd; |
2394 |
int ret; |
2394 |
int ret; |
2395 |
fd=open("/dev/tty", O_RDWR); |
2395 |
fd=open("/dev/tty", O_RDWR); |
2396 |
if (fd < 0) exit(2); |
2396 |
if (fd < 0) exit(2); |
2397 |
ret=tcsetpgrp(fd, tcgetpgrp(fd)); |
2397 |
ret=tcsetpgrp(fd, tcgetpgrp(fd)); |
2398 |
if (ret < 0) exit(1); |
2398 |
if (ret < 0) exit(1); |
2399 |
exit(0); |
2399 |
return(0); |
2400 |
} |
2400 |
} |
2401 |
]])],[zsh_cv_sys_tcsetpgrp=yes],[ |
2401 |
]])],[zsh_cv_sys_tcsetpgrp=yes],[ |
2402 |
case $? in |
2402 |
case $? in |
2403 |
1) zsh_cv_sys_tcsetpgrp=no;; |
2403 |
1) zsh_cv_sys_tcsetpgrp=no;; |
2404 |
2) zsh_cv_sys_tcsetpgrp=notty;; |
2404 |
2) zsh_cv_sys_tcsetpgrp=notty;; |
Lines 2434-2452
if test x$ac_cv_func_getpwnam = xyes; th
Link Here
|
2434 |
#include <pwd.h> |
2434 |
#include <pwd.h> |
2435 |
#include <stdio.h> |
2435 |
#include <stdio.h> |
2436 |
#include <string.h> |
2436 |
#include <string.h> |
2437 |
#include <stdlib.h> |
2437 |
#include <stdlib.h> |
2438 |
#include <unistd.h> |
2438 |
#include <unistd.h> |
2439 |
main() { |
2439 |
int main() { |
2440 |
struct passwd *pw1, *pw2; |
2440 |
struct passwd *pw1, *pw2; |
2441 |
char buf[1024], name[1024]; |
2441 |
char buf[1024], name[1024]; |
2442 |
sprintf(buf, "%d:%d", getpid(), rand()); |
2442 |
sprintf(buf, "%d:%d", getpid(), rand()); |
2443 |
pw1=getpwnam(buf); |
2443 |
pw1=getpwnam(buf); |
2444 |
if (pw1) strcpy(name, pw1->pw_name); |
2444 |
if (pw1) strcpy(name, pw1->pw_name); |
2445 |
sprintf(buf, "%d:%d", rand(), getpid()); |
2445 |
sprintf(buf, "%d:%d", rand(), getpid()); |
2446 |
pw2=getpwnam(buf); |
2446 |
pw2=getpwnam(buf); |
2447 |
exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); |
2447 |
return(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); |
2448 |
} |
2448 |
} |
2449 |
]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])]) |
2449 |
]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])]) |
2450 |
if test x$zsh_cv_sys_getpwnam_faked = xyes; then |
2450 |
if test x$zsh_cv_sys_getpwnam_faked = xyes; then |
2451 |
AC_DEFINE(GETPWNAM_FAKED) |
2451 |
AC_DEFINE(GETPWNAM_FAKED) |
2452 |
fi |
2452 |
fi |
Lines 2763-2784
elif test "x$dynamic" = xyes; then
Link Here
|
2763 |
zsh_cv_sys_elf, |
2763 |
zsh_cv_sys_elf, |
2764 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */ |
2764 |
[AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */ |
2765 |
#include <fcntl.h> |
2765 |
#include <fcntl.h> |
2766 |
#include <stdlib.h> |
2766 |
#include <stdlib.h> |
2767 |
#include <unistd.h> |
2767 |
#include <unistd.h> |
2768 |
main(argc, argv) |
2768 |
int main(int argc, char *argv[]) |
2769 |
int argc; |
|
|
2770 |
char *argv[]; |
2771 |
{ |
2769 |
{ |
2772 |
char b[4]; |
2770 |
char b[4]; |
2773 |
int i = open(argv[0],O_RDONLY); |
2771 |
int i = open(argv[0],O_RDONLY); |
2774 |
if(i == -1) |
2772 |
if(i == -1) |
2775 |
exit(1); /* fail */ |
2773 |
exit(1); /* fail */ |
2776 |
if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') |
2774 |
if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') |
2777 |
exit(0); /* succeed (yes, it's ELF) */ |
2775 |
return(0); /* succeed (yes, it's ELF) */ |
2778 |
else |
2776 |
else |
2779 |
exit(1); /* fail */ |
2777 |
return(1); /* fail */ |
2780 |
}]])],[zsh_cv_sys_elf=yes],[zsh_cv_sys_elf=no],[zsh_cv_sys_elf=yes])]) |
2778 |
}]])],[zsh_cv_sys_elf=yes],[zsh_cv_sys_elf=no],[zsh_cv_sys_elf=yes])]) |
2781 |
|
2779 |
|
2782 |
# We use [0-9]* in case statements, so need to change quoting |
2780 |
# We use [0-9]* in case statements, so need to change quoting |
2783 |
changequote(, ) |
2781 |
changequote(, ) |
2784 |
|
2782 |
|
Lines 2908-2918
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
Link Here
|
2908 |
EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-rdynamic}"],[zsh_cvs_rdynamic_available=no]) |
2908 |
EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-rdynamic}"],[zsh_cvs_rdynamic_available=no]) |
2909 |
LDFLAGS="$old_LDFLAGS") |
2909 |
LDFLAGS="$old_LDFLAGS") |
2910 |
AC_CACHE_CHECK(if your dlsym() needs a leading underscore, |
2910 |
AC_CACHE_CHECK(if your dlsym() needs a leading underscore, |
2911 |
zsh_cv_func_dlsym_needs_underscore, |
2911 |
zsh_cv_func_dlsym_needs_underscore, |
2912 |
[echo failed >conftestval && cat >conftest.c <<EOM |
2912 |
[echo failed >conftestval && cat >conftest.c <<EOM |
2913 |
fred () { } |
2913 |
void fred () { } |
2914 |
EOM |
2914 |
EOM |
2915 |
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest.c 1>&AS_MESSAGE_LOG_FD) && |
2915 |
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest.c 1>&AS_MESSAGE_LOG_FD) && |
2916 |
AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) && |
2916 |
AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) && |
2917 |
AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2917 |
AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2918 |
#include <stdio.h> |
2918 |
#include <stdio.h> |
Lines 2943-2976
char *zsh_gl_sym_addr ;
Link Here
|
2943 |
#define RTLD_LAZY 1 |
2941 |
#define RTLD_LAZY 1 |
2944 |
#endif |
2942 |
#endif |
2945 |
|
2943 |
|
2946 |
extern int fred() ; |
2944 |
extern int fred() ; |
2947 |
|
2945 |
|
2948 |
main() |
2946 |
int main() |
2949 |
{ |
2947 |
{ |
2950 |
void * handle ; |
2948 |
void * handle ; |
2951 |
void * symbol ; |
2949 |
void * symbol ; |
2952 |
FILE *f=fopen("conftestval", "w"); |
2950 |
FILE *f=fopen("conftestval", "w"); |
2953 |
if (!f) exit(1); |
2951 |
if (!f) exit(1); |
2954 |
handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ; |
2952 |
handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ; |
2955 |
if (handle == NULL) { |
2953 |
if (handle == NULL) { |
2956 |
fprintf (f, "dlopen failed") ; |
2954 |
fprintf (f, "dlopen failed") ; |
2957 |
exit(1); |
2955 |
return(1); |
2958 |
} |
2956 |
} |
2959 |
symbol = dlsym(handle, "fred") ; |
2957 |
symbol = dlsym(handle, "fred") ; |
2960 |
if (symbol == NULL) { |
2958 |
if (symbol == NULL) { |
2961 |
/* try putting a leading underscore */ |
2959 |
/* try putting a leading underscore */ |
2962 |
symbol = dlsym(handle, "_fred") ; |
2960 |
symbol = dlsym(handle, "_fred") ; |
2963 |
if (symbol == NULL) { |
2961 |
if (symbol == NULL) { |
2964 |
fprintf (f, "dlsym failed") ; |
2962 |
fprintf (f, "dlsym failed") ; |
2965 |
exit(1); |
2963 |
return(1); |
2966 |
} |
2964 |
} |
2967 |
fprintf (f, "yes") ; |
2965 |
fprintf (f, "yes") ; |
2968 |
} |
2966 |
} |
2969 |
else |
2967 |
else |
2970 |
fprintf (f, "no") ; |
2968 |
fprintf (f, "no") ; |
2971 |
exit(0); |
2969 |
return(0); |
2972 |
}]])],[zsh_cv_func_dlsym_needs_underscore=`cat conftestval`],[zsh_cv_func_dlsym_needs_underscore=failed |
2970 |
}]])],[zsh_cv_func_dlsym_needs_underscore=`cat conftestval`],[zsh_cv_func_dlsym_needs_underscore=failed |
2973 |
dynamic=no],[zsh_cv_func_dlsym_needs_underscore=no])]) |
2971 |
dynamic=no],[zsh_cv_func_dlsym_needs_underscore=no])]) |
2974 |
if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then |
2972 |
if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then |
2975 |
AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) |
2973 |
AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) |
2976 |
elif test "x$zsh_cv_func_dlsym_needs_underscore" != xno; then |
2974 |
elif test "x$zsh_cv_func_dlsym_needs_underscore" != xno; then |