📄 acinclude.m4
字号:
## -*- autoconf -*-dnl This file is part of the KDE libraries/packagesdnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)dnl This file is free software; you can redistribute it and/ordnl modify it under the terms of the GNU Library General Publicdnl License as published by the Free Software Foundation; eitherdnl version 2 of the License, or (at your option) any later version.dnl This library is distributed in the hope that it will be useful,dnl but WITHOUT ANY WARRANTY; without even the implied warranty ofdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUdnl Library General Public License for more details.dnl You should have received a copy of the GNU Library General Public Licensednl along with this library; see the file COPYING.LIB. If not, write todnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,dnl Boston, MA 02111-1307, USA.dnl IMPORTANT NOTE:dnl Please do not modify this file unless you expect your modifications to bednl carried into every other module in the repository. If you decide that youdnl really want to modify it, contact coolo@kde.org mentioning that you havednl and that the modified file should be committed to every module.dnldnl Single-module modifications are best placed in configure.in for kdelibsdnl and kdebase or configure.in.in if present.dnl ------------------------------------------------------------------------dnl Find a file (or one of more files in a list of dirs)dnl ------------------------------------------------------------------------dnlAC_DEFUN(AC_FIND_FILE,[$3=NOfor i in $2;do for j in $1; do if test -r "$i/$j"; then $3=$i break 2 fi donedone])dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,dnl if-not-found, test-parameter)AC_DEFUN(KDE_FIND_PATH,[ AC_MSG_CHECKING([for $1]) kde_cache=`echo $1 | sed 'y%./+-%__p_%'` AC_CACHE_VAL(kde_cv_path_$kde_cache, [ kde_cv_path="NONE" if test -n "$$2"; then kde_cv_path="$$2"; else dirs="$3" kde_save_IFS=$IFS IFS=':' for dir in $PATH; do dirs="$dirs $dir" done IFS=$kde_save_IFS for dir in $dirs; do if test -x "$dir/$1"; then if test -n "$5" then evalstr="$dir/$1 $5 2>&1 " if eval $evalstr; then kde_cv_path="$dir/$1" break fi else kde_cv_path="$dir/$1" break fi fi done fi eval "kde_cv_path_$kde_cache=$kde_cv_path" ]) eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\"" if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then AC_MSG_RESULT(not found) $4 else AC_MSG_RESULT($kde_cv_path) $2=$kde_cv_path fi])AC_DEFUN(KDE_MOC_ERROR_MESSAGE,[ AC_MSG_ERROR([No Qt meta object compiler (moc) found!Please check whether you installed Qt correctly.You need to have a running moc binary.configure tried to run $ac_cv_path_moc and the test didn'tsucceed. If configure shouldn't have tried this one, setthe environment variable MOC to the right one before runningconfigure.])])dnl ------------------------------------------------------------------------dnl Find the meta object compiler in the PATH, in $QTDIR/bin, and somednl more usual placesdnl ------------------------------------------------------------------------dnlAC_DEFUN(AC_PATH_QT_MOC,[ KDE_FIND_PATH(moc, MOC, [$ac_qt_bindir $QTDIR/bin $QTDIR/src/moc \ /usr/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/lib/qt2/bin \ /usr/local/qt/bin], [KDE_MOC_ERROR_MESSAGE]) if test -z "$MOC"; then if test -n "$ac_cv_path_moc"; then output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"` fi echo "configure:__oline__: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&AC_FD_CC echo "configure:__oline__: moc output: $output" >&AC_FD_CC if test -z "$output"; then KDE_MOC_ERROR_MESSAGE fi fi AC_SUBST(MOC)])AC_DEFUN(KDE_1_CHECK_PATHS,[ KDE_1_CHECK_PATH_HEADERS KDE_TEST_RPATH= if test -n "$USE_RPATH"; then if test -n "$kde_libraries"; then KDE_TEST_RPATH="-rpath $kde_libraries" fi if test -n "$qt_libraries"; then KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $qt_libraries" fi if test -n "$x_libraries"; then KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $x_libraries" fi KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH" fiAC_MSG_CHECKING([for KDE libraries installed])ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'if AC_TRY_EVAL(ac_link) && test -s conftest; then AC_MSG_RESULT(yes)else AC_MSG_ERROR([your system fails at linking a small KDE application!Check, if your compiler is installed correctly and if you have used thesame compiler to compile Qt and kdelibs as you did use now])fiif eval `KDEDIR= ./conftest 2>&5`; then kde_result=doneelse kde_result=problemsfiKDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.logkde_have_all_paths=yesAC_LANG_CPLUSPLUSKDE_SET_PATHS($kde_result)])AC_DEFUN(KDE_SET_PATHS,[ kde_cv_all_paths="kde_have_all_paths=\"yes\" \ kde_htmldir=\"$kde_htmldir\" \ kde_appsdir=\"$kde_appsdir\" \ kde_icondir=\"$kde_icondir\" \ kde_sounddir=\"$kde_sounddir\" \ kde_datadir=\"$kde_datadir\" \ kde_locale=\"$kde_locale\" \ kde_cgidir=\"$kde_cgidir\" \ kde_confdir=\"$kde_confdir\" \ kde_mimedir=\"$kde_mimedir\" \ kde_toolbardir=\"$kde_toolbardir\" \ kde_wallpaperdir=\"$kde_wallpaperdir\" \ kde_bindir=\"$kde_bindir\" \ kde_servicesdir=\"$kde_servicesdir\" \ kde_servicetypesdir=\"$kde_servicetypesdir\" \ kde_result=$1"])AC_DEFUN(AC_CREATE_KFSSTND,[AC_REQUIRE([AC_CHECK_RPATH])AC_MSG_CHECKING([for KDE paths])kde_result=""AC_CACHE_VAL(kde_cv_all_paths,[if test "$1" = "default"; then if test -z "$kde_htmldir"; then kde_htmldir='\$(prefix)/share/doc/HTML' fi if test -z "$kde_appsdir"; then kde_appsdir='\$(prefix)/share/applnk' fi if test -z "$kde_icondir"; then kde_icondir='\$(prefix)/share/icons' fi if test -z "$kde_sounddir"; then kde_sounddir='\$(prefix)/share/sounds' fi if test -z "$kde_datadir"; then kde_datadir='\$(prefix)/share/apps' fi if test -z "$kde_locale"; then kde_locale='\$(prefix)/share/locale' fi if test -z "$kde_cgidir"; then kde_cgidir='\$(exec_prefix)/cgi-bin' fi if test -z "$kde_confdir"; then kde_confdir='\$(prefix)/share/config' fi if test -z "$kde_mimedir"; then kde_mimedir='\$(prefix)/share/mimelnk' fi if test -z "$kde_toolbardir"; then kde_toolbardir='\$(prefix)/share/toolbar' fi if test -z "$kde_wallpaperdir"; then kde_wallpaperdir='\$(prefix)/share/wallpapers' fi if test -z "$kde_bindir"; then kde_bindir='\$(exec_prefix)/bin' fi if test -z "$kde_servicesdir"; then kde_servicesdir='\$(prefix)/share/services' fi if test -z "$kde_servicetypesdir"; then kde_servicetypesdir='\$(prefix)/share/servicetypes' fi KDE_SET_PATHS(defaults)else if test $kde_qtver = 1; then AC_MSG_RESULT([compiling]) KDE_1_CHECK_PATHS else AC_MSG_ERROR([path checking not yet supported for KDE 2]) fifi])eval "$kde_cv_all_paths"if test -z "$kde_htmldir" || test -z "$kde_appsdir" || test -z "$kde_icondir" || test -z "$kde_sounddir" || test -z "$kde_datadir" || test -z "$kde_locale" || test -z "$kde_cgidir" || test -z "$kde_confdir" || test -z "$kde_mimedir" || test -z "$kde_toolbardir" || test -z "$kde_wallpaperdir" || test -z "$kde_bindir" || test -z "$kde_servicesdir" || test -z "$kde_servicetypesdir" || test "$kde_have_all_paths" != "yes"; then kde_have_all_paths=no AC_MSG_ERROR([configure could not run a little KDE program to test the environment.Since it had compiled and linked before, it must be a strange problem on your system.Look at config.log for details. If you are not able to fix this, look athttp://www.kde.org/faq/installation.html or any www.kde.org mirror.(If you're using an egcs version on Linux, you may update binutils!)])else rm -f conftest* AC_MSG_RESULT($kde_result)fibindir=$kde_bindir])AC_DEFUN(AC_SUBST_KFSSTND,[AC_SUBST(kde_htmldir)AC_SUBST(kde_appsdir)AC_SUBST(kde_icondir)AC_SUBST(kde_sounddir)AC_SUBST(kde_datadir)AC_SUBST(kde_locale)AC_SUBST(kde_cgidir)AC_SUBST(kde_confdir)AC_SUBST(kde_mimedir)AC_SUBST(kde_toolbardir)AC_SUBST(kde_wallpaperdir)AC_SUBST(kde_bindir)dnl for KDE 2AC_SUBST(kde_servicesdir)AC_SUBST(kde_servicetypesdir)if test "$kde_qtver" = 1; then kde_minidir="$kde_icondir/mini"else# for KDE 1 - this breaks KDE2 apps using minidir, but# that's the plan ;-/ kde_minidir="/dev/null"fiAC_SUBST(kde_minidir)])AC_DEFUN(KDE_MISC_TESTS,[ AC_LANG_C dnl Checks for libraries. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD AC_SUBST(LIBCOMPAT) kde_have_crypt= AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes], AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [ AC_MSG_WARN([you have no crypt in either libcrypt or libc.You should install libcrypt from another source or configure with PAMsupport]) kde_have_crypt=no ])) AC_SUBST(LIBCRYPT) if test $kde_have_crypt = yes; then AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function]) fi AC_CHECK_KSIZE_T AC_LANG_C AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) if test $ac_cv_lib_dnet_dnet_ntoa = no; then AC_CHECK_LIB(dnet_stub, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) fi AC_CHECK_FUNC(inet_ntoa) if test $ac_cv_func_inet_ntoa = no; then AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") fi AC_CHECK_FUNC(connect) if test $ac_cv_func_connect = no; then AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , $X_EXTRA_LIBS) fi AC_CHECK_FUNC(remove) if test $ac_cv_func_remove = no; then AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. AC_CHECK_FUNC(shmat) if test $ac_cv_func_shmat = no; then AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc") fi LIBSOCKET="$X_EXTRA_LIBS" AC_SUBST(LIBSOCKET) AC_SUBST(X_EXTRA_LIBS) AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4 AC_SUBST(LIBUCB) case $host in dnl this *is* LynxOS specific *-*-lynxos* ) AC_MSG_CHECKING([LynxOS header file wrappers]) [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"] AC_MSG_RESULT(disabled) AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS ;; esac AC_REQUIRE([KDE_CHECK_LIBDL]) AC_CHECK_BOOL])dnl ------------------------------------------------------------------------dnl Find the header files and libraries for X-Windows. Extended thednl macro AC_PATH_Xdnl ------------------------------------------------------------------------dnlAC_DEFUN(K_PATH_X,[AC_REQUIRE([AC_PROG_CPP])AC_MSG_CHECKING(for X)AC_LANG_SAVEAC_LANG_CAC_CACHE_VAL(ac_cv_have_x,[# One or both of the vars are not set, and there is no cached value.if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then kde_x_includes=NOelse kde_x_includes=$x_includesfiif test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then kde_x_libraries=NOelse kde_x_libraries=$x_librariesfi# below we use the standard autoconf callsac_x_libraries=$kde_x_librariesac_x_includes=$kde_x_includesAC_PATH_X_DIRECTAC_PATH_X_XMKMFif test -z "$ac_x_includes"; thenac_x_includes="."fiif test -z "$ac_x_libraries"; thenac_x_libraries="/usr/lib"fi#from now on we use our own again# when the user already gave --x-includes, we ignore# what the standard autoconf macros told us.if test "$kde_x_includes" = NO; then kde_x_includes=$ac_x_includesfiif test "$kde_x_includes" = NO; then AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])fiif test "$ac_x_libraries" = NO; then AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])fi# Record where we found X for the cache.ac_cv_have_x="have_x=yes \ kde_x_includes=$kde_x_includes ac_x_libraries=$ac_x_libraries"])dnleval "$ac_cv_have_x"if test "$have_x" != yes; then AC_MSG_RESULT($have_x) no_x=yeselse AC_MSG_RESULT([libraries $ac_x_libraries, headers $kde_x_includes])fiif test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then X_INCLUDES="" x_includes="."; dnl better than nothing :- else x_includes=$kde_x_includes X_INCLUDES="-I$x_includes"fiif 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"fiall_includes="$X_INCLUDES"all_libraries="$X_LDFLAGS"AC_SUBST(X_INCLUDES)AC_SUBST(X_LDFLAGS)AC_SUBST(x_libraries)AC_SUBST(x_includes)# Check for libraries that X11R6 Xt/Xaw programs need.ac_save_LDFLAGS="$LDFLAGS"test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to# check for ICE first), but we must link in the order -lSM -lICE or# we get undefined symbols. So assume we have SM if we have ICE.# These have to be linked with before -lX11, unlike the other# libraries we check for below, so use a different variable.# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.AC_CHECK_LIB(ICE, IceConnectionNumber, [LIBSM="$X_PRELIBS -lSM"], , $X_EXTRA_LIBS)AC_SUBST(LIBSM)LDFLAGS="$ac_save_LDFLAGS"AC_SUBST(X_PRE_LIBS)LIB_X11='-lX11 $(LIBSOCKET)'AC_SUBST(LIB_X11)AC_MSG_CHECKING(for libXext)AC_CACHE_VAL(kde_cv_have_libXext,[kde_ldflags_safe="$LDFLAGS"kde_libs_safe="$LIBS"LDFLAGS="$X_LDFLAGS $USER_LDFLAGS"LIBS="-lXext -lX11 $LIBSOCKET"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -