Re: [RFC] sg3_utils: sgp_dd: work around on pthread_cancel for android

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2017-12-23 at 10:19 +0000, Bean Huo (beanhuo) wrote:
> Doug wrote:
> > This seems to work in Linux but may not work in Android:
> > AC_SEARCH_LIBS([pthread_cancel], [pthread],
> > [AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Found pthread_cancel])], [])
> > 
> > Bean, could you check?
> > 
> 
> Doug, I had tried that, it works, but this is for C codes macro definition in the config.h.
> How can I figure out in the /src/Makefile.ac between Android OS and non-Android?
> Can you give me some suggestions? Like this:
>      if OS_ANDROID
>      sgp_dd_LDADD = ../lib/libsgutils2.la @os_libs@
>     else
>     sgp_dd_LDADD = ../lib/libsgutils2.la @os_libs@ -lpthread
>     endif

How about leaving out the following:
- Use AC_SEARCH_LIBS([pthread_cancel], [pthread]) and AC_CHECK_FUNC([pthread_cancel]) in
  configure.ac. 
- Use @LIBS@ in Makefile.am.

>From https://www.gnu.org/software/autoconf/manual/autoconf-2.66/html_node/Libraries.html:
"If action-if-found is not specified, the default action prepends -llibrary to LIBS [...]".

Bart.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux