📄 aclocal.m4
字号:
LIBS="$FH_SAVE_LIBS" FH_SAVE_LIBS="" AC_LANG_RESTORE])dnl ########################### -*- Mode: M4 -*- #######################dnl Copyright (C) 98, 1999 Matthew D. Langston <langston@SLAC.Stanford.EDU>dnldnl This file 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 NOTE: The AC_HELP_STRING macro has been accepted for inclusion indnl Autoconf 2.15, but this version of Autoconf hasn't beendnl released yet as of the time that I write this. Therefore, Idnl am including it here for the time beingdnl AC_HELP_STRINGdnl --------------dnldnl usage: AC_HELP_STRING(LHS, RHS, HELP-STRING)dnldnl Format an Autoconf macro's help string so that it looks pretty whendnl the user executes "configure --help". This macro take threednl arguments, a "left hand side" (LHS), a "right hand side" (RHS), anddnl a variable (HELP-STRING) to set to the pretty-printed concatenationdnl of LHS and RHS (the new, pretty-printed "help string").dnldnl The resulting string in HELP-STRING is suitable for use in otherdnl macros that require a help string (e.g. AC_ARG_WITH).dnl dnl AC_DEFUN(AC_HELP_STRING,pushdef([AC_HELP_STRING],[dnl dnl Here is the sample string from the Autoconf manual (Node: Externaldnl Software) which shows the proper spacing for help strings.dnl dnl --with-readline support fancy command line editingdnl ^ ^ ^ dnl | | |dnl | column 2 column 26 dnl |dnl column 0dnl dnl A help string is made up of a "left hand side" (LHS) and a "rightdnl hand side" (RHS). In the example above, the LHS isdnl "--with-readline", while the RHS is "support fancy command linednl editing".dnl dnl If the LHS extends past column 24, then the LHS is terminated with adnl newline so that the RHS is on a line of its own beginning in columndnl 26.dnl dnl Therefore, if the LHS were instead "--with-readline-blah-blah-blah",dnl then the AC_HELP_STRING macro would expand into:dnldnldnl --with-readline-blah-blah-blahdnl ^ ^ support fancy command line editingdnl | | ^ dnl | column 2 |dnl column 0 column 26 dnl We divert everything to AC_DIVERSION_NOTICE (which gets output verydnl early in the configure script) because we want the user's helpdnl string to be set before it is used.AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl# This is from AC_HELP_STRINGlhs="$1"rhs="$2"lhs_column=25rhs_column=`expr $lhs_column + 1`# Insure that the LHS begins with exactly two spaces.changequote(, )dnllhs=`echo "$lhs" | sed -n -e "s/[ ]*\(.*\)/ \1/p"`changequote([, ])dnl# Is the length of the LHS less than $lhs_column?if ! `echo "$lhs" | grep ".\{$lhs_column\}" > /dev/null 2>&1`; then # Pad the LHS with spaces. Note that padding the LHS is an # "expensive" operation (i.e. expensive in the sense of there being # multiple calls to `grep') only the first time AC_HELP_STRING is # called. Once this macro is called once, subsequent calls will be # nice and zippy. : ${lhs_pad=""}changequote(, )dnl while ! `echo "$lhs_pad" | grep "[ ]\{$lhs_column\}" > /dev/null 2>&1`; dochangequote([, ])dnl lhs_pad=" $lhs_pad" done lhs="${lhs}${lhs_pad}"changequote(, )dnl$3=`echo "$lhs" | sed -n -e "/.\{$lhs_column\}[ ][ ]*$/ s/\(.\{$rhs_column\}\).*/\1$rhs/p"`changequote([, ])dnlelse # Build up a string of spaces to pad the left-hand-side of the RHS # with. Note that padding the RHS is an "expensive" operation # (i.e. expensive in the sense of there being multiple calls to # `grep') only the first time AC_HELP_STRING is called. Once this # macro is called once, subsequent calls will be nice and zippy. : ${rhs_pad=""}changequote(, )dnl while ! `echo "$rhs_pad" | grep "[ ]\{$rhs_column\}" > /dev/null 2>&1`; dochangequote([, ])dnl rhs_pad=" $rhs_pad" done # Strip all leading spaces from the RHS.changequote(, )dnl rhs=`echo "$rhs" | sed -n -e "s/[ ]*\(.*\)/\1/p"`changequote([, ])dnl$3="$lhs${rhs_pad}${rhs}"fi AC_DIVERT_POP()dnl])dnl ########################### -*- Mode: M4 -*- #######################dnl Copyright (C) 98, 1999 Matthew D. Langston <langston@SLAC.Stanford.EDU>dnldnl This file 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 Mesa) 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$dnl @author Matthew D. Langston <langston@SLAC.Stanford.EDU>AC_DEFUN(MDL_HAVE_OPENGL,[ AC_REQUIRE([AC_PROG_CC]) 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_HELP_STRING([--with-Mesa], [Prefer the Mesa library over a vendors native OpenGL library (default=yes)], with_Mesa_help_string) AC_ARG_ENABLE(Mesa, $with_Mesa_help_string, 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_X_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"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 ])])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -