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
93 lines
2.5 KiB
5c5
|
|
< # Assumes that env variable CXX is set.
|
|
---
|
|
> # Assumes that env variables CXX and COCOA_EXTLIB_DIR are set.
|
|
12a13
|
|
> # Check environment variables CXX and COCOA_EXTLIB_DIR
|
|
15c16
|
|
< echo "$0: ERROR: environment variable CXX not set."
|
|
---
|
|
> echo "ERROR: $0: environment variable CXX not set."
|
|
18a20,36
|
|
> if [ -z "$COCOA_EXTLIB_DIR" ]
|
|
> then
|
|
> echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR not set."
|
|
> exit 1
|
|
> fi
|
|
>
|
|
> if [ \! "$COCOA_EXTLIB_DIR" -ef "/$COCOA_EXTLIB_DIR" ]
|
|
> then
|
|
> echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is not absolute: $COCOA_EXTLIB_DIR."
|
|
> exit 1
|
|
> fi
|
|
>
|
|
> if [ \! -d "$COCOA_EXTLIB_DIR" -o \! -d "$COCOA_EXTLIB_DIR/include" -o \! -d "$COCOA_EXTLIB_DIR/lib" ]
|
|
> then
|
|
> echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is implausible: $COCOA_EXTLIB_DIR."
|
|
> exit 1
|
|
> fi
|
|
20,25d37
|
|
< EXTLIBS=configuration/ExternalLibs
|
|
< # if [ \! -d configuration -o \! -d $EXTLIBS -o \! -d $EXTLIBS/include ]
|
|
< # then
|
|
< # echo "ERROR: $0 expects the $EXTLIBS/ subtree to exist"
|
|
< # exit 1
|
|
< # fi
|
|
28,31c40,49
|
|
< TMP_DIR=configuration/get-gmp-cxxflags-$UID@$HOSTNAME-$$
|
|
< /bin/rm -rf $TMP_DIR
|
|
< mkdir $TMP_DIR
|
|
< pushd $TMP_DIR >/dev/null
|
|
---
|
|
> TODAY=`date "+%Y-%m-%d"`
|
|
> TIME=`date "+%H:%M:%S"`
|
|
> TMP_DIR=/tmp/CoCoALib-config-$USER-$TODAY/gmp-cxx-flags-$TIME-$$
|
|
> /bin/rm -rf $TMP_DIR && mkdir -p $TMP_DIR
|
|
> if [ $? -ne 0 ]; then
|
|
> echo "ERROR: $0 failed to create temporary directory \"$TMP_DIR\""
|
|
> exit 1
|
|
> fi
|
|
>
|
|
> cd $TMP_DIR
|
|
42c60
|
|
< $CXX -I ../ExternalLibs/include prog.C -o prog 2> /dev/null
|
|
---
|
|
> $CXX -I "$COCOA_EXTLIB_DIR/include" prog.C -o prog 2> /dev/null
|
|
46,48c64,66
|
|
< # Deliberately leave $TMPDIR to assist debugging.
|
|
< echo "ERROR: $0 test program crashed! "
|
|
< exit 1
|
|
---
|
|
> # Deliberately leave $TMP_DIR to assist debugging.
|
|
> echo "ERROR: $0: test program crashed!"
|
|
> exit 1
|
|
50,51d67
|
|
< popd > /dev/null
|
|
< /bin/rm -rf $TMP_DIR
|
|
55c71
|
|
< CoCoALib_CXXFLAGS=
|
|
---
|
|
> COCOALIB_CXXFLAGS=
|
|
60c76
|
|
< CoCoALib_CXXFLAGS="$CoCoALib_CXXFLAGS $opt";;
|
|
---
|
|
> COCOALIB_CXXFLAGS="$COCOALIB_CXXFLAGS $opt";;
|
|
64c80,95
|
|
< echo $CoCoALib_CXXFLAGS
|
|
---
|
|
> #######################################################
|
|
> # Check that these GMP CXXFLAGS actually work (they may not if the gmp.h and libgmp.a
|
|
> # have been copied from another machine, e.g. installing via "brew" on MacOSX)
|
|
> # See redmine 975.
|
|
>
|
|
> $CXX $COCOALIB_CXXFLAGS -I "$COCOA_EXTLIB_DIR/include" prog.C -o prog 2> /dev/null
|
|
> if [ $? -ne 0 ]
|
|
> then
|
|
> COCOALIB_CXXFLAGS=""
|
|
> fi
|
|
>
|
|
> # Clean up TMP_DIR
|
|
> cd # Leave TMP_DIR
|
|
> /bin/rm -rf $TMP_DIR
|
|
>
|
|
> echo $COCOALIB_CXXFLAGS
|