1 | |
---|
2 | |
---|
3 | dnl AX_CHECK_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE]) |
---|
4 | AC_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 | |
---|
21 | dnl AX_CHECK_REQUIRED_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE]) |
---|
22 | AC_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 | |
---|
49 | dnl AX_CHECK_REQUIRED_LIB([LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE]) |
---|
50 | AC_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 | dnl AX_CHECK_QT([LIBDIR], [LIBRARIES], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE]) |
---|
79 | AC_DEFUN([AX_CHECK_QT], [ |
---|
80 | _lib_check="" |
---|
81 | _found_lib="" |
---|
82 | |
---|
83 | |
---|
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" |
---|
89 | |
---|
90 | CACHED_CPPFLAG=${CPPFLAGS} |
---|
91 | CACHED_LDFLAGS=${LDFLAGS} |
---|
92 | |
---|
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 |
---|
101 | |
---|
102 | if [test "x$_lib_check" = "xyes"] ; then |
---|
103 | QT_LIBS="${QT_LIBS} -l$_found_lib}" |
---|
104 | $3 |
---|
105 | else |
---|
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 |
---|
112 | fi |
---|
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]) |
---|
123 | fi |
---|
124 | AC_SUBST([QT_MOC]) |
---|
125 | |
---|
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]) |
---|
131 | |
---|
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]) |
---|
135 | fi |
---|
136 | AC_SUBST([QT_RCC]) |
---|
137 | |
---|
138 | |
---|
139 | |
---|
140 | # Restore Values of CPPFLAGS and LDFLAGS |
---|
141 | CPPFLAGS=${CACHED_CPPFLAG} |
---|
142 | LDFLAGS=${CACHED_LDFLAGS} |
---|
143 | ]) |
---|