Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 1996 18:26:31 -0600 (CST)
From:      Dave Bodenstab <imdave@synet.net>
To:        freebsd-questions@freebsd.org
Subject:   Net access to motif? Is this a goofy idea or what?
Message-ID:  <199612040026.SAA12232@base486.synet.net>

next in thread | raw e-mail | index | archive | help

I noticed that someone else brought up the question of linking motif
applications without having to buy motif...  Unfortunately, lesstif is
not yet near enough to completion.  I am not really interested as a
developer in using motif -- I just want to link various public software
packages to create static binaries -- so it's not worth the money (at least
for now) to buy the libraries.  But I, too, would like to link using the
motif libraries.  Let me float this idea...

Wouldn't it be neat if there were some way to do a static link of the
objects referencing a copy of the motif libraries without actually
having the motif libraries?  Of course, if I could reference the
libraries over the Internet, I could just steal them -- and that would
be bad.  However, since static binaries seem to be OK to distribute,
then the problem becomes how to do the link without having the libraries
directly accessible.

If I were to put the objects and libraries I need (including my local
version of libc, etc.) in a directory that is mountable via NFS, and put
together a file (named "OBJECTS", say) listing the objects and libraries
needed for the link such as:

  OBJECTS:  obj1.o obj2.o ... -L. -lmylib1 ... -lXm ...	
  
(for C++ use "OBJECTS++") then someone having the motif libraries
could issue the commands:

  mount -t nfs myhostname:mypath /mnt/mr_nice_guy
  cd /mnt/mr_nice_guy
  /bin/test -f crt0.o || /bin/cp /usr/lib/crt0.o .
  /bin/test -f libgcc.a || /bin/cp /usr/lib/libgcc.a .
  /usr/bin/ld -e start -dc -dp -Bstatic crt0.o -L<motifpath> `/bin/cat OBJECTS` \
  	libgcc.a -lc libgcc.a >MR_NICE_GUY.log 2>&1
  cd /
  umount /mnt/mr_nice_guy

(add -lg++ if "OBJECTS++" were found instead of "OBJECTS") and
POOF! I'd have my static binary!  Even better would be the ability
to fill in a form on a WEB page with my machine's hostname and the
path for the NFS-mountable directory and just click `submit'.  I
think this is secure... I can't think of a way for me to embed
a command that would be executed (and thus either stealing the
libraries or doing something nasty.)  The "ld" program needs to
be run instead of using "cc" so that I couldn't embed a -B./ option
and provide a counterfeit "ld" command...  [I used "cc -v" to see how
the linker was being run in order to come up with the above "ld" command]

I don't know if this would violate the licensing terms of the motif
libraries, but it seems that it would prevent outright theft.  I'm also
assuming that the lesstif versions of the motif header files are
compatible enough to allow me to do the actual compiles to create the
object files -- doing the link is nice enough, I wouldn't expect someone
to turn their machine into a public development machine.

Cool idea, right?  ;-)  Am I nuts, or could this work?  Could this be
used to let folks build static motif binaries for FreeBSD packages?  


Dave Bodenstab
imdave@synet.net

PS.  I, of course, don't have the motif libraries or the machine with
the net access to host such a service :-(  I would be one of the first
to use such a service, though...  I'd like to try out:

  ftp://sunsite.unc.edu/pub/Linux/apps/financial/xfinans-5.9.tar.gz
  ftp://ftp.x.org/contrib/applications/xinvest-2.2.tar.gz





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612040026.SAA12232>