Commit 30924959 authored by Aaron Plattner's avatar Aaron Plattner
Browse files

Switch the build system to Meson



Modify the dlclose test to pick up libvdpau.so from the right place

Rename doc/Doxyfile to doc/Doxyfile.in and use Meson's configuration file
support to generate the Doxyfile.
Signed-off-by: default avatarAaron Plattner <aplattner@nvidia.com>
parent eac13934
ChangeLog
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
compile
depcomp
doc/html-out
install-sh
libtool
libvdpau-*.tar.bz2
libvdpau-*.tar.gz
ltmain.sh
missing
.deps
.libs
*.lo
*.la
*.o
stamp-h1
test-driver
vdpau.pc
SUBDIRS = doc src test trace
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = vdpau.pc
EXTRA_DIST = vdpau.pc.in autogen.sh ChangeLog
.PHONY: ChangeLog
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog
# XORG_CHANGELOG()
# ----------------
# Minimum version: 1.2.0
#
# Defines the variable CHANGELOG_CMD as the command to generate
# ChangeLog from git.
#
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
#
# Stolen from xorg-macros.m4, which has this license:
# xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
#
# Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, provided that the above
# copyright notice(s) and this permission notice appear in all copies of
# the Software and that both the above copyright notice(s) and this
# permission notice appear in supporting documentation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Except as contained in this notice, the name of a copyright holder
# shall not be used in advertising or otherwise to promote the sale, use
# or other dealings in this Software without prior written authorization
# of the copyright holder.
#
AC_DEFUN([XORG_CHANGELOG], [
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
echo 'git directory not found: installing possibly empty changelog.' >&2)"
AC_SUBST([CHANGELOG_CMD])
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
]) # XORG_CHANGELOG
#! /bin/sh
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd "$srcdir"
autoreconf --force --verbose --install || exit 1
cd "$ORIGDIR" || exit $?
if test -z "$NOCONFIGURE"; then
"$srcdir"/configure "$@"
fi
AC_PREREQ(2.60)
AC_INIT(libvdpau, 1.2, [vdpau@lists.freedesktop.org], libvdpau)
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AC_CONFIG_HEADERS(config.h)
# Check for secure_getenv
AC_USE_SYSTEM_EXTENSIONS
AC_CHECK_FUNCS([__secure_getenv secure_getenv])
# Disable static libraries by default. Use --enable-static if you really want
# them.
AC_DISABLE_STATIC
# Check for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
# Checks for dependencies.
PKG_CHECK_MODULES(X11, x11)
AC_SUBST(X11_CFLAGS)
AC_SUBST(X11_LIBS)
# Check for optional dependencies.
AC_ARG_ENABLE(dri2, AS_HELP_STRING([--disable-dri2], [Disable driver name query through DRI2 (default: auto)]), [DRI2=$enableval], [DRI2=auto])
PKG_CHECK_MODULES(dri2proto, dri2proto >= 2.2, [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no])
case "$DRI2,$HAVE_DRI2PROTO" in
yes,no)
AC_MSG_ERROR([DRI2 queries require dri2proto >= 2.2])
;;
yes,yes | auto,yes)
AC_DEFINE(DRI2, 1, [Request driver name from DRI2])
DRI2=yes
PKG_CHECK_MODULES(XEXT, xext)
AC_SUBST([XEXT_CFLAGS])
AC_SUBST([XEXT_LIBS])
;;
esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
AC_SUBST([DLOPEN_LIBS])
# Look for POSIX threads
AC_SEARCH_LIBS([pthread_once], [pthread pthreads c_r], [
AS_IF([test "$ac_cv_search_pthread_once" != "none required"], [
PTHREAD_LIBS="$ac_cv_search_pthread_once"
])
])
AC_SUBST([PTHREAD_LIBS])
# Check for Doxygen.
AC_ARG_ENABLE(documentation, AS_HELP_STRING([--disable-documentation], [Disable Doxygen documentation (default: auto)]), [DOCS=$enableval], [DOCS=auto])
if test "x$DOCS" != xno; then
AC_CHECK_TOOL([DOXYGEN], [doxygen], [no])
AC_CHECK_TOOL([DOT], [dot], [no])
else
DOXYGEN=no
DOT=no
fi
if test "x$DOCS" = xyes; then
if test "x$DOXYGEN" = xno; then
AC_ERROR([Documentation enabled but doxygen was not found in your path])
fi
if test "x$DOT" = xno; then
AC_ERROR([Documentation enabled but dot was not found in your path. Please install graphviz])
fi
fi
AM_CONDITIONAL([ENABLE_DOCS], [test "x$DOXYGEN" != xno -a "x$DOT" != xno])
AC_SUBST(DOXYGEN)
# Options
AC_ARG_WITH(module-dir,
AC_HELP_STRING([--with-module-dir=DIR],
[Default module directory [[default=LIBDIR/vdpau]]]),
[moduledir="$withval"],
[moduledir="$libdir/vdpau"])
AC_SUBST(moduledir)
XORG_CHANGELOG
AC_OUTPUT([Makefile
doc/Makefile
src/Makefile
test/Makefile
trace/Makefile
vdpau.pc])
......@@ -38,7 +38,7 @@ PROJECT_NUMBER =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY =
OUTPUT_DIRECTORY = doc
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
......@@ -113,7 +113,7 @@ FULL_PATH_NAMES = YES
# If left blank the directory from which doxygen is run is used as the
# path to strip.
STRIP_FROM_PATH = $(VDPAU_HEADER_DIR)
STRIP_FROM_PATH = @VDPAU_HEADER_PATH@
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
......@@ -477,7 +477,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = $(VDPAU_HEADER_FILES)
INPUT = @VDPAU_HEADER_PATH@
# This tag can be used to specify the character encoding of the source files that
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default
......@@ -552,7 +552,7 @@ EXAMPLE_RECURSIVE = NO
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH = .
IMAGE_PATH = @VDPAU_DOC_PATH@
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
......@@ -672,7 +672,7 @@ GENERATE_HTML = YES
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html-out
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
......
all: html
install-data-local: install-html
EXTRA_DIST = \
Doxyfile \
vdpau_data_flow.png
VDPAU_HEADER_DIR := $(top_srcdir)/include
VDPAU_HEADER_FILES := \
$(VDPAU_HEADER_DIR)/vdpau/vdpau.h \
$(VDPAU_HEADER_DIR)/vdpau/vdpau_x11.h
export VDPAU_HEADER_DIR
export VDPAU_HEADER_FILES
html-out/%: Doxyfile $(VDPAU_HEADER_FILES)
$(DOXYGEN) $<
if ENABLE_DOCS
html: html-out/index.html
install-html-local:
$(install_sh) -d "$(DESTDIR)$(docdir)/html"
$(install_sh) -m 644 html-out/* "$(DESTDIR)$(docdir)/html"
uninstall-local:
$(RM) -r "$(DESTDIR)$(docdir)/html"
endif
clean-local:
$(RM) -r html-out
doc_option = get_option('documentation')
doc_required = doc_option == 'true'
docdir = join_paths(get_option('datadir'), 'doc', 'libvdpau')
doxygen = find_program('doxygen', required : doc_required)
dot = find_program('dot', required : doc_required)
if doc_option != 'false' and doxygen.found() and dot.found()
doxyfile = configure_file(
input : 'Doxyfile.in',
output : 'Doxyfile',
configuration : cdata,
install : false
)
html = custom_target('libvdpau-docs',
command : [doxygen, doxyfile],
output : 'html',
install : true,
install_dir : docdir,
)
endif
install_subdir('vdpau', install_dir : 'include')
project('libvdpau', 'c', 'cpp', meson_version : '>=0.41')
cc = meson.get_compiler('c')
libdir = join_paths(get_option('prefix'), get_option('libdir'))
moduledir = get_option('moduledir')
if moduledir == ''
moduledir = join_paths(libdir, 'vdpau')
endif
sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
cdata = configuration_data()
cdata.set_quoted('VDPAU_MODULEDIR', moduledir)
cdata.set_quoted('VDPAU_SYSCONFDIR', sysconfdir)
cdata.set_quoted('VDPAU_DOC_PATH', meson.current_source_dir())
cdata.set_quoted('VDPAU_HEADER_PATH', join_paths(meson.source_root(), 'include'))
if cc.has_function('secure_getenv')
cdata.set10('HAVE_SECURE_GETENV', true)
cdata.set10('_GNU_SOURCE', true)
elif cc.has_function('__secure_getenv')
cdata.set10('HAVE___SECURE_GETENV', true)
cdata.set10('_GNU_SOURCE', true)
endif
dri2_option = get_option('dri2')
dri2_required = dri2_option == 'true'
dri2 = []
if dri2_option != 'false'
dri2 += [
dependency('dri2proto', version : '>= 2.2', required : dri2_required),
dependency('xext', required : dri2_required),
]
endif
use_dri2 = dri2_option != 'false'
foreach dep : dri2
use_dri2 = use_dri2 and dep.found()
endforeach
cdata.set10('DRI2', use_dri2)
configure_file(output : 'config.h', configuration : cdata)
add_project_arguments('-DHAVE_CONFIG_H', language : [ 'c', 'cpp' ])
inc = include_directories(['.', 'include'])
subdir('doc')
subdir('include')
subdir('src')
subdir('test')
subdir('trace')
import('pkgconfig').generate(
name : 'VDPAU',
filebase : 'vdpau',
version : '1.2',
description : 'The Video Decode and Presentation API for UNIX',
libraries : '-L${libdir} -lvdpau',
variables : 'moduledir=' + moduledir,
)
option('documentation',
type : 'combo',
choices : [ 'true', 'false', 'auto' ],
value : 'auto',
description : 'Build documentation')
option('dri2',
type : 'combo',
choices : [ 'true', 'false', 'auto' ],
value : 'auto',
description : 'Query driver name through DRI2')
option('moduledir',
type : 'string',
description : 'Module directory')
AM_CFLAGS = \
-I$(top_srcdir)/include \
-DVDPAU_MODULEDIR="\"$(moduledir)\"" \
-DVDPAU_SYSCONFDIR="\"$(sysconfdir)\"" \
$(X11_CFLAGS) \
$(XEXT_CFLAGS)
lib_LTLIBRARIES = libvdpau.la
libvdpau_la_SOURCES = \
vdpau_wrapper.c \
util.h \
$(DRI2_SOURCES)
if DRI2
AM_CFLAGS += \
$(dri2proto_CFLAGS)
DRI2_SOURCES = \
mesa_dri2.c \
mesa_dri2.h
endif
libvdpau_la_LIBADD = \
$(DLOPEN_LIBS) \
$(PTHREAD_LIBS) \
$(XEXT_LIBS)
libvdpau_la_LDFLAGS = -version-info 1:0:0 -no-undefined
libvdpauincludedir = $(includedir)/vdpau
libvdpauinclude_HEADERS = \
$(top_srcdir)/include/vdpau/vdpau.h \
$(top_srcdir)/include/vdpau/vdpau_x11.h
libvdpausysconfdir=$(sysconfdir)
dist_libvdpausysconf_DATA = vdpau_wrapper.cfg
x11 = dependency('x11')
libdl = cc.find_library('dl', required : false)
threads = dependency('threads')
vdpau_src = ['vdpau_wrapper.c']
if use_dri2
vdpau_src += ['mesa_dri2.c']
endif
vdpau = shared_library('vdpau',
sources : vdpau_src,
include_directories : inc,
dependencies : [x11, libdl, threads, dri2],
version : '1.0.0',
install : true,
)
install_data('vdpau_wrapper.cfg', install_dir : get_option('sysconfdir'))
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CFLAGS = $(X11_CFLAGS)
dlclose_LDADD = $(DLOPEN_LIBS) $(X11_LIBS)
TESTS = dlclose
check_PROGRAMS = $(TESTS)
......@@ -35,7 +35,7 @@ int main(void)
// is trying to test for.
int nOpenFDs = countOpenFDs();
void *libXext = dlopen("libXext.so.6", RTLD_LAZY);
void *libvdpau = dlopen("../src/.libs/libvdpau.so", RTLD_LAZY);
void *libvdpau = dlopen("src/libvdpau.so", RTLD_LAZY);
Display *dpy = XOpenDisplay(NULL);
VdpDeviceCreateX11 *pvdp_device_create_x11;
VdpDevice device;
......
dlclose = executable('dlclose', 'dlclose.c',
include_directories : inc,
dependencies : [x11, libdl])
test('dlclose', dlclose)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment