summaryrefslogtreecommitdiff
path: root/devel/papi/files/patch-configure
blob: 66fdfb2355dcba71ad1def4c1ded5050d641ec42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- configure.orig	2013-08-06 20:12:20.000000000 +0400
+++ configure	2013-11-10 23:00:05.000000000 +0400
@@ -6906,7 +6906,7 @@
     MAKEVER="freebsd"
     LDFLAGS="-lpmc"
     # HWPMC driver is available for FreeBSD >= 6
-    FREEBSD_VERSION=`uname -r | cut -c 1`
+    FREEBSD_VERSION=`uname -r | cut -d'.' -f1`
     if test "${FREEBSD_VERSION}" -lt 6 ; then
       { { echo "$as_me:$LINENO: error: PAPI requires FreeBSD 6 or greater" >&5
 echo "$as_me: error: PAPI requires FreeBSD 6 or greater" >&2;}
@@ -7525,11 +7525,11 @@
 
 
 for comp in $components; do
-  idx=`expr index "$comp" /`
+  idx=`echo "$comp" | sed -n "s/\/.*//p" | wc -c`
   if test "$idx" = 0; then
 	subcomp=$comp
   else
-    subcomp=${comp:$idx}
+    subcomp=`echo $comp | sed -E "s/^.{${idx}}//"`
   fi
   COMPONENT_RULES="$COMPONENT_RULES components/$comp/Rules.$subcomp"
   echo "extern papi_vector_t _${subcomp}_vector;" >> components_config.h
@@ -7542,11 +7542,11 @@
 fi
 
 for comp in $components; do
-  idx=`expr index "$comp" /`
+  idx=`echo "$comp" | sed -n "s/\/.*//p" | wc -c`
   if test "$idx" = 0; then
 	subcomp=$comp
   else
-    subcomp=${comp:$idx}
+    subcomp=`echo $comp | sed -E "s/^.{${idx}}//"`
   fi
   echo "   &_${subcomp}_vector," >> components_config.h
 done