[xiph-cvs] cvs commit: vorbis-tools/ogg123 Makefile.am

Stan Seibert volsung at xiph.org
Sat Dec 15 17:35:00 PST 2001



volsung     01/12/15 17:35:00

  Modified:    .        Tag: volsung_kc_20011011 configure.in
               ogg123   Tag: volsung_kc_20011011 Makefile.am
  Log:
  Correct pthreads testing for various platforms thanks to Miod Vallat (by
  way of Christian Weisgerber).

Revision  Changes    Path
No                   revision

No                   revision

1.21.2.1.2.4 +27 -11    vorbis-tools/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/configure.in,v
retrieving revision 1.21.2.1.2.3
retrieving revision 1.21.2.1.2.4
diff -u -r1.21.2.1.2.3 -r1.21.2.1.2.4
--- configure.in	2001/12/15 15:26:22	1.21.2.1.2.3
+++ configure.in	2001/12/16 01:34:59	1.21.2.1.2.4
@@ -82,16 +82,33 @@
 LDFLAGS="$LDFLAGS $ldflags_save"
 
 dnl --------------------------------------------------
-dnl Check for headers
+dnl Check for pthreads (from Miod Vallat <miod at openbsd.org>)
 dnl --------------------------------------------------
-
-dnl none
-
-dnl --------------------------------------------------
-dnl Check for typedefs, structures, etc
-dnl --------------------------------------------------
-
-dnl none
+ 
+AC_CACHE_CHECK(
+        [if compiler recognizes -pthread],
+        ogg123_cv_gcc_pthread,
+        ac_save_CFLAGS=$CFLAGS
+        CFLAGS="$CFLAGS -pthread"
+        AC_LANG_SAVE
+        AC_LANG_C
+        AC_TRY_LINK([#include <pthread.h>],
+                [void *p = pthread_create;],
+                ogg123_cv_gcc_pthread=yes,
+                ogg123_cv_gcc_pthread=no
+        )
+        AC_LANG_RESTORE
+        CFLAGS=$ac_save_CFLAGS
+)
+if test $ogg123_cv_gcc_pthread = yes
+then
+        THREAD_LIBS=""
+        THREAD_CFLAGS="-pthread"
+else
+        dnl AC_CHECK_HEADERS(pthread.h) unreliable
+        AC_CHECK_LIB(pthread,pthread_create,THREAD_LIBS=-lpthread,
+             [AC_CHECK_LIB(c_r,pthread_create,THREAD_LIBS=-lc_r)])
+fi
 
 dnl --------------------------------------------------
 dnl Check for libraries
@@ -104,8 +121,6 @@
 AC_CHECK_HEADER(curl/curl.h, , AC_MSG_ERROR(libcurl headers needed!))
 AC_CHECK_HEADER(curl/easy.h, , AC_MSG_ERROR(libcurl headers needed!))
 AC_CHECK_LIB(curl, curl_easy_perform, CURL_LIBS="-lcurl", AC_MSG_ERROR(libcurl needed!))
-AC_CHECK_HEADER(pthread.h, , AC_MSG_ERROR(pthread header needed!))
-AC_CHECK_LIB(pthread, pthread_mutex_init, THREAD_LIBS="-lpthread", AC_MSG_ERROR(pthread library needed!))
 AC_CHECK_LIB(socket, socket, SOCKET_LIBS="-lsocket")
 AC_CHECK_LIB(nsl, gethostbyname, SOCKET_LIBS="-lnsl $SOCKET_LIBS")
 SHARE_LIBS='$(top_srcdir)/share/libutf8.a $(top_srcdir)/share/libgetopt.a'
@@ -136,6 +151,7 @@
 AC_SUBST(DEBUG)
 AC_SUBST(PROFILE)
 AC_SUBST(THREAD_LIBS)
+AC_SUBST(THREAD_CFLAGS)
 AC_SUBST(SOCKET_LIBS)
 AC_SUBST(SHARE_LIBS)
 AC_SUBST(CURL_LIBS)

No                   revision

No                   revision

1.14.2.4.2.6 +2 -2      vorbis-tools/ogg123/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Makefile.am,v
retrieving revision 1.14.2.4.2.5
retrieving revision 1.14.2.4.2.6
diff -u -r1.14.2.4.2.5 -r1.14.2.4.2.6
--- Makefile.am	2001/12/15 15:26:26	1.14.2.4.2.5
+++ Makefile.am	2001/12/16 01:34:59	1.14.2.4.2.6
@@ -8,10 +8,10 @@
 mandir = @MANDIR@
 man_MANS = ogg123.1
 
-INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@
+INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ @THREAD_CFLAGS@
 
 ogg123_LDADD = @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@ \
-		@SOCKET_LIBS@ @SHARE_LIBS@ @CURL_LIBS@
+		@SOCKET_LIBS@ @SHARE_LIBS@ @CURL_LIBS@ @THREAD_LIBS@
 ogg123_DEPENDENCIES = @SHARE_LIBS@
 ogg123_SOURCES = audio.c buffer.c callbacks.c \
                  cfgfile_options.c cmdline_options.c \

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list