configure 16.6 KB
Newer Older
Dimitri van Heesch's avatar
Dimitri van Heesch committed
1
#!/bin/sh
2 3 4
#
# $Id$
#
5
# Copyright (C) 1997-2008 by Dimitri van Heesch.
6 7 8 9 10 11 12
# 
# Permission to use, copy, modify, and distribute this software and its
# documentation under the terms of the GNU General Public License is hereby 
# granted. No representations are made about the suitability of this software 
# for any purpose. It is provided "as is" without express or implied warranty.
# See the GNU General Public License for more details.
# 
Dimitri van Heesch's avatar
Dimitri van Heesch committed
13 14
# Documents produced by Doxygen are derivative works derived from the
# input used in their production; they are not affected by this license.
15 16 17
# 
# shell script to configure doxygen

18
doxygen_version_major=1
Dimitri van Heesch's avatar
Dimitri van Heesch committed
19
doxygen_version_minor=6
Dimitri van Heesch's avatar
Dimitri van Heesch committed
20
doxygen_version_revision=1
21 22

#NOTE: Setting version_mmn to "NO" will omit mmn info from the package.
23
doxygen_version_mmn=20091222
24

25 26 27 28 29
bin_dirs=`echo $PATH | sed -e "s/:/ /g"`

f_debug=NO
f_shared=YES
f_make=NO
30
f_dot=NO
31 32
f_perl=NO
f_plf_auto=NO
Dimitri van Heesch's avatar
Dimitri van Heesch committed
33
f_prefix=/usr/local
34
f_insttool=NO
35
f_english=NO
36
f_wizard=NO
37
f_app=NO
38
f_thread=NO
39 40
f_flex=NO
f_bison=NO
41
f_langs=nl,sv,cz,fr,id,it,de,jp,je,es,fi,ru,hr,pl,pt,hu,kr,ke,ro,si,cn,no,br,dk,sk,ua,gr,tw,sr,ca,lt,za,ar,fa,vi,tr,eo
42

43
while test -n "$1";  do
44
  case $1 in
Dimitri van Heesch's avatar
Dimitri van Heesch committed
45
    --prefix | -prefix)
46 47
       shift; f_prefix=$1
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
48
    --docdir | -docdir)
Dimitri van Heesch's avatar
Dimitri van Heesch committed
49
       shift; f_docdir=$1
Dimitri van Heesch's avatar
Dimitri van Heesch committed
50 51
       ;;
    --shared | -shared)
52 53
       f_shared=YES
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
54
    --static | -static)
55 56
       f_shared=NO
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
57
    --release | -release)
58 59
       f_debug=NO
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
60
    --debug | -debug)
61 62
       f_debug=YES
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
63
    --english-only | -english-only)
64 65
       f_english=YES
       ;;
66 67 68
    --enable-langs | -enable-langs)
       shift; f_langs=$1
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
69
    --platform | -platform)
70 71
       shift; f_platform=$1
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
72
    --make | -make)
73 74
       shift; f_make=$1
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
75
    --dot | -dot)
76 77
       shift; f_dot=$1
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
78
    --perl | -perl)
79 80
       shift; f_perl=$1
       ;;
81 82 83 84 85 86
    --flex | -flex)
       shift; f_flex=$1
       ;;
    --bison | -bison)
       shift; f_bison=$1
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
87
    --install | -install)
88 89
       shift; f_insttool=$1
       ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
90
    --with-doxywizard | -with-doxywizard)
91 92
       f_wizard=YES
       ;;
93 94 95
    --with-doxyapp | -with-doxyapp)
       f_app=YES
       ;;
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
    -h | -help | --help)
       f_help=y
       ;;
    *)
       echo $1: unknown argument
       f_help=y
       f_error=y
       ;;
  esac
  shift
done

if test "$f_help" = y; then
  cat <<EOF
Usage: $0 [--help] [--shared] [--static] [--release] [--debug] 
111 112 113
          [--perl name] [--flex name] [--bison name] [--make name] 
          [--dot name] [--platform target] [--prefix dir] [--docdir dir] 
          [--install name] [--english-only] [----enable-langs list] 
114
          [--with-doxywizard] [--with-doxyapp]
115

116
Options: 
117

118 119 120 121 122 123 124
  --help                Print this help
  --shared | --static   Build using shared or static linking
		        [default: shared]
  --release | --debug   Build for release or debug 
		        [default: release]
  --perl name           Use \`name' as the name of the perl interpreter 
		        [default: autodetect]
125 126 127 128
  --flex name           Use \`name' as the name of the GNU lexical scanner 
		        [default: autodetect]
  --bison name          Use \`name' as the name of the GNU compiler generator 
		        [default: autodetect]
129 130
  --make name           Use \`name' as the name of the GNU make tool
		        [default: autodetect]
131 132 133
  --dot name            Use \`name' as the name of the dot tool that
                        is part of the Graphviz package.
                        [default: autodetect]
134 135
  --platform target     Do not detect platform but use \`target' instead.
                        See PLATFORMS for a list of possibilities
Dimitri van Heesch's avatar
Dimitri van Heesch committed
136 137
  --prefix dir          Installation prefix directory (doxygen will be
                        put in PREFIX/bin/doxygen)
138
                        [default: $f_prefix]
Dimitri van Heesch's avatar
Dimitri van Heesch committed
139 140
  --docdir dir          Documentation is installed in DOCDIR/
                        [default: PREFIX/share/doc/packages/doxygen]
141
  --install name        Use \`name' as the name of the GNU install tool
142
                        [default: autodetect]
143
  --english-only        Include support for English only.
144 145
  --enable-langs list 	Include support for output languages listed in list.
  			[default: $f_langs]
146
  --with-doxywizard     Build the GUI frontend for doxygen. This
147
                        requires Qt 3.3.x
148
  --with-doxyapp        Example showing how to embed doxygen in an application.
149

150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
EOF
  test "$f_error" = y && exit 1
  exit 0;
fi

u_release=`(uname -r) 2>/dev/null` || u_release=unknown
u_system=`(uname -s) 2>/dev/null` || u_system=unknown

if test -z "$f_platform"; then
  f_platforms="`cat PLATFORMS`"
  
  case "$u_system:$u_release" in
    AIX*)
      f_platform=aix-xlc
      ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
165 166 167
    BeOS*)
      f_platform=beos-g++
      ;;
168 169 170
    dgux:*)
      f_platform=dgux-g++
      ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
171 172
    Darwin:*)
      f_platform=macosx-c++
173 174 175
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
Dimitri van Heesch's avatar
Dimitri van Heesch committed
176
      ;;
177 178
    FreeBSD:*)
      f_platform=freebsd-g++
179 180 181
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
182 183 184
      ;;
    HP-UX:*)
      f_platform=hpux-g++
185 186 187
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
188 189 190 191 192 193 194
      ;;
    IRIX64:*)
      f_platform=irix-64
      ;;
    IRIX:*)
      f_platform=irix-n32
      ;;
195
    Linux:*|GNU:*|GNU/*:*)
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
      f_platform=linux-g++
      ;;
    NetBSD:*)
      f_platform=netbsd-g++
      ;;
    OpenBSD:*)
      f_platform=openbsd-g++
      ;;
    OSF1:*)
      f_platform=osf1-g++
      ;;
    QNX:*)
      f_platform=qnx-g++
      ;;
    *:3.2)
      f_platform=sco-g++
      ;;
    SunOS:4*)
      f_platform=sunos-g++
      ;;
    SunOS:5*)
217
      f_platform=solaris-g++
218 219 220
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
221 222 223 224 225 226 227
      ;;
    ULTRIX:*)
      f_platform=ultrix-g++
      ;;
    UNIX_SV:4.2*)
      f_platform=unixware-g++
      ;;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
228
    Cygwin:*|CYGWIN*)
229 230
      f_platform=win32-g++
      ;;
231 232 233
    *MiNT:*)
      f_platform=m68k-atari-mint-g++
      ;;
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
    *)
    echo
    echo "Your platform was not recognised by this configure script"
    echo "Please use the -platform option to specify one of platforms"
    echo "in this list:"
    echo
    for p in $f_platforms
    do
      echo "    $0 $* -platform $p"
    done
    echo
    exit 2
  esac 
  echo "  Autodetected platform $f_platform... "
  f_plf_auto=YES
fi

Dimitri van Heesch's avatar
Dimitri van Heesch committed
251
if test -z "$f_docdir"; then
252
  f_docdir='$(INSTALL)/share/doc/packages/doxygen'
Dimitri van Heesch's avatar
Dimitri van Heesch committed
253 254
fi

255 256 257 258 259 260 261 262 263 264 265
if test "$f_plf_auto" = NO; then
  echo -n "  Checking for platform $f_platform... "
  if test '!' -d tmake/lib/$f_platform; then
    echo "not supported!" 
    echo
    exit 2
  fi
  echo "supported"
fi

#- check for qt --------------------------------------------------------------
266 267
 
if test "$f_wizard" = YES; then
268 269 270
  if test -z "$QTDIR"; then
    echo "  QTDIR environment variable not set!"
    echo -n "  Checking for Qt..."
271 272
    for d in /usr/{lib,share,qt}/{qt-4,qt4,qt,qt*,4}; do
      if test -x "$d/bin/qmake"; then
273
        QTDIR=$d
274
      fi
275 276 277 278
    done
  else
    echo "  Detected Qt via the QTDIR environment variable..."
    echo -n "                    "
279
  fi
280
  if test -z "$QTDIR"; then
281
    echo "QTDIR not set and Qt not found at standard locations!"
282
    echo
283
    echo "Set the QTDIR environment variable such that \$QTDIR/bin/qmake exists."
Dimitri van Heesch's avatar
Dimitri van Heesch committed
284
    echo "check the Qt installation instructions!"
285 286 287 288
    exit 2
  fi
fi
   
289 290
# - check for make ------------------------------------------------------------

291
echo -n "  Checking for GNU make tool... "
292
if test "$f_make" = NO; then
293
  make_names="gmake make"
294
  make_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
295 296 297 298
  make_prog=NO
  for i in $make_names; do
    for j in $make_dirs; do
      if test -x "$j/$i"; then
299 300 301 302
        if test -n "`$j/$i --version 2>/dev/null | grep GNU`"; then
          make_prog="$j/$i"
          break 2
        fi
303 304 305 306 307 308 309 310 311 312 313 314 315
      fi
    done
  done
  f_make="$make_prog" 
fi

if test "$f_make" = NO; then
  echo "not found!";
  echo
  exit 2
fi
echo "using $f_make"

316 317 318 319 320
# - check for install ------------------------------------------------------------

echo -n "  Checking for GNU install tool... "
if test "$f_insttool" = NO; then
  install_names="ginstall install"
321
  install_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin /usr/ucb"
322 323 324 325 326
  install_prog=NO
  install_found=NO
  for i in $install_names; do
    for j in $install_dirs; do
      if test -x "$j/$i"; then
327
        if test -n "`$j/$i --version 2>/dev/null | grep utils`"; then
328 329 330 331
          install_found=YES
          install_prog="$j/$i"
          break 2
        fi
332 333 334 335 336 337 338 339
      fi
    done
  done
  f_insttool="$install_prog" 
fi

if test "$f_insttool" = NO; then
  if test "$install_found" = YES; then
Dimitri van Heesch's avatar
Dimitri van Heesch committed
340
    echo;
341 342
  else
    echo "not found!";
Dimitri van Heesch's avatar
Dimitri van Heesch committed
343
    echo
344
  fi
345
  echo "GNU version of install is required: this is part of the fileutils/coreutils package: "
Dimitri van Heesch's avatar
Dimitri van Heesch committed
346
  echo "see http://www.gnu.org/software/fileutils/fileutils.html"
347 348 349 350 351 352
  echo
  exit 2
fi
echo "using $f_insttool";


353 354
# - check for dot ------------------------------------------------------------

355
echo -n "  Checking for dot (part of GraphViz)... "
356
if test "$f_dot" = NO; then
357
  dot_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
  dot_prog=NO
  for j in $dot_dirs; do
    if test -x "$j/dot"; then
      dot_prog="$j/dot"
      break 2
    fi
  done
  f_dot="$dot_prog" 
fi

if test "$f_dot" = NO; then
  echo "not found!";
else
  echo "using $f_dot"
fi

374 375 376 377 378
# - check for perl ------------------------------------------------------------

echo -n "  Checking for perl... "
if test "$f_perl" = NO; then
  perl_names="perl perl5"
379
  perl_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
  perl_prog=NO
  perl_found=NO
  for i in $perl_names; do
    for j in $perl_dirs; do
      if test -x "$j/$i"; then
        perl_found=YES
        if $j/$i -e 'require 5.000;' 2>/dev/null ; then
          perl_prog="$j/$i"
          break 2
        fi
      fi
    done
  done
  f_perl="$perl_prog" 
fi

if test "$f_perl" = NO; then
  if test "$perl_found" = YES; then
    echo "version is too old (5.000 or higher is required)."
  else
    echo "not found!";
  fi
  echo
  exit 2
fi
echo "using $f_perl";

407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
# - check for flex ------------------------------------------------------------

echo -n "  Checking for flex... "
if test "$f_flex" = NO; then
  flex_dirs="$bin_dirs /usr/bin /usr/local/bin /bin"
  flex_prog=NO
  flex_found=NO
  for j in $flex_dirs; do
    if test -x "$j/flex"; then
      flex_found=YES
      flex_prog="$j/flex"
      break
    fi
  done
  f_flex="$flex_prog" 
fi

if test "$f_flex" = NO; then
  echo "not found!";
  exit 2
else
  echo "using $f_flex"
fi

# - check for bison ------------------------------------------------------------

echo -n "  Checking for bison... "
if test "$f_bison" = NO; then
  bison_dirs="$bin_dirs /usr/bin /usr/local/bin /bin"
  bison_prog=NO
  bison_found=NO
  for j in $bison_dirs; do
    if test -x "$j/bison"; then
      bison_found=YES
      bison_prog="$j/bison"
      break
    fi
  done
  f_bison="$bison_prog" 
fi

if test "$f_bison" = NO; then
  echo "not found!";
  exit 2
else
  echo "using $f_bison"
fi
454

455 456
# -----------------------------------------------------------------------------

457 458 459 460 461
#
# Make VERSION file
#
echo "  Creating VERSION file."
# Output should be something like 1.4.5-20051010
Dimitri van Heesch's avatar
Dimitri van Heesch committed
462
if test "x$doxygen_version_mmn" = "xNO"; then
463 464 465 466 467
  echo "$doxygen_version_major.$doxygen_version_minor.$doxygen_version_revision" > VERSION
else
  echo "$doxygen_version_major.$doxygen_version_minor.$doxygen_version_revision-$doxygen_version_mmn" > VERSION
fi

468 469 470
test -f .makeconfig && rm .makeconfig
test -f .tmakeconfig && rm .tmakeconfig

471
configPWD=`pwd`
472

473
cat > .makeconfig <<EOF
474 475
DOXYGEN   = $configPWD
TMAKEPATH = $configPWD/tmake/lib/$f_platform
Dimitri van Heesch's avatar
Dimitri van Heesch committed
476
ENV       = env TMAKEPATH=\$(TMAKEPATH)
477
TMAKE     = $configPWD/tmake/bin/tmake
478 479 480
MAKE      = $f_make
PERL      = $f_perl
RM        = rm -f
481
CP        = cp
482
VERSION   = `cat VERSION`
483 484
INSTALL   = $f_prefix
INSTTOOL  = $f_insttool
485
DOXYDOCS  = ..
Dimitri van Heesch's avatar
Dimitri van Heesch committed
486
DOCDIR    = $f_docdir
487
QTDIR     = $QTDIR
488 489
EOF

490 491 492 493 494 495
if test "$f_dot" != NO; then
  cat >> .makeconfig <<EOF
HAVE_DOT  = $f_dot
EOF
fi

496 497 498 499 500 501 502
if test "$f_platform" = "m68k-atari-mint-g++"; then
  cat >> .makeconfig <<EOF
TMAKE += -unix
EOF
fi


503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
# Make doxygen.spec...
#
echo "  Created doxygen.spec file, for rpm generation."

echo "%define version $doxygen_version_major.$doxygen_version_minor.$doxygen_version_revision" > spec.tmp
if test "$doxygen_version_mmn" = NO; then
  echo "%define revision 1" >> spec.tmp
  echo "%define mmn 1"      >> spec.tmp
else
  echo "%define revision $doxygen_version_mmn" >> spec.tmp
  echo "%define mmn $doxygen_version_mmn"      >> spec.tmp
fi

mkdir -p packages
mkdir -p packages/rpm

519
cat spec.tmp ./packages/rpm/doxygen.spec.in > ./packages/rpm/doxygen.spec
520 521 522 523 524 525

rm -f spec.tmp


# make .tmakeconfig
#
526 527
touch .tmakeconfig
if test "$f_shared" = NO; then
528
  if test "$f_platform" = "osf1-cxx" -o "$f_platform" = "irix-n32"; then
529
  cat >> .tmakeconfig <<EOF
Dimitri van Heesch's avatar
Dimitri van Heesch committed
530
    TMAKE_LFLAGS += -non_shared
531
EOF
Dimitri van Heesch's avatar
Dimitri van Heesch committed
532
  elif test "$f_platform" = "solaris-cc"; then
533
  cat >> .tmakeconfig <<EOF
Dimitri van Heesch's avatar
Dimitri van Heesch committed
534
    TMAKE_LFLAGS += -Bstatic
Dimitri van Heesch's avatar
Dimitri van Heesch committed
535 536 537
EOF
  elif test "$f_platform" = "hpux-cc"; then
  cat >> .tmakeconfig <<EOF
Dimitri van Heesch's avatar
Dimitri van Heesch committed
538
    TMAKE_LFLAGS += -noshared
539
EOF
540 541
  else
  cat >> .tmakeconfig <<EOF
Dimitri van Heesch's avatar
Dimitri van Heesch committed
542
    TMAKE_LFLAGS += -static
543 544
EOF
  fi
545
fi
546
if test "$f_platform" = "hpux-g++" -o "$f_platform" = "linux-g++"; then
547 548 549 550
  cat >> .tmakeconfig <<EOF
    TMAKE_CXXFLAGS += -D_LARGEFILE_SOURCE
EOF
fi
551
if test "$f_platform" = "macosx-uni-c++"; then
552
  if test -n "`ls /Developer/SDKs/MacOSX10.*.sdk 2>/dev/null`"; then
553 554
    mac_sdk=MacOSX10.4u.sdk
  fi
555
  if test -n "`ls /Developer/SDKs/MacOSX10.5*.sdk 2>/dev/null`"; then
556 557 558 559 560 561 562 563 564 565
    mac_sdk=MacOSX10.5.sdk
  fi
  if test -n $mac_sdk; then
  cat >> .tmakeconfig <<EOF
    TMAKE_CFLAGS   += -isysroot /Developer/SDKs/$mac_sdk
    TMAKE_CXXFLAGS += -isysroot /Developer/SDKs/$mac_sdk
    TMAKE_LFLAGS   += -Wl,-syslibroot,/Developer/SDKs/$mac_sdk
EOF
  fi
fi
566 567 568 569 570 571
if test "$f_wizard" = YES; then
  cat >> .tmakeconfig <<EOF
TMAKE_MOC = $QTDIR/bin/moc
EOF
fi

572
if test "$f_english" = YES; then
573
  cat >> .tmakeconfig <<EOF
Dimitri van Heesch's avatar
Dimitri van Heesch committed
574
TMAKE_CXXFLAGS += -DENGLISH_ONLY
575 576 577
EOF
fi

578
f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/doxmlparser/src/Makefile.in addon/doxmlparser/test/Makefile.in addon/doxmlparser/examples/metrics/Makefile.in libmd5/Makefile.in addon/doxyapp/Makefile.in"
579 580

for i in $f_inmakefiles ; do
581 582 583 584 585 586 587 588 589
     SRC=$i
     DST=`echo $i|sed 's%\(.*\).in$%\1%'`
     TIME=`date`
     cat > $DST <<EOF
#
# This file was generated from `basename $i` on $TIME
#

EOF
590
     cat .makeconfig >> $DST
591
     if test $i = Makefile.in; then
592 593 594
       echo "" >> $DST
       echo "all: src/version.cpp " >> $DST
       echo "	\$(MAKE) -C qtools" >> $DST
595
       echo "	\$(MAKE) -C libmd5" >> $DST
596
       echo "	\$(MAKE) -C src" >> $DST
597 598 599
       if test $f_wizard = YES; then
         echo "	\$(MAKE) -C addon/doxywizard" >> $DST
       fi
600 601 602
       if test $f_app = YES; then
         echo "	\$(MAKE) -C addon/doxyapp" >> $DST
       fi
603
       echo "" >> $DST
604 605 606 607
       echo "doxywizard_install:" >> $DST
       if test $f_wizard = YES; then
         echo "	\$(MAKE) -C addon/doxywizard install" >> $DST
       fi
608
       echo "" >> $DST
609
     fi
610 611 612 613 614
     if test $f_wizard = YES; then
       sed -e "s/%%WITHDOXYWIZARD%% /--with doxywizard /g" $SRC >> $DST
     else
       sed -e "s/%%WITHDOXYWIZARD%% //g" $SRC >> $DST
     fi
615 616 617
     echo "  Created $DST from $SRC..."
done

618
f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in addon/doxmlparser/examples/metrics/metrics.pro.in libmd5/libmd5.pro.in addon/doxyapp/doxyapp.pro.in" 
619 620

for i in $f_inprofiles ; do
621 622 623 624 625 626 627 628 629 630
     SRC=$i
     DST=`echo $i|sed 's%\(.*\).in$%\1%'`
     TIME=`date`
     cat > $DST <<EOF
#
# This file was generated from `basename $i` on $TIME
#

EOF
     if test "$f_debug" = NO; then
631
       realopts="release"
632
     else
633 634
       realopts="debug"
     fi
635 636 637
     #if test "$f_thread" = YES; then
     #  realopts="$realopts thread"
     #fi
638
     cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" >> $DST
639 640 641
     echo "  Created $DST from $SRC..."
done

642 643
# - generating src/lang_cfg.h 

644
if test -f "src/lang_cfg.h"; then
645 646
    chmod u+w src/lang_cfg.h   # make sure file can be overwritten
fi
647 648 649
echo -n "  Generating src/lang_cfg.h..."
echo $f_langs | $f_perl -e '@l=split(/,/,<STDIN>); 
        chomp @l; 
650
	@allowed=(split(/,/,"NL,SV,CZ,FR,ID,IT,DE,JP,JE,ES,FI,RU,HR,PL,PT,HU,KR,KE,RO,SI,CN,NO,MK,BR,DK,SK,UA,GR,TW,SR,CA,LT,ZA,AR,FA,SC,VI,TR,EO"));
651 652 653 654 655 656 657 658 659 660
	foreach my $elem (@l){ 
	     $elem =~ tr/a-z/A-Z/;
	     $r=0;
	     foreach my $tst (@allowed){
		if ($tst eq $elem) { $r=1; last; } 		
	     }	    
	     if ($r!=1) { die "ERROR: Invalid language $elem was selected!\n"; } 
	     print "#define LANG_$elem\n";
        };' > ./src/lang_cfg.h   
echo