diff --git a/contrib/tsearch/makedict/makedict.pl b/contrib/tsearch/makedict/makedict.pl
index 65c8af3bd2b2eb194ee240403527c03b9426e256..34e77cb95b2148ed4155ed94bd8286a976f02e08 100755
--- a/contrib/tsearch/makedict/makedict.pl
+++ b/contrib/tsearch/makedict/makedict.pl
@@ -4,7 +4,7 @@ use Getopt::Std;
 use locale;
 
 my %opt; 
-getopts('l:he:s:ap:om:f', \%opt);
+getopts('l:he:s:ap:o:m:f', \%opt);
 
 if ( $opt{h} || ! ($opt{e}||$opt{s}) || !$opt{l} ) {
 	print<<EOT;
@@ -94,6 +94,8 @@ print {$fh} <<EOT;
  */
 
 #ifdef DICT_BODY
+#include <ctype.h>
+
 typedef struct {
 	uint8	val;
 	uint8	flag;