dnl dnl ACQGL_TRYLINK_QT(cxxflags, libs [, ACTION-IF-OK [, ACTION-IF-NOT-OK ]]) dnl AC_DEFUN(ACQGL_TRYLINK_QT, [ AC_LANG_SAVE AC_LANG_CPLUSPLUS saved_cxxflags=$CXXFLAGS saved_libs=$LIBS CXXFLAGS="$CXXFLAGS $1" LIBS="$LIBS $2" AC_TRY_LINK([ #include #include #include ], [ int i; char **c = NULL; QGLWidget glw(); /* we need qgl support */ QApplication a(i, c); /* autoconfs main() is broken */ QPushButton hello("Hello world", 0); hello.resize(100, 30); a.setMainWidget(&hello); a.exec(); ], [ ifelse([$3], , :, [$3]) ], [ ifelse([$4], , :, [$4]) ]) CXXFLAGS=$saved_cxxflags LIBS=$saved_libs AC_LANG_RESTORE ]) dnl dnl ACQGL_PATH_QT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN(ACQGL_PATH_QT, [ AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_ARG_WITH(qt,[ --with-qt=DIR Directory where QT is installed ], acqgl_qt_dir="$withval", acqgl_qt_dir="$QTDIR") dnl have a QTDIR? check linking with -lqt-mt or -lqt if test ! x$acqgl_qt_dir = x; then AC_MSG_CHECKING(for Qt) ACQGL_TRYLINK_QT( [-I$acqgl_qt_dir/include], [-L$acqgl_qt_dir/lib -lqt], [ acqgl_qt_cflags="-I$acqgl_qt_dir/include" acqgl_qt_libs="-L$acqgl_qt_dir/lib -lqt" acqgl_qt_moc="$acqgl_qt_dir/bin/moc" acqgl_qt_uic="$acqgl_qt_dir/bin/uic" acqgl_qt_found="yes" ], [ acqgl_qt_found="no" ] ) ACQGL_TRYLINK_QT( [-I$acqgl_qt_dir/include], [-L$acqgl_qt_dir/lib -lqt-mt], [ acqgl_qt_cflags="-I$acqgl_qt_dir/include" acqgl_qt_libs="-L$acqgl_qt_dir/lib -lqt-mt" acqgl_qt_moc="$acqgl_qt_dir/bin/moc" acqgl_qt_uic="$acqgl_qt_dir/bin/uic" acqgl_qt_found="yes" ], [ acqgl_qt_found="no" ] ) dnl dont have QTDIR, try with system defaults then else AC_PATH_PROG(acqgl_qt_moc, moc, FAILED, $PATH) AC_PATH_PROG(acqgl_qt_uic, uic, FAILED, $PATH) if test x$acqgl_qt_moc = xFAILED -o x$acqgl_qt_uic = xFAILED; then acqgl_qt_found="no" else AC_MSG_CHECKING(for Qt) ACQGL_TRYLINK_QT( [-I/usr/include/qt], [-lqt], [ acqgl_qt_cflags="-I/usr/include/qt" acqgl_qt_libs="-lqt" acqgl_qt_found="yes" ], [ ACQGL_TRYLINK_QT( [-I/usr/include/qt], [-lqt-mt], [ acqgl_qt_cflags="-I/usr/include/qt" acqgl_qt_libs="-lqt-mt" acqgl_qt_found="yes" ], [ acqgl_qt_found="no" ] ) ]) fi fi if test x$acqgl_qt_found = xyes; then AC_MSG_RESULT([yes]) ifelse([$2], , :, [$2]) else AC_MSG_RESULT([no]) ifelse([$3], , :, [$3]) fi ])