~ubuntu-branches/ubuntu/dapper/cappuccino/dapper

« back to all changes in this revision

Viewing changes to macros/gnome-guile-checks.m4

  • Committer: Bazaar Package Importer
  • Author(s): Lars Wirzenius
  • Date: 2005-04-28 16:32:00 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050428163200-6ktj118672tak662
Tags: 0.4-2.1
* Non-maintainer upload.
* Rebuilt since linc no longer in archive. Closes: #306151
  (the bug is release critical, hence the urgency).
* debian/menu: Quoted values that weren't quoted, since that's what the
  menu file syntax requires.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl
2
 
dnl GNOME_CHECK_GUILE (failflag)
3
 
dnl
4
 
dnl if failflag is "fail" then GNOME_CHECK_GUILE will abort if guile is not found.
5
 
dnl
6
 
 
7
 
AC_DEFUN([GNOME_CHECK_GUILE],
8
 
[
9
 
        saved_ldflags="$LDFLAGS"
10
 
        saved_cppflags="$CPPFLAGS"
11
 
        LDFLAGS="$LDFLAGS $GNOME_LIBDIR"
12
 
 
13
 
        AC_CHECK_LIB(qthreads,qt_null,[
14
 
                QTTHREADS_LIB="-lqthreads"
15
 
        ],[
16
 
                AC_CHECK_LIB(qt, qt_null, QTTHREADS_LIB="-lqt")
17
 
        ],$LIBS)
18
 
        AC_SUBST(QTTHREADS_LIB)
19
 
 
20
 
        AC_CHECK_LIB(termcap,main,TERMCAP_LIB="-ltermcap")
21
 
        AC_CHECK_LIB(readline,main,READLINE_LIB="-lreadline",,$TERMCAP_LIB)
22
 
 
23
 
        AC_SUBST(TERMCAP_LIB)
24
 
        AC_SUBST(READLINE_LIB)
25
 
 
26
 
        if test "x$cross_compiling" = "xyes" ; then
27
 
          name_build_guile="$target_alias-guile-config"
28
 
        else
29
 
          name_build_guile="guile-config"
30
 
        fi
31
 
 
32
 
        AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no)
33
 
 
34
 
        if test "x$BUILD_GUILE" = "xyes"; then
35
 
            AC_MSG_CHECKING(whether $name_build_guile works)
36
 
            if test x`$name_build_guile --version >/dev/null 2>&1 || \
37
 
                echo no` = xno; then
38
 
                BUILD_GUILE=no
39
 
            fi
40
 
            AC_MSG_RESULT($BUILD_GUILE)
41
 
        else
42
 
 
43
 
            if test "x$cross_compiling" = "xyes" ; then
44
 
                name_build_guile="$target_alias-build-guile"
45
 
            else        
46
 
                name_build_guile="build-guile"
47
 
            fi
48
 
 
49
 
            AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no)
50
 
 
51
 
            if test "x$BUILD_GUILE" = "xyes"; then
52
 
                AC_MSG_CHECKING(whether $name_build_guile works)
53
 
                if test x`$name_build_guile --version >/dev/null 2>&1 || \
54
 
                    echo no` = xno; then
55
 
                    BUILD_GUILE=no
56
 
                fi
57
 
                AC_MSG_RESULT($BUILD_GUILE)
58
 
            fi
59
 
        fi
60
 
 
61
 
        AC_CHECK_LIB(m, sin)
62
 
 
63
 
        if test "x$BUILD_GUILE" = "xyes"; then
64
 
                AC_MSG_CHECKING(for guile libraries)
65
 
                GUILE_LIBS="`$name_build_guile link`"
66
 
                AC_MSG_RESULT($GUILE_LIBS)
67
 
                AC_MSG_CHECKING(for guile headers)
68
 
                GUILE_INCS="`$name_build_guile compile`"
69
 
                AC_MSG_RESULT($GUILE_INCS)
70
 
        else
71
 
                GUILE_LIBS="$GNOME_LIBDIR"
72
 
                GUILE_INCS="$GNOME_INCLUDEDIR"
73
 
                AC_CHECK_LIB(rx, main, GUILE_LIBS="-lrx $GUILE_LIBS")
74
 
                AC_CHECK_LIB(qt, qt_null, GUILE_LIBS="-lqt $GUILE_LIBS")
75
 
                AC_CHECK_LIB(dl, dlopen, GUILE_LIBS="-ldl $GUILE_LIBS")
76
 
                AC_CHECK_LIB(nsl, t_accept, GUILE_LIBS="$GUILE_LIBS -lnsl")
77
 
                AC_CHECK_LIB(socket, socket, GUILE_LIBS="$GUILE_LIBS -lsocket")
78
 
                GUILE_LIBS="-lguile $GUILE_LIBS $QTTHREADS_LIB $READLINE_LIB $TERMCAP_LIB"
79
 
        fi
80
 
 
81
 
        AC_SUBST(GUILE_LIBS)
82
 
        AC_SUBST(GUILE_INCS)
83
 
 
84
 
        saved_LIBS="$LIBS"
85
 
        LIBS="$LIBS $GUILE_LIBS"
86
 
        CPPFLAGS="$saved_cppflags $GUILE_INCS"
87
 
 
88
 
        AC_MSG_CHECKING(whether guile works)
89
 
        AC_TRY_LINK([
90
 
                #include <libguile.h>
91
 
                #include <guile/gh.h>
92
 
        ],[
93
 
                gh_eval_str("(newline)");
94
 
                scm_boot_guile(0,NULL,NULL,NULL);
95
 
        ],[
96
 
                ac_cv_guile_found=yes
97
 
                AC_DEFINE(HAVE_GUILE)
98
 
        ],[
99
 
                ac_cv_guile_found=no
100
 
        ])
101
 
        AC_MSG_RESULT($ac_cv_guile_found)
102
 
 
103
 
        if test x$ac_cv_guile_found = xno ; then
104
 
                if test x$1 = xfail ; then
105
 
                  AC_MSG_ERROR(Can not find Guile on this system)
106
 
                else
107
 
                  AC_MSG_WARN(Can not find Guile on this system)
108
 
                fi
109
 
                ac_cv_guile_found=no
110
 
                GUILE_LIBS= GUILE_INCS=
111
 
        fi
112
 
 
113
 
        LIBS="$saved_LIBS"
114
 
        LDFLAGS="$saved_ldflags"
115
 
        CPPFLAGS="$saved_cppflags"
116
 
 
117
 
        AC_SUBST(GUILE_LIBS)
118
 
        AM_CONDITIONAL(GUILE, test x$ac_cv_guile_found = xyes)
119
 
])