configure 16.7 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=9
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=20090622
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,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
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
    --docdir | -docdir)
dimitri's avatar
dimitri committed
49
       shift; f_docdir=$1
dimitri's avatar
dimitri committed
50 51
       ;;
    --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
          [--perl name] [--flex name] [--bison name] [--make name] 
          [--dot name] [--platform target] [--prefix dir] [--docdir dir] 
          [--install name] [--english-only] [----enable-langs list] 
dimitri's avatar
dimitri committed
114
          [--with-doxywizard] [--with-doxyapp]
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/
                        [default: PREFIX/share/doc/packages/doxygen]
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
  --with-doxyapp        Example showing how to embed doxygen in an application.
dimitri's avatar
dimitri committed
149

mueller's avatar
mueller committed
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's avatar
dimitri committed
165 166 167
    BeOS*)
      f_platform=beos-g++
      ;;
mueller's avatar
mueller committed
168 169 170
    dgux:*)
      f_platform=dgux-g++
      ;;
dimitri's avatar
dimitri committed
171 172
    Darwin:*)
      f_platform=macosx-c++
dimitri's avatar
dimitri committed
173 174 175
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
dimitri's avatar
dimitri committed
176
      ;;
mueller's avatar
mueller committed
177 178
    FreeBSD:*)
      f_platform=freebsd-g++
dimitri's avatar
dimitri committed
179 180 181
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
mueller's avatar
mueller committed
182 183 184
      ;;
    HP-UX:*)
      f_platform=hpux-g++
dimitri's avatar
dimitri committed
185 186 187
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
mueller's avatar
mueller committed
188 189 190 191 192 193 194
      ;;
    IRIX64:*)
      f_platform=irix-64
      ;;
    IRIX:*)
      f_platform=irix-n32
      ;;
dimitri's avatar
dimitri committed
195
    Linux:*|GNU:*|GNU/*:*)
mueller's avatar
mueller committed
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*)
dimitri's avatar
dimitri committed
217
      f_platform=solaris-g++
dimitri's avatar
dimitri committed
218 219 220
      if test "$f_insttool" = NO; then
        f_insttool=/usr/bin/install
      fi
mueller's avatar
mueller committed
221 222 223 224 225 226 227
      ;;
    ULTRIX:*)
      f_platform=ultrix-g++
      ;;
    UNIX_SV:4.2*)
      f_platform=unixware-g++
      ;;
dimitri's avatar
dimitri committed
228
    Cygwin:*|CYGWIN*)
dimitri's avatar
dimitri committed
229 230
      f_platform=win32-g++
      ;;
dimitri's avatar
dimitri committed
231 232 233
    *MiNT:*)
      f_platform=m68k-atari-mint-g++
      ;;
mueller's avatar
mueller committed
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's avatar
dimitri committed
251
if test -z "$f_docdir"; then
dimitri's avatar
dimitri committed
252
  f_docdir='$(INSTALL)/share/doc/packages/doxygen'
dimitri's avatar
dimitri committed
253 254
fi

mueller's avatar
mueller committed
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 --------------------------------------------------------------
dimitri's avatar
dimitri committed
266 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 272
    for d in /usr/{lib,share,qt}/{qt-4,qt4,qt,qt*,4}; do
      if test -x "$d/bin/qmake"; then
dimitri's avatar
dimitri committed
273
        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
    echo
dimitri's avatar
dimitri committed
283
    echo "Set the QTDIR environment variable such that \$QTDIR/bin/qmake exists."
dimitri's avatar
dimitri committed
284
    echo "check the Qt installation instructions!"
dimitri's avatar
dimitri committed
285 286 287 288
    exit 2
  fi
fi
   
mueller's avatar
mueller committed
289 290
# - check for make ------------------------------------------------------------

mueller's avatar
mueller committed
291
echo -n "  Checking for GNU make tool... "
mueller's avatar
mueller committed
292
if test "$f_make" = NO; then
mueller's avatar
mueller committed
293
  make_names="gmake make"
dimitri's avatar
dimitri committed
294
  make_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
mueller's avatar
mueller committed
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
mueller's avatar
mueller committed
299 300 301 302
        if test -n "`$j/$i --version 2>/dev/null | grep GNU`"; then
          make_prog="$j/$i"
          break 2
        fi
mueller's avatar
mueller committed
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"

dimitri's avatar
dimitri committed
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"
dimitri's avatar
dimitri committed
321
  install_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin /usr/ucb"
dimitri's avatar
dimitri committed
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
dimitri's avatar
dimitri committed
327
        if test -n "`$j/$i --version 2>/dev/null | grep utils`"; then
dimitri's avatar
dimitri committed
328 329 330 331
          install_found=YES
          install_prog="$j/$i"
          break 2
        fi
dimitri's avatar
dimitri committed
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's avatar
dimitri committed
340
    echo;
dimitri's avatar
dimitri committed
341 342
  else
    echo "not found!";
dimitri's avatar
dimitri committed
343
    echo
dimitri's avatar
dimitri committed
344
  fi
dimitri's avatar
dimitri committed
345
  echo "GNU version of install is required: this is part of the fileutils/coreutils package: "
dimitri's avatar
dimitri committed
346
  echo "see http://www.gnu.org/software/fileutils/fileutils.html"
dimitri's avatar
dimitri committed
347 348 349 350 351 352
  echo
  exit 2
fi
echo "using $f_insttool";


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

dimitri's avatar
dimitri committed
355
echo -n "  Checking for dot (part of GraphViz)... "
356
if test "$f_dot" = NO; then
dimitri's avatar
dimitri committed
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

mueller's avatar
mueller committed
374 375 376 377 378
# - check for perl ------------------------------------------------------------

echo -n "  Checking for perl... "
if test "$f_perl" = NO; then
  perl_names="perl perl5"
dimitri's avatar
dimitri committed
379
  perl_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
mueller's avatar
mueller committed
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";

dimitri's avatar
dimitri committed
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
dimitri's avatar
dimitri committed
454

mueller's avatar
mueller committed
455 456
# -----------------------------------------------------------------------------

dimitri's avatar
dimitri committed
457 458 459 460 461
#
# Make VERSION file
#
echo "  Creating VERSION file."
# Output should be something like 1.4.5-20051010
dimitri's avatar
dimitri committed
462
if test "x$doxygen_version_mmn" = "xNO"; then
dimitri's avatar
dimitri committed
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

mueller's avatar
mueller committed
468 469 470
test -f .makeconfig && rm .makeconfig
test -f .tmakeconfig && rm .tmakeconfig

dimitri's avatar
dimitri committed
471
configPWD=`pwd`
dimitri's avatar
dimitri committed
472

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

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

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


dimitri's avatar
dimitri committed
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

dimitri's avatar
dimitri committed
519
cat spec.tmp ./packages/rpm/doxygen.spec.in > ./packages/rpm/doxygen.spec
dimitri's avatar
dimitri committed
520 521 522 523 524 525

rm -f spec.tmp


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

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

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

for i in $f_inmakefiles ; do
mueller's avatar
mueller committed
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
dimitri's avatar
dimitri committed
590
     cat .makeconfig >> $DST
dimitri's avatar
dimitri committed
591
     if test $i = Makefile.in; then
dimitri's avatar
dimitri committed
592 593 594
       echo "" >> $DST
       echo "all: src/version.cpp " >> $DST
       echo "	\$(MAKE) -C qtools" >> $DST
dimitri's avatar
dimitri committed
595
       echo "	\$(MAKE) -C libpng" >> $DST
dimitri's avatar
dimitri committed
596
       echo "	\$(MAKE) -C libmd5" >> $DST
dimitri's avatar
dimitri committed
597
       echo "	\$(MAKE) -C src" >> $DST
dimitri's avatar
dimitri committed
598 599 600
       if test $f_wizard = YES; then
         echo "	\$(MAKE) -C addon/doxywizard" >> $DST
       fi
dimitri's avatar
dimitri committed
601 602 603
       if test $f_app = YES; then
         echo "	\$(MAKE) -C addon/doxyapp" >> $DST
       fi
dimitri's avatar
dimitri committed
604
       echo "" >> $DST
dimitri's avatar
dimitri committed
605 606 607 608
       echo "doxywizard_install:" >> $DST
       if test $f_wizard = YES; then
         echo "	\$(MAKE) -C addon/doxywizard install" >> $DST
       fi
dimitri's avatar
dimitri committed
609
       echo "" >> $DST
dimitri's avatar
dimitri committed
610
     fi
dimitri's avatar
dimitri committed
611 612 613 614 615
     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
616 617 618
     echo "  Created $DST from $SRC..."
done

dimitri's avatar
dimitri committed
619
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
620 621

for i in $f_inprofiles ; do
mueller's avatar
mueller committed
622 623 624 625 626 627 628 629 630 631
     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
632
       realopts="release"
mueller's avatar
mueller committed
633
     else
dimitri's avatar
dimitri committed
634 635
       realopts="debug"
     fi
dimitri's avatar
dimitri committed
636 637 638
     #if test "$f_thread" = YES; then
     #  realopts="$realopts thread"
     #fi
dimitri's avatar
dimitri committed
639
     cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" >> $DST
mueller's avatar
mueller committed
640 641 642
     echo "  Created $DST from $SRC..."
done

dimitri's avatar
dimitri committed
643 644
# - generating src/lang_cfg.h 

dimitri's avatar
dimitri committed
645
if test -f "src/lang_cfg.h"; then
dimitri's avatar
dimitri committed
646 647
    chmod u+w src/lang_cfg.h   # make sure file can be overwritten
fi
dimitri's avatar
dimitri committed
648 649 650
echo -n "  Generating src/lang_cfg.h..."
echo $f_langs | $f_perl -e '@l=split(/,/,<STDIN>); 
        chomp @l; 
dimitri's avatar
dimitri committed
651
	@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"));
dimitri's avatar
dimitri committed
652 653 654 655 656 657 658 659 660 661
	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