Imported Upstream version 1.8.8
[platform/upstream/doxygen.git] / configure
1 #!/bin/sh
2 #
3 # $Id$
4 #
5 # Copyright (C) 1997-2014 by Dimitri van Heesch.
6
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.
12
13 # Documents produced by Doxygen are derivative works derived from the
14 # input used in their production; they are not affected by this license.
15
16 # shell script to configure doxygen
17
18 doxygen_version_major=1
19 doxygen_version_minor=8
20 doxygen_version_revision=8
21
22 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package.
23 doxygen_version_mmn=NO
24
25 bin_dirs=`echo $PATH | sed -e "s/:/ /g"`
26
27 f_debug=NO
28 f_shared=YES
29 f_make=NO
30 f_dot=NO
31 f_perl=NO
32 f_python=NO
33 f_plf_auto=NO
34 f_prefix=/usr/local
35 f_insttool=NO
36 f_english=NO
37 f_wizard=NO
38 f_app=NO
39 f_doxmlparser=NO
40 f_thread=NO
41 f_flex=NO
42 f_bison=NO
43 f_search=NO
44 f_sqlite3=NO
45 f_sqlite3static=NO
46 f_sqlite3_path=NO
47 f_libclang=NO
48 f_libclangstatic=NO
49
50 #
51 # first setup the list with availabe languages, so we cannot forget any
52 # list will be in case as specified (f_langs) and in uppercase (f_ulangs) as used in the internal perl script
53 #
54 f_langs=`ls -1 src/translator_??.h | sed -e 's%src/translator_%%g' | sed -e 's/\.h//' | tr '\012' ','`
55
56 while test -n "$1";  do
57   case $1 in
58     --prefix=*)
59        f_prefix=`echo $1 | sed 's/^--prefix=//'`
60        ;;
61     --prefix | -prefix)
62        shift; f_prefix=$1
63        ;;
64     --docdir=*)
65        f_docdir=`echo $1 | sed 's/^--docdir=//'`
66        ;;
67     --docdir | -docdir)
68        shift; f_docdir=$1
69        ;;
70     --shared | -shared)
71        f_shared=YES
72        ;;
73     --static | -static)
74        f_shared=NO
75        ;;
76     --release | -release)
77        f_debug=NO
78        ;;
79     --debug | -debug)
80        f_debug=YES
81        ;;
82     --english-only | -english-only)
83        f_english=YES
84        ;;
85     --enable-langs=*)
86        f_langs=`echo $1 | sed 's/^--enable-langs=//'`
87        ;;
88     --enable-langs | -enable-langs)
89        shift; f_langs=$1
90        ;;
91     --platform=*)
92        f_platform=`echo $1 | sed 's/^--platform=//'`
93        ;;
94     --platform | -platform)
95        shift; f_platform=$1
96        ;;
97     --make=*)
98        f_make=`echo $1 | sed 's/^--make=//'`
99        ;;
100     --make | -make)
101        shift; f_make=$1
102        ;;
103     --dot=*)
104        f_dot=`echo $1 | sed 's/^--dot=//'`
105        ;;
106     --dot | -dot)
107        shift; f_dot=$1
108        ;;
109     --python=*)
110        f_python=`echo $1 | sed 's/^--python=//'`
111        ;;
112     --python | -python)
113        shift; f_python=$1
114        ;;
115     --perl=*)
116        f_perl=`echo $1 | sed 's/^--perl=//'`
117        ;;
118     --perl | -perl)
119        shift; f_perl=$1
120        ;;
121     --flex=*)
122        f_flex=`echo $1 | sed 's/^--flex=//'`
123        ;;
124     --flex | -flex)
125        shift; f_flex=$1
126        ;;
127     --bison=*)
128        f_bison=`echo $1 | sed 's/^--bison=//'`
129        ;;
130     --bison | -bison)
131        shift; f_bison=$1
132        ;;
133     --install=*)
134        f_insttool=`echo $1 | sed 's/^--install=//'`
135        ;;
136     --install | -install)
137        shift; f_insttool=$1
138        ;;
139     --with-doxywizard | -with-doxywizard)
140        f_wizard=YES
141        ;;
142     --with-doxyapp | -with-doxyapp)
143        f_app=YES
144        ;;
145     --with-doxmlparser | -with-doxmlparser)
146        f_doxmlparser=YES
147        ;;
148     --with-doxysearch | -with-doxysearch)
149        f_search=YES
150        ;;
151     --with-sqlite3 | -with-sqlite3)
152        f_sqlite3=YES
153        ;;
154     --with-sqlite3-static | -with-sqlite3-static)
155        f_sqlite3=YES
156        f_sqlite3static=YES
157        ;;
158     --sqlite3-path=*)
159        f_sqlite3_path=`echo $1 | sed 's/^--sqlite3-path=//'`
160        ;;
161     --sqlite3-path | -sqlite3-path)
162        shift; f_sqlite3_path=$1
163        ;;
164     --with-libclang | -with-libclang)
165        f_libclang=YES
166        ;;
167     --with-libclang-static | -with-libclang-static)
168        f_libclang=YES
169        f_libclangstatic=YES
170        ;;
171     -h | -help | --help)
172        f_help=y
173        ;;
174     *)
175        echo $1: unknown argument
176        f_help=y
177        f_error=y
178        ;;
179   esac
180   shift
181 done
182
183 if test "$f_help" = y; then
184   cat <<EOF
185 Usage: $0 [--help] [--shared] [--static] [--release] [--debug] [--python name]
186           [--perl name] [--flex name] [--bison name] [--make name] 
187           [--dot name] [--platform target] [--prefix dir] [--docdir dir] 
188           [--install name] [--english-only] [--enable-langs list] 
189           [--with-sqlite3] [--with-sqlite3-static] [--sqlite3-path]
190           [--with-libclang] [--with-libclang-static]
191           [--with-doxywizard] [--with-doxysearch] [--with-doxyapp]
192           [--with-doxxmlparser]
193
194 Options: 
195
196   --help                Print this help
197   --shared | --static   Build using shared or static linking
198                         [default: shared]
199   --release | --debug   Build for release or debug 
200                         [default: release]
201   --python name         Use \`name' as the name of the python interpreter 
202                         [default: autodetect]
203   --perl name           Use \`name' as the name of the perl interpreter 
204                         [default: autodetect]
205   --flex name           Use \`name' as the name of the GNU lexical scanner 
206                         [default: autodetect]
207   --bison name          Use \`name' as the name of the GNU compiler generator 
208                         [default: autodetect]
209   --make name           Use \`name' as the name of the GNU make tool
210                         [default: autodetect]
211   --dot name            Use \`name' as the name of the dot tool that
212                         is part of the Graphviz package.
213                         [default: autodetect]
214   --platform target     Do not detect platform but use \`target' instead.
215                         See PLATFORMS for a list of possibilities
216   --prefix dir          Installation prefix directory (doxygen will be
217                         put in PREFIX/bin/doxygen)
218                         [default: $f_prefix]
219   --docdir dir          Documentation is installed in DOCDIR/
220                         [default: PREFIX/share/doc/packages/doxygen]
221   --install name        Use \`name' as the name of the GNU install tool
222                         [default: autodetect]
223   --english-only        Include support for English only.
224   --enable-langs list   Include support for output languages listed in list.
225                         [default: $f_langs]
226   --with-sqlite3        Add support for sqlite3 output [experimental]
227   --with-libclang       Add support for libclang parsing
228   --with-doxywizard     Build the GUI frontend for doxygen. This
229                         requires Qt version 4.
230   --with-doxysearch     Build external search tools (doxysearch and doxyindexer)
231                         requires Xapian library version 1.2
232   --with-doxyapp        Example showing how to embed doxygen in an application.
233   --with-doxmlparser    Example showing how to parse doxygen's XML output.
234
235 EOF
236   test "$f_error" = y && exit 1
237   exit 0;
238 fi
239
240 u_release=`(uname -r) 2>/dev/null` || u_release=unknown
241 u_system=`(uname -s) 2>/dev/null` || u_system=unknown
242
243 if test -z "$f_platform"; then
244   f_platforms="`cat PLATFORMS`"
245   
246   case "$u_system:$u_release" in
247     AIX*)
248       f_platform=aix-xlc
249       ;;
250     BeOS*)
251       f_platform=beos-g++
252       ;;
253     dgux:*)
254       f_platform=dgux-g++
255       ;;
256     Darwin:*)
257       f_platform=macosx-c++
258       if test "$f_insttool" = NO; then
259         f_insttool=/usr/bin/install
260       fi
261       ;;
262     FreeBSD:*)
263       f_platform=freebsd-g++
264       if test "$f_insttool" = NO; then
265         f_insttool=/usr/bin/install
266       fi
267       ;;
268     NetBSD:*)
269       f_platform=netbsd-g++
270       if test "$f_insttool" = NO; then
271         f_insttool=/usr/bin/install
272       fi
273       ;;
274     HP-UX:*)
275       f_platform=hpux-g++
276       if test "$f_insttool" = NO; then
277         f_insttool=/usr/bin/install
278       fi
279       ;;
280     IRIX64:*)
281       f_platform=irix-64
282       ;;
283     IRIX:*)
284       f_platform=irix-n32
285       ;;
286     Linux:*|GNU:*|GNU/*:*)
287       f_platform=linux-g++
288       ;;
289     NetBSD:*)
290       f_platform=netbsd-g++
291       ;;
292     OpenBSD:*)
293       f_platform=openbsd-g++
294       ;;
295     OSF1:*)
296       f_platform=osf1-g++
297       ;;
298     QNX:*)
299       f_platform=qnx-g++
300       ;;
301     *:3.2)
302       f_platform=sco-g++
303       ;;
304     SunOS:4*)
305       f_platform=sunos-g++
306       ;;
307     SunOS:5*)
308       f_platform=solaris-g++
309       if test "$f_insttool" = NO; then
310         f_insttool=/usr/bin/install
311       fi
312       ;;
313     ULTRIX:*)
314       f_platform=ultrix-g++
315       ;;
316     UNIX_SV:4.2*)
317       f_platform=unixware-g++
318       ;;
319     Cygwin:*|CYGWIN*)
320       f_platform=win32-g++
321       ;;
322     MINGW32_NT*)
323       f_platform=win32-mingw
324       ;;
325     *MiNT:*)
326       f_platform=m68k-atari-mint-g++
327       ;;
328     *)
329     echo
330     echo "Your platform was not recognised by this configure script"
331     echo "Please use the -platform option to specify one of platforms"
332     echo "in this list:"
333     echo
334     for p in $f_platforms
335     do
336       echo "    $0 $* -platform $p"
337     done
338     echo
339     exit 2
340   esac 
341   echo "  Autodetected platform $f_platform... "
342   f_plf_auto=YES
343 fi
344
345 if test -z "$f_docdir"; then
346   f_docdir='$(INSTALL)/share/doc/packages/doxygen'
347 fi
348
349 if test "$f_plf_auto" = NO; then
350   printf "  Checking for platform $f_platform... "
351   if test '!' -d tmake/lib/$f_platform; then
352     echo "not supported!" 
353     echo
354     exit 2
355   fi
356   echo "supported"
357 fi
358
359 #- check for qt --------------------------------------------------------------
360  
361 if test "$f_wizard" = YES; then
362   if test -z "$QTDIR"; then
363     echo "  QTDIR environment variable not set!"
364     printf "  Checking for Qt..."
365     for d in /usr/{lib,share,qt}/{qt-4,qt4,qt,qt*,4} /usr; do
366       if test -x "$d/bin/qmake"; then
367         QTDIR=$d
368         break 2
369       fi
370     done
371   else
372     if test -e "$QTDIR/bin/qmake"; then
373       printf "  Detected Qt via the QTDIR environment variable..."
374     else
375       printf "ERROR Detected Qt via the QTDIR environment variable..."
376       echo ", but $QTDIR/bin/qmake does not exist."
377       echo "      Set the QTDIR environment variable such that \$QTDIR/bin/qmake exists."
378       exit 2
379     fi
380   fi
381   if test -z "$QTDIR"; then
382     echo "QTDIR not set and Qt not found at standard locations!"
383     echo
384     echo "Set the QTDIR environment variable such that \$QTDIR/bin/qmake exists."
385     echo "check the Qt installation instructions!"
386     exit 2
387   fi
388   echo using $QTDIR
389 fi
390
391 #- check for xapian -----------------------------------------------------------
392
393 if test "$f_search" = YES; then
394   if test -z "$XAPIAN"; then
395     printf "  Checking for Xapian..."
396     for d in /usr /usr/local /opt/local; do
397       if test -e "$d/include/xapian.h"; then
398         XAPIAN=$d
399         break 2
400       fi
401     done
402   else
403     if test -e "$XAPIAN/include/xapian.h"; then
404       printf "  Detected Xapian via the XAPIAN environment variable..."
405     else
406       printf "ERROR Detected Xapian via the XAPIAN environment variable..."
407       echo ", but $XAPIAN/include/xapian.h does not exist."
408       echo "      Set the XAPIAN environment variable such that \$XAPIAN/include/xapian.h exists."
409       exit 2
410     fi
411   fi
412   if test -z "$XAPIAN"; then
413     echo "XAPIAN not set and xapian.h not found at standard locations!"
414     exit 2;
415   fi
416   echo using $XAPIAN
417 fi
418    
419 # - check for make ------------------------------------------------------------
420
421 printf "  Checking for GNU make tool... "
422 if test "$f_make" = NO; then
423   make_names="gmake make"
424   make_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
425   make_prog=NO
426   for i in $make_names; do
427     for j in $make_dirs; do
428       if test -x "$j/$i"; then
429         if test -n "`$j/$i --version 2>/dev/null | grep GNU`"; then
430           make_prog="$j/$i"
431           break 2
432         fi
433       fi
434     done
435   done
436   f_make="$make_prog" 
437 fi
438
439 if test "$f_make" = NO; then
440   echo "not found!";
441   echo
442   exit 2
443 fi
444 echo "using $f_make"
445
446 # - check for install ------------------------------------------------------------
447
448 printf "  Checking for GNU install tool... "
449 if test "$f_insttool" = NO; then
450   install_names="ginstall install"
451   install_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin /usr/ucb"
452   install_prog=NO
453   install_found=NO
454   for i in $install_names; do
455     for j in $install_dirs; do
456       if test -x "$j/$i"; then
457         if test -n "`$j/$i --version 2>/dev/null | grep utils`"; then
458           install_found=YES
459           install_prog="$j/$i"
460           break 2
461         fi
462       fi
463     done
464   done
465   f_insttool="$install_prog" 
466 fi
467
468 if test "$f_insttool" = NO; then
469   if test "$install_found" = YES; then
470     echo;
471   else
472     echo "not found!";
473     echo
474   fi
475   echo "GNU version of install is required: this is part of the fileutils/coreutils package: "
476   echo "see http://www.gnu.org/software/fileutils/fileutils.html"
477   echo
478   exit 2
479 fi
480 echo "using $f_insttool";
481
482
483 # - check for dot ------------------------------------------------------------
484
485 printf "  Checking for dot (part of GraphViz)... "
486 if test "$f_dot" = NO; then
487   dot_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
488   dot_prog=NO
489   for j in $dot_dirs; do
490     if test -x "$j/dot"; then
491       dot_prog="$j/dot"
492       break 2
493     fi
494   done
495   f_dot="$dot_prog" 
496 fi
497
498 if test "$f_dot" = NO; then
499   echo "not found!";
500 else
501   echo "using $f_dot"
502 fi
503
504 # - check for sqlite3 ---------------------------------------------------------
505
506 if test "$f_sqlite3" = YES; then
507   printf "  Checking for sqlite3 ... "
508   if test "$f_sqlite3_path" = NO; then
509     sqlite3_hdr_dir="/usr/include /usr/local/include /opt/local/include"
510     sqlite3_lib_dir="/usr/lib /usr/local/lib /opt/local/lib /usr/lib/x86_64-linux-gnu /usr/lib64"
511   else
512     sqlite3_hdr_dir="$f_sqlite3_path/include"
513     sqlite3_lib_dir="$f_sqlite3_path/lib"
514   fi
515   if test "$f_sqlite3static" = NO; then
516     sqlite3_lib_name="libsqlite3.so libsqlite3.dylib libsqlite3.a libsqlite3.dll.a"
517   else
518     sqlite3_lib_name="libsqlite3.a"
519   fi
520   sqlite3_hdr=NO
521   sqlite3_lib=NO
522   sqlite3_link=
523   for j in $sqlite3_hdr_dir; do
524     if test -f "$j/sqlite3.h"; then
525       sqlite3_hdr="$j/sqlite3.h"
526       break
527     fi
528   done
529   for i in $sqlite3_lib_dir; do
530     if test "$sqlite3_lib" = NO; then
531       for j in $sqlite3_lib_name; do
532         if test -e "$i/$j"; then
533           if test "$f_sqlite3static" = NO; then
534             sqlite3_lib="$i/$j"
535             sqlite3_link="-L$i -lsqlite3"
536           else
537             sqlite3_lib="$i/$j"
538             sqlite3_link="$i/$j -ldl"
539           fi
540           break
541         fi
542       done
543     fi
544   done
545   if test "$sqlite3_hdr" = NO -o "$sqlite3_lib" = NO; then
546     echo "not found!";
547     exit 1
548   else
549     echo "using header $sqlite3_hdr and library $sqlite3_lib...";
550   fi
551 fi
552
553 # - check for libclang ---------------------------------------------------------
554
555 if test "$f_libclang" = YES; then
556   printf "  Checking for libclang ... "
557   libclang_hdr_dir="/usr/include /usr/local/include /opt/local/include"
558   libclang_lib_dir="/usr/lib /usr/local/lib /opt/local/lib /usr/lib64/llvm /usr/lib/llvm"
559   if test "$f_libclangstatic" = NO; then
560     libclang_lib_name="libclang.so libclang.dylib libclang.a libclang.dll.a"
561   else
562     libclang_lib_name="libclang.a"
563   fi
564   libclang_hdr=NO
565   libclang_lib=NO
566   libclang_link=
567   for j in $libclang_hdr_dir; do
568     if test -f "$j/clang-c/Index.h"; then
569       libclang_hdr="$j/clang-c/Index.h"
570       break
571     fi
572   done
573   for i in $libclang_lib_dir; do
574     if test "$libclang_lib" = NO; then
575       for j in $libclang_lib_name; do
576         if test -f "$i/$j"; then
577           libclang_lib="$i/$j"
578           if test "$f_libclangstatic" = NO; then
579             libclang_link="-L $i -lclang"
580           else
581             libclang_link="$i/libclang.a $i/libclangFrontend.a $i/libclangSerialization.a $i/libclangParse.a $i/libclangSema.a $i/libclangAnalysis.a $i/libclangStaticAnalyzerCore.a $i/libclangAST.a $i/libclangBasic.a $i/libclangDriver.a $i/libclangEdit.a $i/libclangLex.a $i/libclangRewriteCore.a $i/libLLVMBitReader.a $i/libLLVMMC.a $i/libLLVMMCParser.a $i/libLLVMSupport.a -ldl -lpthread"
582           fi
583           break
584         fi
585       done
586     fi
587   done
588   if test "$libclang_hdr" = NO -o "$libclang_lib" = NO; then
589     echo "not found!";
590   else
591     echo "using header $libclang_hdr and library $libclang_lib...";
592   fi
593 fi
594
595 # - check for python ----------------------------------------------------------
596
597 python_version=0
598 printf "  Checking for python... "
599 if test "$f_python" = NO; then
600   python_names="python3 python2 python"
601   python_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
602   python_prog=NO
603   python_found=NO
604   for i in $python_names; do
605     for j in $python_dirs; do
606       if test -x "$j/$i"; then
607         python_found=YES
608         if test `$j/$i -c "import sys; print(sys.version_info[0])"` = 3; then
609           python_prog="$j/$i";
610           python_version=`$j/$i -c "import platform; print(platform.python_version())"`;
611           break 2
612         elif test `$j/$i -c "import sys; print(sys.version_info[0])"` = 2; then
613           if test `$j/$i -c "import sys; print(sys.version_info[1])"` -ge 6; then
614             python_prog="$j/$i";
615             python_version=`$j/$i -c "import platform; print(platform.python_version())"`;
616             break 2
617           fi
618         fi
619       fi
620     done
621   done
622   f_python="$python_prog"
623 fi
624
625 if test "$f_python" = NO; then
626   if test "$python_found" = YES; then
627     echo "version should be python 2.6 or higher."
628   else
629     echo "not found!";
630   fi
631   echo
632   exit 2
633 fi
634 echo "using $f_python (version $python_version)";
635
636 # - check for perl ------------------------------------------------------------
637
638 printf "  Checking for perl... "
639 if test "$f_perl" = NO; then
640   perl_names="perl perl5"
641   perl_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
642   perl_prog=NO
643   perl_found=NO
644   for i in $perl_names; do
645     for j in $perl_dirs; do
646       if test -x "$j/$i"; then
647         perl_found=YES
648         if $j/$i -e 'require 5.000;' 2>/dev/null ; then
649           perl_prog="$j/$i"
650           break 2
651         fi
652       fi
653     done
654   done
655   f_perl="$perl_prog" 
656 fi
657
658 if test "$f_perl" = NO; then
659   if test "$perl_found" = YES; then
660     echo "version is too old (5.000 or higher is required)."
661   else
662     echo "not found!";
663   fi
664   echo
665   exit 2
666 fi
667 echo "using $f_perl";
668
669 # - check for flex ------------------------------------------------------------
670
671 printf "  Checking for flex... "
672 if test "$f_flex" = NO; then
673   flex_dirs="$bin_dirs /usr/bin /usr/local/bin /bin"
674   flex_prog=NO
675   flex_found=NO
676   for j in $flex_dirs; do
677     if test -x "$j/flex"; then
678       flex_found=YES
679       flex_prog="$j/flex"
680       break
681     fi
682   done
683   f_flex="$flex_prog" 
684 fi
685
686 if test "$f_flex" = NO; then
687   echo "not found!";
688   exit 2
689 else
690   echo "using $f_flex"
691 fi
692
693 # - check for bison ------------------------------------------------------------
694
695 printf "  Checking for bison... "
696 if test "$f_bison" = NO; then
697   bison_dirs="$bin_dirs /usr/bin /usr/local/bin /bin"
698   bison_prog=NO
699   bison_found=NO
700   for j in $bison_dirs; do
701     if test -x "$j/bison"; then
702       bison_found=YES
703       bison_prog="$j/bison"
704       break
705     fi
706   done
707   f_bison="$bison_prog" 
708 fi
709
710 if test "$f_bison" = NO; then
711   echo "not found!";
712   exit 2
713 else
714   echo "using $f_bison"
715 fi
716
717 # -----------------------------------------------------------------------------
718
719 if test '!' -d "generated_src/doxygen"; then
720   mkdir -p generated_src/doxygen
721 fi
722 if test "$f_wizard" = YES; then
723   if test '!' -d "generated_src/doxywizard"; then
724     mkdir -p generated_src/doxywizard
725   fi
726 fi
727
728 #
729 # Make VERSION file
730 #
731 test -f "VERSION" && chmod u+w VERSION
732 test -f "generated_src/doxygen/version.cpp" && chmod u+w generated_src/doxygen/version.cpp
733 echo "  Generating generated_src/doxygen/version.cpp and VERSION..."
734 cd src
735 $f_python version.py ../generated_src/doxygen
736 cd ..
737 if test "$f_wizard" = YES; then
738   test -f "VERSION" && chmod u+w VERSION
739   test -f "generated_src/doxywizard/version.cpp" && chmod u+w generated_src/doxywizard/version.cpp
740   echo "  Generating generated_src/doxywizard/version.cpp and VERSION..."
741   cd src
742   $f_python version.py ../generated_src/doxywizard
743   cd ..
744
745 fi
746
747 test -f .makeconfig && rm .makeconfig
748 test -f .tmakeconfig && rm .tmakeconfig
749
750 configPWD=`pwd`
751
752 cat > .makeconfig <<EOF
753 DOXYGEN   = $configPWD
754 TMAKEPATH = $configPWD/tmake/lib/$f_platform
755 ENV       = env TMAKEPATH="\$(TMAKEPATH)"
756 TMAKE     = $configPWD/tmake/bin/tmake
757 MAKE      = $f_make
758 PYTHON    = $f_python
759 PERL      = $f_perl
760 LEX       = $f_flex
761 RM        = rm -f
762 CP        = cp
763 VERSION   = `cat VERSION`
764 INSTALL   = $f_prefix
765 INSTTOOL  = $f_insttool
766 DOXYDOCS  = ..
767 DOCDIR    = $f_docdir
768 QTDIR     = $QTDIR
769 EOF
770
771 if test "$f_dot" != NO; then
772   cat >> .makeconfig <<EOF
773 HAVE_DOT  = $f_dot
774 EOF
775 fi
776
777
778 if test "$f_platform" = "m68k-atari-mint-g++"; then
779   cat >> .makeconfig <<EOF
780 TMAKE += -unix
781 EOF
782 fi
783
784 if test "$f_platform" = "macosx-c++"; then
785   cat >> .makeconfig <<EOF
786 MKSPECS   = -spec macx-g++
787 EOF
788 fi
789 if test "$f_platform" = "macosx-uni-c++"; then
790   cat >> .makeconfig <<EOF
791 MKSPECS   = -spec macx-g++
792 EOF
793 fi
794
795 # Make doxygen.spec...
796 #
797 echo "  Created doxygen.spec file, for rpm generation."
798
799 echo "%define version $doxygen_version_major.$doxygen_version_minor.$doxygen_version_revision" > spec.tmp
800 if test "$doxygen_version_mmn" = NO; then
801   echo "%define revision 1" >> spec.tmp
802   echo "%define mmn 1"      >> spec.tmp
803 else
804   echo "%define revision $doxygen_version_mmn" >> spec.tmp
805   echo "%define mmn $doxygen_version_mmn"      >> spec.tmp
806 fi
807
808 mkdir -p packages
809 mkdir -p packages/rpm
810
811 cat spec.tmp ./packages/rpm/doxygen.spec.in > ./packages/rpm/doxygen.spec
812
813 rm -f spec.tmp
814
815
816 # make .tmakeconfig
817 #
818 touch .tmakeconfig
819 if test "$f_shared" = NO; then
820   if test "$f_platform" = "osf1-cxx" -o "$f_platform" = "irix-n32"; then
821   cat >> .tmakeconfig <<EOF
822     TMAKE_LFLAGS += -non_shared
823 EOF
824   elif test "$f_platform" = "solaris-cc"; then
825   cat >> .tmakeconfig <<EOF
826     TMAKE_LFLAGS += -Bstatic
827 EOF
828   elif test "$f_platform" = "hpux-cc"; then
829   cat >> .tmakeconfig <<EOF
830     TMAKE_LFLAGS += -noshared
831 EOF
832   else
833   cat >> .tmakeconfig <<EOF
834     TMAKE_LFLAGS += -static
835 EOF
836   fi
837 fi
838 if test "$f_platform" = "hpux-g++" -o "$f_platform" = "linux-g++"; then
839   cat >> .tmakeconfig <<EOF
840     TMAKE_CXXFLAGS += -D_LARGEFILE_SOURCE
841 EOF
842 fi
843 if test "$f_platform" = "macosx-uni-c++"; then
844   if test -n "`ls /Developer/SDKs/MacOSX10.*.sdk 2>/dev/null`"; then
845     mac_sdk=MacOSX10.4u.sdk
846   fi
847   if test -n "`ls /Developer/SDKs/MacOSX10.5*.sdk 2>/dev/null`"; then
848     mac_sdk=MacOSX10.5.sdk
849   fi
850   if test -n $mac_sdk; then
851   cat >> .tmakeconfig <<EOF
852     TMAKE_CFLAGS   += -isysroot /Developer/SDKs/$mac_sdk
853     TMAKE_CXXFLAGS += -isysroot /Developer/SDKs/$mac_sdk
854     TMAKE_LFLAGS   += -Wl,-syslibroot,/Developer/SDKs/$mac_sdk
855 EOF
856   fi
857 fi
858 if test "$f_wizard" = YES; then
859   cat >> .tmakeconfig <<EOF
860 TMAKE_MOC = $QTDIR/bin/moc
861 EOF
862 fi
863
864 if test "$f_search" = YES; then
865   cat >> .tmakeconfig <<EOF
866 LIBS += -L$XAPIAN/lib
867 INCLUDEPATH += $XAPIAN/include
868 EOF
869 fi
870
871 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 addon/doxysearch/Makefile.in vhdlparser/Makefile.in"
872
873 for i in $f_inmakefiles ; do
874      SRC=$i
875      DST=`echo $i|sed 's%\(.*\).in$%\1%'`
876      TIME=`date`
877      cat > $DST <<EOF
878 #
879 # This file was generated from `basename $i` on $TIME
880 #
881
882 EOF
883      cat .makeconfig >> $DST
884      if test $i = Makefile.in; then
885        echo "" >> $DST
886        EXTRADEPS=
887        if test $f_wizard = YES; then
888          EXTRADEPS=doxywizard
889        fi
890 #       if test $f_search = YES; then
891 #         EXTRADEPS="$EXTRADEPS doxysearch"
892 #       fi
893        echo "all: generated_src/doxygen/version.cpp $EXTRADEPS" >> $DST
894        echo "   \$(MAKE) -C qtools" >> $DST
895        echo "   \$(MAKE) -C libmd5" >> $DST
896        echo "   \$(MAKE) -C vhdlparser" >> $DST
897        echo "   \$(MAKE) -C src" >> $DST
898
899        if test $f_wizard = YES; then
900          echo " \$(MAKE) MAN1DIR=\$(MAN1DIR) -C addon/doxywizard" >> $DST
901        fi
902        if test $f_search = YES; then
903          echo " \$(MAKE) -C addon/doxysearch" >> $DST
904        fi
905        if test $f_app = YES; then
906          echo " \$(MAKE) -C addon/doxyapp" >> $DST
907        fi
908        if test $f_doxmlparser = YES; then
909          echo " \$(MAKE) -C addon/doxmlparser/src" >> $DST
910          echo " \$(MAKE) -C addon/doxmlparser/test" >> $DST
911          echo " \$(MAKE) -C addon/doxmlparser/examples/metrics" >> $DST
912        fi
913        echo "" >> $DST
914        echo "doxywizard_install:" >> $DST
915        if test $f_wizard = YES; then
916          echo " \$(MAKE) INSTALL=\$(DESTDIR)\$(INSTALL) MAN1DIR=\$(MAN1DIR) -C addon/doxywizard install" >> $DST
917        fi
918        echo "doxysearch_install:" >> $DST
919        if test $f_search = YES; then
920          echo " \$(MAKE) INSTALL=\$(DESTDIR)\$(INSTALL) MAN1DIR=\$(MAN1DIR) -C addon/doxysearch install" >> $DST
921        fi
922        echo "" >> $DST
923      fi
924      if test $f_wizard = YES; then
925        sed -e "s/%%WITHDOXYWIZARD%% /--with doxywizard /g" $SRC >> $DST
926      else
927        sed -e "s/%%WITHDOXYWIZARD%% //g" $SRC >> $DST
928      fi
929      echo "  Created $DST from $SRC..."
930 done
931
932 cat src/libdoxycfg.t.in | sed -e "s|%%FLEX%%|$f_flex|g" -e "s|%%BISON%%|$f_bison|g" -e "s|%%PYTHON%%|$f_python|g" > src/libdoxycfg.t
933 cat src/libdoxygen.t.in | sed -e "s|%%FLEX%%|$f_flex|g" -e "s|%%BISON%%|$f_bison|g" -e "s|%%PYTHON%%|$f_python|g" > src/libdoxygen.t
934
935 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 addon/doxysearch/doxysearch.pro.in addon/doxysearch/doxyindexer.pro.in vhdlparser/vhdlparser.pro.in"
936
937 for i in $f_inprofiles ; do
938      SRC=$i
939      DST=`echo $i|sed 's%\(.*\).in$%\1%'`
940      TIME=`date`
941      cat > $DST <<EOF
942 #
943 # This file was generated from `basename $i` on $TIME
944 #
945
946 EOF
947      if test "$f_debug" = NO; then
948        realopts="release"
949      else
950        realopts="debug"
951      fi
952      #if test "$f_thread" = YES; then
953      #  realopts="$realopts thread"
954      #fi
955      cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" -e "s;%%SQLITE3_INC%%;$sqlite3_hdr_dir;g" -e "s;%%SQLITE3_LIBS%%;$sqlite3_link;g" -e "s;%%LIBCLANG_LIBS%%;$libclang_link;g" >> $DST
956      echo "  Created $DST from $SRC..."
957 done
958
959 # - generating generated_src/doxygen/doxygen/lang_cfg.h 
960 # use consistent method on Linux and Windows
961
962 if test -f "generated_src/doxygen/lang_cfg.h"; then
963     chmod u+w generated_src/doxygen/lang_cfg.h   # make sure file can be overwritten
964 fi
965 echo "  Generating generated_src/doxygen/lang_cfg.h..."
966 if test "$f_english" = YES; then
967    $f_python src/lang_cfg.py ENONLY > generated_src/doxygen/lang_cfg.h
968 else
969    f_ulangs=`echo $f_langs | tr '[a-z]' '[A-Z]' | tr ',' ' '`
970    $f_python src/lang_cfg.py $f_ulangs > generated_src/doxygen/lang_cfg.h
971 fi
972
973 if test -f "generated_src/doxygen/settings.h"; then
974     chmod u+w generated_src/doxygen/settings.h
975 fi
976 echo "  Generating generated_src/doxygen/settings.h..."
977 $f_python src/settings.py $f_sqlite3 $f_libclang generated_src/doxygen
978
979 if test "$f_wizard" = YES; then
980   if test -f "generated_src/doxywizard/settings.h"; then
981       chmod u+w generated_src/doxywizard/settings.h
982   fi
983   echo "  Generating generated_src/doxywizard/settings.h..."
984   $f_python src/settings.py $f_sqlite3 $f_libclang generated_src/doxywizard
985 fi
986
987 cd ..
988 echo "  Finished"