##################################################################### # Standard routine for finding $$package # # source: $$filename ##################################################################### if test x$enabled_$$package_esc = xyes then if test x$found_$$package_esc = xno then AC_ARG_WITH([qtdir], [ --with-qtdir=DIR Qt installation directory [default=$QTDIR]], QTDIR=$withval) dirs="$sandbox_location/qt3/include /usr/include/qt3" if test x$QTDIR != x then QTDIR=`echo $QTDIR | sed -e 's=/$=='` dirs="$QTDIR/include $dirs" fi for sub1 in /usr/lib /usr/share /usr/local /usr/local/lib /usr/local/share /opt do for sub2 in qt3 qt31 qt32 qt33 do dirs="$dirs $sub1/$sub2/include" done done for dir in $dirs do found=1 for file in $$headers{$$package} do if test ! -f $dir/$file then found=0 break 1 fi done if test $found = 1 then break 1 fi done AC_MSG_CHECKING([[$$package header(s) found]]) if test $found = 1 then AC_MSG_RESULT([yes: $dir]) include_dirs_$$package_esc=$dir lib_dirs_$$package_esc=`echo $dir | sed -e 's=/include=/lib='` AC_MSG_RESULT([yes: $dir, assuming lib-dir $lib_dirs_$$package_esc]) if test x"$$libs{$$package}" != x then LIBS= old_CXXFLAGS=$CXXFLAGS old_LDFLAGS=$LDFLAGS for tmp in $include_dirs_$$package_esc do CXXFLAGS="$CXXFLAGS -I$tmp" done for tmp in $lib_dirs_$$package_esc do LDFLAGS="$LDFLAGS -L$tmp" done AC_MSG_CHECKING([libraries needed for $$package]) AC_COMPILE_IFELSE( [ AC_LANG_SOURCE( [[ $$source{$$package} ]] )],[ links_ok=0 tmp_libs="" sep="" for tmp in $$libs{$$package} do LDFLAGS="$LDFLAGS -l$tmp" tmp_libs="$tmp_libs$sep$tmp" sep=" " AC_LINK_IFELSE( [ AC_LANG_SOURCE( [[ $$source{$$package}; ]]) ],[ links_ok=yes ],[ ] ) if test x$links_ok = xyes; then break 2 fi done if test x$links_ok = xyes; then libs_$$package_esc=$tmp_libs found_$$package_esc=yes AC_MSG_RESULT([$libs_$$package_esc]) else # trying alternative libs LDFLAGS=$old_LDFLAGS tmp_libs="" sep="" for tmp in $$alt_libs{$$package} do LDFLAGS="$LDFLAGS -l$tmp" tmp_libs="$tmp_libs$sep$tmp" sep=" " AC_LINK_IFELSE( [ AC_LANG_SOURCE( [[ $$source{$$package}; ]]) ],[ links_ok=yes ],[ ] ) if test x$links_ok = xyes; then break 2 fi done if test x$links_ok = xyes; then libs_$$package_esc=$tmp_libs found_$$package_esc=yes AC_MSG_RESULT([$libs_$$package_esc]) else AC_MSG_RESULT([linking failed]) fi fi ],[ AC_MSG_RESULT([compilation failed]) ]) CXXFLAGS=$old_CXXFLAGS LDFLAGS=$old_LDFLAGS else # no libs to checks found_$$package_esc=yes fi else AC_MSG_RESULT([no]) found_$$package_esc=no fi else AC_MSG_RESULT([no]) fi fi