Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 869539
Collapse All | Expand All

(-)zsh-5.9/configure.ac.old (-36 / +34 lines)
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
(-)zsh-5.9/aczsh.m4.old (-26 / +32 lines)
Lines 42-51 AC_DEFUN(zsh_64_BIT_TYPE, Link Here
42
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
42
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
43
#ifdef HAVE_SYS_TYPES_H
43
#ifdef HAVE_SYS_TYPES_H
44
#include <sys/types.h>
44
#include <sys/types.h>
45
#endif
45
#endif
46
46
47
int
47
main()
48
main()
48
{
49
{
49
  $1 foo = 0; 
50
  $1 foo = 0; 
50
  int bar = (int) foo;
51
  int bar = (int) foo;
51
  return sizeof($1) != 8;
52
  return sizeof($1) != 8;
Lines 144-176 char *zsh_gl_sym_addr ; Link Here
144
#endif
145
#endif
145
#ifndef RTLD_GLOBAL
146
#ifndef RTLD_GLOBAL
146
#define RTLD_GLOBAL 0
147
#define RTLD_GLOBAL 0
147
#endif
148
#endif
148
149
150
int
149
main()
151
main()
150
{
152
{
151
    void *handle1, *handle2;
153
    void *handle1, *handle2;
152
    void *(*zsh_getaddr1)(), *(*zsh_getaddr2)();
154
    void *(*zsh_getaddr1)(), *(*zsh_getaddr2)();
153
    void *sym1, *sym2;
155
    void *sym1, *sym2;
154
    handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
156
    handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
155
    if(!handle1) exit(1);
157
    if(!handle1) return(1);
156
    handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
158
    handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
157
    if(!handle2) exit(1);
159
    if(!handle2) return(1);
158
    zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
160
    zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
159
    zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2");
161
    zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2");
160
    sym1 = zsh_getaddr1();
162
    sym1 = zsh_getaddr1();
161
    sym2 = zsh_getaddr2();
163
    sym2 = zsh_getaddr2();
162
    if(!sym1 || !sym2) exit(1);
164
    if(!sym1 || !sym2) return(1);
163
    if(sym1 != sym2) exit(1);
165
    if(sym1 != sym2) return(1);
164
    dlclose(handle1);
166
    dlclose(handle1);
165
    handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
167
    handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
166
    if(!handle1) exit(1);
168
    if(!handle1) return(1);
167
    zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
169
    zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
168
    sym1 = zsh_getaddr1();
170
    sym1 = zsh_getaddr1();
169
    if(!sym1) exit(1);
171
    if(!sym1) return(1);
170
    if(sym1 != sym2) exit(1);
172
    if(sym1 != sym2) return(1);
171
    exit(0);
173
    return(0);
172
}
174
}
173
]])],[zsh_cv_shared_$1=yes],
175
]])],[zsh_cv_shared_$1=yes],
174
[zsh_cv_shared_$1=no],
176
[zsh_cv_shared_$1=no],
175
[zsh_cv_shared_$1=no]
177
[zsh_cv_shared_$1=no]
176
)
178
)
Lines 226-248 char *zsh_gl_sym_addr ; Link Here
226
#endif
228
#endif
227
#ifndef RTLD_GLOBAL
229
#ifndef RTLD_GLOBAL
228
#define RTLD_GLOBAL 0
230
#define RTLD_GLOBAL 0
229
#endif
231
#endif
230
232
231
233
int
232
main()
234
main()
233
{
235
{
234
    void *handle1, *handle2;
236
    void *handle1, *handle2;
235
    int (*fred1)(), (*fred2)();
237
    int (*fred1)(), (*fred2)();
236
    handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
238
    handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
237
    if(!handle1) exit(1);
239
    if(!handle1) return(1);
238
    handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
240
    handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
239
    if(!handle2) exit(1);
241
    if(!handle2) return(1);
240
    fred1 = (int (*)()) dlsym(handle1, "${us}fred");
242
    fred1 = (int (*)()) dlsym(handle1, "${us}fred");
241
    fred2 = (int (*)()) dlsym(handle2, "${us}fred");
243
    fred2 = (int (*)()) dlsym(handle2, "${us}fred");
242
    if(!fred1 || !fred2) exit(1);
244
    if(!fred1 || !fred2) return(1);
243
    exit((*fred1)() != 42 || (*fred2)() != 69);
245
    return((*fred1)() != 42 || (*fred2)() != 69);
244
}
246
}
245
]])],[zsh_cv_sys_dynamic_clash_ok=yes],
247
]])],[zsh_cv_sys_dynamic_clash_ok=yes],
246
[zsh_cv_sys_dynamic_clash_ok=no],
248
[zsh_cv_sys_dynamic_clash_ok=no],
247
[zsh_cv_sys_dynamic_clash_ok=no]
249
[zsh_cv_sys_dynamic_clash_ok=no]
248
)
250
)
Lines 302-322 char *zsh_gl_sym_addr ; Link Here
302
#endif
304
#endif
303
#ifndef RTLD_GLOBAL
305
#ifndef RTLD_GLOBAL
304
#define RTLD_GLOBAL 0
306
#define RTLD_GLOBAL 0
305
#endif
307
#endif
306
308
309
int
307
main()
310
main()
308
{
311
{
309
    void *handle;
312
    void *handle;
310
    int (*barneysym)();
313
    int (*barneysym)();
311
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
314
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
312
    if(!handle) exit(1);
315
    if(!handle) return(1);
313
    handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
316
    handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
314
    if(!handle) exit(1);
317
    if(!handle) return(1);
315
    barneysym = (int (*)()) dlsym(handle, "${us}barney");
318
    barneysym = (int (*)()) dlsym(handle, "${us}barney");
316
    if(!barneysym) exit(1);
319
    if(!barneysym) return(1);
317
    exit((*barneysym)() != 69);
320
    return((*barneysym)() != 69);
318
}
321
}
319
]])],[zsh_cv_sys_dynamic_rtld_global=yes],
322
]])],[zsh_cv_sys_dynamic_rtld_global=yes],
320
[zsh_cv_sys_dynamic_rtld_global=no],
323
[zsh_cv_sys_dynamic_rtld_global=no],
321
[zsh_cv_sys_dynamic_rtld_global=no]
324
[zsh_cv_sys_dynamic_rtld_global=no]
322
)
325
)
Lines 372-390 char *zsh_gl_sym_addr ; Link Here
372
#endif
375
#endif
373
#ifndef RTLD_GLOBAL
376
#ifndef RTLD_GLOBAL
374
#define RTLD_GLOBAL 0
377
#define RTLD_GLOBAL 0
375
#endif
378
#endif
376
379
380
int
377
main()
381
main()
378
{
382
{
379
    void *handle;
383
    void *handle;
380
    int (*barneysym)();
384
    int (*barneysym)();
381
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
385
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
382
    if(!handle) exit(1);
386
    if(!handle) return(1);
383
    barneysym = (int (*)()) dlsym(handle, "${us}barney");
387
    barneysym = (int (*)()) dlsym(handle, "${us}barney");
384
    if(!barneysym) exit(1);
388
    if(!barneysym) return(1);
385
    exit((*barneysym)() != 69);
389
    return((*barneysym)() != 69);
386
}
390
}
387
391
388
int fred () { return 42; }
392
int fred () { return 42; }
389
]])],[zsh_cv_sys_dynamic_execsyms=yes],
393
]])],[zsh_cv_sys_dynamic_execsyms=yes],
390
[zsh_cv_sys_dynamic_execsyms=no],
394
[zsh_cv_sys_dynamic_execsyms=no],
Lines 446-464 char *zsh_gl_sym_addr ; Link Here
446
#endif
450
#endif
447
#ifndef RTLD_GLOBAL
451
#ifndef RTLD_GLOBAL
448
#define RTLD_GLOBAL 0
452
#define RTLD_GLOBAL 0
449
#endif
453
#endif
450
454
455
int
451
main()
456
main()
452
{
457
{
453
    void *handle;
458
    void *handle;
454
    int (*barneysym)();
459
    int (*barneysym)();
455
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
460
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
456
    if(!handle) exit(1);
461
    if(!handle) return(1);
457
    barneysym = (int (*)()) dlsym(handle, "${us}barney");
462
    barneysym = (int (*)()) dlsym(handle, "${us}barney");
458
    if(!barneysym) exit(1);
463
    if(!barneysym) return(1);
459
    exit((*barneysym)() != 69);
464
    return((*barneysym)() != 69);
460
}
465
}
461
466
462
int fred () { return 42; }
467
int fred () { return 42; }
463
]])],[zsh_cv_sys_dynamic_strip_exe=yes],
468
]])],[zsh_cv_sys_dynamic_strip_exe=yes],
464
[zsh_cv_sys_dynamic_strip_exe=no],
469
[zsh_cv_sys_dynamic_strip_exe=no],
Lines 514-532 char *zsh_gl_sym_addr ; Link Here
514
#endif
519
#endif
515
#ifndef RTLD_GLOBAL
520
#ifndef RTLD_GLOBAL
516
#define RTLD_GLOBAL 0
521
#define RTLD_GLOBAL 0
517
#endif
522
#endif
518
523
524
int
519
main()
525
main()
520
{
526
{
521
    void *handle;
527
    void *handle;
522
    int (*fredsym)();
528
    int (*fredsym)();
523
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
529
    handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
524
    if(!handle) exit(1);
530
    if(!handle) return(1);
525
    fredsym = (int (*)()) dlsym(handle, "${us}fred");
531
    fredsym = (int (*)()) dlsym(handle, "${us}fred");
526
    if(!fredsym) exit(1);
532
    if(!fredsym) return(1);
527
    exit((*fredsym)() != 42);
533
    return((*fredsym)() != 42);
528
}
534
}
529
]])],[zsh_cv_sys_dynamic_strip_lib=yes],
535
]])],[zsh_cv_sys_dynamic_strip_lib=yes],
530
[zsh_cv_sys_dynamic_strip_lib=no],
536
[zsh_cv_sys_dynamic_strip_lib=no],
531
[zsh_cv_sys_dynamic_strip_lib=no]
537
[zsh_cv_sys_dynamic_strip_lib=no]
532
)
538
)

Return to bug 869539