[vlc-devel] OpenBSD build fix

Joris van Rooij jorrizza at jrrzz.net
Tue Apr 21 16:37:14 CEST 2009


Hello,

I've just built vlc from git on OpenBSD 4.4 amd64. I had to patch the code 
somewhat to make it compile. Some changes are obvious bugs, some others I'm 
not so sure about.

I've used the following configuration:
AUTOCONF_VERSION=2.61 AUTOMAKE_VERSION=1.9 ./bootstrap                       
./configure --prefix=/usr/local/vlc --disable-mad --disable-a52 \
  --disable-qt4 --disable-skins2 --disable-remoteosd --disable-opengl \
  CC=/usr/local/bin/amd64-unknown-openbsd4.4-gcc-4.2.0 \
  CXX=/usr/local/bin/amd64-unknown-openbsd4.4-eg++      

Greetings,
Joris
-------------- next part --------------
diff --git a/configure.ac b/configure.ac
index af49d08..36203c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -869,6 +869,7 @@ AC_CHECK_HEADERS(fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat
 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/udplite.h sys/eventfd.h])
 AC_CHECK_HEADERS([net/if.h], [], [],
   [
+    #include <stdlib.h>
     #include <sys/socket.h>
   ])
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
diff --git a/modules/access/oss.c b/modules/access/oss.c
index 61999f0..a3328ca 100644
--- a/modules/access/oss.c
+++ b/modules/access/oss.c
@@ -45,7 +45,15 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 
-#include <sys/soundcard.h>
+#ifdef HAVE_SYS_SOUNDCARD_H
+#  include <sys/soundcard.h>
+#endif
+#ifdef HAVE_MACHINE_SOUNDCARD_H
+#  include <machine/soundcard.h>
+#endif
+#ifdef HAVE_SOUNDCARD_H
+#  include <soundcard.h>
+#endif
 
 #include <poll.h>
 
diff --git a/modules/access/vcd/cdrom.c b/modules/access/vcd/cdrom.c
index 1990237..10c5a7d 100644
--- a/modules/access/vcd/cdrom.c
+++ b/modules/access/vcd/cdrom.c
@@ -58,7 +58,7 @@
 #   include <IOKit/storage/IOCDMedia.h>
 #   include <IOKit/storage/IOCDMediaBSDClient.h>
 #elif defined( HAVE_SCSIREQ_IN_SYS_SCSIIO_H )
-#   include <sys/inttypes.h>
+#   include <inttypes.h>
 #   include <sys/cdio.h>
 #   include <sys/scsiio.h>
 #elif defined( HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H )
@@ -724,7 +724,7 @@ int ioctl_ReadSectors( vlc_object_t *p_this, const vcddev_t *p_vcddev,
         sc.flags = SCCMD_READ;
         sc.timeout = 10000;
 
-        i_ret = ioctl( i_fd, SCIOCCOMMAND, &sc );
+        i_ret = ioctl( p_vcddev->i_device_handle, SCIOCCOMMAND, &sc );
         if( i_ret == -1 )
         {
             msg_Err( p_this, "SCIOCCOMMAND failed" );
diff --git a/modules/access/vcd/cdrom_internals.h b/modules/access/vcd/cdrom_internals.h
index ddaded1..941c83b 100644
--- a/modules/access/vcd/cdrom_internals.h
+++ b/modules/access/vcd/cdrom_internals.h
@@ -147,10 +147,6 @@ typedef struct _CDROM_READ_TOC_EX {
 #define SRB_EVENT_NOTIFY    0x40
 
 #define READ_CD 0xbe
-#define SECTOR_TYPE_MODE2_FORM2 0x14
-#define SECTOR_TYPE_CDDA 0x04
-#define READ_CD_RAW_MODE2 0xF0
-#define READ_CD_USERDATA 0x10
 
 #define READ_TOC 0x43
 #define READ_TOC_FORMAT_TOC 0x0
@@ -211,6 +207,10 @@ struct SRB_ExecSCSICmd
 #pragma pack()
 #endif /* WIN32 */
 
+#define SECTOR_TYPE_MODE2_FORM2 0x14
+#define SECTOR_TYPE_CDDA 0x04
+#define READ_CD_RAW_MODE2 0xF0
+#define READ_CD_USERDATA 0x10
 
 /*****************************************************************************
  * Local Prototypes
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index fecf500..19f5a07 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -40,7 +40,7 @@ INSTALL_DATA = @INSTALL_DATA@
 # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
 # versions, $(mkinstalldirs) and $(install_sh) are unused.
 mkinstalldirs = $(SHELL) @install_sh@ -d
-install_sh = $(SHELL) @install_sh@
+install_sh = @install_sh@
 MKDIR_P = @MKDIR_P@
 mkdir_p = @mkdir_p@
 
diff --git a/src/misc/threads.c b/src/misc/threads.c
index 5dc08e1..cc477f5 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -783,11 +783,15 @@ int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
         struct sched_param sp = { .sched_priority = priority, };
         int policy;
 
+#    ifdef _POSIX_PRIORITY_SCHEDULING
+
         if (sp.sched_priority <= 0)
             sp.sched_priority += sched_get_priority_max (policy = SCHED_OTHER);
         else
             sp.sched_priority += sched_get_priority_min (policy = SCHED_RR);
 
+#    endif
+
         pthread_attr_setschedpolicy (&attr, policy);
         pthread_attr_setschedparam (&attr, &sp);
     }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090421/49069a3d/attachment.sig>


More information about the vlc-devel mailing list