From dd0242de6dbfa0d34f48752e1e22082c664207fe Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Wed, 20 Aug 2003 03:44:25 +0000
Subject: [PATCH] Remove the dummy pthread functions and use -lpthread instead
 to resolve missing symbols in GL libs.

---
 configure             | 14 ++++--------
 configure.ac          |  9 ++++----
 include/config.h.in   | 15 -------------
 libs/wine/Makefile.in |  1 -
 libs/wine/errno.c     | 52 -------------------------------------------
 5 files changed, 8 insertions(+), 83 deletions(-)
 delete mode 100644 libs/wine/errno.c

diff --git a/configure b/configure
index f8be4bc3b85..34acbcfe3b3 100755
--- a/configure
+++ b/configure
@@ -8198,6 +8198,10 @@ if test $ac_cv_lib_GLU_gluLookAt = yes; then
 
 fi
 
+                if test -n "$OPENGL_LIBS"
+                then
+                  OPENGL_LIBS="$OPENGL_LIBS -lpthread"
+                fi
 	     fi
 	 fi
     fi
@@ -13364,11 +13368,6 @@ fi
 
 
 
-
-
-
-
-
 
 
 
@@ -13408,11 +13407,6 @@ for ac_func in \
 	pclose \
 	popen \
 	pread \
-	pthread_getspecific \
-	pthread_key_create \
-	pthread_mutex_lock \
-	pthread_mutex_unlock \
-	pthread_setspecific \
 	pwrite \
 	rfork \
 	select \
diff --git a/configure.ac b/configure.ac
index 161cca04efa..39496ac2d77 100644
--- a/configure.ac
+++ b/configure.ac
@@ -341,6 +341,10 @@ This prevents linking to OpenGL. Delete the file and restart configure.])
 			     ,,
 			     $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
 		)
+                if test -n "$OPENGL_LIBS"
+                then
+                  OPENGL_LIBS="$OPENGL_LIBS -lpthread"
+                fi
 	     fi
 	 fi
     fi
@@ -958,11 +962,6 @@ AC_CHECK_FUNCS(\
 	pclose \
 	popen \
 	pread \
-	pthread_getspecific \
-	pthread_key_create \
-	pthread_mutex_lock \
-	pthread_mutex_unlock \
-	pthread_setspecific \
 	pwrite \
 	rfork \
 	select \
diff --git a/include/config.h.in b/include/config.h.in
index 9adc1a09805..5a68794f3b2 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -395,21 +395,6 @@
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
-/* Define to 1 if you have the `pthread_getspecific' function. */
-#undef HAVE_PTHREAD_GETSPECIFIC
-
-/* Define to 1 if you have the `pthread_key_create' function. */
-#undef HAVE_PTHREAD_KEY_CREATE
-
-/* Define to 1 if you have the `pthread_mutex_lock' function. */
-#undef HAVE_PTHREAD_MUTEX_LOCK
-
-/* Define to 1 if you have the `pthread_mutex_unlock' function. */
-#undef HAVE_PTHREAD_MUTEX_UNLOCK
-
-/* Define to 1 if you have the `pthread_setspecific' function. */
-#undef HAVE_PTHREAD_SETSPECIFIC
-
 /* Define to 1 if you have the <pty.h> header file. */
 #undef HAVE_PTY_H
 
diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in
index f3b1cd18b6a..3a1b0400261 100644
--- a/libs/wine/Makefile.in
+++ b/libs/wine/Makefile.in
@@ -10,7 +10,6 @@ EXTRALIBS = $(LIBPORT) @DLLIBS@ @CRTLIBS@
 C_SRCS = \
 	config.c \
 	debug.c \
-	errno.c \
 	ldt.c \
 	loader.c
 
diff --git a/libs/wine/errno.c b/libs/wine/errno.c
deleted file mode 100644
index ee465e1bff9..00000000000
--- a/libs/wine/errno.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Wine library reentrant errno support
- *
- * Copyright 1998 Alexandre Julliard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "config.h"
-
-#include <assert.h>
-
-#ifndef HAVE_NPTL
-
-/***********************************************************************
- *		pthread functions
- *
- * FIXME: should find a better place for these
- */
-#ifndef HAVE_PTHREAD_GETSPECIFIC
-void pthread_getspecific() { assert(0); }
-#endif
-
-#ifndef HAVE_PTHREAD_KEY_CREATE
-void pthread_key_create() { assert(0); }
-#endif
-
-#ifndef HAVE_PTHREAD_MUTEX_LOCK
-void pthread_mutex_lock() { assert(0); }
-#endif
-
-#ifndef HAVE_PTHREAD_MUTEX_UNLOCK
-void pthread_mutex_unlock() { assert(0); }
-#endif
-
-#ifndef HAVE_PTHREAD_SETSPECIFIC
-void pthread_setspecific() { assert(0); }
-#endif
-
-#endif  /* HAVE_NPTL */
-- 
GitLab