[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Mar 19 18:14:20 2001 
Subject:rebuilding Poplog on AIX ... 
From:bsl 
Volume-ID:1010319.02 

I am trying to rebuild Poplog v15.53 on AIX/PowerPC release 3.  However I am
having some problems ...

mklibpop fails recompiling c_core.c.  I have forgotten all the C I ever knew
(not a lot), so I am at a loss as to why the compilation of c_core.c fails.

  hurst:(48$) ./mklibpop
  c_core.c:1792: conflicting types for `htonl'
  /usr/include/netinet/in.h:274: previous declaration of `htonl'
  c_core.c:1794: conflicting types for `ntohl'
  /usr/include/netinet/in.h:273: previous declaration of `ntohl'

htonl and ntohl are defined in in.h in /usr/include/netinet as follows:

  *
   * UNIX 98 says thiese should be available here, in addition to in arpa/inet.h.
   */
  #if (_XOPEN_SOURCE == 500)
  
  #ifdef  _NO_PROTO
  
  #ifndef htonl
  uint16_t ntohs(), htons();
  uint32_t  ntohl(), htonl();
  #endif
  
  #else   /* POSIX required prototypes */
  
  #ifndef htonl
  uint16_t ntohs(uint16_t);
  uint16_t htons(uint16_t);
  uint32_t ntohl(uint32_t);
  uint32_t htonl(uint32_t);
  #endif
  
  #endif /* _NO_PROTO */
  #endif /* _XOPEN_SOURCE == 500 */

and the types uint32_t and uint16_t are unsigned 32 and 16 bit ints
respectively.

c_core.c contains the following:

  #if defined(__hpux) || defined(AIX)
  /* These are macros in hpux/AIX */
  #ifdef htonl
  #undef htonl
  #undef htons
  #undef ntohl
  #undef ntohs
  #endif
  unsigned long  htonl(h) unsigned long  h; { return(h); }
  unsigned short htons(h) unsigned short h; { return(h); }
  unsigned long  ntohl(n) unsigned long  n; { return(n); }
  unsigned short ntohs(n) unsigned short n; { return(n); }
  
  #ifdef AIX
  /* This is needed in crummy AIX because the procedures above are not
   * referenced in poplog itself, and "ld" isn't exporting the procedure
   * descriptor symbols for these in the image symbol table (this ought to
   * fixed by the -bnogc option, but that seems to be buggy).
   * This procedure is never actually called.
   */
  __pop_socket_stuff_dummy(dum)
  int *dum;
    {
          dum[0] = (int) pop_call_in_addr_arg;
          dum[1] = (int) pop_call_in_addr_res;
          dum[2] = (int) htonl;
          dum[3] = (int) htons;
          dum[4] = (int) ntohl;
          dum[5] = (int) ntohs;
    }
  #endif
  
  #endif  /* defined(__hpux) || defined(AIX) */

As far as I can see, this should undefine htonl and ntohl and then redefine
them as required by poplog, so there should be no previous declaration
warnings.  I can't remember the definitions of C basic types, but I suspect
that a long nowadays is probably 64 bits, which would be a problem if the
definitions of htonl and ntohl weren't being undef'd.  I tried commenting
this stuff out, but that gave me an "unbalanced #endif" error (I can't
remember the rules for comments and C pre-processor statements), so I
deleted it from c_core.h.  Now I get a libpop.a ...

I then tried newpop again, but it fails linking against the Motif libraries.

  hurst:(69$) $popsrc/newpop -link -x=-xm -norsv
  Sussex Poplog Version 15.53
  NEWPOP started on Tue Feb 27 11:40:51 GMT 2001
  system = power
  usepop = /usr/local/poplog/v15.52
  popsys = /usr/local/poplog/v15.52/pop/pop
  popsrc = /usr/local/poplog/v15.52/pop/src
  Reading options file: /usr/local/poplog/v15.52/pop/src/newpop_options
  Linking newpop11 ...
  === Running: ./pglink -xm -map
  Moving newpop11 to basepop11 ...
  !!! Warning - existing version of basepop11 in popsys saved as oldpop11
  Making the Poplog Widget Set ...
  === Running: $popcom/mkXpw
  === Running: $popcom/mkstartup
  ;;; MAKING IMAGE /usr/local/poplog/v15.52/pop/lib/psv/startup.psv
  ;;; LOADING LIB startup
  ;;; Loading Sussex XVed (Version 4.0 (motif))
  
  ;;; Source directories: $usepop/pop/x/ved/src/
  ;;; LOADING $usepop/pop/x/ved/src/xveddeclare.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedgeneral.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedarglist.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedkeysymseq.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedscreen.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedinput.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedhandlers.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedclipboard.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedselections.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedbutton.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedkey.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedbitmaps.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedwm.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedvedtraps.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedwindows.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedresources.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedsetup.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedscrollbar.p
  ;;; LOADING $usepop/pop/x/ved/src/xvedmenubar.p
  ;;; LOADING $usepop/pop/x/ved/src/xveddialogs.p
  
  ;;; Loaded XVed, Time = 12.75 seconds
  ;;; Warning: can't open shared object /usr/lib/libXm.a(shr.o) ( 0509-022
  ;;;     Cannot load module /usr/lib/libXm.a(shr.o).
  ;;;     0509-152   Member shr.o is not found in archive )
  ;;; Warning: can't open shared object /usr/lib/libXt.a(shr.o) ( 0509-022
  ;;;     Cannot load module /usr/lib/libXt.a(shr.o).
  ;;;     0509-152   Member shr.o is not found in archive )
  ;;; Warning: can't open shared object /usr/lib/libX11.a(shr.o) (        0509-0
  ;;;     22 Cannot load module /usr/lib/libX11.a(shr.o).
  ;;;     0509-152   Member shr.o is not found in archive )
  Linked basepop11 to pop11
  Linked basepop11 to prolog
  Linked basepop11 to clisp
  Linked basepop11 to pml
  Linked basepop11 to xved
  Linked basepop11 to ved
  Linked basepop11 to help
  Linked basepop11 to ref
  Linked basepop11 to teach
  Linked basepop11 to doc
  Linked basepop11 to im

and so on.  As far as I can see, the Xt and Xm libraries are there--they are 
symbolic links to 

  hurst:(106$) ll /usr/lib/libXm.a
  lrwxrwxrwx   1 bin      bin           36 31 Jan 2000  /usr/lib/libXm.a@ -> /usr/lpp/X11/lib/R6/Motif2.1/libXm.a

and

  hurst:(109$) ll /usr/lib/libXt.a 
  lrwxrwxrwx   1 bin      bin           27 31 Jan 2000  /usr/lib/libXt.a@ -> /usr/lpp/X11/lib/R6/libXt.a

but I don't understand why it's trying to statically link the libraries or
even if it does, why it can't find them ...

If anyone has any suggestions as to what might be going wrong or how to
proceed, I would be grateful.

Thanks


-- Brian

  Brian Logan,  School of Computer Science & IT, University of Nottingham
 Email: bsl@cs.nott.ac.uk,  Phone: +44 115 846 6509, Fax: +44 115 951 4254