Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/qt_gui/acinclude.m4 @ 7509

Last change on this file since 7509 was 7502, checked in by bensch, 19 years ago

some more configure (not running at the moment)

File size: 3.7 KB
RevLine 
[6274]1
2
3dnl AX_CHECK_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
4AC_DEFUN([AX_CHECK_HEADER_LIB], [
5    _header_check=""
6    _lib_check=""
7
8    AC_CHECK_HEADER([$1], [_header_check="yes"], [_header_check="no"])
9    AC_CHECK_LIB([$2], [$3], [_lib_check="yes"], [_lib_check="no"])
10    if [test "x$_header_check" = "xyes" && test "x$_lib_check" = "xyes"] ; then
11         LIBS="$LIBS -l$2"
[7502]12         $4
[6274]13    else
14         echo "no Support for $2"
[7502]15         $5
[6274]16    fi
17])
18
19
20
21dnl AX_CHECK_REQUIRED_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
22AC_DEFUN([AX_CHECK_REQUIRED_HEADER_LIB], [
23    _header_check=""
24    _lib_check=""
25
26    for _header in $1
27    do
28      AC_CHECK_HEADER([$_header], [_header_check="yes"], [_header_check="no"])
29      if  test "x$_header_check" = "xyes" ; then
30        break
31      fi
32    done
33    AC_CHECK_LIB([$2], [$3], [_lib_check="yes"], [_lib_check="no"])
34    if [test x$_header_check = "xyes" && test "x$_lib_check" = "xyes"] ; then
35         LIBS="$LIBS -l$2"
[7502]36         $4
[6274]37    else
38         echo "------------------"
39         echo "LIBRARY $2 not found."
40         echo "please install the $2-LIBRARY-package which can be found at $6"
41         echo "------------------"
[7502]42         $5
[6274]43         exit -1
44    fi
45])
[7442]46
47
48
49dnl AX_CHECK_REQUIRED_LIB([LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
50AC_DEFUN([AX_CHECK_REQUIRED_LIB], [
51    _lib_check=""
52    _found_lib=""
53
54
55    for _lib in $1
56    do
57      AC_CHECK_LIB([$_lib], [$2], [_lib_check="yes"], [_lib_check="no"])
58      if test "x$_lib_check" = "xyes" ; then
59        _found_lib=$_lib
60        break
61      fi
62    done
63
64    if [test "x$_lib_check" = "xyes"] ; then
65         LIBS="$LIBS -l$_found_lib"
66         $3
67    else
68         echo "------------------"
69         echo "LIBRARY $1 not found."
70         echo "please install the $1-LIBRARY-package which can be found at $5"
71         echo "------------------"
72         $4
73         exit -1
74    fi
75])
76
77
[7502]78dnl AX_CHECK_QT([LIBDIR], [LIBRARIES], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
79AC_DEFUN([AX_CHECK_QT], [
80    _lib_check=""
81    _found_lib=""
[7442]82
83
[7502]84    QT_PREFIX="$1"
85    QT_LIBS=""
86    QT_CXXFLAGS="-I${QT_PREFIX}/include"
87    QT_LDFLAGS="-L${QT_PREFIX}/lib -Wl,-rpath -Wl,${QT_PREFIX}/lib"
88    QT_BIN_DIR="${QT_PREFIX}/bin"
[7442]89
[7502]90    CACHED_CPPFLAG=${CPPFLAGS}
91    CACHED_LDFLAGS=${LDFLAGS}
[7442]92
[7502]93    for _lib in $2
94    do
95      AC_CHECK_LIB([$_lib], [main], [_lib_check="yes"], [_lib_check="no"])
96      if test "x$_lib_check" = "xyes" ; then
97        _found_libs=$_lib
98        break
99      fi
100    done
[7442]101
[7502]102    if [test "x$_lib_check" = "xyes"] ; then
103         QT_LIBS="${QT_LIBS} -l$_found_lib}"
104         $3
[7442]105    else
[7502]106         echo "------------------"
107         echo "LIBRARY $1 not found."
108         echo "please install the $1-LIBRARY-package which can be found at $5"
109         echo "------------------"
110         $4
111         exit -1
[7442]112    fi
[7502]113    AC_SUBST([QT_LIBS])
114    AC_SUBST([QT_CXXFLAGS])
115    AC_SUBST([QT_LDFLAGS])
116
117    #----------#
118    # QT - MOC #
119    #----------#
120    AC_PATH_PROG([QT_MOC], [moc], [no], ["${QT_BIN_DIR}:${PATH}"])
121      if test x${QT_MOC} = xno ; then
122        AC_MSG_ERROR([QT MOC not found])
[7442]123      fi
[7502]124    AC_SUBST([QT_MOC])
[7442]125
[7502]126    AC_PATH_PROG([QT_UIC], [uic], [no], ["${QT_BIN_DIR}:${PATH}"])
127      if test x${QT_UIC} = xno ; then
128        AC_MSG_ERROR([QT UIC not found])
129      fi
130    AC_SUBST([QT_UIC])
[7442]131
[7502]132    AC_PATH_PROG([QT_RCC], [rcc], [no], ["${QT_BIN_DIR}:${PATH}"])
133      if test x${QT_RCC} = xno ; then
134        AC_MSG_ERROR([QT RCC not found])
[7442]135      fi
[7502]136    AC_SUBST([QT_RCC])
[7442]137
138
139
[7502]140    # Restore Values of CPPFLAGS and LDFLAGS
141    CPPFLAGS=${CACHED_CPPFLAG}
142    LDFLAGS=${CACHED_LDFLAGS}
[7442]143])
Note: See TracBrowser for help on using the repository browser.