diff options
author | AdriĆ Arrufat <arrufat@users.noreply.github.com> | 2017-05-18 19:36:12 +0200 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2017-05-18 10:36:12 -0700 |
commit | f7d266cf19da089c660c9dd0cdd1444c0c90ba72 (patch) | |
tree | 2f9042737c05bdb168c1d394261d20cf1c74681c /tensorflow/c/generate-pc.sh | |
parent | eac1a7bade980426925cb79ccc14c7f738bd5528 (diff) |
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.
Diffstat (limited to 'tensorflow/c/generate-pc.sh')
-rwxr-xr-x | tensorflow/c/generate-pc.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tensorflow/c/generate-pc.sh b/tensorflow/c/generate-pc.sh index ea2eed011c..0aac0673b7 100755 --- a/tensorflow/c/generate-pc.sh +++ b/tensorflow/c/generate-pc.sh @@ -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 |