Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/osx/acinclude.m4 @ 8221

Last change on this file since 8221 was 7769, checked in by ponder, 19 years ago

If QT-frameworks ( macosx ) are present, the library directories for QT_LIB are also returned correctly.
Added pck-config to handle macosx-specific stuff. Maybe we could use if throughout the configure.ac?
Removed direct.h from the util/file.cc includes.

File size: 6.8 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"
[7661]12         $4
[6274]13    else
14         echo "no Support for $2"
[7661]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"
[7661]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 "------------------"
[7661]42         $5
[6274]43         exit -1
44    fi
45])
[7661]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    QT_PREFIX="$1"
85    QT_INCLUDE_DIRECTORY=""
86    QT_LIB_DIRECTORY=""
[7669]87    QT_BIN_DIRECTORY=""
[7661]88
89    QT_COMMON_INCLUDE_DIRECTORIES="
90      `ls -dr ${QT_PREFIX}/include     2>/dev/null`
91      /usr/include
92      `ls -dr /usr/include/qt*         2>/dev/null`
93      `ls -dr /usr/lib/qt*/include     2>/dev/null`
94      `ls -dr /usr/local/qt*/include   2>/dev/null`
95      `ls -dr /opt/qt*/include         2>/dev/null`
96      `ls -dr /Developer/qt*/include   2>/dev/null`
[7669]97      `ls -dr /c/Qt/*/include          2>/dev/null`
[7661]98    "
99
100    QT_COMMON_LIB_DIRECTORIES="
101      `ls -dr ${QT_PREFIX}/lib         2>/dev/null`
102      /usr/include
103      `ls -dr /usr/lib/qt*             2>/dev/null`
104      `ls -dr /usr/local/qt*/lib       2>/dev/null`
105      `ls -dr /opt/qt*/lib             2>/dev/null`
106      `ls -dr /Developer/qt*/lib       2>/dev/null`
[7669]107      `ls -dr /c/Qt/*/lib              2>/dev/null`
[7661]108    "
109
[7669]110    QT_COMMON_BIN_DIRECTORIES="
111      `ls -dr ${QT_PREFIX}/bin         2>/dev/null`
112      /usr/bin
113      `ls -dr /usr/bin/qt*             2>/dev/null`
114      `ls -dr /usr/local/qt*/bin       2>/dev/null`
115      `ls -dr /opt/qt*/bin             2>/dev/null`
116      `ls -dr /Developer/qt*/bin       2>/dev/null`
117      `ls -dr /c/Qt/*/bin              2>/dev/null`
118    "
119
120## Search in all IncludeDirectories for QT-includes
[7670]121    for _qt_include_directory in ${QT_COMMON_INCLUDE_DIRECTORIES}
[7661]122    do
[7670]123      if test -e ${_qt_include_directory}/QtCore/QCoreApplication ; then
124        QT_INCLUDE_DIRECTORY="${_qt_include_directory}"
[7661]125        break
126      fi
127    done
128    if test -n ${QT_INCLUDE_DIRECTORY} ; then
129      echo "Qt-Include Directory is: ${QT_INCLUDE_DIRECTORY}"
130    else
131      AC_MSG_ERROR([Qt Headers not found])
132    fi
133
134## Search in all LibraryDirectories for QT-includes
135    for _lib_directory in ${QT_COMMON_LIB_DIRECTORIES}
136    do
[7769]137      if test -e ${_lib_directory}/libQtCore.so || test -e ${_lib_directory}/libQtCore4.a || \
138                        test -e ${_lib_directory}/QtCore.framework ; then
[7661]139        QT_LIB_DIRECTORY=${_lib_directory}
140        break
[7769]141          fi
[7661]142    done
143    if test -n ${QT_LIB_DIRECTORY} ; then
144      echo "Qt-Library Directory is: ${QT_LIB_DIRECTORY}"
145    else
146      AC_MSG_ERROR([Qt LIB not found])
147    fi
148
[7669]149## Search in all BINDirectories for QT-executables
150    for _bin_directory in ${QT_COMMON_BIN_DIRECTORIES}
151    do
152      if test -e ${_bin_directory}/moc || test -e  ${_bin_directory}/moc.exe ; then
153        QT_BIN_DIRECTORY=${_bin_directory}
154        break
155      fi
156    done
157    if test -n ${QT_BIN_DIRECTORY} ; then
158        echo "Qt-Bin Directory is: ${QT_BIN_DIRECTORY}"
159    else
160        QT_BIN_DIRECTORY=${QT_PREFIX}/bin
161    fi
162
[7661]163## Setting up the Environment Variables.
164    QT_LIBS=""
165    QT_CXXFLAGS="-I${QT_INCLUDE_DIRECTORY}"
166    LDFLAGS="${LDFLAGS} -L${QT_LIB_DIRECTORY} -Wl,-rpath -Wl,${QT_LIB_DIRECTORY}"
167
168    CACHED_CPPFLAG=${CPPFLAGS}
169    CACHED_LDFLAGS=${LDFLAGS}
170
171    LDFLAGS="${LDFLAGS} ${QT_LDFLAGS}"
172    for _lib in $2
173    do
174      AC_CHECK_LIB([$_lib], [main], [_lib_check="yes"], [_lib_check="no"])
175      if test "x$_lib_check" = "xyes" ; then
176        _found_lib=$_lib
177        break
178      fi
179    done
180
181    if [test "x$_lib_check" = "xyes"] ; then
182         QT_LIBS="${QT_LIBS} -l$_found_lib"
183         AX_CHECK_REQUIRED_LIB([QtCore QtCore4], [main],,,[http://www.trolltech.com] )
184         AX_CHECK_REQUIRED_LIB([QtGui QtGui4], [main],,,[http://www.trolltech.com] )
185         AX_CHECK_REQUIRED_LIB([QtOpenGL QtOpenGL4], [main],,,[http://www.trolltech.com] )
186
187         $3
188    else
189         echo "------------------"
190         echo "LIBRARY $2 not found.in $1"
191         echo "please install the $1-LIBRARY-package which can be found at $5"
192         echo "------------------"
193         $4
194         exit -1
195    fi
196
[7769]197    echo "QT_LIBS          = ${QT_LIBS}"
198    echo "QT_CXXFLAGS      = ${QT_CXXFLAGS}"
199    echo "QT_LD_FLAGS      = ${QT_LDFLAGS}"
[7669]200    echo "QT_BIN_DIRECTORY = ${QT_BIN_DIRECTORY}"
[7661]201
202    AC_SUBST([QT_LIBS])
203    AC_SUBST([QT_CXXFLAGS])
204    AC_SUBST([QT_LDFLAGS])
205
206    #----------#
207    # QT - MOC #
208    #----------#
[7669]209    AC_PATH_PROG([QT_MOC], [moc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
[7661]210      if test x${QT_MOC} = xno ; then
211        AC_MSG_ERROR([QT MOC not found])
212      fi
213    AC_SUBST([QT_MOC])
214
[7669]215    AC_PATH_PROG([QT_UIC], [uic], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
[7661]216 #     if test x${QT_UIC} = xno ; then
217 #       AC_MSG_WARN([QT UIC not found])
218 #     fi
219    AC_SUBST([QT_UIC])
220
[7669]221    AC_PATH_PROG([QT_RCC], [rcc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
[7661]222#      if test x${QT_RCC} = xno ; then
223#        AC_MSG_WARN([QT RCC not found])
224#      fi
225    AC_SUBST([QT_RCC])
226
227
228
229    # Restore Values of CPPFLAGS and LDFLAGS
230    CPPFLAGS=${CACHED_CPPFLAG}
231    LDFLAGS=${CACHED_LDFLAGS}
232])
Note: See TracBrowser for help on using the repository browser.