📄 acinclude.m4
字号:
# Defines the following vars:# ${basename}_LIB_NAME The computed library name.# ${basename}_LIB_SPEC The computed linker flags.#------------------------------------------------------------------------AC_DEFUN(SC_LIB_SPEC, [ AC_MSG_CHECKING(for $1 library) eval "sc_lib_name_dir=${libdir}" for i in \ `ls -dr ${sc_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${sc_lib_name_dir}/lib$1.* 2>/dev/null ` \ `ls -dr ${sc_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/pkg/*/lib$1.so 2>/dev/null ` \ `ls -dr /usr/pkg/*/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/pkg/lib/lib$1.so 2>/dev/null ` \ `ls -dr /usr/pkg/lib/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib/lib$1.so 2>/dev/null ` \ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/local/lib/lib$1.so 2>/dev/null ` \ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do if test -f "$i" ; then sc_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` break fi done case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) $1_LIB_SPEC=${$1_LIB_NAME} ;; *) # Strip off the leading "lib" and trailing ".a" or ".so" sc_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.so.*$//' -e 's/\.a$//'` $1_LIB_SPEC="-L${sc_lib_name_dir} -l${sc_lib_name_lib}" ;; esac if test "x${sc_lib_name_lib}" = x ; then AC_MSG_ERROR(not found) else AC_MSG_RESULT(${$1_LIB_SPEC}) fi])#------------------------------------------------------------------------# SC_PUBLIC_TCL_HEADERS --## Locate the installed public Tcl header files## Arguments:# None.## Requires:## Results:## Adds a --with-tclinclude switch to configure.# Result is cached.## Substs the following vars:# TCL_INCLUDES#------------------------------------------------------------------------AC_DEFUN(SC_PUBLIC_TCL_HEADERS, [ AC_MSG_CHECKING(for Tcl public headers) AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files.], with_tclinclude=${withval}) if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl public header file tcl.h]) fi else AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then ac_cv_c_tclh=${with_tclinclude} else # Check in the includedir, if --prefix was specified eval "temp_includedir=${includedir}" for i in \ ${temp_includedir} /usr/local/include /usr/include /usr/pkg/include \ `ls -dr /usr/include/tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_ERROR(tcl.h not found. Please specify its location with --with-tclinclude) else AC_MSG_RESULT(${ac_cv_c_tclh}) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`echo ${ac_cv_c_tclh}` TCL_INCLUDES="-I${INCLUDE_DIR_NATIVE}" AC_SUBST(TCL_INCLUDES)])#------------------------------------------------------------------------# SC_PUBLIC_TK_HEADERS --## Locate the installed public Tk header files## Arguments:# None.## Requires:## Results:## Adds a --with-tkinclude switch to configure.# Result is cached.## Substs the following vars:# TK_INCLUDES#------------------------------------------------------------------------AC_DEFUN(SC_PUBLIC_TK_HEADERS, [ AC_MSG_CHECKING(for Tk public headers) AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files.], with_tkinclude=${withval}) if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else AC_MSG_ERROR([${with_tkinclude} directory does not contain Tk public header file tk.h]) fi else AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then ac_cv_c_tkh=${with_tkinclude} else # Check in the includedir, if --prefix was specified eval "temp_includedir=${includedir}" for i in \ ${temp_includedir} /usr/local/include /usr/include /usr/pkg/include \ `ls -dr /usr/include/tk[[8-9]].[[0-9]]* 2>/dev/null` \ `ls -dr /usr/include/tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then AC_MSG_ERROR(tk.h not found. Please specify its location with --with-tkinclude) else AC_MSG_RESULT(${ac_cv_c_tkh}) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`echo ${ac_cv_c_tkh}` TK_INCLUDES="-I${INCLUDE_DIR_NATIVE}" AC_SUBST(TK_INCLUDES)])dnl ########################### -*- Mode: M4 -*- #######################dnl Copyright (C) 98, 1999 Matthew D. Langston <langston@SLAC.Stanford.EDU>dnldnl This macro is free software; you can redistribute it and/or modify itdnl under the terms of the GNU General Public License as published bydnl the Free Software Foundation; either version 2 of the License, ordnl (at your option) any later version.dnldnl This file is distributed in the hope that it will be useful, butdnl WITHOUT ANY WARRANTY; without even the implied warranty ofdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUdnl General Public License for more details.dnldnl You should have received a copy of the GNU General Public Licensednl along with this file; if not, write to:dnldnl Free Software Foundation, Inc.dnl Suite 330dnl 59 Temple Placednl Boston, MA 02111-1307, USA.dnl ####################################################################dnl @synopsis MDL_HAVE_OPENGLdnl dnl Search for OpenGL. We search first for Mesa (a GPL'ed version ofdnl OpenGL) before a vendor's version of OpenGL, unless we werednl specifically asked not to with `--with-Mesa=no' or `--without-Mesa'.dnldnl The four "standard" OpenGL libraries are searched for: "-lGL",dnl "-lGLU", "-lGLX" (or "-lMesaGL", "-lMesaGLU" as the case may be) anddnl "-lglut".dnldnl All of the libraries that are found (since "-lglut" or "-lGLX" mightdnl be missing) are added to the shell output variable "GL_LIBS", alongdnl with any other libraries that are necessary to successfully link andnl OpenGL application (e.g. the X11 libraries). Care has been taken todnl make sure that all of the libraries in "GL_LIBS" are listed in thednl proper order.dnldnl Additionally, the shell output variable "GL_CFLAGS" is set to anydnl flags (e.g. "-I" flags) that are necessary to successfully compilednl an OpenGL application.dnldnl The following shell variable (which are not output variables) arednl also set to either "yes" or "no" (depending on which libraries werednl found) to help you determine exactly what was found.dnldnl have_GLdnl have_GLUdnl have_GLXdnl have_glutdnldnl A complete little toy "Automake `make distcheck'" package of how todnl use this macro is available at:dnldnl ftp://ftp.slac.stanford.edu/users/langston/autoconf/ac_opengl-0.01.tar.gzdnldnl Please note that as the ac_opengl macro and the toy example evolves,dnl the version number increases, so you may have to adjust the abovednl URL accordingly.dnldnl @version 0.01 $Id: acinclude.m4,v 1.1.1.1 2004/06/06 14:14:24 rpm Exp $dnl @author Matthew D. Langston <langston@SLAC.Stanford.EDU>dnldnl Patched by <rpm@xenomai.org> to suit RTAI's requirements.AC_DEFUN(MDL_HAVE_OPENGL,[ AC_REQUIRE([AC_PATH_X]) AC_REQUIRE([AC_PATH_XTRA]) AC_CACHE_CHECK([for OpenGL], mdl_cv_have_OpenGL, [dnl Check for Mesa first, unless we were asked not to. AC_ARG_ENABLE(Mesa, [], use_Mesa=$enableval, use_Mesa=yes) if test x"$use_Mesa" = xyes; then GL_search_list="MesaGL GL" GLU_search_list="MesaGLU GLU" GLX_search_list="MesaGLX GLX" else GL_search_list="GL MesaGL" GLU_search_list="GLU MesaGLU" GLX_search_list="GLX MesaGLX" fi AC_LANG_SAVE AC_LANG_Cdnl If we are running under X11 then add in the appropriate libraries. if ! test x"$no_x" = xyes; thendnl Add everything we need to compile and link X programs to GL_CFLAGSdnl and GL_X_LIBS. GL_CFLAGS="$X_CFLAGS" GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS -lm" fi GL_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$GL_CFLAGS" GL_save_LIBS="$LIBS" LIBS="$GL_X_LIBS" # Save the "AC_MSG_RESULT file descriptor" to FD 8. exec 8>&AC_FD_MSG # Temporarily turn off AC_MSG_RESULT so that the user gets pretty # messages. exec AC_FD_MSG>/dev/null AC_SEARCH_LIBS(glAccum, $GL_search_list, have_GL=yes, have_GL=no) AC_SEARCH_LIBS(gluBeginCurve, $GLU_search_list, have_GLU=yes, have_GLU=no) AC_SEARCH_LIBS(glXChooseVisual, $GLX_search_list, have_GLX=yes, have_GLX=no) AC_SEARCH_LIBS(glutInit, glut, have_glut=yes, have_glut=no) # Restore pretty messages. exec AC_FD_MSG>&8 if test -n "$LIBS"; then mdl_cv_have_OpenGL=yes GL_LIBS="$LIBS" AC_SUBST(GL_CFLAGS) AC_SUBST(GL_LIBS) else mdl_cv_have_OpenGL=no GL_CFLAGS= fidnl Reset GL_X_LIBS regardless, since it was just a temporary variablednl and we don't want to be global namespace polluters. GL_X_LIBS= LIBS="$GL_save_LIBS" CPPFLAGS="$GL_save_CPPFLAGS" AC_LANG_RESTORE ])])AC_DEFUN(SC_PATH_EFLTK, [dnl EFLTK dir passed to the command line overrides the Kconfig settingAC_ARG_WITH(efltk, [ --with-efltk directory containing EFLTK], with_efltk=${withval})dnl Defaults to the Kconfig setting (CONFIG_RTAI_EFLTK_DIR) if unsettest x$with_efltk = x && with_efltk=$1AC_MSG_CHECKING([for EFLTK])AC_CACHE_VAL(ac_cv_efltk,[ # First check to see if --with-efltk was specified. if test x"${with_efltk}" != x ; then if test -f "${with_efltk}/bin/efltk-config" ; then ac_cv_efltk=`(cd ${with_efltk}; pwd)` else AC_MSG_ERROR([${with_efltk}/bin directory doesn't contain efltk-config]) fi fi # then check for a private EFLTK installation if test x"${ac_cv_efltk}" = x ; then for i in \ ../efltk \ `ls -dr ../efltk* 2>/dev/null` \ ../../efltk \ `ls -dr ../../efltk* 2>/dev/null` \ ../../../efltk \ `ls -dr ../../../efltk* 2>/dev/null` ; do if test -f "$i/bin/efltk-config" ; then ac_cv_efltk=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_efltk}" = x ; then for i in ${prefix}/efltk* /usr/local/efltk* /usr/pkg/efltk* /usr \ `ls -dr /usr/lib/efltk* 2>/dev/null` ; do if test -f "$i/bin/efltk-config" ; then ac_cv_efltk=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_efltk}" = x ; then for i in \ ${srcdir}/../efltk \ `ls -dr ${srcdir}/../efltk* 2>/dev/null` ; do if test -f "$i/bin/efltk-config" ; then ac_cv_efltk=`(cd $i; pwd)` break fi done fi ])if test x"${ac_cv_efltk}" = x ; then EFLTK_DIR="# no EFLTK installation found" AC_MSG_ERROR(Can't find EFLTK-devel installation (missing bin/efltk-config?))else EFLTK_DIR=${ac_cv_efltk} AC_MSG_RESULT(found $EFLTK_DIR)fi])AC_DEFUN(SC_PATH_COMEDI, [dnl COMEDI dir passed to the command line overrides the Kconfig settingAC_ARG_WITH(comedi, [ --with-comedi directory containing COMEDI], with_comedi=${withval})dnl Defaults to the Kconfig setting (CONFIG_RTAI_COMEDI_DIR) if unsettest x$with_comedi = x && with_comedi=$1AC_MSG_CHECKING([for COMEDI])AC_CACHE_VAL(ac_cv_comedi,[ # First check to see if --with-comedi was specified. if test x"${with_comedi}" != x ; then if test -f "${with_comedi}/include/linux/comedilib.h" ; then ac_cv_comedi=`(cd ${with_comedi}; pwd)` else AC_MSG_ERROR([${with_comedi}/include directory doesn't contain linux/comedilib.h]) fi fi # then check for a private COMEDI installation if test x"${ac_cv_comedi}" = x ; then for i in \ ../comedi \ `ls -dr ../comedi* 2>/dev/null` \ ../../comedi \ `ls -dr ../../comedi* 2>/dev/null` \ ../../../comedi \ `ls -dr ../../../comedi* 2>/dev/null` ; do if test -f "$i/include/linux/comedilib.h" ; then ac_cv_comedi=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_comedi}" = x ; then for i in ${prefix}/comedi* /usr/local/comedi* /usr/pkg/comedi* /usr \ `ls -dr /usr/lib/comedi* 2>/dev/null` ; do if test -f "$i/include/linux/comedilib.h" ; then ac_cv_comedi=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_comedi}" = x ; then for i in \ ${srcdir}/../comedi \ `ls -dr ${srcdir}/../comedi* 2>/dev/null` ; do if test -f "$i/include/linux/comedilib.h" ; then ac_cv_comedi=`(cd $i; pwd)` break fi done fi ])if test x"${ac_cv_comedi}" = x ; then COMEDI_DIR="# no COMEDI installation found" AC_MSG_ERROR(Can't find COMEDI installation ( missing linux/comedilib.h ) )else COMEDI_DIR=${ac_cv_comedi} AC_MSG_RESULT(found $COMEDI_DIR)fi])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -