3 # $Id: configure,v 1.229 2005/11/09 21:17:03 dimitri Exp $
5 # Copyright (C) 1997-2012 by Dimitri van Heesch.
7 # Permission to use, copy, modify, and distribute this software and its
8 # documentation under the terms of the GNU General Public License is hereby
9 # granted. No representations are made about the suitability of this software
10 # for any purpose. It is provided "as is" without express or implied warranty.
11 # See the GNU General Public License for more details.
13 # Documents produced by Doxygen are derivative works derived from the
14 # input used in their production; they are not affected by this license.
16 # shell script to configure doxygen
18 doxygen_version_major=1
19 doxygen_version_minor=8
20 doxygen_version_revision=2
22 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package.
23 doxygen_version_mmn=NO
25 bin_dirs=`echo $PATH | sed -e "s/:/ /g"`
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,mk,br,dk,sk,ua,gr,tw,sr,ca,lt,za,ar,fa,sc,vi,tr,eo,am
43 while test -n "$1"; do
63 --english-only | -english-only)
66 --enable-langs | -enable-langs)
69 --platform | -platform)
90 --with-doxywizard | -with-doxywizard)
93 --with-doxyapp | -with-doxyapp)
100 echo $1: unknown argument
108 if test "$f_help" = y; then
110 Usage: $0 [--help] [--shared] [--static] [--release] [--debug]
111 [--perl name] [--flex name] [--bison name] [--make name]
112 [--dot name] [--platform target] [--prefix dir] [--docdir dir]
113 [--install name] [--english-only] [----enable-langs list]
114 [--with-doxywizard] [--with-doxyapp]
118 --help Print this help
119 --shared | --static Build using shared or static linking
121 --release | --debug Build for release or debug
123 --perl name Use \`name' as the name of the perl interpreter
124 [default: autodetect]
125 --flex name Use \`name' as the name of the GNU lexical scanner
126 [default: autodetect]
127 --bison name Use \`name' as the name of the GNU compiler generator
128 [default: autodetect]
129 --make name Use \`name' as the name of the GNU make tool
130 [default: autodetect]
131 --dot name Use \`name' as the name of the dot tool that
132 is part of the Graphviz package.
133 [default: autodetect]
134 --platform target Do not detect platform but use \`target' instead.
135 See PLATFORMS for a list of possibilities
136 --prefix dir Installation prefix directory (doxygen will be
137 put in PREFIX/bin/doxygen)
139 --docdir dir Documentation is installed in DOCDIR/
140 [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 --enable-langs list Include support for output languages listed in list.
146 --with-doxywizard Build the GUI frontend for doxygen. This
148 --with-doxyapp Example showing how to embed doxygen in an application.
151 test "$f_error" = y && exit 1
155 u_release=`(uname -r) 2>/dev/null` || u_release=unknown
156 u_system=`(uname -s) 2>/dev/null` || u_system=unknown
158 if test -z "$f_platform"; then
159 f_platforms="`cat PLATFORMS`"
161 case "$u_system:$u_release" in
172 f_platform=macosx-c++
173 if test "$f_insttool" = NO; then
174 f_insttool=/usr/bin/install
178 f_platform=freebsd-g++
179 if test "$f_insttool" = NO; then
180 f_insttool=/usr/bin/install
184 f_platform=netbsd-g++
185 if test "$f_insttool" = NO; then
186 f_insttool=/usr/bin/install
191 if test "$f_insttool" = NO; then
192 f_insttool=/usr/bin/install
201 Linux:*|GNU:*|GNU/*:*)
205 f_platform=netbsd-g++
208 f_platform=openbsd-g++
223 f_platform=solaris-g++
224 if test "$f_insttool" = NO; then
225 f_insttool=/usr/bin/install
229 f_platform=ultrix-g++
232 f_platform=unixware-g++
238 f_platform=m68k-atari-mint-g++
242 echo "Your platform was not recognised by this configure script"
243 echo "Please use the -platform option to specify one of platforms"
246 for p in $f_platforms
248 echo " $0 $* -platform $p"
253 echo " Autodetected platform $f_platform... "
257 if test -z "$f_docdir"; then
258 f_docdir='$(INSTALL)/share/doc/packages/doxygen'
261 if test "$f_plf_auto" = NO; then
262 echo -n " Checking for platform $f_platform... "
263 if test '!' -d tmake/lib/$f_platform; then
264 echo "not supported!"
271 #- check for qt --------------------------------------------------------------
273 if test "$f_wizard" = YES; then
274 if test -z "$QTDIR"; then
275 echo " QTDIR environment variable not set!"
276 echo -n " Checking for Qt..."
277 for d in /usr/{lib,share,qt}/{qt-4,qt4,qt,qt*,4} /usr; do
278 if test -x "$d/bin/qmake"; then
283 echo " Detected Qt via the QTDIR environment variable..."
286 if test -z "$QTDIR"; then
287 echo "QTDIR not set and Qt not found at standard locations!"
289 echo "Set the QTDIR environment variable such that \$QTDIR/bin/qmake exists."
290 echo "check the Qt installation instructions!"
295 # - check for make ------------------------------------------------------------
297 echo -n " Checking for GNU make tool... "
298 if test "$f_make" = NO; then
299 make_names="gmake make"
300 make_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
302 for i in $make_names; do
303 for j in $make_dirs; do
304 if test -x "$j/$i"; then
305 if test -n "`$j/$i --version 2>/dev/null | grep GNU`"; then
315 if test "$f_make" = NO; then
322 # - check for install ------------------------------------------------------------
324 echo -n " Checking for GNU install tool... "
325 if test "$f_insttool" = NO; then
326 install_names="ginstall install"
327 install_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin /usr/ucb"
330 for i in $install_names; do
331 for j in $install_dirs; do
332 if test -x "$j/$i"; then
333 if test -n "`$j/$i --version 2>/dev/null | grep utils`"; then
341 f_insttool="$install_prog"
344 if test "$f_insttool" = NO; then
345 if test "$install_found" = YES; then
351 echo "GNU version of install is required: this is part of the fileutils/coreutils package: "
352 echo "see http://www.gnu.org/software/fileutils/fileutils.html"
356 echo "using $f_insttool";
359 # - check for dot ------------------------------------------------------------
361 echo -n " Checking for dot (part of GraphViz)... "
362 if test "$f_dot" = NO; then
363 dot_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
365 for j in $dot_dirs; do
366 if test -x "$j/dot"; then
374 if test "$f_dot" = NO; then
380 # - check for perl ------------------------------------------------------------
382 echo -n " Checking for perl... "
383 if test "$f_perl" = NO; then
384 perl_names="perl perl5"
385 perl_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
388 for i in $perl_names; do
389 for j in $perl_dirs; do
390 if test -x "$j/$i"; then
392 if $j/$i -e 'require 5.000;' 2>/dev/null ; then
402 if test "$f_perl" = NO; then
403 if test "$perl_found" = YES; then
404 echo "version is too old (5.000 or higher is required)."
411 echo "using $f_perl";
413 # - check for flex ------------------------------------------------------------
415 echo -n " Checking for flex... "
416 if test "$f_flex" = NO; then
417 flex_dirs="$bin_dirs /usr/bin /usr/local/bin /bin"
420 for j in $flex_dirs; do
421 if test -x "$j/flex"; then
430 if test "$f_flex" = NO; then
437 # - check for bison ------------------------------------------------------------
439 echo -n " Checking for bison... "
440 if test "$f_bison" = NO; then
441 bison_dirs="$bin_dirs /usr/bin /usr/local/bin /bin"
444 for j in $bison_dirs; do
445 if test -x "$j/bison"; then
447 bison_prog="$j/bison"
451 f_bison="$bison_prog"
454 if test "$f_bison" = NO; then
458 echo "using $f_bison"
461 # -----------------------------------------------------------------------------
466 echo " Creating VERSION file."
467 # Output should be something like 1.4.5-20051010
468 if test "x$doxygen_version_mmn" = "xNO"; then
469 echo "$doxygen_version_major.$doxygen_version_minor.$doxygen_version_revision" > VERSION
471 echo "$doxygen_version_major.$doxygen_version_minor.$doxygen_version_revision-$doxygen_version_mmn" > VERSION
474 test -f .makeconfig && rm .makeconfig
475 test -f .tmakeconfig && rm .tmakeconfig
479 cat > .makeconfig <<EOF
481 TMAKEPATH = $configPWD/tmake/lib/$f_platform
482 ENV = env TMAKEPATH=\$(TMAKEPATH)
483 TMAKE = $configPWD/tmake/bin/tmake
488 VERSION = `cat VERSION`
490 INSTTOOL = $f_insttool
494 MAN1DIR = share/man/man1
497 if test "$f_dot" != NO; then
498 cat >> .makeconfig <<EOF
503 if test "$f_platform" = "m68k-atari-mint-g++"; then
504 cat >> .makeconfig <<EOF
509 if test "$f_platform" = "macosx-c++"; then
510 cat >> .makeconfig <<EOF
511 MKSPECS = -spec macx-g++
514 if test "$f_platform" = "macosx-uni-c++"; then
515 cat >> .makeconfig <<EOF
516 MKSPECS = -spec macx-g++
521 # Make doxygen.spec...
523 echo " Created doxygen.spec file, for rpm generation."
525 echo "%define version $doxygen_version_major.$doxygen_version_minor.$doxygen_version_revision" > spec.tmp
526 if test "$doxygen_version_mmn" = NO; then
527 echo "%define revision 1" >> spec.tmp
528 echo "%define mmn 1" >> spec.tmp
530 echo "%define revision $doxygen_version_mmn" >> spec.tmp
531 echo "%define mmn $doxygen_version_mmn" >> spec.tmp
535 mkdir -p packages/rpm
537 cat spec.tmp ./packages/rpm/doxygen.spec.in > ./packages/rpm/doxygen.spec
545 if test "$f_shared" = NO; then
546 if test "$f_platform" = "osf1-cxx" -o "$f_platform" = "irix-n32"; then
547 cat >> .tmakeconfig <<EOF
548 TMAKE_LFLAGS += -non_shared
550 elif test "$f_platform" = "solaris-cc"; then
551 cat >> .tmakeconfig <<EOF
552 TMAKE_LFLAGS += -Bstatic
554 elif test "$f_platform" = "hpux-cc"; then
555 cat >> .tmakeconfig <<EOF
556 TMAKE_LFLAGS += -noshared
559 cat >> .tmakeconfig <<EOF
560 TMAKE_LFLAGS += -static
564 if test "$f_platform" = "hpux-g++" -o "$f_platform" = "linux-g++"; then
565 cat >> .tmakeconfig <<EOF
566 TMAKE_CXXFLAGS += -D_LARGEFILE_SOURCE
569 if test "$f_platform" = "macosx-uni-c++"; then
570 if test -n "`ls /Developer/SDKs/MacOSX10.*.sdk 2>/dev/null`"; then
571 mac_sdk=MacOSX10.4u.sdk
573 if test -n "`ls /Developer/SDKs/MacOSX10.5*.sdk 2>/dev/null`"; then
574 mac_sdk=MacOSX10.5.sdk
576 if test -n $mac_sdk; then
577 cat >> .tmakeconfig <<EOF
578 TMAKE_CFLAGS += -isysroot /Developer/SDKs/$mac_sdk
579 TMAKE_CXXFLAGS += -isysroot /Developer/SDKs/$mac_sdk
580 TMAKE_LFLAGS += -Wl,-syslibroot,/Developer/SDKs/$mac_sdk
584 if test "$f_wizard" = YES; then
585 cat >> .tmakeconfig <<EOF
586 TMAKE_MOC = $QTDIR/bin/moc
590 if test "$f_english" = YES; then
591 cat >> .tmakeconfig <<EOF
592 TMAKE_CXXFLAGS += -DENGLISH_ONLY
596 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"
598 for i in $f_inmakefiles ; do
600 DST=`echo $i|sed 's%\(.*\).in$%\1%'`
604 # This file was generated from `basename $i` on $TIME
608 cat .makeconfig >> $DST
609 if test $i = Makefile.in; then
611 echo "all: src/version.cpp " >> $DST
612 echo " \$(MAKE) -C qtools" >> $DST
613 echo " \$(MAKE) -C libmd5" >> $DST
614 echo " \$(MAKE) -C src" >> $DST
615 if test $f_wizard = YES; then
616 echo " \$(MAKE) MAN1DIR=\$(MAN1DIR) -C addon/doxywizard" >> $DST
618 if test $f_app = YES; then
619 echo " \$(MAKE) -C addon/doxyapp" >> $DST
622 echo "doxywizard_install:" >> $DST
623 if test $f_wizard = YES; then
624 echo " \$(MAKE) MAN1DIR=\$(MAN1DIR) -C addon/doxywizard install" >> $DST
628 if test $f_wizard = YES; then
629 sed -e "s/%%WITHDOXYWIZARD%% /--with doxywizard /g" $SRC >> $DST
631 sed -e "s/%%WITHDOXYWIZARD%% //g" $SRC >> $DST
633 echo " Created $DST from $SRC..."
636 cat src/libdoxycfg.t.in | sed -e "s|%%FLEX%%|$f_flex|g" -e "s|%%BISON%%|$f_bison|g" > src/libdoxycfg.t
637 cat src/libdoxygen.t.in | sed -e "s|%%FLEX%%|$f_flex|g" -e "s|%%BISON%%|$f_bison|g" > src/libdoxygen.t
639 f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.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"
641 for i in $f_inprofiles ; do
643 DST=`echo $i|sed 's%\(.*\).in$%\1%'`
647 # This file was generated from `basename $i` on $TIME
651 if test "$f_debug" = NO; then
656 #if test "$f_thread" = YES; then
657 # realopts="$realopts thread"
659 cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" >> $DST
660 echo " Created $DST from $SRC..."
663 # - generating src/lang_cfg.h
665 if test -f "src/lang_cfg.h"; then
666 chmod u+w src/lang_cfg.h # make sure file can be overwritten
668 echo -n " Generating src/lang_cfg.h..."
669 echo $f_langs | $f_perl -e '@l=split(/,/,<STDIN>);
671 @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,AM"));
672 foreach my $elem (@l){
673 $elem =~ tr/a-z/A-Z/;
675 foreach my $tst (@allowed){
676 if ($tst eq $elem) { $r=1; last; }
678 if ($r!=1) { die "ERROR: Invalid language $elem was selected!\n"; }
679 print "#define LANG_$elem\n";
680 };' > ./src/lang_cfg.h