From 14e212406c00de0e7e1ba7445fc9f31c54d22acc Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Wed, 10 Oct 2018 16:12:24 +1000 Subject: [PATCH] Fix Issue #195 - need to sort extensions by name, rather than path --- auto/Makefile | 2 +- auto/bin/make_enable_index.pl | 5 +++-- auto/bin/make_index.pl | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/auto/Makefile b/auto/Makefile index c363d5a..3efc5de 100644 --- a/auto/Makefile +++ b/auto/Makefile @@ -193,7 +193,7 @@ $(S.DEST)/glew.c: $(EXT)/.dummy $(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@ echo -e "\nstatic const char * _glewExtensionLookup[] = {" >> $@; $(BIN)/make_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ - echo -e " NULL\n};\n" >> $@; + echo -e " NULL\n};\n\n" >> $@; $(BIN)/make_enable_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ $(BIN)/make_initd.pl GL $(GL_CORE_SPEC) >> $@ $(BIN)/make_initd.pl GL $(GL_EXT_SPEC) >> $@ diff --git a/auto/bin/make_enable_index.pl b/auto/bin/make_enable_index.pl index b5f7261..c9114cd 100755 --- a/auto/bin/make_enable_index.pl +++ b/auto/bin/make_enable_index.pl @@ -9,6 +9,7 @@ use strict; use warnings; +use File::Basename; use lib '.'; do 'bin/make.pl'; @@ -29,7 +30,7 @@ if (@ARGV) print "/* Detected via extension string or experimental mode */\n"; print "static GLboolean* _glewExtensionEnabled[] = {\n";; - foreach my $ext (sort @extlist) + foreach my $ext (sort { basename($a) cmp basename($b) } @extlist) { my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext); @@ -42,5 +43,5 @@ if (@ARGV) print "#endif\n"; } - print " NULL\n};\n"; + print " NULL\n};\n\n"; } diff --git a/auto/bin/make_index.pl b/auto/bin/make_index.pl index 1d2b5d4..3f24258 100755 --- a/auto/bin/make_index.pl +++ b/auto/bin/make_index.pl @@ -9,6 +9,7 @@ use strict; use warnings; +use File::Basename; use lib '.'; do 'bin/make.pl'; @@ -27,7 +28,7 @@ if (@ARGV) { @extlist = @ARGV; - foreach my $ext (sort @extlist) + foreach my $ext (sort { basename($a) cmp basename($b) } @extlist) { my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);