fix a bug in generate-pc.sh (#10008)

* add pkg-config generation script

* add suggestions from asimshankar to generate-pc.sh

* generate-pc: fix bug and robustify

The script was unable to genereate the pkgconfig file even with the
correct options.
Also, now it forces user to pass a version in order to continue.
This commit is contained in:
Adrià Arrufat 2017-05-18 19:36:12 +02:00 committed by Rasmus Munk Larsen
parent eac1a7bade
commit f7d266cf19

View File

@ -9,6 +9,8 @@ usage() {
echo -e "-h, --help\tdisplay this message"
}
[ $# == 0 ] && usage && exit 0
# read the options
ARGS=`getopt -o p:v:h --long prefix:,version:,help -n $0 -- "$@"`
eval set -- "$ARGS"
@ -27,11 +29,13 @@ while true ; do
"") shift 2 ;;
*) TF_VERSION=$2 ; shift 2 ;;
esac ;;
--) shift ; echo "Try '$0 --help' for more information."; exit 1 ;;
--) shift ; break ;;
*) echo "Internal error! Try '$0 --help' for more information." ; exit 1 ;;
esac
done
[ -z $TF_VERSION ] && echo "Specify a version using -v or --version" && exit 1
echo "Generating pkgconfig file for TensorFlow $TF_VERSION in $TF_PREFIX"
cat << EOF > tensorflow.pc