kurz@mrcnext.cso.uiuc.edu (Charles L. Kurz) (10/04/90)
I've just received shipment of an RS6000 at work and would like to move some existing perl programs. Does anyone have any experience porting c programs, perl in particular to this platform. I am reading some of the BSD to AIX porting docs, but would like to hear from some one who has experience a port. kurz@mrcnext.cso.uiuc.edu
phillips@cs.ubc.ca (George Phillips) (10/06/90)
In article <1990Oct4.031517.18636@ux1.cso.uiuc.edu> kurz@mrcnext.cso.uiuc.edu (Charles L. Kurz) writes: >I've just received shipment of an RS6000 at work and would like to move some > existing perl programs. Does anyone have any experience porting c programs, > perl in particular to this platform. I am reading some of the BSD to AIX > porting docs, but would like to hear from some one who has experience a port. I've managed to compile perl 3.0, patchlevel 28 on an IBM RS6000 machine. There were only a few snags: 1) You need to have -D_NO_PROTO in the C compiler flags. 2) The passwd struct does not contain a pw_comment field. 3) O_EXEC is used by <fcntl.h>. 4) op.mkdir test 3 may fail depending if mkdir says mkdir: Do not specify an existing file. or mkdir: File exists Then there were a couple of things which you can ignore. TRUE and FALSE are already defined so the compiler complains. Configure seems to get "-lm" twice in the C libraries and there is an "#ifdef undef" in x2p/util.c which chokes the compiler (changing it to #ifdef neverdefined worked for me). Here are some unofficial patches to Configure, arg.h, config_h.SH, doio.c, eval.c and toke.c which fix up (2) and (3). No doubt these patches (or some variation on them) will be part of the next patch set to hit the net. -- George Phillips phillips@cs.ubc.ca {alberta,uw-beaver,uunet}!ubc-cs!phillips *** Configure Tue Sep 11 19:09:19 1990 --- /tmp/rsp/Configure Mon Sep 24 15:19:30 1990 *************** *** 169,174 **** --- 169,175 ---- i_grp='' i_niin='' i_pwd='' + d_pwcomment='' d_pwquota='' d_pwage='' d_pwchange='' *************** *** 1887,1892 **** --- 1888,1898 ---- else d_pwexpire="$undef" fi + if $contains 'pw_comment' $$.h >/dev/null 2>&1; then + d_pwcomment="$define" + else + d_pwcomment="$undef" + fi rm -f $$.h else i_pwd="$undef" *************** *** 1895,1900 **** --- 1901,1907 ---- d_pwchange="$undef" d_pwclass="$undef" d_pwexpire="$undef" + d_pwcomment="$undef" echo "No pwd.h found." fi *** arg.h Tue Sep 11 00:15:35 1990 --- /tmp/rsp/arg.h Mon Sep 24 15:19:17 1990 *************** *** 123,129 **** #define O_EACH 89 #define O_CHOP 90 #define O_FORK 91 ! #define O_EXEC 92 #define O_SYSTEM 93 #define O_OCT 94 #define O_HEX 95 --- 123,129 ---- #define O_EACH 89 #define O_CHOP 90 #define O_FORK 91 ! #define O_EXEC_OP 92 #define O_SYSTEM 93 #define O_OCT 94 #define O_HEX 95 *** config_h.SH Tue Sep 11 00:16:38 1990 --- /tmp/rsp/config_h.SH Mon Sep 24 15:19:00 1990 *************** *** 531,536 **** --- 531,540 ---- * This symbol, if defined, indicates to the C program that struct passwd * contains pw_expire. */ + /* PWCOMMENT: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_comment. + */ #$i_pwd I_PWD /**/ #$d_pwquota PWQUOTA /**/ #$d_pwage PWAGE /**/ *************** *** 537,542 **** --- 541,547 ---- #$d_pwchange PWCHANGE /**/ #$d_pwclass PWCLASS /**/ #$d_pwexpire PWEXPIRE /**/ + #$d_pwcomment PWCOMMENT /**/ /* I_SYSDIR: * This symbol, if defined, indicates to the C program that it should *** doio.c Tue Sep 11 00:18:01 1990 --- /tmp/rsp/doio.c Thu Oct 4 20:22:17 1990 *************** *** 1920,1926 **** --- 1920,1928 ---- #ifdef PWCLASS str_set(str,pwent->pw_class); #else + #ifdef PWCOMMENT str_set(str, pwent->pw_comment); + #endif #endif (void)astore(ary, ++sp, str = str_static(&str_no)); str_set(str, pwent->pw_gecos); *** eval.c Tue Sep 11 00:18:03 1990 --- /tmp/rsp/eval.c Mon Sep 24 15:19:20 1990 *************** *** 1446,1452 **** } goto donumset; #endif /* FORK */ ! case O_EXEC: if ((arg[1].arg_type & A_MASK) == A_STAB) value = (double)do_aexec(st[1],arglast); else if (arglast[2] - arglast[1] != 1) --- 1446,1452 ---- } goto donumset; #endif /* FORK */ ! case O_EXEC_OP: if ((arg[1].arg_type & A_MASK) == A_STAB) value = (double)do_aexec(st[1],arglast); else if (arglast[2] - arglast[1] != 1) *** toke.c Tue Sep 11 00:18:04 1990 --- /tmp/rsp/toke.c Mon Sep 24 15:19:23 1990 *************** *** 701,707 **** HFUN(O_EACH); if (strEQ(d,"exec")) { set_csh(); ! LOP(O_EXEC); } if (strEQ(d,"endhostent")) FUN0(O_EHOSTENT); --- 701,707 ---- HFUN(O_EACH); if (strEQ(d,"exec")) { set_csh(); ! LOP(O_EXEC_OP); } if (strEQ(d,"endhostent")) FUN0(O_EHOSTENT);