* Makefile.in (TAGS): Produce a single tags file for all of Guile.
[bpt/guile.git] / configure.in
1 AC_INIT(Makefile.in)
2
3 rm -f config.build-subdirs
4
5 . $srcdir/GUILE-VERSION
6
7 all_subdirs=`cat $srcdir/*/PLUGIN/REQ $srcdir/*/PLUGIN/OPT /dev/null | tsort | xargs echo`
8 req_subdirs=`cat $srcdir/*/PLUGIN/REQ /dev/null | tsort | xargs echo`
9 opt_subdirs=`cat $srcdir/*/PLUGIN/OPT /dev/null | tsort | xargs echo`
10
11 AC_CONFIG_SUBDIRS($all_subdirs)
12 existingdirs=
13 for d in $all_subdirs; do
14 if test -d $srcdir/$d ; then
15 existingdirs="$existingdirs $d"
16 if test "x$verbose" = xyes; then
17 if test -f $srcdir/$d/PLUGIN/greet ; then
18 cat $srcdir/$d/PLUGIN/greet
19 else
20 echo ===
21 echo === Configuring plug-in component $d
22 echo ===
23 fi
24 fi
25 fi
26 done
27
28 for d in $req_subdirs; do
29 if test ! -d $srcdir/$d ; then
30 echo "*******"
31 echo "*******"
32 echo "**\+/**"
33 echo "**=*=**" ERROR: Missing required package: $d
34 echo "**/+\**"
35 echo "*******"
36 echo "*******"
37 exit 1
38 fi
39 done
40
41 if test "x$verbose" = xyes; then
42 for d in $opt_subdirs; do
43 if test ! -d $srcdir/$d ; then
44 echo "*****"
45 echo "*===*"
46 echo "*=*=*" WARNING: Missing suggested package: $d
47 echo "*===*"
48 echo "*****"
49 fi
50 done
51 fi
52
53
54 AC_PROG_CC
55
56 ### build_subdirs is the list of directories we actually want to
57 ### build. It's not equivalent to existingdirs: if we can't find the
58 ### Tcl libraries, then we don't want to build in gtcltk-lib.
59 ###
60 ### So why can't we just forget about gtcltk-lib altogether, and
61 ### delete it from existingdirs, in that case? Well, in order for
62 ### 'make dist' to work, we still need to configure gtcltk-lib, and
63 ### the top-level Makefile needs to know it exists,
64 build_subdirs="${existingdirs}"
65
66 ### Decide which directories to build; remove the ones we don't want
67 ### from build_subdirs.
68
69 ### On some systems, the Tcl library contains references to
70 ### functions in the dynamic linker library, -ldl, so we may need
71 ### to include that.
72 AC_CHECK_LIB(dl, dlopen)
73
74 ### Use gtcltk-lib only if we seem to have Tcl installed on the
75 ### system. We really should check for Tk as well, but that involves
76 ### finding all the X libraries that we need to do a complete link.
77 AC_CHECK_LIB(tcl7.5, Tcl_CreateInterp, have_tcl=true, have_tcl=false, -lm)
78 if $have_tcl; then :; else
79 build_subdirs="`echo $build_subdirs | sed s:gtcltk-lib::`"
80 req_subdirs="`echo $req_subdirs | sed s:gtcltk-lib::`"
81 fi
82
83 ### Write the list of survivors, the directories we do want to build,
84 ### to a file in the top level, so the subdirectories' configuration
85 ### scripts can find it. We don't want to pass the list in the
86 ### environment, because the subdirectory configuration scripts can be
87 ### run on their own.
88 echo "${build_subdirs}" > config.build-subdirs
89
90 AC_SUBST(existingdirs)
91 AC_SUBST(build_subdirs)
92 AC_SUBST(GUILE_VERSION)
93 AC_OUTPUT(Makefile doc/Makefile)