Explorar o código

Backed out some misinformed changes, and made gcc-dependent thread library inclusion consistent across platforms.

Ralf S. Engelschall %!s(int64=24) %!d(string=hai) anos
pai
achega
62597925e2
Modificáronse 1 ficheiros con 14 adicións e 1 borrados
  1. 14 1
      pgp2/pgp2.spec

+ 14 - 1
pgp2/pgp2.spec

@@ -68,7 +68,20 @@ AutoReqProv:  no
 
 %build
     cd src
-    CC="%{l_cc}"
+    CC="%{l_cc}" CFLAGS="%{l_cflags -O}"
+    CFLAGS="%{l_cflags -O}"
+    case "%{l_target}" in
+        *-freebsd* )
+            if ( %{l_cc} --version | grep -i -e "gcc" ); then
+                CFLAGS="$CFLAGS -pthread"
+            fi
+            ;;
+        *-solaris* )
+            if ( %{l_cc} --version | grep -i -e "gcc" ); then
+                CFLAGS="$CFLAGS -pthreads"
+            fi
+            ;;
+    esac
     case "%{l_target}" in
         *-freebsd* )
             OS=freebsd