On 01/09/20 10:50, Roman Bolshakov wrote: > macOS is shipped with an old non-enhanced version of getopt and it > doesn't support options used by run_tests.sh. Proper version of getopt > is available from homebrew but it has to be added to PATH before invoking > run_tests.sh. It's not convenient because it has to be done in each > shell instance and there could be many if a multiplexor is used. > > The change provides a way to override getopt and halts ./configure if > enhanced getopt can't be found. > > Cc: Cameron Esfahani <dirty@xxxxxxxxx> > Signed-off-by: Roman Bolshakov <r.bolshakov@xxxxxxxxx> I don't like the extra option very much, generally people are just expected to stick homebrew in their path somehow. Reporting a better error is a good idea though, what about this: diff --git a/configure b/configure index 4eb504f..3293634 100755 --- a/configure +++ b/configure @@ -167,6 +167,13 @@ EOF rm -f lib-test.{o,S} fi +# require enhanced getopt +getopt -T > /dev/null +if [ $? -ne 4 ]; then + echo "Enhanced getopt is not available, add it to your PATH?" + exit 1 +fi + # Are we in a separate build tree? If so, link the Makefile # and shared stuff so that 'make' and run_tests.sh work. if test ! -e Makefile; then diff --git a/run_tests.sh b/run_tests.sh index 01e36dc..70d012c 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -34,6 +34,13 @@ EOF RUNTIME_arch_run="./$TEST_DIR/run" source scripts/runtime.bash +# require enhanced getopt +getopt -T > /dev/null +if [ $? -ne 4 ]; then + echo "Enhanced getopt is not available, add it to your PATH?" + exit 1 +fi + only_tests="" args=`getopt -u -o ag:htj:v -l all,group:,help,tap13,parallel:,verbose -- $*` [ $? -ne 0 ] && exit 2; Paolo