initialize_view 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #!/bin/ksh
  2. #
  3. # initialize_view
  4. #
  5. ########################################################################
  6. PROG_NAME=$0
  7. X_TOP=/proj/x11/xc
  8. MOTIF_TOP=/proj/motif
  9. CDE_TOP=/proj/cde
  10. CDE_TEST_TOP=/proj/cde-test
  11. VERBOSE=""
  12. DEBUG=""
  13. usage ()
  14. {
  15. print -u1 "USAGE: $1"
  16. print -u1 "\t[-v | -verbose] # Turn on tracing"
  17. print -u1 "\t[-d | -debug] # Print commands but do NOT execute them"
  18. }
  19. while [ $# -gt 0 ]; do
  20. case $1 in
  21. -v | -verbose) VERBOSE="True"; shift 1 ;;
  22. -d | -debug) DEBUG="echo"; shift 1 ;;
  23. -h | -? | -help) usage $PROG_NAME
  24. shift 1
  25. exit 1 ;;
  26. esac
  27. done
  28. if [ "True" = "$VERBOSE" ]; then
  29. set -x
  30. fi
  31. #
  32. # Motif
  33. #
  34. $DEBUG cd $MOTIF_TOP
  35. if [ ! -d exports ]; then
  36. $DEBUG mkdir exports
  37. $DEBUG chmod 777 exports
  38. fi
  39. if [ ! -d imports ]; then
  40. $DEBUG mkdir imports
  41. $DEBUG chmod 777 imports
  42. fi
  43. $DEBUG cd imports
  44. if [ ! -L x11 ]; then
  45. $DEBUG ln -s ../../x11/xc/exports x11
  46. fi
  47. #
  48. # CDE
  49. #
  50. $DEBUG cd $CDE_TOP
  51. if [ ! -d exports ]; then
  52. $DEBUG mkdir exports
  53. $DEBUG chmod 777 exports
  54. fi
  55. if [ ! -d imports ]; then
  56. $DEBUG mkdir imports
  57. $DEBUG chmod 777 imports
  58. fi
  59. $DEBUG cd imports
  60. if [ ! -L x11 ]; then
  61. $DEBUG ln -s ../../motif/imports/x11 x11
  62. fi
  63. if [ ! -L motif ]; then
  64. $DEBUG ln -s ../../motif/exports motif
  65. fi
  66. #
  67. # CDE test build config links
  68. #
  69. if [ -d $CDE_TEST_TOP/config ]; then
  70. $DEBUG cd $CDE_TEST_TOP/config
  71. if [ ! -L OSVersion.tmpl ] || [ ! -L localtree.tmpl ]; then
  72. case "`uname -s`" in
  73. HP-UX) if [ ! -L OSVersion.tmpl ]; then
  74. $DEBUG ln -s OSVersiontemplates/10.20 OSVersion.tmpl
  75. fi
  76. if [ ! -L localtree.tmpl ]; then
  77. $DEBUG ln -s localtemplates/hpux/10.20/optimized.shared localtree.tmpl
  78. fi
  79. ;;
  80. OSF1) if [ ! -L OSVersion.tmpl ]; then
  81. $DEBUG ln -s OSVersiontemplates/4.0 OSVersion.tmpl
  82. fi
  83. if [ ! -L localtree.tmpl ]; then
  84. $DEBUG ln -s localtemplates/dec/alpha/osf/optimized.sharedlibs localtree.tmpl
  85. fi
  86. ;;
  87. AIX) if [ ! -L OSVersion.tmpl ]; then
  88. $DEBUG ln -s OSVersiontemplates/4.2 OSVersion.tmpl
  89. fi
  90. if [ ! -L localtree.tmpl ]; then
  91. $DEBUG ln -s localtemplates/ibm/rs6000/aix4.2/optimized.sharedlibs localtree.tmpl
  92. fi
  93. ;;
  94. SunOS) if [ ! -L OSVersion.tmpl ]; then
  95. $DEBUG ln -s OSVersiontemplates/5.4 OSVersion.tmpl
  96. fi
  97. if [ ! -L localtree.tmpl ]; then
  98. $DEBUG ln -s localtemplates/sun/optimized.sharedlibs localtree.tmpl
  99. fi
  100. ;;
  101. UNIX_SV) if [ ! -L OSVersion.tmpl ]; then
  102. $DEBUG ln -s OSVersiontemplates/4.2 OSVersion.tmpl
  103. fi
  104. if [ ! -L localtree.tmpl ]; then
  105. $DEBUG ln -s localtemplates/sun/optimized.sharedlibs localtree.tmpl
  106. fi
  107. ;;
  108. *) $DEBUG print -u1 "$PROG_NAME: Test build config links not set up for this architecture"
  109. ;;
  110. esac
  111. fi
  112. else
  113. $DEBUG print -u2 "$PROG_NAME: CDE test config directory $CDE_TEST_TOP/config does not exist!"
  114. $DEBUG exit 1
  115. fi
  116. exit 0