Modified:
trunk/configure.in
trunk/qt.m4
trunk/setup/Makefile.am
Log:
- Removed expicit "-lXext -lX11" in the test compile for a working Qt
build, the idea is to terminate when libraries are missing, gets
ruined if adding libraries in test itself.
- Moved the X and Qt test part to be later in the configure file,
else not all LIBS and LDFLAGS are set and test for Qt is not
with what will be used in the end.
- Added "--with-extra-xlibs=" option to configure, sets
new EXTRA_XLIBS variable
- Let "setup/Makefile.am" use EXTRA_XLIBS
- Check outcome of Qt test in FUN_CHECK_QT, terminate in error.
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2007-03-16 22:40:04 UTC (rev 253)
+++ trunk/configure.in 2007-03-18 20:26:50 UTC (rev 254)
@@ -191,65 +191,6 @@
###################################################################
#
-# X
-#
-###################################################################
-
-AC_PATH_X
-if test -z "$ac_x_libraries" || test "x$ac_x_libraries" = xNONE; then
- X_LDFLAGS=""
- x_libraries="/usr/lib"; dnl better than nothing :-
- else
- x_libraries=$ac_x_libraries
- X_LDFLAGS="-L$x_libraries"
-fi
-all_includes="$all_includes $X_INCLUDES"
-all_libraries="$all_libraries $X_LDFLAGS"
-
-AC_SUBST(X_INCLUDES)
-AC_SUBST(X_LDFLAGS)
-AC_SUBST(x_libraries)
-AC_SUBST(x_includes)
-
-LIB_X11='-lX11 $(LIBSOCKET)'
-AC_SUBST(LIB_X11)
-
-###################################################################
-#
-# --enable-gui
-#
-###################################################################
-AC_ARG_ENABLE( gui,
-[AC_HELP_STRING([--enable-gui],[Build GUI bits (needs qt) [default=yes]])],
-[ case "${enableval}" in
- yes) gui=true ;;
- no) gui=false ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-gui) ;;
- esac],[gui=true])
-
-if test "x$gui" = "xtrue"; then
- AC_PROG_CXX
-else
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
- else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
- fi
-fi
-
-have_qt="no"
-if test "x$gui" = "xtrue"; then
- FUN_CHECK_QT
-fi
-
-AM_CONDITIONAL(QT, test "x$have_qt" = "xyes" )
-
-###################################################################
-#
# --enable-bundles
#
###################################################################
@@ -815,6 +756,101 @@
###################################################################
# #
+# Add some extra X libs when linking shared library that usees X #
+# #
+###################################################################
+
+AC_ARG_WITH(ldflags,
+ [ --with-ldflags=option Extra arguments for linking],
+ EXTRA_LDFLAGS="$withval",EXTRA_LDFLAGS="")
+AC_SUBST(EXTRA_LDFLAGS)
+LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
+
+extra_xlibs=
+AC_ARG_WITH(extra-xlibs,
+ [ --with-extra-xlibs= Extra arguments for linking X apps/libs],
+ use_extra_xlibs=$withval,
+ use_extra_xlibs=no
+)
+if test -n "$use_extra_xlibs" && \
+ test "$use_extra_xlibs" != "no"; then
+
+ EXTRA_XLIBS="$use_extra_xlibs"
+fi
+AC_SUBST(EXTRA_XLIBS)
+
+###################################################################
+#
+# X
+#
+###################################################################
+
+# We delayed the test for X and Qt, as it will use LDFLAGS and LIBS
+# set above. This configure doesn't even try find threads library
+# etc, it trust to get these configuration from the packages it uses,
+# so configure trying to link a Qt test app earlier than this, will
+# fail. "qt.m4" actually assumes a PTHREAD_LIBS that never is set.
+
+AC_PATH_X
+if test -z "$ac_x_libraries" || test "x$ac_x_libraries" = xNONE; then
+ X_LDFLAGS=""
+ x_libraries="/usr/lib"; dnl better than nothing :-
+ else
+ x_libraries=$ac_x_libraries
+ X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$all_includes $X_INCLUDES"
+all_libraries="$all_libraries $X_LDFLAGS"
+
+AC_SUBST(X_INCLUDES)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(x_libraries)
+AC_SUBST(x_includes)
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+AC_SUBST(LIB_X11)
+
+###################################################################
+#
+# --enable-gui
+#
+###################################################################
+AC_ARG_ENABLE( gui,
+[AC_HELP_STRING([--enable-gui],[Build GUI bits (needs qt) [default=yes]])],
+[ case "${enableval}" in
+ yes) gui=true ;;
+ no) gui=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-gui) ;;
+ esac],[gui=true])
+
+if test "x$gui" = "xtrue"; then
+ AC_PROG_CXX
+else
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+ else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+ fi
+fi
+
+have_qt="no"
+if test "x$gui" = "xtrue"; then
+ FUN_CHECK_QT
+ dnl This did run FUN_QT_COMPILE that try link a Qt test app, but
+ dnl leave it to us to decide what to do with a failure
+ if test "x$qt_compile" != "xyes" ; then
+ AC_MSG_ERROR([--enable-gui is given but can't compile/link a Qt test application])
+ fi
+fi
+
+AM_CONDITIONAL(QT, test "x$have_qt" = "xyes" )
+
+###################################################################
+# #
# Build test library ? #
# #
###################################################################
Modified: trunk/qt.m4
===================================================================
--- trunk/qt.m4 2007-03-16 22:40:04 UTC (rev 253)
+++ trunk/qt.m4 2007-03-18 20:26:50 UTC (rev 254)
@@ -348,7 +348,7 @@
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS -I$qt_includes $X_CFLAGS $all_includes"
fi
LDFLAGS="$LDFLAGS -L$qt_libraries $X_LIBS $X_LDFLAGS"
- LIBS="$LIBS $PTHREAD_LIBS $qt_libs $X_EXTRA_LIBS -lXext -lX11 $X_PRE_LIBS $EXTRA_XLIBS"
+ LIBS="$LIBS $PTHREAD_LIBS $qt_libs $X_EXTRA_LIBS $X_PRE_LIBS $EXTRA_XLIBS"
if expr "$QTVERSION" '>=' "040000" > /dev/null ; then
AC_TRY_LINK([
Modified: trunk/setup/Makefile.am
===================================================================
--- trunk/setup/Makefile.am 2007-03-16 22:40:04 UTC (rev 253)
+++ trunk/setup/Makefile.am 2007-03-18 20:26:50 UTC (rev 254)
@@ -128,7 +128,8 @@
-module
# libmyodbc3S_la_LIBADD = @QT_LDFLAGS@ @LIB_QT@ ../util/libmyodbc3u.la
-libmyodbc3S_la_LIBADD = $(QT_LDFLAGS) $(QT_LIBS) ../util/libmyodbc3u.la
+libmyodbc3S_la_LIBADD = $(QT_LDFLAGS) $(QT_LIBS) $(EXTRA_XLIBS) \
+ ../util/libmyodbc3u.la
libmyodbc3S_la_DEPENDENCIES = ../util/libmyodbc3u.la
| Thread |
|---|
| • Connector/ODBC 3.51 commit: r254 - in trunk: . setup | mysqldev | 18 Mar |