source: packages/libs/cyassl/patches/130-configure_disable_pthreads_tests.patch @ 20417

Last change on this file since 20417 was 20417, checked in by jow, 6 years ago

[packages] cyassl: get rid of zlib and pthread dependencies

File size: 13.9 KB
  • configure

    a b F77 
    874874FFLAGS 
    875875ac_ct_F77 
    876876LIBTOOL 
    877 acx_pthread_config 
    878 PTHREAD_CC 
    879 PTHREAD_LIBS 
    880 PTHREAD_CFLAGS 
    881877LIBOBJS 
    882878LTLIBOBJS' 
    883879ac_subst_files='' 
    ac_compile='$CC -c $CFLAGS $CPPFLAGS con 
    2194621942ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 
    2194721943ac_compiler_gnu=$ac_cv_c_compiler_gnu 
    2194821944 
    21949 acx_pthread_ok=no 
    21950  
    21951 # We used to check for pthread.h first, but this fails if pthread.h 
    21952 # requires special compiler flags (e.g. on True64 or Sequent). 
    21953 # It gets checked for in the link test anyway. 
    21954  
    21955 # First of all, check if the user has set any of the PTHREAD_LIBS, 
    21956 # etcetera environment variables, and if threads linking works using 
    21957 # them: 
    21958 if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then 
    21959         save_CFLAGS="$CFLAGS" 
    21960         CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 
    21961         save_LIBS="$LIBS" 
    21962         LIBS="$PTHREAD_LIBS $LIBS" 
    21963         { echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 
    21964 echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6; } 
    21965         cat >conftest.$ac_ext <<_ACEOF 
    21966 /* confdefs.h.  */ 
    21967 _ACEOF 
    21968 cat confdefs.h >>conftest.$ac_ext 
    21969 cat >>conftest.$ac_ext <<_ACEOF 
    21970 /* end confdefs.h.  */ 
    21971  
    21972 /* Override any GCC internal prototype to avoid an error. 
    21973    Use char because int might match the return type of a GCC 
    21974    builtin and then its argument prototype would still apply.  */ 
    21975 #ifdef __cplusplus 
    21976 extern "C" 
    21977 #endif 
    21978 char pthread_join (); 
    21979 int 
    21980 main () 
    21981 { 
    21982 return pthread_join (); 
    21983   ; 
    21984   return 0; 
    21985 } 
    21986 _ACEOF 
    21987 rm -f conftest.$ac_objext conftest$ac_exeext 
    21988 if { (ac_try="$ac_link" 
    21989 case "(($ac_try" in 
    21990   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
    21991   *) ac_try_echo=$ac_try;; 
    21992 esac 
    21993 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
    21994   (eval "$ac_link") 2>conftest.er1 
    21995   ac_status=$? 
    21996   grep -v '^ *+' conftest.er1 >conftest.err 
    21997   rm -f conftest.er1 
    21998   cat conftest.err >&5 
    21999   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    22000   (exit $ac_status); } && { 
    22001          test -z "$ac_c_werror_flag" || 
    22002          test ! -s conftest.err 
    22003        } && test -s conftest$ac_exeext && 
    22004        $as_test_x conftest$ac_exeext; then 
    22005   acx_pthread_ok=yes 
    22006 else 
    22007   echo "$as_me: failed program was:" >&5 
    22008 sed 's/^/| /' conftest.$ac_ext >&5 
    22009  
    22010  
    22011 fi 
    22012  
    22013 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 
    22014       conftest$ac_exeext conftest.$ac_ext 
    22015         { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 
    22016 echo "${ECHO_T}$acx_pthread_ok" >&6; } 
    22017         if test x"$acx_pthread_ok" = xno; then 
    22018                 PTHREAD_LIBS="" 
    22019                 PTHREAD_CFLAGS="" 
    22020         fi 
    22021         LIBS="$save_LIBS" 
    22022         CFLAGS="$save_CFLAGS" 
    22023 fi 
    22024  
    22025 # We must check for the threads library under a number of different 
    22026 # names; the ordering is very important because some systems 
    22027 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the 
    22028 # libraries is broken (non-POSIX). 
    22029  
    22030 # Create a list of thread flags to try.  Items starting with a "-" are 
    22031 # C compiler flags, and other items are library names, except for "none" 
    22032 # which indicates that we try without any flags at all, and "pthread-config" 
    22033 # which is a program returning the flags for the Pth emulation library. 
    22034  
    22035 acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" 
    22036  
    22037 # The ordering *is* (sometimes) important.  Some notes on the 
    22038 # individual items follow: 
    22039  
    22040 # pthreads: AIX (must check this before -lpthread) 
    22041 # none: in case threads are in libc; should be tried before -Kthread and 
    22042 #       other compiler flags to prevent continual compiler warnings 
    22043 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) 
    22044 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) 
    22045 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) 
    22046 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) 
    22047 # -pthreads: Solaris/gcc 
    22048 # -mthreads: Mingw32/gcc, Lynx/gcc 
    22049 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it 
    22050 #      doesn't hurt to check since this sometimes defines pthreads too; 
    22051 #      also defines -D_REENTRANT) 
    22052 #      ... -mt is also the pthreads flag for HP/aCC 
    22053 # pthread: Linux, etcetera 
    22054 # --thread-safe: KAI C++ 
    22055 # pthread-config: use pthread-config program (for GNU Pth library) 
    22056  
    22057 case "${host_cpu}-${host_os}" in 
    22058         *solaris*) 
    22059  
    22060         # On Solaris (at least, for some versions), libc contains stubbed 
    22061         # (non-functional) versions of the pthreads routines, so link-based 
    22062         # tests will erroneously succeed.  (We need to link with -pthreads/-mt/ 
    22063         # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather 
    22064         # a function called by this macro, so we could check for that, but 
    22065         # who knows whether they'll stub that too in a future libc.)  So, 
    22066         # we'll just look for -pthreads and -lpthread first: 
    22067  
    22068         acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" 
    22069         ;; 
    22070 esac 
    22071  
    22072 if test x"$acx_pthread_ok" = xno; then 
    22073 for flag in $acx_pthread_flags; do 
    22074  
    22075         case $flag in 
    22076                 none) 
    22077                 { echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5 
    22078 echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6; } 
    22079                 ;; 
    22080  
    22081                 -*) 
    22082                 { echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5 
    22083 echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6; } 
    22084                 PTHREAD_CFLAGS="$flag" 
    22085                 ;; 
    22086  
    22087                 pthread-config) 
    22088                 # Extract the first word of "pthread-config", so it can be a program name with args. 
    22089 set dummy pthread-config; ac_word=$2 
    22090 { echo "$as_me:$LINENO: checking for $ac_word" >&5 
    22091 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } 
    22092 if test "${ac_cv_prog_acx_pthread_config+set}" = set; then 
    22093   echo $ECHO_N "(cached) $ECHO_C" >&6 
    22094 else 
    22095   if test -n "$acx_pthread_config"; then 
    22096   ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. 
    22097 else 
    22098 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
    22099 for as_dir in $PATH 
    22100 do 
    22101   IFS=$as_save_IFS 
    22102   test -z "$as_dir" && as_dir=. 
    22103   for ac_exec_ext in '' $ac_executable_extensions; do 
    22104   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then 
    22105     ac_cv_prog_acx_pthread_config="yes" 
    22106     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 
    22107     break 2 
    22108   fi 
    22109 done 
    22110 done 
    22111 IFS=$as_save_IFS 
    22112  
    22113   test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" 
    22114 fi 
    22115 fi 
    22116 acx_pthread_config=$ac_cv_prog_acx_pthread_config 
    22117 if test -n "$acx_pthread_config"; then 
    22118   { echo "$as_me:$LINENO: result: $acx_pthread_config" >&5 
    22119 echo "${ECHO_T}$acx_pthread_config" >&6; } 
    22120 else 
    22121   { echo "$as_me:$LINENO: result: no" >&5 
    22122 echo "${ECHO_T}no" >&6; } 
    22123 fi 
    22124  
    22125  
    22126                 if test x"$acx_pthread_config" = xno; then continue; fi 
    22127                 PTHREAD_CFLAGS="`pthread-config --cflags`" 
    22128                 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" 
    22129                 ;; 
    22130  
    22131                 *) 
    22132                 { echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5 
    22133 echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6; } 
    22134                 PTHREAD_LIBS="-l$flag" 
    22135                 ;; 
    22136         esac 
    22137  
    22138         save_LIBS="$LIBS" 
    22139         save_CFLAGS="$CFLAGS" 
    22140         LIBS="$PTHREAD_LIBS $LIBS" 
    22141         CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 
    22142  
    22143         # Check for various functions.  We must include pthread.h, 
    22144         # since some functions may be macros.  (On the Sequent, we 
    22145         # need a special flag -Kthread to make this header compile.) 
    22146         # We check for pthread_join because it is in -lpthread on IRIX 
    22147         # while pthread_create is in libc.  We check for pthread_attr_init 
    22148         # due to DEC craziness with -lpthreads.  We check for 
    22149         # pthread_cleanup_push because it is one of the few pthread 
    22150         # functions on Solaris that doesn't have a non-functional libc stub. 
    22151         # We try pthread_create on general principles. 
    22152         cat >conftest.$ac_ext <<_ACEOF 
    22153 /* confdefs.h.  */ 
    22154 _ACEOF 
    22155 cat confdefs.h >>conftest.$ac_ext 
    22156 cat >>conftest.$ac_ext <<_ACEOF 
    22157 /* end confdefs.h.  */ 
    22158 #include <pthread.h> 
    22159 int 
    22160 main () 
    22161 { 
    22162 pthread_t th; pthread_join(th, 0); 
    22163                      pthread_attr_init(0); pthread_cleanup_push(0, 0); 
    22164                      pthread_create(0,0,0,0); pthread_cleanup_pop(0); 
    22165   ; 
    22166   return 0; 
    22167 } 
    22168 _ACEOF 
    22169 rm -f conftest.$ac_objext conftest$ac_exeext 
    22170 if { (ac_try="$ac_link" 
    22171 case "(($ac_try" in 
    22172   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
    22173   *) ac_try_echo=$ac_try;; 
    22174 esac 
    22175 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
    22176   (eval "$ac_link") 2>conftest.er1 
    22177   ac_status=$? 
    22178   grep -v '^ *+' conftest.er1 >conftest.err 
    22179   rm -f conftest.er1 
    22180   cat conftest.err >&5 
    22181   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    22182   (exit $ac_status); } && { 
    22183          test -z "$ac_c_werror_flag" || 
    22184          test ! -s conftest.err 
    22185        } && test -s conftest$ac_exeext && 
    22186        $as_test_x conftest$ac_exeext; then 
    22187   acx_pthread_ok=yes 
    22188 else 
    22189   echo "$as_me: failed program was:" >&5 
    22190 sed 's/^/| /' conftest.$ac_ext >&5 
    22191  
    22192  
    22193 fi 
    22194  
    22195 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 
    22196       conftest$ac_exeext conftest.$ac_ext 
    22197  
    22198         LIBS="$save_LIBS" 
    22199         CFLAGS="$save_CFLAGS" 
    22200  
    22201         { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 
    22202 echo "${ECHO_T}$acx_pthread_ok" >&6; } 
    22203         if test "x$acx_pthread_ok" = xyes; then 
    22204                 break; 
    22205         fi 
    22206  
    22207         PTHREAD_LIBS="" 
    22208         PTHREAD_CFLAGS="" 
    22209 done 
    22210 fi 
    22211  
    22212 # Various other checks: 
    22213 if test "x$acx_pthread_ok" = xyes; then 
    22214         save_LIBS="$LIBS" 
    22215         LIBS="$PTHREAD_LIBS $LIBS" 
    22216         save_CFLAGS="$CFLAGS" 
    22217         CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 
    22218  
    22219         # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. 
    22220         { echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5 
    22221 echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6; } 
    22222         attr_name=unknown 
    22223         for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do 
    22224             cat >conftest.$ac_ext <<_ACEOF 
    22225 /* confdefs.h.  */ 
    22226 _ACEOF 
    22227 cat confdefs.h >>conftest.$ac_ext 
    22228 cat >>conftest.$ac_ext <<_ACEOF 
    22229 /* end confdefs.h.  */ 
    22230 #include <pthread.h> 
    22231 int 
    22232 main () 
    22233 { 
    22234 int attr=$attr; return attr; 
    22235   ; 
    22236   return 0; 
    22237 } 
    22238 _ACEOF 
    22239 rm -f conftest.$ac_objext conftest$ac_exeext 
    22240 if { (ac_try="$ac_link" 
    22241 case "(($ac_try" in 
    22242   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
    22243   *) ac_try_echo=$ac_try;; 
    22244 esac 
    22245 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
    22246   (eval "$ac_link") 2>conftest.er1 
    22247   ac_status=$? 
    22248   grep -v '^ *+' conftest.er1 >conftest.err 
    22249   rm -f conftest.er1 
    22250   cat conftest.err >&5 
    22251   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    22252   (exit $ac_status); } && { 
    22253          test -z "$ac_c_werror_flag" || 
    22254          test ! -s conftest.err 
    22255        } && test -s conftest$ac_exeext && 
    22256        $as_test_x conftest$ac_exeext; then 
    22257   attr_name=$attr; break 
    22258 else 
    22259   echo "$as_me: failed program was:" >&5 
    22260 sed 's/^/| /' conftest.$ac_ext >&5 
    22261  
    22262  
    22263 fi 
    22264  
    22265 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 
    22266       conftest$ac_exeext conftest.$ac_ext 
    22267         done 
    22268         { echo "$as_me:$LINENO: result: $attr_name" >&5 
    22269 echo "${ECHO_T}$attr_name" >&6; } 
    22270         if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then 
    22271  
    22272 cat >>confdefs.h <<_ACEOF 
    22273 #define PTHREAD_CREATE_JOINABLE $attr_name 
    22274 _ACEOF 
    22275  
    22276         fi 
    22277  
    22278         { echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 
    22279 echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; } 
    22280         flag=no 
    22281         case "${host_cpu}-${host_os}" in 
    22282             *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; 
    22283             *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; 
    22284         esac 
    22285         { echo "$as_me:$LINENO: result: ${flag}" >&5 
    22286 echo "${ECHO_T}${flag}" >&6; } 
    22287         if test "x$flag" != xno; then 
    22288             PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" 
    22289         fi 
    22290  
    22291         LIBS="$save_LIBS" 
    22292         CFLAGS="$save_CFLAGS" 
    22293  
    22294         # More AIX lossage: must compile with xlc_r or cc_r 
    22295         if test x"$GCC" != xyes; then 
    22296           for ac_prog in xlc_r cc_r 
    22297 do 
    22298   # Extract the first word of "$ac_prog", so it can be a program name with args. 
    22299 set dummy $ac_prog; ac_word=$2 
    22300 { echo "$as_me:$LINENO: checking for $ac_word" >&5 
    22301 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } 
    22302 if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then 
    22303   echo $ECHO_N "(cached) $ECHO_C" >&6 
    22304 else 
    22305   if test -n "$PTHREAD_CC"; then 
    22306   ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. 
    22307 else 
    22308 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
    22309 for as_dir in $PATH 
    22310 do 
    22311   IFS=$as_save_IFS 
    22312   test -z "$as_dir" && as_dir=. 
    22313   for ac_exec_ext in '' $ac_executable_extensions; do 
    22314   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then 
    22315     ac_cv_prog_PTHREAD_CC="$ac_prog" 
    22316     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 
    22317     break 2 
    22318   fi 
    22319 done 
    22320 done 
    22321 IFS=$as_save_IFS 
    22322  
    22323 fi 
    22324 fi 
    22325 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC 
    22326 if test -n "$PTHREAD_CC"; then 
    22327   { echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5 
    22328 echo "${ECHO_T}$PTHREAD_CC" >&6; } 
    22329 else 
    22330   { echo "$as_me:$LINENO: result: no" >&5 
    22331 echo "${ECHO_T}no" >&6; } 
    22332 fi 
    22333  
    22334  
    22335   test -n "$PTHREAD_CC" && break 
    22336 done 
    22337 test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" 
    22338  
    22339         else 
    22340           PTHREAD_CC=$CC 
    22341         fi 
    22342 else 
    22343         PTHREAD_CC="$CC" 
    22344 fi 
    22345  
    22346  
    22347  
    22348  
    22349  
    22350 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: 
    22351 if test x"$acx_pthread_ok" = xyes; then 
    22352  
    22353 cat >>confdefs.h <<\_ACEOF 
    22354 #define HAVE_PTHREAD 1 
    22355 _ACEOF 
    22356  
    22357         : 
    22358 else 
    22359         acx_pthread_ok=no 
    22360  
    22361 fi 
    22362 ac_ext=c 
    22363 ac_cpp='$CPP $CPPFLAGS' 
    22364 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 
    22365 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 
    22366 ac_compiler_gnu=$ac_cv_c_compiler_gnu 
    22367  
    22368  
    22369  
    22370 LIBS="$PTHREAD_LIBS $LIBS" 
    22371 CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 
    22372  
    2237321945 
    2237421946        { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 
    2237521947echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } 
Note: See TracBrowser for help on using the repository browser.