/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.23 Revision 1.26
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.23 2003/03/01 03:38:40 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.26 2003/03/06 20:35:26 azarah Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
318 then 318 then
319 einfo "Done with patching" 319 einfo "Done with patching"
320 fi 320 fi
321} 321}
322 322
323# This function return true if we are using the NPTL pthreads
324# implementation.
325#
326# <azarah@gentoo.org> (06 March 2003)
327#
328
329have_NPTL() {
330
331 cat > ${T}/test-nptl.c <<-"END"
332 #define _XOPEN_SOURCE
333 #include <unistd.h>
334 #include <stdio.h>
335
336 int main()
337 {
338 char buf[255];
339 char *str = buf;
340
341 confstr(_CS_GNU_LIBPTHREAD_VERSION, str, 255);
342 if (NULL != str) {
343 printf("%s\n", str);
344 if (NULL != strstr(str, "NPTL"))
345 return 0;
346 }
347
348 return 1;
349 }
350 END
351
352 einfon "Checking for _CS_GNU_LIBPTHREAD_VERSION support in glibc ... "
353 if gcc -o ${T}/nptl ${T}/test-nptl.c &> /dev/null
354 then
355 echo "yes"
356 einfon "Checking what PTHREADS implementation we have ... "
357 if ${T}/nptl
358 then
359 return 0
360 else
361 return 1
362 fi
363 else
364 echo "no"
365 fi
366
367 return 1
368}
369
323# This function check how many cpu's are present, and then set 370# This function check how many cpu's are present, and then set
324# -j in MAKEOPTS accordingly. 371# -j in MAKEOPTS accordingly.
325# 372#
326# Thanks to nall <nall@gentoo.org> for this. 373# Thanks to nall <nall@gentoo.org> for this.
327# 374#
566 local oldsandbox="${oldsandbox}" 613 local oldsandbox="${oldsandbox}"
567 export SANDBOX_ON="0" 614 export SANDBOX_ON="0"
568 groupadd ${opts} ${egroup} || die "enewgroup failed" 615 groupadd ${opts} ${egroup} || die "enewgroup failed"
569 export SANDBOX_ON="${oldsandbox}" 616 export SANDBOX_ON="${oldsandbox}"
570} 617}
618
619# Simple script to replace 'dos2unix' binaries
620# vapier@gentoo.org
621#
622# edos2unix(file, <more files>...)
623edos2unix() {
624 for f in $@ ; do
625 cp ${f} ${T}/
626 sed 's/\r$//' ${T}/${f} > ${f}
627 done
628}

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20