File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ DISTCLEANFILES = sysconfdir.h \
49
49
sysconfdir.h : Makefile
50
50
echo ' #define FREETDS_SYSCONFDIR "$(sysconfdir)"' > $@
51
51
52
- all-am : sysconfdir.h
52
+ all-am : sysconfdir.h odbc_attributes_sorted
53
53
54
54
GENERATED_HEADER_FILES = encodings.h charset_lookup.h
55
55
EXTRA_DIST = $(GENERATED_HEADER_FILES )
@@ -65,4 +65,11 @@ charset_lookup.h: encodings.h
65
65
encodings.h : encodings.pl alternative_character_sets.h character_sets.h Makefile
66
66
perl $(srcdir ) /encodings.pl $(srcdir ) $(GPERF ) > $@ .tmp 2> /dev/null
67
67
mv $@ .tmp $@
68
+
69
+ odbc_attributes_sorted : odbc_attributes.pl odbc.h Makefile
70
+ perl $(srcdir ) /odbc_attributes.pl $(srcdir )
71
+ touch $@
72
+ else
73
+ odbc_attributes_sorted : odbc.h Makefile
74
+ touch $@
68
75
endif
Original file line number Diff line number Diff line change
1
+ # !/usr/bin/perl
2
+ # # This file is in the public domain.
3
+ use strict;
4
+ use File::Basename;
5
+
6
+ my $basename = basename($0 );
7
+ my $srcdir = " $ARGV [0]/" ;
8
+
9
+ # check list of attributes is alphabetically sorted
10
+ my $filename = " ${srcdir} odbc.h" ;
11
+ my $prev = ' ' ;
12
+ open ODBC, $filename or die qq( $basename : could not open "$filename "\n ) ;
13
+ while (<ODBC>){
14
+ next unless / ^\s ODBC_PARAM\( (.*?)\) / ;
15
+ my $attr = $1 ;
16
+ die " $attr following $prev " if lc ($attr ) le lc ($prev );
17
+ $prev = $attr ;
18
+ }
19
+ close ODBC;
You can’t perform that action at this time.
0 commit comments