openbsd-ports/x11/vlc/patches/patch-configure_ac
phessler 7ccc4d7c1c Update to VLC 1.1.12
Most of the bits from Brad, a minor runtime fix by me.

Tested on amd64, i386, macppc

OK dhill@, rpointel@, sthen@, jasper@
2011-11-16 13:33:15 +00:00

128 lines
4.4 KiB
Plaintext

$OpenBSD: patch-configure_ac,v 1.20 2011/11/16 13:33:15 phessler Exp $
--- configure.ac.orig Thu Oct 6 14:02:25 2011
+++ configure.ac Sun Nov 13 15:25:53 2011
@@ -184,20 +184,14 @@ case "${host_os}" in
;;
*bsd*)
SYS="${host_os}"
- CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
case "${host_os}" in
freebsd*)
+ CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
CPPFLAGS_save="${CPPFLAGS_save} -I/usr/local/include"
CPPFLAGS="${CPPFLAGS_save}"
LDFLAGS_save="${LDFLAGS_save} -L/usr/local/lib"
LDFLAGS="${LDFLAGS_save}"
;;
- openbsd*)
- CPPFLAGS_save="${CPPFLAGS_save} -I/usr/local/include -I/usr/X11R6/include"
- CPPFLAGS="${CPPFLAGS_save}"
- LDFLAGS_save="${LDFLAGS_save} -L/usr/local/lib -L/usr/X11R6/lib/"
- LDFLAGS="${LDFLAGS_save}"
- ;;
esac
;;
darwin*)
@@ -785,6 +779,20 @@ if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
dnl Check for pthreads - borrowed from XMMS
THREAD_LIB=error
if test "${THREAD_LIB}" = "error"; then
+ AC_MSG_CHECKING(for pthread_create in -pthread)
+ save_LDFLAGS="${LDFLAGS}"
+ LDFLAGS="${LDFLAGS} -pthread"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ pthread_t thr;]],
+ [pthread_create(&thr, NULL, NULL, NULL);])],
+ [THREAD_LIB="-pthread"
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+ LDFLAGS="${save_LDFLAGS}"
+fi
+if test "${THREAD_LIB}" = "error"; then
AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
fi
if test "${THREAD_LIB}" = "error"; then
@@ -1001,65 +1009,6 @@ CFLAGS="${CFLAGS_save}"
RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration])
RDC_PROG_CC_FLAGS([-pipe])
-dnl Check for various optimization flags
-AC_CACHE_CHECK([if \$CC accepts -Os],
- [ac_cv_c_os],
- [CFLAGS="${CFLAGS_save} -Os"
- AC_TRY_COMPILE([],,ac_cv_c_os=yes, ac_cv_c_os=no)])
-if test "${ac_cv_c_os}" != "no"; then
- CFLAGS_OPTIM_SIZE="${CFLAGS_OPTIM_SIZE} -Os"
-else
- AC_CACHE_CHECK([if \$CC accepts -O],
- [ac_cv_c_o],
- [CFLAGS="${CFLAGS_save} -O"
- AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
- if test "${ac_cv_c_o}" != "no"; then
- if test "${ac_cv_c_o3}" = "no"; then
- CFLAGS_OPTIM_SIZE="${CFLAGS_OPTIM_SIZE} -O"
- fi
- fi
-fi
-
-AC_CACHE_CHECK([if \$CC accepts -O4],
- [ac_cv_c_o4],
- [CFLAGS="${CFLAGS_save} -O4"
- AC_TRY_COMPILE([],,ac_cv_c_o4=yes, ac_cv_c_o4=no)])
-if test "${ac_cv_c_o4}" != "no" -a "x${enable_debug}" = "xno"; then
- CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O4"
-else
- AC_CACHE_CHECK([if \$CC accepts -O3],
- [ac_cv_c_o3],
- [CFLAGS="${CFLAGS_save} -O3"
- AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
- if test "${ac_cv_c_o3}" != "no" -a "x${enable_debug}" = "xno"; then
- CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O3"
- else
- AC_CACHE_CHECK([if \$CC accepts -O2],
- [ac_cv_c_o2],
- [CFLAGS="${CFLAGS_save} -O2"
- AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
- if test "${ac_cv_c_o2}" != "no"; then
- CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O2"
- else
- AC_CACHE_CHECK([if \$CC accepts -O],
- [ac_cv_c_o],
- [CFLAGS="${CFLAGS_save} -O"
- AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
- if test "${ac_cv_c_o}" != "no"; then
- CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O"
- fi
- fi
- fi
-fi
-
-AC_CACHE_CHECK([if \$CC accepts -O0],
- [ac_cv_c_o0],
- [CFLAGS="${CFLAGS_save} -O0"
- AC_TRY_COMPILE([],,ac_cv_c_o0=yes, ac_cv_c_o0=no)])
-if test "${ac_cv_c_o0}" != "no"; then
- CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O0"
-fi
-
dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
[ac_cv_c_fast_math],
@@ -3074,11 +3023,11 @@ AC_ARG_ENABLE(png,
[ --enable-png PNG support (default enabled)])
if test "${enable_png}" != "no"; then
AC_CHECK_HEADERS(png.h, [
- LDFLAGS="${LDFLAGS_save} -lz"
+ LDFLAGS="${LDFLAGS_save} -lm -lz"
AC_CHECK_LIB(png, png_set_rows, [
- VLC_ADD_LIBS([png],[-lpng -lz])
+ VLC_ADD_LIBS([png],[-lpng -lm -lz])
VLC_ADD_PLUGIN([png osdmenu osd_parser])],
- [],[-lz])
+ [],[-lm -lz])
LDFLAGS="${LDFLAGS_save}"
])
fi