source: m4/bnv_have_qt.m4@ 212c179

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 212c179 was 060ba4, checked in by Frederik Heber <heber@…>, 13 years ago

Replaced m4 macro gwqt4.m4 by bnv_have_qt.m4

  • as is used with seismolo.
  • @MOC@ -> QTMOC, @UIC@ -> QT_UIC.
  • QT_LIBS has it all.
  • new QT_DEBUG when Qt debug should be printed or not.
  • Property mode set to 100644
File size: 20.5 KB
Line 
1dnl @synopsis BNV_HAVE_QT [--with-Qt-dir=DIR] [--with-Qt-lib-dir=DIR] [--with-Qt-lib=LIB]
2dnl @synopsis BNV_HAVE_QT [--with-Qt-include-dir=DIR] [--with-Qt-bin-dir=DIR] [--with-Qt-lib-dir=DIR] [--with-Qt-lib=LIB]
3dnl
4dnl @summary Search for Trolltech's Qt GUI framework.
5dnl
6dnl Searches common directories for Qt include files, libraries and Qt
7dnl binary utilities. The macro supports several different versions of
8dnl the Qt framework being installed on the same machine. Without
9dnl options, the macro is designed to look for the latest library,
10dnl i.e., the highest definition of QT_VERSION in qglobal.h. By use of
11dnl one or more options a different library may be selected. There are
12dnl two different sets of options. Both sets contain the option
13dnl --with-Qt-lib=LIB which can be used to force the use of a
14dnl particular version of the library file when more than one are
15dnl available. LIB must be in the form as it would appear behind the
16dnl "-l" option to the compiler. Examples for LIB would be "qt-mt" for
17dnl the multi-threaded version and "qt" for the regular version. In
18dnl addition to this, the first set consists of an option
19dnl --with-Qt-dir=DIR which can be used when the installation conforms
20dnl to Trolltech's standard installation, which means that header files
21dnl are in DIR/include, binary utilities are in DIR/bin and the library
22dnl is in DIR/lib. The second set of options can be used to indicate
23dnl individual locations for the header files, the binary utilities and
24dnl the library file, in addition to the specific version of the
25dnl library file.
26dnl
27dnl The following shell variable is set to either "yes" or "no":
28dnl
29dnl have_qt
30dnl
31dnl Additionally, the following variables are exported:
32dnl
33dnl QT_CXXFLAGS
34dnl QT_LIBS
35dnl QT_MOC
36dnl QT_RCC
37dnl QT_UIC
38dnl QT_DIR
39dnl
40dnl which respectively contain an "-I" flag pointing to the Qt include
41dnl directory (and "-DQT_THREAD_SUPPORT" when LIB is "qt-mt"), link
42dnl flags necessary to link with Qt and X, the name of the meta object
43dnl compiler and the user interface compiler both with full path, and
44dnl finaly the variable QTDIR as Trolltech likes to see it defined (if
45dnl possible).
46dnl
47dnl Example lines for Makefile.in:
48dnl
49dnl CXXFLAGS = @QT_CXXFLAGS@
50dnl MOC = @QT_MOC@
51dnl
52dnl After the variables have been set, a trial compile and link is
53dnl performed to check the correct functioning of the meta object
54dnl compiler. This test may fail when the different detected elements
55dnl stem from different releases of the Qt framework. In that case, an
56dnl error message is emitted and configure stops.
57dnl
58dnl No common variables such as $LIBS or $CFLAGS are polluted.
59dnl
60dnl Options:
61dnl
62dnl --with-Qt-dir=DIR: DIR is equal to $QTDIR if you have followed the
63dnl installation instructions of Trolltech. Header files are in
64dnl DIR/include, binary utilities are in DIR/bin and the library is in
65dnl DIR/lib.
66dnl
67dnl --with-Qt-include-dir=DIR: Qt header files are in DIR.
68dnl
69dnl --with-Qt-bin-dir=DIR: Qt utilities such as moc and uic are in DIR.
70dnl
71dnl --with-Qt-lib-dir=DIR: The Qt library is in DIR.
72dnl
73dnl --with-Qt-lib=LIB: Use -lLIB to link with the Qt library.
74dnl
75dnl If some option "=no" or, equivalently, a --without-Qt-* version is
76dnl given in stead of a --with-Qt-*, "have_qt" is set to "no" and the
77dnl other variables are set to the empty string.
78dnl
79dnl @category InstalledPackages
80dnl @author Bastiaan Veelo <Bastiaan@Veelo.net>
81dnl @version 2006-03-12
82dnl @license AllPermissive
83dnl
84dnl Note by Frederik Heber <heber@ins.uni-bonn.de>
85dnl added fix from RTXI manual:
86dnl if configure throws with "syntax error in line blabla" when checking Qt,
87dnl then it is because of empty if-then-else construct, add line with single
88dnl colon ":" in it to (leave bnv_qt_lib_dir defined).
89dnl
90dnl Second Note by Frederik Heber <heber@ins.uni-bonn.de>
91dnl some changes by me, to get it working with Qt4 and Qwt
92dnl - bnv_qt_include_dir is now list of dirs, extended to -I<> syntax
93dnl - all subdirs of qt-include directory
94dnl - look for lib[[Qq]]t not only libqt
95dnl
96dnl Third Note by Frederik Heber <heber@ins.uni-bonn.de>
97dnl added QT_RCC flag
98dnl
99dnl Fourth Note by Frederik Heber <heber@ins.uni-bonn.de>
100dnl some changes to get it working with Ubuntu 10.04
101dnl - bn_qt_lib_dir is now issued when specified --with-qt-dir
102dnl - removed libXt and libXi which are just shared libs linked in
103dnl the other libs
104
105dnl Copyright (C) 2001, 2002, 2003, 2005, 2006 Bastiaan Veelo
106
107dnl THANKS! This code includes bug fixes and contributions made by:
108dnl Tim McClarren,
109dnl Dennis R. Weilert,
110dnl Qingning Huo,
111dnl Brian Mingus,
112dnl Jens Hannemann,
113dnl Pavel Roskin,
114dnl Scott J. Bertin.
115
116dnl ChangeLog
117dnl 2006-03-12 * Hide output of ls and fix an m4 quoting problem (due to Scott J. Bertin).
118dnl 2006-02-13 * Check compiler return value instead of parsing the error stream,
119dnl which detected warnings as false negatives (due to Jens Hannemann).
120dnl 2006-02-02 * Spelling of "Success".
121dnl * Fixed unsave test for $bnv_qt_lib without quotes.
122dnl * Put dnl in front of all comments.
123dnl * Changed -l$bnv_qt_lib_dir into -L$bnv_qt_lib_dir (all due to Pavel Roskin).
124dnl 2006-01-19 * Support for 64bit architectures.
125dnl * Updated documentation.
126dnl 2006-01-18: * Fix "cat: bnv_qt_test.c: No such file or directory" (due to Jens Hannemann).
127dnl * Hide output of failing ls.
128dnl 2006-01-11: * Check in /Developer on Mac OS X; Check in $QTDIR (due to Brian Mingus).
129
130dnl Calls BNV_PATH_QT_DIRECT (contained in this file) as a subroutine.
131AC_DEFUN([BNV_HAVE_QT],
132[
133 AC_REQUIRE([AC_PROG_CXX])
134 AC_REQUIRE([AC_PATH_X])
135 AC_REQUIRE([AC_PATH_XTRA])
136
137 AC_MSG_CHECKING(for Qt)
138
139 AC_ARG_WITH([Qt-dir],
140 [ --with-Qt-dir=DIR DIR is equal to $QTDIR if you have followed the
141 installation instructions of Trolltech. Header
142 files are in DIR/include, binary utilities are
143 in DIR/bin. The library is in DIR/lib, unless
144 --with-Qt-lib-dir is also set.])
145 AC_ARG_WITH([Qt-include-dir],
146 [ --with-Qt-include-dir=DIR
147 Qt header files are in DIR])
148 AC_ARG_WITH([Qt-bin-dir],
149 [ --with-Qt-bin-dir=DIR Qt utilities such as moc and uic are in DIR])
150 AC_ARG_WITH([Qt-lib-dir],
151 [ --with-Qt-lib-dir=DIR The Qt library is in DIR])
152 AC_ARG_WITH([Qt-lib],
153 [ --with-Qt-lib=LIB Use -lLIB to link with the Qt library])
154 if test x"$with_Qt_dir" = x"no" ||
155 test x"$with_Qt_include-dir" = x"no" ||
156 test x"$with_Qt_bin_dir" = x"no" ||
157 test x"$with_Qt_lib_dir" = x"no" ||
158 test x"$with_Qt_lib" = x"no"; then
159 # user disabled Qt. Leave cache alone.
160 have_qt="User disabled Qt."
161 else
162 # "yes" is a bogus option
163 if test x"$with_Qt_dir" = xyes; then
164 with_Qt_dir=
165 fi
166 if test x"$with_Qt_include_dir" = xyes; then
167 with_Qt_include_dir=
168 fi
169 if test x"$with_Qt_bin_dir" = xyes; then
170 with_Qt_bin_dir=
171 fi
172 if test x"$with_Qt_lib_dir" = xyes; then
173 with_Qt_lib_dir=
174 fi
175 if test x"$with_Qt_lib" = xyes; then
176 with_Qt_lib=
177 fi
178 # No Qt unless we discover otherwise
179 have_qt=no
180 # Check whether we are requested to link with a specific version
181 if test x"$with_Qt_lib" != x; then
182 bnv_qt_lib="$with_Qt_lib"
183 fi
184 # Check whether we were supplied with an answer already
185 if test x"$with_Qt_dir" != x; then
186 have_qt=yes
187 bnv_qt_dir="$with_Qt_dir"
188 if test x`echo $with_Qt_dir | grep qt3` != x; then
189 # qt3
190 bnv_qt_include_dir="$with_Qt_dir/include"
191 else
192 # Qt4
193 bnv_qt_include_dir="$with_Qt_dir/include"
194 # FH: due to laziness of certain programmers and to simulate qmake
195 # bhavior, we have to add all subdirectories, too
196 for dir in `ls $with_Qt_dir/include`
197 do
198 bnv_qt_include_dir="${bnv_qt_include_dir} $with_Qt_dir/include/$dir"
199 done
200 fi
201 bnv_qt_bin_dir="$with_Qt_dir/bin"
202 if test x"$with_Qt_lib_dir" != x; then
203 bnv_qt_lib_dir="$with_Qt_lib_dir"
204 else
205 bnv_qt_lib_dir="$with_Qt_dir/lib"
206 fi
207 # Only search for the lib if the user did not define one already
208 if test x"$bnv_qt_lib" = x; then
209 bnv_qt_lib="`ls $bnv_qt_lib_dir/lib[[Qq]]t* | sed -n 1p |
210 sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
211 fi
212 bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
213 else
214 # Use cached value or do search, starting with suggestions from
215 # the command line
216 AC_CACHE_VAL(bnv_cv_have_qt,
217 [
218 # We are not given a solution and there is no cached value.
219 bnv_qt_dir=NO
220 bnv_qt_include_dir=NO
221 bnv_qt_lib_dir=NO
222 if test x"$bnv_qt_lib" = x; then
223 bnv_qt_lib=NO
224 fi
225 BNV_PATH_QT_DIRECT
226 if test "$bnv_qt_dir" = NO ||
227 test "$bnv_qt_include_dir" = NO ||
228 test "$bnv_qt_lib_dir" = NO ||
229 test "$bnv_qt_lib" = NO; then
230 # Problem with finding complete Qt. Cache the known absence of Qt.
231 bnv_cv_have_qt="have_qt=no"
232 else
233 # Record where we found Qt for the cache.
234 bnv_cv_have_qt="have_qt=yes \
235 bnv_qt_dir=$bnv_qt_dir \
236 bnv_qt_include_dir=$bnv_qt_include_dir \
237 bnv_qt_bin_dir=$bnv_qt_bin_dir \
238 bnv_qt_LIBS=\"$bnv_qt_LIBS\""
239 fi
240 ])dnl
241 eval "$bnv_cv_have_qt"
242 fi # all $bnv_qt_* are set
243 fi # $have_qt reflects the system status
244 if test x"$have_qt" = xyes; then
245 # FH: expect a list of dirs and add all
246 for dir in $bnv_qt_include_dir
247 do
248 QT_CXXFLAGS="${QT_CXXFLAGS} -I${dir}"
249 done
250 if test x"$bnv_qt_lib" = xqt-mt; then
251 QT_CXXFLAGS="$QT_CXXFLAGS -DQT_THREAD_SUPPORT"
252 fi
253 QT_DIR="$bnv_qt_dir"
254 QT_LIBS="$bnv_qt_LIBS"
255 # If bnv_qt_dir is defined, utilities are expected to be in the
256 # bin subdirectory
257 if test x"$bnv_qt_dir" != x; then
258 if test -x "$bnv_qt_dir/bin/uic"; then
259 QT_UIC="$bnv_qt_dir/bin/uic"
260 else
261 # Old versions of Qt don't have uic
262 QT_UIC=
263 fi
264 QT_MOC="$bnv_qt_dir/bin/moc"
265 QT_RCC="$bnv_qt_dir/bin/rcc"
266 else
267 # Or maybe we are told where to look for the utilities
268 if test x"$bnv_qt_bin_dir" != x; then
269 if test -x "$bnv_qt_bin_dir/uic"; then
270 QT_UIC="$bnv_qt_bin_dir/uic"
271 else
272 # Old versions of Qt don't have uic
273 QT_UIC=
274 fi
275 QT_MOC="$bnv_qt_bin_dir/moc"
276 QT_RCC="$bnv_qt_bin_dir/rcc"
277 else
278 # Last possibility is that they are in $PATH
279 QT_UIC="`which uic`"
280 QT_MOC="`which moc`"
281 QT_RCC="`which rcc`"
282 fi
283 fi
284 # All variables are defined, report the result
285 AC_MSG_RESULT([$have_qt:
286 QT_CXXFLAGS=$QT_CXXFLAGS
287 QT_DIR=$QT_DIR
288 QT_LIBS=$QT_LIBS
289 QT_UIC=$QT_UIC
290 QT_MOC=$QT_MOC
291 QT_RCC=$QT_RCC])
292 else
293 # Qt was not found
294 QT_CXXFLAGS=
295 QT_DIR=
296 QT_LIBS=
297 QT_UIC=
298 QT_MOC=
299 QT_RCC=
300 AC_MSG_RESULT($have_qt)
301 fi
302 AC_SUBST(QT_CXXFLAGS)
303 AC_SUBST(QT_DIR)
304 AC_SUBST(QT_LIBS)
305 AC_SUBST(QT_UIC)
306 AC_SUBST(QT_MOC)
307 AC_SUBST(QT_RCC)
308
309 #### Being paranoid:
310 if test x"$have_qt" = xyes; then
311 AC_MSG_CHECKING(correct functioning of Qt installation)
312 AC_CACHE_VAL(bnv_cv_qt_test_result,
313 [
314 cat > bnv_qt_test.h << EOF
315#include <qobject.h>
316class Test : public QObject
317{
318Q_OBJECT
319public:
320 Test() {}
321 ~Test() {}
322public slots:
323 void receive() {}
324signals:
325 void send();
326};
327EOF
328
329 cat > bnv_qt_main.$ac_ext << EOF
330#include "bnv_qt_test.h"
331#include <qapplication.h>
332int main( int argc, char **argv )
333{
334 QApplication app( argc, argv );
335 Test t;
336 QObject::connect( &t, SIGNAL(send()), &t, SLOT(receive()) );
337}
338EOF
339
340 bnv_cv_qt_test_result="failure"
341 bnv_try_1="$QT_MOC bnv_qt_test.h -o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null"
342 AC_TRY_EVAL(bnv_try_1)
343 if test x"$ac_status" != x0; then
344 echo "$bnv_err_1" >&AC_FD_CC
345 echo "configure: could not run $QT_MOC on:" >&AC_FD_CC
346 cat bnv_qt_test.h >&AC_FD_CC
347 else
348 bnv_try_2="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o moc_bnv_qt_test.o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null"
349 AC_TRY_EVAL(bnv_try_2)
350 if test x"$ac_status" != x0; then
351 echo "$bnv_err_2" >&AC_FD_CC
352 echo "configure: could not compile:" >&AC_FD_CC
353 cat moc_bnv_qt_test.$ac_ext >&AC_FD_CC
354 else
355 bnv_try_3="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o bnv_qt_main.o bnv_qt_main.$ac_ext >/dev/null 2>/dev/null"
356 AC_TRY_EVAL(bnv_try_3)
357 if test x"$ac_status" != x0; then
358 echo "$bnv_err_3" >&AC_FD_CC
359 echo "configure: could not compile:" >&AC_FD_CC
360 cat bnv_qt_main.$ac_ext >&AC_FD_CC
361 else
362 bnv_try_4="$CXX $QT_LIBS $LIBS -o bnv_qt_main bnv_qt_main.o moc_bnv_qt_test.o >/dev/null 2>/dev/null"
363 AC_TRY_EVAL(bnv_try_4)
364 if test x"$ac_status" != x0; then
365 echo "$bnv_err_4" >&AC_FD_CC
366 else
367 bnv_cv_qt_test_result="success"
368 fi
369 fi
370 fi
371 fi
372 ])dnl AC_CACHE_VAL bnv_cv_qt_test_result
373 AC_MSG_RESULT([$bnv_cv_qt_test_result]);
374 if test x"$bnv_cv_qt_test_result" = "xfailure"; then
375 AC_MSG_ERROR([Failed to find matching components of a complete
376 Qt installation. Try using more options,
377 see ./configure --help.])
378 fi
379
380 rm -f bnv_qt_test.h moc_bnv_qt_test.$ac_ext moc_bnv_qt_test.o \
381 bnv_qt_main.$ac_ext bnv_qt_main.o bnv_qt_main
382 fi
383])
384
385dnl Internal subroutine of BNV_HAVE_QT
386dnl Set bnv_qt_dir bnv_qt_include_dir bnv_qt_bin_dir bnv_qt_lib_dir bnv_qt_lib
387AC_DEFUN([BNV_PATH_QT_DIRECT],
388[
389 ## Binary utilities ##
390 if test x"$with_Qt_bin_dir" != x; then
391 bnv_qt_bin_dir=$with_Qt_bin_dir
392 fi
393 ## Look for header files ##
394 if test x"$with_Qt_include_dir" != x; then
395 bnv_qt_include_dir="$with_Qt_include_dir"
396 else
397 # The following header file is expected to define QT_VERSION.
398 qt_direct_test_header=qglobal.h
399 # Look for the header file in a standard set of common directories.
400 # FH: added some more system directories, also fuer qt4
401 bnv_include_path_list="
402 /usr/include
403 `ls -dr ${QTDIR}/include 2>/dev/null`
404 `ls -dr /usr/share/qt*/include/ 2>/dev/null`
405 `ls -dr /usr/share/qt*/include/Qt/ 2>/dev/null`
406 `ls -dr /usr/include/qt* 2>/dev/null`
407 `ls -dr /usr/lib/qt*/include 2>/dev/null`
408 `ls -dr /usr/local/qt*/include 2>/dev/null`
409 `ls -dr /opt/qt*/include 2>/dev/null`
410 `ls -dr /Developer/qt*/include 2>/dev/null`
411 "
412 for bnv_dir in $bnv_include_path_list; do
413 if test -r "$bnv_dir/$qt_direct_test_header"; then
414 bnv_dirs="$bnv_dirs $bnv_dir"
415 fi
416 done
417 # Now look for the newest in this list
418 bnv_prev_ver=0
419 for bnv_dir in $bnv_dirs; do
420 bnv_this_ver=`egrep -w '#define QT_VERSION' $bnv_dir/$qt_direct_test_header | sed s/'#define QT_VERSION'//`
421 if expr $bnv_this_ver '>' $bnv_prev_ver > /dev/null; then
422 bnv_qt_include_dir=$bnv_dir
423 bnv_prev_ver=$bnv_this_ver
424 fi
425 done
426 fi dnl Found header files.
427
428 # Are these headers located in a traditional Trolltech installation?
429 # That would be $bnv_qt_include_dir stripped from its last element:
430 bnv_possible_qt_dir=`dirname $bnv_qt_include_dir`
431 if (test -x $bnv_possible_qt_dir/bin/moc) &&
432 ((ls $bnv_possible_qt_dir/lib/lib[[Qq]]t* > /dev/null 2>/dev/null) ||
433 (ls $bnv_possible_qt_dir/lib64/lib[[Qq]]t* > /dev/null 2>/dev/null)); then
434 # Then the rest is a piece of cake
435 bnv_qt_dir=$bnv_possible_qt_dir
436 bnv_qt_bin_dir="$bnv_qt_dir/bin"
437 if test x"$with_Qt_lib_dir" != x; then
438 bnv_qt_lib_dir="$with_Qt_lib_dir"
439 else
440 if (test -d $bnv_qt_dir/lib64); then
441 bnv_qt_lib_dir="$bnv_qt_dir/lib64"
442 else
443 bnv_qt_lib_dir="$bnv_qt_dir/lib"
444 fi
445 fi
446 # Only look for lib if the user did not supply it already
447 if test x"$bnv_qt_lib" = xNO; then
448 bnv_qt_lib="`ls $bnv_qt_lib_dir/lib[[Qq]]t* | sed -n 1p |
449 sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
450 fi
451 bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
452 else
453 # There is no valid definition for $QTDIR as Trolltech likes to see it
454 bnv_qt_dir=
455 ## Look for Qt library ##
456 if test x"$with_Qt_lib_dir" != x; then
457 bnv_qt_lib_dir="$with_Qt_lib_dir"
458 # Only look for lib if the user did not supply it already
459 if test x"$bnv_qt_lib" = xNO; then
460 bnv_qt_lib="`ls $bnv_qt_lib_dir/lib[[Qq]]t* | sed -n 1p |
461 sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
462 fi
463 bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
464 else
465 # Normally, when there is no traditional Trolltech installation,
466 # the library is installed in a place where the linker finds it
467 # automatically.
468 # If the user did not define the library name, try with qt
469 if test x"$bnv_qt_lib" = xNO; then
470 bnv_qt_lib=qt
471 fi
472 qt_direct_test_header=qapplication.h
473 qt_direct_test_main="
474 int argc;
475 char ** argv;
476 QApplication app(argc,argv);
477 "
478 # See if we find the library without any special options.
479 # Don't add top $LIBS permanently yet
480 bnv_save_LIBS="$LIBS"
481 LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
482 bnv_qt_LIBS="$LIBS"
483 bnv_save_CXXFLAGS="$CXXFLAGS"
484 CXXFLAGS="-I$bnv_qt_include_dir"
485 AC_TRY_LINK([#include <$qt_direct_test_header>],
486 $qt_direct_test_main,
487 [
488 # Success.
489 # We can link with no special library directory.
490 bnv_qt_lib_dir=
491 ], [
492 # That did not work. Try the multi-threaded version
493 echo "Non-critical error, please neglect the above." >&AC_FD_CC
494 bnv_qt_lib=qt-mt
495 LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
496 AC_TRY_LINK([#include <$qt_direct_test_header>],
497 $qt_direct_test_main,
498 [
499 # Success.
500 # We can link with no special library directory.
501 bnv_qt_lib_dir=
502 ], [
503 # That did not work. Try the OpenGL version
504 echo "Non-critical error, please neglect the above." >&AC_FD_CC
505 bnv_qt_lib=qt-gl
506 LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
507 AC_TRY_LINK([#include <$qt_direct_test_header>],
508 $qt_direct_test_main,
509 [
510 # Success.
511 # We can link with no special library directory.
512 bnv_qt_lib_dir=
513 ], [
514 # That did not work. Maybe a library version I don't know about?
515 echo "Non-critical error, please neglect the above." >&AC_FD_CC
516 # Look for some Qt lib in a standard set of common directories.
517 bnv_dir_list="
518 `echo $bnv_qt_includes | sed ss/includess`
519 /lib
520 /usr/lib64
521 /usr/lib
522 /usr/local/lib64
523 /usr/local/lib
524 /opt/lib64
525 /opt/lib
526 `ls -dr /usr/lib64/qt* 2>/dev/null`
527 `ls -dr /usr/lib64/qt*/lib64 2>/dev/null`
528 `ls -dr /usr/lib/qt* 2>/dev/null`
529 `ls -dr /usr/local/qt* 2>/dev/null`
530 `ls -dr /opt/qt* 2>/dev/null`
531 "
532 for bnv_dir in $bnv_dir_list; do
533 if ls $bnv_dir/lib[[Qq]]t* >/dev/null 2>/dev/null; then
534 # Gamble that it's the first one...
535 bnv_qt_lib="`ls $bnv_dir/lib[[Qq]]t* | sed -n 1p |
536 sed s@$bnv_dir/lib@@ | sed s/[[.]].*//`"
537 bnv_qt_lib_dir="$bnv_dir"
538 break
539 fi
540 done
541 # Try with that one
542 LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
543 AC_TRY_LINK([#include <$qt_direct_test_header>],
544 $qt_direct_test_main,
545 [
546 # Success.
547 # We can link with no special library directory.
548 bnv_qt_lib_dir=
549 ], [
550 :
551 # Leave bnv_qt_lib_dir defined
552 ])
553 ])
554 ])
555 ])
556 if test x"$bnv_qt_lib_dir" != x; then
557 bnv_qt_LIBS="-L$bnv_qt_lib_dir $LIBS"
558 else
559 bnv_qt_LIBS="$LIBS"
560 fi
561 LIBS="$bnv_save_LIBS"
562 CXXFLAGS="$bnv_save_CXXFLAGS"
563 fi dnl $with_Qt_lib_dir was not given
564 fi dnl Done setting up for non-traditional Trolltech installation
565])
Note: See TracBrowser for help on using the repository browser.