Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 7529 was 7528, checked in by bensch, 19 years ago

qt_gui: some more configure-stuff

File size: 4.1 KB
Line 
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"
12         $4
13    else
14         echo "no Support for $2"
15         $5
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"
36         $4
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 "------------------"
42         $5
43         exit -1
44    fi
45])
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
78
79
80dnl AX_CHECK_QT([QTDIR], [LIBRARIES], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
81AC_DEFUN([AX_CHECK_QT], [
82    _lib_check=""
83    _found_lib=""
84
85
86    QT_PREFIX="$1"
87    QT_LIBS=""
88    QT_CXXFLAGS="-I${QT_PREFIX}/include"
89    QT_LDFLAGS="-L${QT_PREFIX}/lib -Wl,-rpath -Wl,${QT_PREFIX}/lib"
90    QT_BIN_DIR="${QT_PREFIX}/bin"
91    QT_COMMON_INCLUDE_DIRECTORIES=/usr/include `ls -dr /usr/include/qt*` `ls -dr /usr/lib/qt*/include` `ls -dr /usr/local/qt*/include` `ls -dr /opt/qt*/include` `ls -dr /Developer/qt*/include`
92    QT_COMMON_LIB_DIRECTORIES=/usr/lib `ls -dr /usr/lib/qt*` `ls -dr /usr/local/qt*/lib` `ls -dr /opt/qt*/lib` `ls -dr/Developer/qt*/lib`
93
94    CACHED_CPPFLAG=${CPPFLAGS}
95    CACHED_LDFLAGS=${LDFLAGS}
96
97    LDFLAGS="${LDFLAGS} ${QT_LDFLAGS}"
98    for _lib in $2
99    do
100      AC_CHECK_LIB([$_lib], [main], [_lib_check="yes"], [_lib_check="no"])
101      if test "x$_lib_check" = "xyes" ; then
102        _found_lib=$_lib
103        break
104      fi
105    done
106
107    if [test "x$_lib_check" = "xyes"] ; then
108         QT_LIBS="${QT_LIBS} -l$_found_lib"
109         $3
110    else
111         echo "------------------"
112         echo "LIBRARY $2 not found.in $1"
113         echo "please install the $1-LIBRARY-package which can be found at $5"
114         echo "------------------"
115         $4
116         exit -1
117    fi
118    AC_SUBST([QT_LIBS])
119    AC_SUBST([QT_CXXFLAGS])
120    AC_SUBST([QT_LDFLAGS])
121
122    #----------#
123    # QT - MOC #
124    #----------#
125    AC_PATH_PROG([QT_MOC], [moc], [no], ["${QT_BIN_DIR}:${PATH}"])
126      if test x${QT_MOC} = xno ; then
127        AC_MSG_ERROR([QT MOC not found])
128      fi
129    AC_SUBST([QT_MOC])
130
131    AC_PATH_PROG([QT_UIC], [uic], [no], ["${QT_BIN_DIR}:${PATH}"])
132 #     if test x${QT_UIC} = xno ; then
133 #       AC_MSG_WARN([QT UIC not found])
134 #     fi
135    AC_SUBST([QT_UIC])
136
137    AC_PATH_PROG([QT_RCC], [rcc], [no], ["${QT_BIN_DIR}:${PATH}"])
138#      if test x${QT_RCC} = xno ; then
139#        AC_MSG_WARN([QT RCC not found])
140#      fi
141    AC_SUBST([QT_RCC])
142
143
144
145    # Restore Values of CPPFLAGS and LDFLAGS
146    CPPFLAGS=${CACHED_CPPFLAG}
147    LDFLAGS=${CACHED_LDFLAGS}
148])
Note: See TracBrowser for help on using the repository browser.