Index: app/src/compiledic/compiledic
===================================================================
--- app/src/compiledic/compiledic	(revision 389de9abcbd0bbec63c04912b2d253b58dc5145c)
+++ app/src/compiledic/compiledic	(revision c8e8fa8b5847f1531da80c5fbfce80f990b1b4c5)
@@ -14,44 +14,95 @@
 use Getopt::Long;
 
-my $systemconfigfile='';
+
+my $linesPerFile = 20000;
+
+
+my $systemconfigfile='/usr/local/etc/utt/compiledic.conf';
 my $userconfigfile=home()."/.utt/compiledic.conf";
 
 Getopt::Long::Configure('no_ignore_case_always');
 
-$symfile='~/.utt/pl/pl_PL.iso-8859-2.sym';
-$symfilenoext = $symfile;
-$symfilenoext =~ s/\.sym$//;
-$labfile = $symfilenoext . '.lab';
-$sclfile = $symfilenoext . '.scl';
+#my $symfile='~/.utt/pl/pl_PL.iso-8859-2.sym';
+my $symbols=0;
+my $help=0;
+
+
+
+#read configuration files###########################
+my $file;
+foreach $file ($systemconfigfile, $userconfigfile){
+  if(open(CONFIG, $file)){
+  	while (<CONFIG>) {
+  		chomp;                  
+      		s/#.*//;                
+	      	s/^\s+//;               
+      		s/\s+$//;               
+    		next unless length;     
+    		my ($name, $value) = split(/\s*=\s*/, $_, 2);
+    		if($name eq "symbols"){
+			$symbols=$value;
+    		}
+   		elsif(($name eq "help")or($name eq "h")){
+			$help=1;
+    		}
+    	
+	} 
+  	close CONFIG;
+  }
+}
+#########################################################
+
+
+GetOptions("symbols=s" => \$symbols,
+	   "help|h" => \$help);
+
+if($help)
+{
+    print <<'END'
+Usage: compiledic [OPTIONS] dictionaryfile
+
+Options:
+   --help -h                      Help.
+   --symbols=FILE                 Symbol file.
+END
+;
+    exit 0;
+}
+
+
 
 ##################################################
-$linesPerFile = 20000;
-
-if (@ARGV < 1) {
-    print "usage: ", basename($0), " dictionary_file\n";
-    exit;
-}
-
-my $file = shift; # @ARGV;
-my $filenameprefix;
-
-if ($file =~ /(.*)\.dic/)
-{
-    $filenameprefix = $1;
-}
-else
-{
-    print "The input file must have .dic extension.";
-    exit(1);
-}
-
-# Przygotowanie etykiet
-
-#`makeLabels.pl > labels.sym`;
-
-`lexmakelab $symfilenoext`;
+
+-f $symbols or die("Symbol file not found.");
+
+@ARGV < 1   or die("Source dictionary not given.");
+
+my $file = shift;
+
+-f $file or die("Source dictionary not found.");
+
+$file =~ /(.*)\.dic/ or die("The input file must have .dic extension.");
+
+my $filenameprefix = $1;
+
+##################################################
 
 # Tworzymy katalog tymczasowy, gdzie wszystko bedzie umieszczane.
 $tmp_root = tempdir( CLEANUP => 1 );
+
+print "TMPROOT: $tmp_root\n";
+
+
+(undef, my $symfile) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sym" );
+my $symfilenoext=$symfile;
+$symfilenoext =~ s/\.sym$//;
+my $labfile = $symfilenoext . '.lab';
+my $sclfile = $symfilenoext . '.scl';
+
+copy($symbols, $symfile);
+
+# Przygotowanie etykiet
+
+`lexmakelab $symfilenoext`;
 
 
