You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.5 KiB

2 months ago
  1. 5c5
  2. < # Assumes that env variable CXX is set.
  3. ---
  4. > # Assumes that env variables CXX and COCOA_EXTLIB_DIR are set.
  5. 12a13
  6. > # Check environment variables CXX and COCOA_EXTLIB_DIR
  7. 15c16
  8. < echo "$0: ERROR: environment variable CXX not set."
  9. ---
  10. > echo "ERROR: $0: environment variable CXX not set."
  11. 18a20,36
  12. > if [ -z "$COCOA_EXTLIB_DIR" ]
  13. > then
  14. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR not set."
  15. > exit 1
  16. > fi
  17. >
  18. > if [ \! "$COCOA_EXTLIB_DIR" -ef "/$COCOA_EXTLIB_DIR" ]
  19. > then
  20. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is not absolute: $COCOA_EXTLIB_DIR."
  21. > exit 1
  22. > fi
  23. >
  24. > if [ \! -d "$COCOA_EXTLIB_DIR" -o \! -d "$COCOA_EXTLIB_DIR/include" -o \! -d "$COCOA_EXTLIB_DIR/lib" ]
  25. > then
  26. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is implausible: $COCOA_EXTLIB_DIR."
  27. > exit 1
  28. > fi
  29. 20,25d37
  30. < EXTLIBS=configuration/ExternalLibs
  31. < # if [ \! -d configuration -o \! -d $EXTLIBS -o \! -d $EXTLIBS/include ]
  32. < # then
  33. < # echo "ERROR: $0 expects the $EXTLIBS/ subtree to exist"
  34. < # exit 1
  35. < # fi
  36. 28,31c40,49
  37. < TMP_DIR=configuration/get-gmp-cxxflags-$UID@$HOSTNAME-$$
  38. < /bin/rm -rf $TMP_DIR
  39. < mkdir $TMP_DIR
  40. < pushd $TMP_DIR >/dev/null
  41. ---
  42. > TODAY=`date "+%Y-%m-%d"`
  43. > TIME=`date "+%H:%M:%S"`
  44. > TMP_DIR=/tmp/CoCoALib-config-$USER-$TODAY/gmp-cxx-flags-$TIME-$$
  45. > /bin/rm -rf $TMP_DIR && mkdir -p $TMP_DIR
  46. > if [ $? -ne 0 ]; then
  47. > echo "ERROR: $0 failed to create temporary directory \"$TMP_DIR\""
  48. > exit 1
  49. > fi
  50. >
  51. > cd $TMP_DIR
  52. 42c60
  53. < $CXX -I ../ExternalLibs/include prog.C -o prog 2> /dev/null
  54. ---
  55. > $CXX -I "$COCOA_EXTLIB_DIR/include" prog.C -o prog 2> /dev/null
  56. 46,48c64,66
  57. < # Deliberately leave $TMPDIR to assist debugging.
  58. < echo "ERROR: $0 test program crashed! "
  59. < exit 1
  60. ---
  61. > # Deliberately leave $TMP_DIR to assist debugging.
  62. > echo "ERROR: $0: test program crashed!"
  63. > exit 1
  64. 50,51d67
  65. < popd > /dev/null
  66. < /bin/rm -rf $TMP_DIR
  67. 55c71
  68. < CoCoALib_CXXFLAGS=
  69. ---
  70. > COCOALIB_CXXFLAGS=
  71. 60c76
  72. < CoCoALib_CXXFLAGS="$CoCoALib_CXXFLAGS $opt";;
  73. ---
  74. > COCOALIB_CXXFLAGS="$COCOALIB_CXXFLAGS $opt";;
  75. 64c80,95
  76. < echo $CoCoALib_CXXFLAGS
  77. ---
  78. > #######################################################
  79. > # Check that these GMP CXXFLAGS actually work (they may not if the gmp.h and libgmp.a
  80. > # have been copied from another machine, e.g. installing via "brew" on MacOSX)
  81. > # See redmine 975.
  82. >
  83. > $CXX $COCOALIB_CXXFLAGS -I "$COCOA_EXTLIB_DIR/include" prog.C -o prog 2> /dev/null
  84. > if [ $? -ne 0 ]
  85. > then
  86. > COCOALIB_CXXFLAGS=""
  87. > fi
  88. >
  89. > # Clean up TMP_DIR
  90. > cd # Leave TMP_DIR
  91. > /bin/rm -rf $TMP_DIR
  92. >
  93. > echo $COCOALIB_CXXFLAGS