|
From: Bart V. A. <bar...@gm...> - 2008-07-30 11:34:41
|
On Wed, Jul 30, 2008 at 11:31 AM, Julian Seward <js...@ac...> wrote:
>
> Is it at least possible to arrange it so that configure does not fail
> if pkg-config is not installed? I don't want to acquire a dependency
> on pkg-config.
>
> Also, what happens if I want to use a non-default Qt4, that is, one which
> I build from source and pkg-config knows nothing about? What then?
The configure.in file as present on the DRDDEV branch has the
following properties:
* pkg-config must be installed before running ./autogen.sh such that
the PKG_* macro definitions can be expanded properly.
* When running ./configure on a system where pkg-config has not been
installed, configure will finish successfully but will print the
following message (can be simulated e.g. as follows: ./configure
PKG_CONFIG=pkg-config-has-not-been-installed):
checking pkg-config is at least version 0.9.0... ./configure: line
2548: pkg-config: command not found no
The above message will be printed whether or not the QTCORE_CFLAGS and
QTCORE_LIBS variables have been passed to the configure script.
* When running ./configure on a system where pkg-config has been
installed, pkg-config will be used to find out QTCORE_CFLAGS and
QTCORE_LIBS.
Is this behavior acceptable ?
Bart.
configure.in patch:
@@ -50,6 +50,9 @@
# place.
AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], [--with-vex=$VEX_DIR])
+# pkg-config initialization.
+PKG_PROG_PKG_CONFIG()
+
# Checks for programs.
CFLAGS="-Wno-long-long"
@@ -1251,15 +1254,6 @@
sys/types.h \
])
-# Checks for C++ header files.
-AC_LANG(C++)
-AC_CHECK_HEADERS([ \
- QtCore/QMutex \
- QtCore/QSemaphore \
- QtCore/QThread \
- ])
-AC_LANG(C)
-
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_TYPE_OFF_T
@@ -1273,7 +1267,6 @@
AC_TYPE_SIGNAL
AC_CHECK_LIB([rt], [clock_gettime])
-AC_CHECK_LIB([QtCore], [_ZN6QMutex4lockEv]) # QMutex::lock()
AC_CHECK_FUNCS([ \
clock_gettime\
@@ -1401,26 +1394,17 @@
AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
-# does this compiler have the include file <Qt/qmutex.h> and does it have
-# libQtCore.so ?
+# Has the QtCore package been installed ?
-AC_MSG_CHECKING([for Qt4 core library])
-
-AC_TRY_COMPILE([ ],
-[
-#if ! defined(HAVE_LIBQTCORE) || ! defined(HAVE_QTCORE_QMUTEX)
-#error Qt4 not supported.
-#endif
- return 0;
-],
+PKG_CHECK_EXISTS([QtCore],
[
+ PKG_CHECK_MODULES([QTCORE], [QtCore])
ac_have_qtcore=yes
- AC_MSG_RESULT([yes])
],
[
ac_have_qtcore=no
- AC_MSG_RESULT([no])
-])
+]
+)
AM_CONDITIONAL([HAVE_QTCORE], [test x$ac_have_qtcore = xyes])
|