diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2018-02-24 08:19:04 -0800 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2019-02-28 11:00:09 -0800 |
commit | 309249599cd05ce5ff93750ffbaa452567bf7caa (patch) | |
tree | 3fd7bd1b4052f6fac0c04b78a10824a367fc7b6c | |
parent | eac1393480bc7c2209d4984819951cb9dc1e03d0 (diff) |
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: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r-- | .gitignore | 29 | ||||
-rw-r--r-- | INSTALL | 0 | ||||
-rw-r--r-- | Makefile.am | 13 | ||||
-rw-r--r-- | NEWS | 0 | ||||
-rw-r--r-- | README | 0 | ||||
-rw-r--r-- | acinclude.m4 | 46 | ||||
-rwxr-xr-x | autogen.sh | 14 | ||||
-rw-r--r-- | configure.ac | 92 | ||||
-rw-r--r-- | doc/Doxyfile.in (renamed from doc/Doxyfile) | 10 | ||||
-rw-r--r-- | doc/Makefile.am | 28 | ||||
-rw-r--r-- | doc/meson.build | 22 | ||||
-rw-r--r-- | include/meson.build | 1 | ||||
-rw-r--r-- | meson.build | 58 | ||||
-rw-r--r-- | meson_options.txt | 13 | ||||
-rw-r--r-- | src/Makefile.am | 36 | ||||
-rw-r--r-- | src/meson.build | 19 | ||||
-rw-r--r-- | test/.gitignore | 1 | ||||
-rw-r--r-- | test/Makefile.am | 6 | ||||
-rw-r--r-- | test/dlclose.c | 2 | ||||
-rw-r--r-- | test/meson.build | 4 | ||||
-rw-r--r-- | trace/Makefile.am | 18 | ||||
-rw-r--r-- | trace/meson.build | 8 | ||||
-rw-r--r-- | vdpau.pc.in | 12 |
23 files changed, 131 insertions, 301 deletions
diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 4705784..0000000 --- a/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -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 diff --git a/INSTALL b/INSTALL deleted file mode 100644 index e69de29..0000000 --- a/INSTALL +++ /dev/null diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index d256cc3..0000000 --- a/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -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 diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index a275cee..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,46 +0,0 @@ -# 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 diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index c896097..0000000 --- a/autogen.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /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 diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 5df6abb..0000000 --- a/configure.ac +++ /dev/null @@ -1,92 +0,0 @@ -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]) diff --git a/doc/Doxyfile b/doc/Doxyfile.in index 1f1a4fc..a179da6 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile.in @@ -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 diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index b5f96cd..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -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 diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000..c00894e --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,22 @@ +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 diff --git a/include/meson.build b/include/meson.build new file mode 100644 index 0000000..40c5c75 --- /dev/null +++ b/include/meson.build @@ -0,0 +1 @@ +install_subdir('vdpau', install_dir : 'include') diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..cd17ed4 --- /dev/null +++ b/meson.build @@ -0,0 +1,58 @@ +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, +) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..c4e84b5 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,13 @@ +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') diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 8d28bb4..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -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 diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..9bb253a --- /dev/null +++ b/src/meson.build @@ -0,0 +1,19 @@ +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')) diff --git a/test/.gitignore b/test/.gitignore deleted file mode 100644 index 50254bd..0000000 --- a/test/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dlclose diff --git a/test/Makefile.am b/test/Makefile.am deleted file mode 100644 index 7cbbd8c..0000000 --- a/test/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = $(X11_CFLAGS) -dlclose_LDADD = $(DLOPEN_LIBS) $(X11_LIBS) - -TESTS = dlclose -check_PROGRAMS = $(TESTS) diff --git a/test/dlclose.c b/test/dlclose.c index 3999c0e..0830c8d 100644 --- a/test/dlclose.c +++ b/test/dlclose.c @@ -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; diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000..006f67d --- /dev/null +++ b/test/meson.build @@ -0,0 +1,4 @@ +dlclose = executable('dlclose', 'dlclose.c', + include_directories : inc, + dependencies : [x11, libdl]) +test('dlclose', dlclose) diff --git a/trace/Makefile.am b/trace/Makefile.am deleted file mode 100644 index d134446..0000000 --- a/trace/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -AM_CXXFLAGS = \ - -I$(top_srcdir)/include \ - $(X11_CFLAGS) - -module_LTLIBRARIES = libvdpau_trace.la - -libvdpau_trace_la_SOURCES = \ - vdpau_trace.cpp - -libvdpau_trace_la_LIBADD = \ - $(DLOPEN_LIBS) - -libvdpau_trace_la_LDFLAGS = -version-info 1:0:0 -module -no-undefined - -libvdpau_traceincludedir = $(includedir)/vdpau -libvdpau_traceinclude_HEADERS = \ - $(top_srcdir)/include/vdpau/vdpau.h \ - $(top_srcdir)/include/vdpau/vdpau_x11.h diff --git a/trace/meson.build b/trace/meson.build new file mode 100644 index 0000000..5381b8b --- /dev/null +++ b/trace/meson.build @@ -0,0 +1,8 @@ +trace = shared_library('vdpau_trace', + sources : 'vdpau_trace.cpp', + include_directories : inc, + dependencies : libdl, + version : '1.0.0', + install : true, + install_dir : moduledir, +) diff --git a/vdpau.pc.in b/vdpau.pc.in deleted file mode 100644 index e48f665..0000000 --- a/vdpau.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -moduledir=@moduledir@ - -Name: VDPAU -Description: The Video Decode and Presentation API for UNIX -Version: @PACKAGE_VERSION@ -Requires.private: x11 -Cflags: -I${includedir} -Libs: -L${libdir} -lvdpau |