From 92aabefb34531d9aeeeb492e58815a5a7e088ad4 Mon Sep 17 00:00:00 2001 From: markus Date: Fri, 28 Apr 2006 12:07:53 +0000 Subject: Fix build on 4.x Reported by: kris --- x11/libsynaptics/Makefile | 4 ++ x11/libsynaptics/files/patch-Makefile.in | 11 +++++ x11/libsynaptics/files/patch-pad.cpp | 85 ++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 x11/libsynaptics/files/patch-Makefile.in create mode 100644 x11/libsynaptics/files/patch-pad.cpp (limited to 'x11') diff --git a/x11/libsynaptics/Makefile b/x11/libsynaptics/Makefile index 470b3105815f..9a1fe4a92d07 100644 --- a/x11/libsynaptics/Makefile +++ b/x11/libsynaptics/Makefile @@ -21,4 +21,8 @@ GNU_CONFIGURE= yes CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" +post-patch: + @${REINPLACE_CMD} -e 's/%%PTHREAD_LIBS%%/${PTHREAD_LIBS}/g' \ + ${WRKSRC}/Makefile.in + .include diff --git a/x11/libsynaptics/files/patch-Makefile.in b/x11/libsynaptics/files/patch-Makefile.in new file mode 100644 index 000000000000..a2a56f61a4e7 --- /dev/null +++ b/x11/libsynaptics/files/patch-Makefile.in @@ -0,0 +1,11 @@ +--- Makefile.in.orig Thu Apr 27 01:35:21 2006 ++++ Makefile.in Thu Apr 27 01:35:41 2006 +@@ -209,7 +209,7 @@ + library_includedir = $(includedir)/synaptics + library_include_HEADERS = pad.h Shm_0_14_4 synaptics.h syndebug.h synparams.h synshm.h version.h + syntest_SOURCES = syntest.cpp synaptics.h +-syntest_LDADD = libsynaptics.la ++syntest_LDADD = libsynaptics.la %%PTHREAD_LIBS%% + all: all-am + + .SUFFIXES: diff --git a/x11/libsynaptics/files/patch-pad.cpp b/x11/libsynaptics/files/patch-pad.cpp new file mode 100644 index 000000000000..133cb7a5c40a --- /dev/null +++ b/x11/libsynaptics/files/patch-pad.cpp @@ -0,0 +1,85 @@ +--- pad.cpp.orig Thu Apr 27 00:53:03 2006 ++++ pad.cpp Thu Apr 27 01:26:18 2006 +@@ -15,11 +15,13 @@ + #include "version.h" + + #include // for typedef Bool ++#include + #include + #include ++#include + + #include +-static pthread_mutex_t lock; ++static pthread_mutex_t mylock; + + #define PAROFF( verId, par ) \ + offsetof( SynShm, verId ) + offsetof( ShmSegment##verId, par ) +@@ -31,7 +33,7 @@ + p.max_val = max; + + #define NODRIVERVER VER( 0, 0, 0 ) +-#define RETURN( val ) pthread_mutex_unlock( &lock ); return ( val ) ++#define RETURN( val ) pthread_mutex_unlock( &mylock ); return ( val ) + + + // +@@ -81,7 +83,7 @@ + mSelf = new Synaptics::Pad(); // call constructor + else + { +- pthread_mutex_lock( &lock ); ++ pthread_mutex_lock( &mylock ); + return; + } + +@@ -310,7 +312,7 @@ + PadType pt = PT_NONE; + + // FIXME: detection just based on the assumption that the driver will register as unknown +- if ( mHasShm and mDetectedDriver == DV_UNKNOWN ) ++ if ( mHasShm && mDetectedDriver == DV_UNKNOWN ) + pt = PT_UNKNOWN; + else + { +@@ -345,19 +347,19 @@ + { + Param p = mSupportedDriver[ DRIVERSTR ][ param ]; + +- if ( ( p.type == PT_BOOL ) or ( p.type == PT_BOOL_RO ) ) ++ if ( ( p.type == PT_BOOL ) || ( p.type == PT_BOOL_RO ) ) + { + rb = *(Bool*)(((char*)mSynShm) + p.offset ); + RETURN( rb ); + } + +- if ( ( p.type == PT_INT ) or ( p.type == PT_INT_RO ) ) ++ if ( ( p.type == PT_INT ) || ( p.type == PT_INT_RO ) ) + { + ri = *(int*)(((char*)mSynShm) + p.offset ); + RETURN( ri ); + } + +- if ( ( p.type == PT_DOUBLE ) or ( p.type == PT_DOUBLE_RO ) ) ++ if ( ( p.type == PT_DOUBLE ) || ( p.type == PT_DOUBLE_RO ) ) + { + rd = *(double*)(((char*)mSynShm) + p.offset ); + RETURN( rd ); +@@ -376,7 +378,7 @@ + { + Param p = mSupportedDriver[ DRIVERSTR ][ param ]; + +- if ( ( p.min_val <= v ) and ( p.max_val >= v ) ) ++ if ( ( p.min_val <= v ) && ( p.max_val >= v ) ) + { + if ( p.type == PT_BOOL ) + (*(Bool*)(((char*)mSynShm) + p.offset)) = (Bool)v; +@@ -391,7 +393,7 @@ + } + } + // instead of RETURN(void) +- pthread_mutex_unlock( &lock ); ++ pthread_mutex_unlock( &mylock ); + } + + int Synaptics::Pad::driverVersion() -- cgit