source: m4/gwqt4.m4@ 861874

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 861874 was 861874, checked in by Frederik Heber <heber@…>, 14 years ago

libMolecuilderAction is now a shared lib via libtool.

This is all taken from the example available at http://www.openismus.com/documents/linux/building_libraries/building_libraries/building_libraries.shtml.

Necessary changes:

  • ValueStorage is now part of Actions, not of UIElements anymore (which is actually as it should have been right away, only Dialog uses ValueStorage and for all Actions ValueStorage is the simple adapter pattern to MapOfActions needed the relax (compilation) dependencies).
  • new files:
    • config/ltmain.sh (scipt for libtool)
    • libmolecuilder_config.h.in (extra config.h which is copied along with lib to contain how it has been compiled)
    • molecuilder.pc.in (package config information
  • BUGFIX: m4/gwqt4.m4 added -L$X_libraries, however $X_libraries was nowhere set and libtool admonished the empty "-L"
  • libMolecuilderUI now depends on libMolecuilderAction
  • all unit tests now have libMolecuilderAction and libMolecuilderUI due to non-interactive calls of actions
  • Property mode set to 100644
File size: 5.5 KB
RevLine 
[3027f8]1# Check for Qt compiler flags, linker flags, and binary packages
2AC_DEFUN([gw_CHECK_QT4],
3[
4AC_REQUIRE([AC_PROG_CXX])
5AC_REQUIRE([AC_PATH_X])
6
7AC_MSG_CHECKING([QTDIR])
8AC_ARG_WITH([qtdir], [ --with-qtdir=DIR Qt installation directory [default=$QTDIR]], QTDIR=$withval)
9# Check that QTDIR is defined or that --with-qtdir given
10if test x"$QTDIR" = x ; then
11 # some usual Qt-locations
12 QT_SEARCH="/usr /usr/lib/qt /usr/X11R6 /usr/local/Trolltech/Qt-4.0.0 /usr/local/Trolltech/Qt-4.0.1 /usr/local/Trolltech/Qt-4.1.0 /usr/local/Trolltech/Qt-4.2.0 /usr/local/Trolltech/Qt-4.2.1 /usr/local/Trolltech/Qt-4.2.2"
13else
14 QT_SEARCH=$QTDIR
15 QTDIR=""
16fi
17for i in $QT_SEARCH ; do
18 QT_INCLUDE_SEARCH="include/qt4 include"
19 for j in $QT_INCLUDE_SEARCH ; do
20 if test -f $i/$j/Qt/qglobal.h -a x$QTDIR = x ; then
21 QTDIR=$i
22 QT_INCLUDES=$i/$j
23 fi
24 done
25done
26if test x"$QTDIR" = x ; then
27 AC_MSG_ERROR([*** QTDIR must be defined, or --with-qtdir option given])
28fi
29AC_MSG_RESULT([$QTDIR])
30
31# Change backslashes in QTDIR to forward slashes to prevent escaping
32# problems later on in the build process, mainly for Cygwin build
33# environment using MSVC as the compiler
34QTDIR=`echo $QTDIR | sed 's/\\\\/\\//g'`
35
36AC_MSG_CHECKING([Qt includes])
37# Check where includes are located
38if test x"$QT_INCLUDES" = x ; then
39 AC_MSG_ERROR([*** could not find Qt-includes! Make sure you have the Qt-devel-files installed!])
40fi
41AC_MSG_RESULT([$QT_INCLUDES])
42
43
44if test -z "$QTHOSTDIR" ; then
45 case "${prefix}" in
46 /opt/mingw*)
47 QTHOSTDIR=/usr
48 ;;
49 *)
50 if test -n "$QTDIR" ; then
51 QTHOSTDIR="$QTDIR"
52 else
53 QTHOSTDIR=/usr
54 fi
55 ;;
56 esac
57fi
58
59
60# Check that moc is in path
61AC_CHECK_PROG(MOC, moc-qt4, $QTHOSTDIR/bin/moc-qt4,,$QTHOSTDIR/bin/)
62if test x$MOC = x ; then
63 AC_CHECK_PROG(MOC, moc, $QTHOSTDIR/bin/moc,,$QTHOSTDIR/bin/)
64 if test x$MOC = x ; then
65 AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
66 fi
67fi
68
69# Check that uic is in path
70AC_CHECK_PROG(UIC, uic-qt4, $QTHOSTDIR/bin/uic-qt4,,$QTHOSTDIR/bin/)
71if test x$UIC = x ; then
72 AC_CHECK_PROG(UIC, uic, $QTHOSTDIR/bin/uic,,$QTHOSTDIR/bin/)
73 if test x$UIC = x ; then
74 AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
75 fi
76fi
77
78# lupdate is the Qt translation-update utility.
79AC_CHECK_PROG(LUPDATE, lupdate-qt4, $QTHOSTDIR/bin/lupdate-qt4,,$QTHOSTDIR/bin/)
80if test x$LUPDATE = x ; then
81 AC_CHECK_PROG(LUPDATE, lupdate, $QTHOSTDIR/bin/lupdate,,$QTHOSTDIR/bin/)
82 if test x$MOC = x ; then
83 AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
84 fi
85fi
86
87# lrelease is the Qt translation-release utility.
88AC_CHECK_PROG(LRELEASE, lrelease-qt4, $QTHOSTDIR/bin/lrelease-qt4,,$QTHOSTDIR/bin/)
89if test x$LRELEASE = x ; then
90 AC_CHECK_PROG(LRELEASE, lrelease, $QTHOSTDIR/bin/lrelease,,$QTHOSTDIR/bin/)
91 if test x$MOC = x ; then
92 AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
93 fi
94fi
95
96# Calculate Qt include path
97QT_CXXFLAGS="-I$QT_INCLUDES -I$QT_INCLUDES/Qt"
98
99# On unix, figure out if we're doing a static or dynamic link
100case "${host}" in
101 *mingw32)
102 QT_IS_STATIC=`ls $QTDIR/lib/*.a 2> /dev/null`
103 if test "x$QT_IS_STATIC" = x; then
104 QT_IS_STATIC="no"
105 else
106 QT_IS_STATIC="yes"
107 fi
108 if test x$QT_IS_STATIC = xno ; then
109 QT_IS_DYNAMIC=`ls $QTDIR/lib/*.so 2> /dev/null`
110 if test "x$QT_IS_DYNAMIC" = x; then
111 AC_MSG_ERROR([*** Couldn't find any Qt libraries])
112 fi
113 fi
114 QT_LIB="-L$QTDIR/bin -lQtCore4 -lQtXml4 -lQtNetwork4 -lws2_32"
115 QT_LIB_GUI="-lQtGui4"
116 # Check that windres is in path
117 AC_PATH_PROGS([WINDRES],[i586-mingw32-windres windres],,[${prefix}/bin:$PATH])
118 if test x$WINDRES = x ; then
119 AC_MSG_ERROR([*** not found! Make sure you have binutils installed!])
120 fi
121 ;;
122 *)
123 QT_IS_STATIC=`ls $QTDIR/lib/*.a 2> /dev/null`
124 if test "x$QT_IS_STATIC" = x; then
125 QT_IS_STATIC="no"
126 else
127 QT_IS_STATIC="yes"
128 fi
129 if test x$QT_IS_STATIC = xno ; then
130 QT_IS_DYNAMIC=`ls $QTDIR/lib/*.so 2> /dev/null`
131 if test "x$QT_IS_DYNAMIC" = x; then
132 AC_MSG_ERROR([*** Couldn't find any Qt libraries])
133 fi
134 fi
135 QT_LIB="-L$QTDIR/lib -L$QTDIR/lib/qt4 -lQtCore -lQtXml -lQtNetwork"
136 QT_LIB_GUI="-lQtGui"
137 ;;
138esac
139AC_MSG_CHECKING([if Qt is static])
140AC_MSG_RESULT([$QT_IS_STATIC])
141
142QT_LIBS="$QT_LIB"
143
144
145case "${host}" in
146 *irix*)
147 QT_LIBS="$QT_LIB"
148 if test $QT_IS_STATIC = yes ; then
[861874]149 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE"
[3027f8]150 fi
151 ;;
152
153 *linux*)
154 QT_LIBS="$QT_LIB"
155 if test $QT_IS_STATIC = yes ; then
[861874]156 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE -ldl"
[3027f8]157 fi
158 ;;
159
160 *osf*)
161 # Digital Unix (aka DGUX aka Tru64)
162 QT_LIBS="$QT_LIB"
163 if test $QT_IS_STATIC = yes ; then
[861874]164 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE"
[3027f8]165 fi
166 ;;
167
168 *solaris*)
169 QT_LIBS="$QT_LIB"
170 if test $QT_IS_STATIC = yes ; then
[861874]171 QT_LIBS="$QT_LIBS -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl"
[3027f8]172 fi
173 ;;
174
175esac
176
177
178QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT"
179
180QT_LDADD="$QT_LIBS"
181
182AC_MSG_CHECKING([QT_CXXFLAGS])
183AC_MSG_RESULT([$QT_CXXFLAGS])
184AC_MSG_CHECKING([QT_LDADD])
185AC_MSG_RESULT([$QT_LDADD])
186
187AC_SUBST(QT_CXXFLAGS)
188AC_SUBST(QT_LDADD)
189AC_SUBST(QT_LIB_GUI)
190
191])
192
193
Note: See TracBrowser for help on using the repository browser.