
AC_DEFUN([OSIRIS_LIB_QT],[
        AC_ARG_WITH(qt,[  --with-qt=DIR      path to qt root directory ])
        AC_MSG_CHECKING([for Qt GUI toolkit library])
        AC_CACHE_VAL(osiris_cv_qt,[
        
                if test x"${with_qt}" != x ; then
                        if test -f "${with_qt}/lib/libqt.a"; then
                                osiris_cv_qt="${with_qt}"
                        else 
                                AC_MSG_ERROR( [${with_qt} doesn't contain libqt.a])
                        fi
                else
                        for i in \
                                `ls -dr /usr/local/qt 2>/dev/null` \
                                `ls -dr /opt/qt 2>/dev/null` \
                                `ls -dr ${HOME}/qt 2>/dev/null` ; do

                                if test -f "${i}/lib/libqt.a"; then
                                        osiris_cv_qt="${i}"
                                        break;
                                fi
                        done
                fi
        ])
        
        if test x"${osiris_cv_qt}" != x ; then
                qt_root="${osiris_cv_qt}"
        else
            AC_MSG_WARN([couldn't find Qt root directory  (libqt.a), not building Qt GUI.]);
        fi
        
        if test -f "${osiris_cv_qt}/bin/moc"; then
                qt_moc="${osiris_cv_qt}/bin/moc"
        fi

        AC_MSG_RESULT([${osiris_cv_qt}])
])

AC_DEFUN([OSIRIS_LIB_X11],[
        AC_ARG_WITH(x11,[  --with-x11=DIR      path to X windows lib directory ])
        AC_MSG_CHECKING([for X Windows])
        AC_CACHE_VAL(osiris_cv_x11,[

                if test x"${with_x11}" != x ; then
                        if test -f "${with_x11}/libX11.a"; then
                                osiris_cv_x11="${with_x11}"
                        else
                                AC_MSG_ERROR( [${with_x11} doesn't contain libX11.a])
                        fi
                else
                        for i in \
                                `ls -dr /usr/X11R6/lib 2>/dev/null` \
                                `ls -dr /usr/X/lib 2>/dev/null` ; do

                                if test -f "${i}/libX11.a"; then
                                        osiris_cv_x11="${i}"
                                        break;
                                fi
                        done
                fi
        ])

        if test x"${osiris_cv_x11}" != x ; then
                x11_libdir="${osiris_cv_x11}"
        fi

        AC_MSG_RESULT([${osiris_cv_x11}])
])



