tt_ld.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Shell script for linking C++ ToolTalk routines. We have
  2. # %% (c) Copyright 1993, 1994 Hewlett-Packard Company
  3. # %% (c) Copyright 1993, 1994 International Business Machines Corp.
  4. # %% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  5. # %% (c) Copyright 1993, 1994 Novell, Inc.
  6. # %% $XConsortium: tt_ld.sh /main/4 1995/10/20 16:23:10 rswiston $
  7. # to do this "by hand" to get all the compiler libraries included
  8. # just once, with libC static and libc and libm dynamic.
  9. # Calling sequence
  10. # tt_ld $(CCLIBDIR) $@ $(LDFLAGS) -- $(OBJECT_FILES) $(TT_LIBS) $(TT_AUX_LIBS)
  11. #
  12. CCLIBDIR=$1; shift
  13. BINARY=$1; shift
  14. LDFLAGS=""
  15. while test "$1" != "--"
  16. do LDFLAGS="$LDFLAGS $1"
  17. shift
  18. done
  19. shift
  20. if test "$TARGET_SYS" = "SVR4";
  21. then
  22. echo $0 is not used for SVR4 based systems. Check your Makefiles and
  23. echo environment variables.
  24. exit 1
  25. else
  26. if test "$PROF" = "gprof";
  27. then
  28. if ld -dc -dp -e start -X $LDFLAGS -Bstatic -o $BINARY \
  29. $CCLIBDIR/gcrt0.o $CCLIBDIR/cg87/_crt1.o \
  30. -L$CCLIBDIR/cg87 -L$CCLIBDIR \
  31. $* \
  32. -Bstatic -lX11 -lC -lc_p -lm >/tmp/ld.$$.4.err 2>&1
  33. then $CCLIBDIR/c++filt </tmp/ld.$$.4.err
  34. rm -f /tmp/ld.$$.4.err
  35. $CCLIBDIR/patch $BINARY
  36. exit 0
  37. else $CCLIBDIR/c++filt </tmp/ld.$$.4.err
  38. rm -f /tmp/ld.$$.4.err
  39. exit 1
  40. fi
  41. else
  42. if ld -dc -dp -e start -X $LDFLAGS -o $BINARY \
  43. $CCLIBDIR/crt0.o $CCLIBDIR/cg87/_crt1.o \
  44. -L$CCLIBDIR/cg87 -L$CCLIBDIR \
  45. $* \
  46. -Bstatic -lC -Bdynamic -lc -lm >/tmp/ld.$$.4.err 2>&1
  47. then $CCLIBDIR/c++filt </tmp/ld.$$.4.err
  48. rm -f /tmp/ld.$$.4.err
  49. $CCLIBDIR/patch $BINARY
  50. exit 0
  51. else $CCLIBDIR/c++filt </tmp/ld.$$.4.err
  52. rm -f /tmp/ld.$$.4.err
  53. exit 1
  54. fi
  55. fi
  56. fi