📄 acinclude.m4
字号:
## CERTI acinclude.m4## Copyright (C) 2001 ONERA## $Id: acinclude.m4,v 3.0 2002/11/21 01:27:51 breholee Exp $## ## This M4 file contains additionnal macros for Autoconf, some of them coming## from the Autoconf Macro Archive at http://www.gnu.org/software/ac-archive/AC_DEFUN([AC_CXX_IOSTREAM_HEADER],[AC_CACHE_CHECK([for ISO C++ headers],ac_cv_cxx_have_iostream, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include <iostream>] ,[return 0;], ac_cv_cxx_have_iostream=yes, ac_cv_cxx_have_iostream=no) AC_LANG_RESTORE ])if test "$ac_cv_cxx_have_iostream" = yes; thenAC_DEFINE(HAVE_IOSTREAM_HEADER,,[define if the compiler supports ISO C++ iostream header])fi])## +--------------------------------------------+ ############################## | Macros from the GNU Autoconf Macro Archive | ############################## +--------------------------------------------+ ############################## Please note that every macro contained in this archive is## copyrighted by its respective author, unless the macro source## explicitely says otherwise. Permission has been granted, though, to## use and distribute all macros under the following license, which is## a modified version of the GNU General Public License version 2:#### Every Autoconf macro presented on this web site is free software; you## can redistribute it and/or modify it under the terms of the GNU## General Public License as published by the Free Software Foundation;## either version 2, or (at your option) any later version.## ## They are distributed in the hope that they will be useful, but WITHOUT## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License## for more details. (You should have received a copy of the GNU General## Public License along with this program; if not, write to the Free## Software Foundation, Inc., 59 Temple Place -- Suite 330, Boston, MA## 02111-1307, USA.)## ## As a special exception, the Free Software Foundation gives unlimited## permission to copy, distribute and modify the configure scripts that## are the output of Autoconf. You need not follow the terms of the GNU## General Public License when using or distributing such scripts, even## though portions of the text of Autoconf appear in them. The GNU## General Public License (GPL) does govern all other use of the material## that constitutes the Autoconf program.## ## Certain portions of the Autoconf source text are designed to be copied## (in certain cases, depending on the input) into the output of## Autoconf. We call these the "data" portions. The rest of the Autoconf## source text consists of comments plus executable code that decides## which of the data portions to output in any given case. We call these## comments and executable code the "non-data" portions. Autoconf never## copies any of the non-data portions into its output.## ## This special exception to the GPL applies to versions of Autoconf## released by the Free Software Foundation. When you make and distribute## a modified version of Autoconf, you may extend this special exception## to the GPL to apply to your modified version as well, *unless* your## modified version has the potential to copy into its output some of the## text that was the non-data portion of the version that you started## with. (In other words, unless your change moves or copies text from## the non-data portions to the data portions.) If your modification has## such potential, you must delete any notice of this special exception## to the GPL from your modified version.## ---------------------------------------------------------------------------## Synopsis TYPE_SOCKLEN_T ## Version 1.2 (2000/07/19) ## Author Lars Brinkhoff <lars@nocrew.org> ## Description Check whether sys/socket.h defines type socklen_t. Please## note that some systems require sys/types.h to be included ## before sys/socket.h can be compiled.AC_DEFUN([AC_TYPE_SOCKLEN_T],[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,[ AC_TRY_COMPILE( [#include <sys/types.h> #include <sys/socket.h>], [socklen_t len = 42; return 0;], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)]) if test $ac_cv_type_socklen_t != yes; then AC_DEFINE(socklen_t, int) fi])## ---------------------------------------------------------------------------dnl @synopsis ETR_SOCKET_NSLdnldnl This macro figures out what libraries are required on this platformdnl to link sockets programs. It's usually -lsocket and/or -lnsl ordnl neither. We test for all three combinations.dnldnl @version $Id: acinclude.m4,v 3.0 2002/11/21 01:27:51 breholee Exp $dnl @author Warren Young <warren@etr-usa.com>dnlAC_DEFUN([AC_ETR_SOCKET_NSL],[AC_CACHE_CHECK(for libraries containing socket functions,ac_cv_socket_libs, [ oCFLAGS=$CFLAGS AC_TRY_LINK([ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs=-lc, ac_cv_socket_libs=no) if test x"$ac_cv_socket_libs" = "xno" then CFLAGS="$oCFLAGS -lsocket" AC_TRY_LINK([ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs=-lsocket, ac_cv_socket_libs=no) fi if test x"$ac_cv_socket_libs" = "xno" then CFLAGS="$oCFLAGS -lsocket -lnsl" AC_TRY_LINK([ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs="-lsocket -lnsl", ac_cv_socket_libs=no) fi CFLAGS=$oCFLAGS]) if test x"$ac_cv_socket_libs" = "xno" then AC_MSG_ERROR([Cannot find socket libraries]) elif test x"$ac_cv_socket_libs" = "x-lc" then ETR_SOCKET_LIBS="" else ETR_SOCKET_LIBS="$ac_cv_socket_libs" fi AC_SUBST(ETR_SOCKET_LIBS)]) dnl AC_ETR_SOCKET_NSL## Synopsis AC_CXX_NAMESPACES ## Version 1.2 (2000/07/19) ## Author Luc Maisonobe ## Description If the compiler can prevent names clashes using namespaces, ## define HAVE_NAMESPACES. AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK([for namespaces], ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ])## Synopsis AC_CXX_HAVE_STD ## Version 1.2 (2000/07/19) ## Author Luc Maisonobe ## Description If the compiler supports ISO C++ standard library (i.e., can ## include the files iostream, map, iomanip and cmath}), define ## HAVE_STD. AC_DEFUN([AC_CXX_HAVE_STD],[AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library,ac_cv_cxx_have_std,[AC_REQUIRE([AC_CXX_NAMESPACES])AC_LANG_SAVEAC_LANG_CPLUSPLUSAC_TRY_COMPILE([#include <iostream> #include <map> #include <iomanip> #include <cmath> #ifdef HAVE_NAMESPACES using namespace std; #endif] ,[return 0;],ac_cv_cxx_have_std=yes, ac_cv_cxx_have_std=no)AC_LANG_RESTORE])if test "$ac_cv_cxx_have_std" = yes; thenAC_DEFINE(HAVE_STD,,[define if the compiler supports ISO C++ standard library])fi])## Synopsis AC_CXX_BOOL ## Version 1.2 (2000/07/19) ## Author Luc Maisonobe ## Description If the compiler recognizes bool as a separate built-in type, ## define HAVE_BOOL. Note that a typedef is not a separate type ## since you cannot overload a function such that it accepts ## either the basic type or the typedef. AC_DEFUN([AC_CXX_BOOL], [AC_CACHE_CHECK([for bool built-in type], ac_cv_cxx_bool, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ int f(int x){return 1;} int f(char x){return 1;} int f(bool x){return 1;} ],[bool b = true; return f(b);], ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_bool" = yes; then AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type]) fi ])## +----------------+ ########################################################## | GLIB/GTKMacros | ########################################################## +----------------+ ########################################################dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or dnl gthread is specified in MODULES, pass to glib-configdnlAC_DEFUN(AM_PATH_GLIB,[dnl dnl Get the cflags and libraries from the glib-config scriptdnlAC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], glib_config_prefix="$withval", glib_config_prefix="")AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], glib_config_exec_prefix="$withval", glib_config_exec_prefix="")AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], , enable_glibtest=yes) if test x$glib_config_exec_prefix != x ; then glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config fi fi if test x$glib_config_prefix != x ; then glib_config_args="$glib_config_args --prefix=$glib_config_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_prefix/bin/glib-config fi fi for module in . $4 do case "$module" in gmodule) glib_config_args="$glib_config_args gmodule" ;; gthread) glib_config_args="$glib_config_args gthread" ;; esac done
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -