[scponly] scponly on AIX

Frank Fegert fra.nospam.nk at gmx.de
Wed Nov 17 07:41:06 EST 2010


Hello Kaleb,

On Tue, Nov 16, 2010 at 06:52:33AM -0800, Kaleb Pederson wrote:
> I've actually just made such a change in scponly but haven't yet had the
> opportunity to test it on AIX so I'd be very interested in seeing your patch
> so I can compare. Also, it would be wonderful if you could test my final
> patch as I no longer have an AIX machine to test on.

i'd be glad to help out and/or test on the AIX end of things! Please
see the attached patch file. Beware that all in all it's a very crude
hack, since getting it to work at all and on time were the primary
objectives ;-) Thus i simply used getopt and its dependencies from
the NetBSD sources, tweaked a little and stuck them into a ./extlib/
directory within my RPM build directory for scponly:
    extlib/
    extlib/getopt
    extlib/getopt/ansi.h
    extlib/getopt/assert.h
    extlib/getopt/cdefs.h
    extlib/getopt/cdefs_aout.h
    extlib/getopt/getopt.c
    extlib/getopt/getopt.h
    extlib/getopt/getopt_long.c
    extlib/getopt/getprogname.c
    extlib/getopt/int_types.h
    extlib/getopt/setprogname.c
    extlib/getopt/vwarnx.c
    extlib/getopt/warnx.c

The needed objects are manually build in the RPM spec file before the
configure macro for scponly:
    ...
    CC=cc; export CC
    CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -I/opt/freeware/include"; export CFLAGS
    ...
    OWD=`pwd`; cd extlib/getopt/
    ${CC} ${CFLAGS} -I. -I. -o getopt.o -c getopt.c
    ${CC} ${CFLAGS} -I. -I. -o getopt_long.o -c getopt_long.c
    ${CC} ${CFLAGS} -I. -I. -o getprogname.o -c getprogname.c
    ${CC} ${CFLAGS} -I. -I. -o setprogname.o -c setprogname.c
    ${CC} ${CFLAGS} -I. -I. -o warnx.o -c warnx.c
    ${CC} ${CFLAGS} -I. -I. -o vwarnx.o -c vwarnx.c
    cd ${OWD}
    
    %configure \
       ...

Also the stock scponly manpage doesn't go well with the AIX nroff, so
i'm packaging the alternate manpage in my RPM:
    mv scponly.8 scponly.8.broken
    cp scponly.8.alternate_manpage scponly.8

I think - except for the missing getopt_long - all the changes could
be handled properly by just extending the autoconf checks. As for the
getopt_long, which is missing on AIX and other not-so-GNU-OSes, there
are several options (bundle from external source, reimplement within
scponly, rewrite scponly to not use getopt_long).

Best regards,

    Frank

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scponly.patch
Type: text/x-diff
Size: 2847 bytes
Desc: not available
Url : http://lists.ccs.neu.edu/pipermail/scponly/attachments/20101117/698b3a99/attachment.patch 


More information about the scponly mailing list