configure 17.2 KB
Newer Older
dimitri's avatar
dimitri committed
1
#!/bin/sh
mueller's avatar
mueller committed
2 3 4
#
# $Id$
#
dimitri's avatar
dimitri committed
5
# Copyright (C) 1997-2008 by Dimitri van Heesch.
mueller's avatar
mueller committed
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's avatar
dimitri 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.
mueller's avatar
mueller committed
15 16 17
# 
# shell script to configure doxygen

dimitri's avatar
dimitri committed
18
doxygen_version_major=1
dimitri's avatar
dimitri committed
19
doxygen_version_minor=5
dimitri's avatar
dimitri committed
20
doxygen_version_revision=6
dimitri's avatar
dimitri committed
21 22

#NOTE: Setting version_mmn to "NO" will omit mmn info from the package.
dimitri's avatar
dimitri committed
23
doxygen_version_mmn=20080727
dimitri's avatar
dimitri committed
24

mueller's avatar
mueller committed
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
mueller's avatar
mueller committed
31 32
f_perl=NO
f_plf_auto=NO
dimitri's avatar
dimitri committed
33
f_prefix=/usr/local
dimitri's avatar
dimitri committed
34
f_insttool=NO
mueller's avatar
mueller committed
35
f_english=NO
dimitri's avatar
dimitri committed
36
f_wizard=NO
dimitri's avatar
dimitri committed
37
f_app=NO
dimitri's avatar
dimitri committed
38
f_thread=NO
dimitri's avatar
dimitri committed
39 40
f_flex=NO
f_bison=NO
dimitri's avatar
dimitri committed
41
f_langs=nl,se,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
mueller's avatar
mueller committed
42

mueller's avatar
mueller committed
43
while test -n "$1";  do
mueller's avatar
mueller committed
44
  case $1 in
dimitri's avatar
dimitri committed
45
    --prefix | -prefix)
mueller's avatar
mueller committed
46 47
       shift; f_prefix=$1
       ;;
dimitri's avatar
dimitri committed
48 49 50 51
    --docdir | -docdir)
       shift; f_docdir=$1/doxygen
       ;;
    --shared | -shared)
mueller's avatar
mueller committed
52 53
       f_shared=YES
       ;;
dimitri's avatar
dimitri committed
54
    --static | -static)
mueller's avatar
mueller committed
55 56
       f_shared=NO
       ;;
dimitri's avatar
dimitri committed
57
    --release | -release)
mueller's avatar
mueller committed
58 59
       f_debug=NO
       ;;
dimitri's avatar
dimitri committed
60
    --debug | -debug)
mueller's avatar
mueller committed
61 62
       f_debug=YES
       ;;
dimitri's avatar
dimitri committed
63
    --english-only | -english-only)
mueller's avatar
mueller committed
64 65
       f_english=YES
       ;;
dimitri's avatar
dimitri committed
66 67 68
    --enable-langs | -enable-langs)
       shift; f_langs=$1
       ;;
dimitri's avatar
dimitri committed
69
    --platform | -platform)
mueller's avatar
mueller committed
70 71
       shift; f_platform=$1
       ;;
dimitri's avatar
dimitri committed
72
    --make | -make)
mueller's avatar
mueller committed
73 74
       shift; f_make=$1
       ;;
dimitri's avatar
dimitri committed
75
    --dot | -dot)
76 77
       shift; f_dot=$1
       ;;
dimitri's avatar
dimitri committed
78
    --perl | -perl)
mueller's avatar
mueller committed
79 80
       shift; f_perl=$1
       ;;
dimitri's avatar
dimitri committed
81 82 83 84 85 86
    --flex | -flex)
       shift; f_flex=$1
       ;;
    --bison | -bison)
       shift; f_bison=$1
       ;;
dimitri's avatar
dimitri committed
87
    --install | -install)
mueller's avatar
mueller committed
88 89
       shift; f_insttool=$1
       ;;
dimitri's avatar
dimitri committed
90
    --with-doxywizard | -with-doxywizard)
dimitri's avatar
dimitri committed
91 92
       f_wizard=YES
       ;;
dimitri's avatar
dimitri committed
93 94 95
    --with-doxyapp | -with-doxyapp)
       f_app=YES
       ;;
mueller's avatar
mueller committed
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] 
dimitri's avatar
dimitri committed
111 112 113 114
          [--perl name] [--flex name] [--bison name] [--make name] 
          [--dot name] [--platform target] [--prefix dir] [--docdir dir] 
          [--install name] [--english-only] [----enable-langs list] 
          [--with-doxywizard]
mueller's avatar
mueller committed
115

116
Options: 
mueller's avatar
mueller committed
117

mueller's avatar
mueller committed
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]
dimitri's avatar
dimitri committed
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]
mueller's avatar
mueller committed
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]
mueller's avatar
mueller committed
134 135
  --platform target     Do not detect platform but use \`target' instead.
                        See PLATFORMS for a list of possibilities
dimitri's avatar
dimitri committed
136 137
  --prefix dir          Installation prefix directory (doxygen will be
                        put in PREFIX/bin/doxygen)
dimitri's avatar
dimitri committed
138
                        [default: $f_prefix]
dimitri's avatar
dimitri committed
139 140
  --docdir dir          Documentation is installed in DOCDIR/doxygen/
                        [default: PREFIX/share/doc/packages]
mueller's avatar
mueller committed
141
  --install name        Use \`name' as the name of the GNU install tool
dimitri's avatar
dimitri committed
142
                        [default: autodetect]
mueller's avatar
mueller committed
143
  --english-only        Include support for English only.
dimitri's avatar
dimitri committed
144 145
  --enable-langs list 	Include support for output languages listed in list.
  			[default: $f_langs]
dimitri's avatar
dimitri committed
146
  --with-doxywizard     Build the GUI frontend for doxygen. This
dimitri's avatar
dimitri committed
147
                        requires Qt 3.3.x
dimitri's avatar
dimitri committed
148

mueller's avatar
mueller committed
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
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's avatar
dimitri committed
164 165 166
    BeOS*)
      f_platform=beos-g++
      ;;
mueller's avatar
mueller committed
167 168 169
    dgux:*)
      f_platform=dgux-g++
      ;;
dimitri's avatar
dimitri committed
170 171
    Darwin:*)
      f_platform=macosx-c++
dimitri's avatar
dimitri committed
172 173 174
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
dimitri's avatar
dimitri committed
175
      ;;
mueller's avatar
mueller committed
176 177
    FreeBSD:*)
      f_platform=freebsd-g++
dimitri's avatar
dimitri committed
178 179 180
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
mueller's avatar
mueller committed
181 182 183
      ;;
    HP-UX:*)
      f_platform=hpux-g++
dimitri's avatar
dimitri committed
184 185 186
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
mueller's avatar
mueller committed
187 188 189 190 191 192 193
      ;;
    IRIX64:*)
      f_platform=irix-64
      ;;
    IRIX:*)
      f_platform=irix-n32
      ;;
dimitri's avatar
dimitri committed
194
    Linux:*|GNU:*|GNU/*:*)
mueller's avatar
mueller committed
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
      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*)
dimitri's avatar
dimitri committed
216
      f_platform=solaris-g++
dimitri's avatar
dimitri committed
217 218 219
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
mueller's avatar
mueller committed
220 221 222 223 224 225 226
      ;;
    ULTRIX:*)
      f_platform=ultrix-g++
      ;;
    UNIX_SV:4.2*)
      f_platform=unixware-g++
      ;;
dimitri's avatar
dimitri committed
227
    Cygwin:*|CYGWIN:*)
dimitri's avatar
dimitri committed
228 229
      f_platform=win32-g++
      ;;
dimitri's avatar
dimitri committed
230 231 232
    *MiNT:*)
      f_platform=m68k-atari-mint-g++
      ;;
mueller's avatar
mueller committed
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
    *)
    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's avatar
dimitri committed
250
if test -z "$f_docdir"; then
dimitri's avatar
dimitri committed
251
  f_docdir='$(INSTALL)/share/doc/packages/doxygen'
dimitri's avatar
dimitri committed
252 253
fi

mueller's avatar
mueller committed
254 255 256 257 258 259 260 261 262 263 264
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 --------------------------------------------------------------
dimitri's avatar
dimitri committed
265
 
dimitri's avatar
dimitri committed
266
LIBDIR=lib
dimitri's avatar
dimitri committed
267
if test "$f_wizard" = YES; then
dimitri's avatar
dimitri committed
268 269 270
  if test -z "$QTDIR"; then
    echo "  QTDIR environment variable not set!"
    echo -n "  Checking for Qt..."
dimitri's avatar
dimitri committed
271
    for d in /usr/{lib,share,qt}/{qt-3,qt3,qt,qt*,3}; do
dimitri's avatar
dimitri committed
272 273
      if test -d "$d/lib" -a -d "$d/include" -a -x "$d/bin/moc"; then
        QTDIR=$d
dimitri's avatar
dimitri committed
274
      fi
dimitri's avatar
dimitri committed
275 276 277 278
    done
  else
    echo "  Detected Qt via the QTDIR environment variable..."
    echo -n "                    "
dimitri's avatar
dimitri committed
279
  fi
dimitri's avatar
dimitri committed
280
  if test -z "$QTDIR"; then
dimitri's avatar
dimitri committed
281
    echo "QTDIR not set and Qt not found at standard locations!"
dimitri's avatar
dimitri committed
282 283
    echo
    echo "tmake requires the QTDIR environment variable to be set."
dimitri's avatar
dimitri committed
284
    echo "check the Qt installation instructions!"
dimitri's avatar
dimitri committed
285 286 287
    exit 2
  else
    if test ! -d "$QTDIR/lib"; then
dimitri's avatar
dimitri committed
288 289 290 291 292
      if test ! -d "$QTDIR/lib64"; then
        echo "QTDIR is set to $QTDIR, but library directory $QTDIR/lib does not exist!"
        exit 2
      fi
      LIBDIR=lib64
dimitri's avatar
dimitri committed
293 294
    fi
    if test ! -d "$QTDIR/include"; then
dimitri's avatar
dimitri committed
295
      echo "QTDIR is set to $QTDIR, but include directory $QTDIR/include does not exist!"
dimitri's avatar
dimitri committed
296 297
      exit 2
    fi
dimitri's avatar
dimitri committed
298
    if test ! -x "$QTDIR/bin/moc"; then
dimitri's avatar
dimitri committed
299
      echo "QTDIR is set to $QTDIR, but the moc tool could not be found in $QTDIR/bin!"
dimitri's avatar
dimitri committed
300 301
      exit 2
    fi
dimitri's avatar
dimitri committed
302
    echo " headers $QTDIR/include,"
dimitri's avatar
dimitri committed
303 304
    echo "                     libraries $QTDIR/$LIBDIR"  
    if test -n "`ls $QTDIR/$LIBDIR/* | grep qt-mt`"; then
dimitri's avatar
dimitri committed
305 306
      f_thread=YES
    fi
dimitri's avatar
dimitri committed
307 308 309
  fi
fi
   
mueller's avatar
mueller committed
310 311
# - check for make ------------------------------------------------------------

mueller's avatar
mueller committed
312
echo -n "  Checking for GNU make tool... "
mueller's avatar
mueller committed
313
if test "$f_make" = NO; then
mueller's avatar
mueller committed
314
  make_names="gmake make"
dimitri's avatar
dimitri committed
315
  make_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
mueller's avatar
mueller committed
316 317 318 319
  make_prog=NO
  for i in $make_names; do
    for j in $make_dirs; do
      if test -x "$j/$i"; then
mueller's avatar
mueller committed
320 321 322 323
        if test -n "`$j/$i --version 2>/dev/null | grep GNU`"; then
          make_prog="$j/$i"
          break 2
        fi
mueller's avatar
mueller committed
324 325 326 327 328 329 330 331 332 333 334 335 336
      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"

dimitri's avatar
dimitri committed
337 338 339 340 341
# - check for install ------------------------------------------------------------

echo -n "  Checking for GNU install tool... "
if test "$f_insttool" = NO; then
  install_names="ginstall install"
dimitri's avatar
dimitri committed
342
  install_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin /usr/ucb"
dimitri's avatar
dimitri committed
343 344 345 346 347
  install_prog=NO
  install_found=NO
  for i in $install_names; do
    for j in $install_dirs; do
      if test -x "$j/$i"; then
dimitri's avatar
dimitri committed
348
        if test -n "`$j/$i --version 2>/dev/null | grep utils`"; then
dimitri's avatar
dimitri committed
349 350 351 352
          install_found=YES
          install_prog="$j/$i"
          break 2
        fi
dimitri's avatar
dimitri committed
353 354 355 356 357 358 359 360
      fi
    done
  done
  f_insttool="$install_prog" 
fi

if test "$f_insttool" = NO; then
  if test "$install_found" = YES; then
dimitri's avatar
dimitri committed
361
    echo;
dimitri's avatar
dimitri committed
362 363
  else
    echo "not found!";
dimitri's avatar
dimitri committed
364
    echo
dimitri's avatar
dimitri committed
365
  fi
dimitri's avatar
dimitri committed
366
  echo "GNU version of install is required: this is part of the fileutils/coreutils package: "
dimitri's avatar
dimitri committed
367
  echo "see http://www.gnu.org/software/fileutils/fileutils.html"
dimitri's avatar
dimitri committed
368 369 370 371 372 373
  echo
  exit 2
fi
echo "using $f_insttool";


374 375
# - check for dot ------------------------------------------------------------

dimitri's avatar
dimitri committed
376
echo -n "  Checking for dot (part of GraphViz)... "
377
if test "$f_dot" = NO; then
dimitri's avatar
dimitri committed
378
  dot_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
  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

mueller's avatar
mueller committed
395 396 397 398 399
# - check for perl ------------------------------------------------------------

echo -n "  Checking for perl... "
if test "$f_perl" = NO; then
  perl_names="perl perl5"
dimitri's avatar
dimitri committed
400
  perl_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
mueller's avatar
mueller committed
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
  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";

dimitri's avatar
dimitri committed
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 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
# - 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
dimitri's avatar
dimitri committed
475

mueller's avatar
mueller committed
476 477
# -----------------------------------------------------------------------------

dimitri's avatar
dimitri committed
478 479 480 481 482
#
# Make VERSION file
#
echo "  Creating VERSION file."
# Output should be something like 1.4.5-20051010
dimitri's avatar
dimitri committed
483
if test "x$doxygen_version_mmn" = "xNO"; then
dimitri's avatar
dimitri committed
484 485 486 487 488
  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

mueller's avatar
mueller committed
489 490 491
test -f .makeconfig && rm .makeconfig
test -f .tmakeconfig && rm .tmakeconfig

dimitri's avatar
dimitri committed
492
configPWD=`pwd`
dimitri's avatar
dimitri committed
493

mueller's avatar
mueller committed
494
cat > .makeconfig <<EOF
dimitri's avatar
dimitri committed
495 496
DOXYGEN   = $configPWD
TMAKEPATH = $configPWD/tmake/lib/$f_platform
dimitri's avatar
dimitri committed
497
ENV       = env TMAKEPATH=\$(TMAKEPATH)
dimitri's avatar
dimitri committed
498
TMAKE     = $configPWD/tmake/bin/tmake
mueller's avatar
mueller committed
499 500 501
MAKE      = $f_make
PERL      = $f_perl
RM        = rm -f
dimitri's avatar
dimitri committed
502
CP        = cp
mueller's avatar
mueller committed
503
VERSION   = `cat VERSION`
mueller's avatar
mueller committed
504 505
INSTALL   = $f_prefix
INSTTOOL  = $f_insttool
mueller's avatar
mueller committed
506
DOXYDOCS  = ..
dimitri's avatar
dimitri committed
507
DOCDIR    = $f_docdir
dimitri's avatar
dimitri committed
508
QTDIR     = $QTDIR
mueller's avatar
mueller committed
509 510
EOF

511 512 513 514 515 516
if test "$f_dot" != NO; then
  cat >> .makeconfig <<EOF
HAVE_DOT  = $f_dot
EOF
fi

dimitri's avatar
dimitri committed
517 518 519 520 521 522 523
if test "$f_platform" = "m68k-atari-mint-g++"; then
  cat >> .makeconfig <<EOF
TMAKE += -unix
EOF
fi


dimitri's avatar
dimitri committed
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539
# 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

dimitri's avatar
dimitri committed
540
cat spec.tmp ./packages/rpm/doxygen.spec.in > ./packages/rpm/doxygen.spec
dimitri's avatar
dimitri committed
541 542 543 544 545 546

rm -f spec.tmp


# make .tmakeconfig
#
mueller's avatar
mueller committed
547 548
touch .tmakeconfig
if test "$f_shared" = NO; then
dimitri's avatar
dimitri committed
549
  if test "$f_platform" = "osf1-cxx" -o "$f_platform" = "irix-n32"; then
mueller's avatar
mueller committed
550
  cat >> .tmakeconfig <<EOF
dimitri's avatar
dimitri committed
551
    TMAKE_LFLAGS += -non_shared
mueller's avatar
mueller committed
552
EOF
dimitri's avatar
dimitri committed
553
  elif test "$f_platform" = "solaris-cc"; then
dimitri's avatar
dimitri committed
554
  cat >> .tmakeconfig <<EOF
dimitri's avatar
dimitri committed
555
    TMAKE_LFLAGS += -Bstatic
dimitri's avatar
dimitri committed
556 557 558
EOF
  elif test "$f_platform" = "hpux-cc"; then
  cat >> .tmakeconfig <<EOF
dimitri's avatar
dimitri committed
559
    TMAKE_LFLAGS += -noshared
dimitri's avatar
dimitri committed
560
EOF
dimitri's avatar
dimitri committed
561 562
  else
  cat >> .tmakeconfig <<EOF
dimitri's avatar
dimitri committed
563
    TMAKE_LFLAGS += -static
dimitri's avatar
dimitri committed
564 565
EOF
  fi
mueller's avatar
mueller committed
566
fi
dimitri's avatar
dimitri committed
567 568 569 570 571
if test "$f_platform" = "hpux-g++"; then
  cat >> .tmakeconfig <<EOF
    TMAKE_CXXFLAGS += -D_LARGEFILE_SOURCE
EOF
fi
dimitri's avatar
dimitri committed
572
if test "$f_platform" = "macosx-uni-c++"; then
dimitri's avatar
dimitri committed
573
  if test -n "`ls /Developer/SDKs/MacOSX10.*.sdk 2>/dev/null`"; then
dimitri's avatar
dimitri committed
574 575
    mac_sdk=MacOSX10.4u.sdk
  fi
dimitri's avatar
dimitri committed
576
  if test -n "`ls /Developer/SDKs/MacOSX10.5*.sdk 2>/dev/null`"; then
dimitri's avatar
dimitri committed
577 578 579 580 581 582 583 584 585 586
    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
dimitri's avatar
dimitri committed
587 588 589 590 591 592
if test "$f_wizard" = YES; then
  cat >> .tmakeconfig <<EOF
TMAKE_MOC = $QTDIR/bin/moc
EOF
fi

mueller's avatar
mueller committed
593
if test "$f_english" = YES; then
594
  cat >> .tmakeconfig <<EOF
dimitri's avatar
dimitri committed
595
TMAKE_CXXFLAGS += -DENGLISH_ONLY
mueller's avatar
mueller committed
596 597 598
EOF
fi

dimitri's avatar
dimitri committed
599
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 libpng/Makefile.in libmd5/Makefile.in addon/doxyapp/Makefile.in"
dimitri's avatar
dimitri committed
600 601

for i in $f_inmakefiles ; do
mueller's avatar
mueller committed
602 603 604 605 606 607 608 609 610
     SRC=$i
     DST=`echo $i|sed 's%\(.*\).in$%\1%'`
     TIME=`date`
     cat > $DST <<EOF
#
# This file was generated from `basename $i` on $TIME
#

EOF
dimitri's avatar
dimitri committed
611
     cat .makeconfig >> $DST
dimitri's avatar
dimitri committed
612
     if test $i = Makefile.in; then
dimitri's avatar
dimitri committed
613 614 615
       echo "" >> $DST
       echo "all: src/version.cpp " >> $DST
       echo "	\$(MAKE) -C qtools" >> $DST
dimitri's avatar
dimitri committed
616
       echo "	\$(MAKE) -C libpng" >> $DST
dimitri's avatar
dimitri committed
617
       echo "	\$(MAKE) -C libmd5" >> $DST
dimitri's avatar
dimitri committed
618
       echo "	\$(MAKE) -C src" >> $DST
dimitri's avatar
dimitri committed
619 620 621
       if test $f_wizard = YES; then
         echo "	\$(MAKE) -C addon/doxywizard" >> $DST
       fi
dimitri's avatar
dimitri committed
622 623 624
       if test $f_app = YES; then
         echo "	\$(MAKE) -C addon/doxyapp" >> $DST
       fi
dimitri's avatar
dimitri committed
625
       echo "" >> $DST
dimitri's avatar
dimitri committed
626 627 628 629
       echo "doxywizard_install:" >> $DST
       if test $f_wizard = YES; then
         echo "	\$(MAKE) -C addon/doxywizard install" >> $DST
       fi
dimitri's avatar
dimitri committed
630
       echo "" >> $DST
dimitri's avatar
dimitri committed
631
     fi
dimitri's avatar
dimitri committed
632 633 634 635 636
     if test $f_wizard = YES; then
       sed -e "s/%%WITHDOXYWIZARD%% /--with doxywizard /g" $SRC >> $DST
     else
       sed -e "s/%%WITHDOXYWIZARD%% //g" $SRC >> $DST
     fi
mueller's avatar
mueller committed
637 638 639
     echo "  Created $DST from $SRC..."
done

dimitri's avatar
dimitri committed
640
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 libpng/libpng.pro.in libmd5/libmd5.pro.in addon/doxyapp/doxyapp.pro.in" 
dimitri's avatar
dimitri committed
641 642

for i in $f_inprofiles ; do
mueller's avatar
mueller committed
643 644 645 646 647 648 649 650 651 652
     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
dimitri's avatar
dimitri committed
653
       realopts="release"
mueller's avatar
mueller committed
654
     else
dimitri's avatar
dimitri committed
655 656 657 658
       realopts="debug"
     fi
     if test "$f_thread" = YES; then
       realopts="$realopts thread"
mueller's avatar
mueller committed
659
     fi
dimitri's avatar
dimitri committed
660
     cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" >> $DST
mueller's avatar
mueller committed
661 662 663
     echo "  Created $DST from $SRC..."
done

dimitri's avatar
dimitri committed
664 665
# - generating src/lang_cfg.h 

dimitri's avatar
dimitri committed
666
if test -f "src/lang_cfg.h"; then
dimitri's avatar
dimitri committed
667 668
    chmod u+w src/lang_cfg.h   # make sure file can be overwritten
fi
dimitri's avatar
dimitri committed
669 670 671
echo -n "  Generating src/lang_cfg.h..."
echo $f_langs | $f_perl -e '@l=split(/,/,<STDIN>); 
        chomp @l; 
dimitri's avatar
dimitri committed
672
	@allowed=(split(/,/,"NL,SE,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"));
dimitri's avatar
dimitri committed
673 674 675 676 677 678 679 680 681 682
	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