This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Modify hints for Hurd per Debian ticket 825020.
authorSamuel Thibault <sthibault@debian.org>
Mon, 30 May 2016 15:11:00 +0000 (11:11 -0400)
committerJames E Keenan <jkeenan@cpan.org>
Mon, 30 May 2016 15:17:42 +0000 (11:17 -0400)
For:  RT #128279

Patch written by Samuel Thibault, forwarded by Dominic Hargreaves.

hints/gnu.sh

index fe251cb..8ec9470 100644 (file)
@@ -1,6 +1,5 @@
 # hints/gnu.sh
-# Last modified: Thu Dec 10 20:47:28 CET 1998
-# Mark Kettenis <kettenis@phys.uva.nl>
+# Originally contributed by:  Mark Kettenis <kettenis@phys.uva.nl> Dec 10 1998
 
 # libnsl is unusable on the Hurd.
 # XXX remove this once SUNRPC is implemented.
@@ -30,8 +29,34 @@ lddlflags='-shared'
 # Flags needed by programs that use dynamic linking.
 ccdlflags='-Wl,-E'
 
-# Debian bug #258618
-ccflags="-D_GNU_SOURCE $ccflags"
+# This script UU/usethreads.cbu will get 'called-back' by Configure
+# after it has prompted the user for whether to use threads.
+cat > UU/usethreads.cbu <<'EOCBU'
+case "$usethreads" in
+$define|true|[yY]*)
+        ccflags="-D_REENTRANT -D_GNU_SOURCE $ccflags"
+        if echo $libswanted | grep -v pthread >/dev/null
+        then
+            set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
+            shift
+            libswanted="$*"
+        fi
+
+       # Somehow at least in Debian 2.2 these manage to escape
+       # the #define forest of <features.h> and <time.h> so that
+       # the hasproto macro of Configure doesn't see these protos,
+       # even with the -D_GNU_SOURCE.
+
+       d_asctime_r_proto="$define"
+       d_crypt_r_proto="$define"
+       d_ctime_r_proto="$define"
+       d_gmtime_r_proto="$define"
+       d_localtime_r_proto="$define"
+       d_random_r_proto="$define"
+
+       ;;
+esac
+EOCBU
 
 cat > UU/uselargefiles.cbu <<'EOCBU'
 # This script UU/uselargefiles.cbu will get 'called-back' by Configure