⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aclocal.m4

📁 asn格式文件的编译器
💻 M4
📖 第 1 页 / 共 4 页
字号:
dnldnl This macro figures out how to build C programs using POSIXdnl threads.  It sets the PTHREAD_LIBS output variable to the threadsdnl library and linker flags, and the PTHREAD_CFLAGS output variablednl to any special C compiler flags that are needed.  (The user can alsodnl force certain compiler flags/libs to be tested by setting thesednl environment variables.)dnldnl Also sets PTHREAD_CC to any special C compiler that is needed fordnl multi-threaded programs (defaults to the value of CC otherwise).dnl (This is necessary on AIX to use the special cc_r compiler alias.)dnldnl If you are only building threads programs, you may wish todnl use these variables in your default LIBS, CFLAGS, and CC:dnldnl        LIBS="$PTHREAD_LIBS $LIBS"dnl        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"dnl        CC="$PTHREAD_CC"dnldnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attributednl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLEdnl to that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).dnldnl ACTION-IF-FOUND is a list of shell commands to run if a threadsdnl library is found, and ACTION-IF-NOT-FOUND is a list of commandsdnl to run it if it is not found.  If ACTION-IF-FOUND is not specified,dnl the default action will define HAVE_PTHREAD.dnldnl Please let the authors know if this macro fails on any platform,dnl or if you have any other suggestions or comments.  This macro wasdnl based on work by SGJ on autoconf scripts for FFTW (www.fftw.org)dnl (with help from M. Frigo), as well as ac_pthread and hb_pthreaddnl macros posted by AFC to the autoconf macro repository.  We are alsodnl grateful for the helpful feedback of numerous users.dnldnl @version $Id: acx_pthread.m4,v 1.1.1.1 2001/08/01 07:38:48 mangelo Exp $dnl @author Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro Forero Cuervo <bachue@bachue.com>AC_DEFUN([ACX_PTHREAD], [AC_REQUIRE([AC_CANONICAL_HOST])acx_pthread_ok=no# First, check if the POSIX threads header, pthread.h, is available.# If it isn't, don't bother looking for the threads libraries.AC_CHECK_HEADER(pthread.h, , acx_pthread_ok=noheader)# We must check for the threads library under a number of different# names; the ordering is very important because some systems# (e.g. DEC) have both -lpthread and -lpthreads, where one of the# libraries is broken (non-POSIX).# First of all, check if the user has set any of the PTHREAD_LIBS,# etcetera environment variables, and if threads linking works using# them:if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then        save_CFLAGS="$CFLAGS"        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"        save_LIBS="$LIBS"        LIBS="$PTHREAD_LIBS $LIBS"        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)        AC_MSG_RESULT($acx_pthread_ok)        if test x"$acx_pthread_ok" = xno; then                PTHREAD_LIBS=""                PTHREAD_CFLAGS=""        fi        LIBS="$save_LIBS"        CFLAGS="$save_CFLAGS"fi# Create a list of thread flags to try.  Items starting with a "-" are# C compiler flags, and other items are library names, except for "none"# which indicates that we try without any flags at all.acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"# The ordering *is* (sometimes) important.  Some notes on the# individual items follow:# pthreads: AIX (must check this before -lpthread)# none: in case threads are in libc; should be tried before -Kthread and#       other compiler flags to prevent continual compiler warnings# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)# -pthreads: Solaris/gcc# -mthreads: Mingw32/gcc, Lynx/gcc# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it#      doesn't hurt to check since this sometimes defines pthreads too;#      also defines -D_REENTRANT)# pthread: Linux, etcetera# --thread-safe: KAI C++case "${host_cpu}-${host_os}" in        *solaris*)        # On Solaris (at least, for some versions), libc contains stubbed        # (non-functional) versions of the pthreads routines, so link-based        # tests will erroneously succeed.  (We need to link with -pthread or        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather        # a function called by this macro, so we could check for that, but        # who knows whether they'll stub that too in a future libc.)  So,        # we'll just look for -pthreads and -lpthread first:        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"        ;;esacif test x"$acx_pthread_ok" = xno; thenfor flag in $acx_pthread_flags; do        case $flag in                none)                AC_MSG_CHECKING([whether pthreads work without any flags])                ;;                -*)                AC_MSG_CHECKING([whether pthreads work with $flag])                PTHREAD_CFLAGS="$flag"                ;;                *)                AC_MSG_CHECKING([for the pthreads library -l$flag])                PTHREAD_LIBS="-l$flag"                ;;        esac        save_LIBS="$LIBS"        save_CFLAGS="$CFLAGS"        LIBS="$PTHREAD_LIBS $LIBS"        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"        # Check for various functions.  We must include pthread.h,        # since some functions may be macros.  (On the Sequent, we        # need a special flag -Kthread to make this header compile.)        # We check for pthread_join because it is in -lpthread on IRIX        # while pthread_create is in libc.  We check for pthread_attr_init        # due to DEC craziness with -lpthreads.  We check for        # pthread_cleanup_push because it is one of the few pthread        # functions on Solaris that doesn't have a non-functional libc stub.        # We try pthread_create on general principles.        AC_TRY_LINK([#include <pthread.h>],                    [pthread_t th; pthread_join(th, 0);                     pthread_attr_init(0); pthread_cleanup_push(0, 0);                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],                    [acx_pthread_ok=yes])        LIBS="$save_LIBS"        CFLAGS="$save_CFLAGS"        AC_MSG_RESULT($acx_pthread_ok)        if test "x$acx_pthread_ok" = xyes; then                break;        fi        PTHREAD_LIBS=""        PTHREAD_CFLAGS=""donefi# Various other checks:if test "x$acx_pthread_ok" = xyes; then        save_LIBS="$LIBS"        LIBS="$PTHREAD_LIBS $LIBS"        save_CFLAGS="$CFLAGS"        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"        # Detect AIX lossage: threads are created detached by default        # and the JOINABLE attribute has a nonstandard name (UNDETACHED).        AC_MSG_CHECKING([for joinable pthread attribute])        AC_TRY_LINK([#include <pthread.h>],                    [int attr=PTHREAD_CREATE_JOINABLE;],                    ok=PTHREAD_CREATE_JOINABLE, ok=unknown)        if test x"$ok" = xunknown; then                AC_TRY_LINK([#include <pthread.h>],                            [int attr=PTHREAD_CREATE_UNDETACHED;],                            ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)        fi        if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then                AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,                          [Define to the necessary symbol if this constant                           uses a non-standard name on your system.])        fi        AC_MSG_RESULT(${ok})        if test x"$ok" = xunknown; then                AC_MSG_WARN([we do not know how to create joinable pthreads])        fi        AC_MSG_CHECKING([if more special flags are required for pthreads])        flag=no        case "${host_cpu}-${host_os}" in                *-aix* | *-freebsd*)     flag="-D_THREAD_SAFE";;                *solaris* | alpha*-osf*) flag="-D_REENTRANT";;        esac        AC_MSG_RESULT(${flag})        if test "x$flag" != xno; then                PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"        fi        LIBS="$save_LIBS"        CFLAGS="$save_CFLAGS"        # More AIX lossage: must compile with cc_r        AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})else        PTHREAD_CC="$CC"fiAC_SUBST(PTHREAD_LIBS)AC_SUBST(PTHREAD_CFLAGS)AC_SUBST(PTHREAD_CC)# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:if test x"$acx_pthread_ok" = xyes; then        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])        :else        acx_pthread_ok=no        $2fi])dnl ACX_PTHREADdnldnl Copyright (c) 2001 Institute for Information Industry, Taiwan, Republic of China dnl Written by angelo@iii.org.twdnl dnl This file is part of III ASN.1 Tool.dnl dnl The contents of this file are subject to the Mozilla Public Licensednl Version 1.0 (the "License"); you may not use this file except indnl compliance with the License. You may obtain a copy of the License atdnl http://www.mozilla.org/MPL/dnldnl Software distributed under the License is distributed on an "AS IS"dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Seednl the License for the specific language governing rights and limitationsdnl under the License.dnl dnl III ASN.1 Tool is the ASN.1 to C++ compiler which transforms ASN.1 Modulednl to C++ codes along with the C++ run time library for encoding and decoding dnl ASN.1 types. For details, see the III ASN.1 Tool World-Wide-Web page, dnl `http://www.iii.org.tw/portal/lab1/asn1tool.html'.dnldnl @synopsis III_ENABLE_STL_THREADdnldnl @author Huang-Ming HuangAC_DEFUN(III_ENABLE_STL_THREAD, [  AC_BEFORE(III_CHECK_STLPORT)  if test x"$ac_cv_prog_gxx" = xyes; then        if test x"$iii_cv_have_stlport" = xno; then        # assume using libstdc++                if test x"$host_os" = xcygwin ; then                        AC_DEFINE(__STL_WIN32THREADS, , [enable libstdc++ WIN32 thread support] )                else                        AC_DEFINE(__STL_PTHREADS, , [enable libstdc++ pthread support] )                fi        else        # using stlport                AC_DEFINE(_REENTRANT, , [enable STLport thread support])        fi  fi])dnl @synopsis AC_CXX_HAVE_NEW_IOSTREAMdnldnl If the C++ library has a working ASNI compliant iostream, define HAVE_NEW_IOSTREAM.dnldnl @author Huang-Ming Huangdnl @version $Id: ac_cxx_have_new_iostream.m4,v 1.1.1.1 2001/08/01 07:38:42 mangelo Exp $dnlAC_DEFUN([AC_CXX_HAVE_NEW_IOSTREAM],[AC_CACHE_CHECK(whether the compiler has ASNI compliant iostream,ac_cv_cxx_have_new_iostream,[AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include <ios>using namespace std;],[ios_base::iostate state = ios_base::goodbit; return 0;], ac_cv_cxx_have_new_iostream=yes, ac_cv_cxx_have_new_iostream=no) AC_LANG_RESTORE])if test "$ac_cv_cxx_have_new_iostream" = yes; then  AC_DEFINE(HAVE_NEW_IOSTREAM,,[define if the compiler has ASNI compliant iostream])fi])dnl @synopsis AC_CXX_HAVE_WSTRINGdnldnl If the C++ library has a working wstring, define HAVE_WSTRING.dnldnl @author Huang-Ming Huangdnl @version $Id: ac_cxx_have_wstring.m4,v 1.4 2002/07/04 03:47:22 mangelo Exp $dnlAC_DEFUN([AC_CXX_HAVE_WSTRING], [ AC_CACHE_CHECK([whether the compiler has wstring],    		  [ac_cv_cxx_have_wstring],    		  [		      AC_REQUIRE([AC_CXX_NAMESPACES])		      AC_LANG_SAVE		      AC_LANG_CPLUSPLUS		      AC_TRY_COMPILE([		         #include <string>		         #ifdef HAVE_NAMESPACES		         using namespace std;		         #endif		         ],[wstring str; str = L"Hello"; return 0;],		         ac_cv_cxx_have_wstring=yes, 		         ac_cv_cxx_have_wstring=no		      )		      dnl GCC 3.0 require _GLIBCPP_USE_CHAR_T to be defined  		      if test "$ac_cv_cxx_have_wstring" = no; then		         AC_TRY_COMPILE([		            #define _GLIBCPP_USE_WCHAR_T 1		            #include<string>		            #ifdef HAVE_NAMESPACES		            using namespace std;		            #endif		            ],[		            wstring str; str = L"Hello"; return 0;		            ],[		            ac_cv_cxx_have_wstring=yes			    ac_cv_need__GLIBCPP_USE_WCHAR_T=yes		            		            ], ac_cv_cxx_have_wstring=no)		     fi 		     dnl GCC 2.95.x need a typedef		     if test "$ac_cv_cxx_have_wstring" = no; then		         AC_TRY_COMPILE([		            #include<string>		            #ifdef HAVE_NAMESPACES		            using namespace std;		            #endif		            ],[		            typedef basic_string<wchar_t> wstring;		            wstring str; str = L"Hello"; return 0;		            ],[		            ac_cv_cxx_have_wstring=yes			    ac_cv_need_wstring_typedef=yes		            		            ], ac_cv_cxx_have_wstring=no)		     fi 		     AC_LANG_RESTORE     		  ]    		 )    if test "$ac_cv_cxx_have_wstring" = yes; then    AC_DEFINE(HAVE_WSTRING,,[define if the compiler has wstring])    if test "$ac_cv_need__GLIBCPP_USE_WCHAR_T" = yes; then    	AC_DEFINE(_GLIBCPP_USE_WCHAR_T,1, [define if the GLIB need the flag to turn on wstring support])    fi    if test "$ac_cv_need_wstring_typedef" = yes; then    	AC_DEFINE(NEED_WSTRING_TYPEDEF, 1, [define if explicit wstring typedef is needed])    fi  fi ])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -