Hi,
I've attached the patches that are used for building the Debian openal-soft
packages. I've attached them in the order that they are applied so they can be
more easily reviewed. I've ensured that these patches apply cleanly to git HEAD.
The first patch (install-alsoft.conf.patch) is used to optionally install
alsoftrc.sample as a configuration file in /etc/openal/alsoft.conf. It is optional
and must be set so that someone who may be building and installing the openal-
soft libraries directly from a source tarball don't get their alsoft.conf file
overwritten unintentionally.
The second patch applies right after the first and is used to install an openal-
config script and corresponding manpage. I don't know if this is really
necessary, but it seems that there are still programs out there that rely on
openal-config. See [1].
The third patch adds the actual openal-config script. You may need to set the
execute bit on the file after it's applied.
The fourth patch adds the manpage for openal-config.
The fifth patch is used to allow Debian packages to build the static library. I'm
not sure if this is necessary still. In any case, it applies after applying all
other patches.
1.
http://www.linuxquestions.org/questions/linux-software-2/openal-config-718012/--
Regards,
Andres
[install-alsoft.conf.patch]
Patch to optionally install alsoft.conf file
==========================================================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,8 @@
OPTION(EXAMPLES "Build example programs" ON)
+OPTION(ALSOFT_CONFIG "Install alsoft.conf configuration file" OFF)
+
IF(WIN32)
SET(LIBNAME OpenAL32)
@@ -406,6 +408,13 @@
INSTALL(FILES "${OpenAL_BINARY_DIR}/admin/pkgconfig/openal.pc"
DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+# Install alsoft.conf configuration file
+IF(ALSOFT_CONFIG)
+ INSTALL(FILES alsoftrc.sample DESTINATION /etc/openal
+ RENAME alsoft.conf
+ )
+ENDIF()
+
IF(EXAMPLES)
ADD_EXECUTABLE(openal-info examples/openal-info.c)
TARGET_LINK_LIBRARIES(openal-info ${LIBNAME})
[install-openal-config.patch]
Modify CMakeLists.txt to install openal-config.
==========================================================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -362,13 +362,17 @@
# This is always available
SET(BACKENDS "${BACKENDS} WaveFile")
-# Needed for openal.pc.in
+# Needed for openal.pc.in and openal-config
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix "\${prefix}")
SET(libdir "\${exec_prefix}/${LIB_INSTALL_DIR}")
SET(bindir "\${exec_prefix}/bin")
SET(includedir "\${prefix}/include")
SET(PACKAGE_VERSION "${LIB_VERSION}")
+EXECUTE_PROCESS(COMMAND date +%Y-%m-%d
+ OUTPUT_VARIABLE date_var
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+SET(DATE ${date_var})
# End configuration
CONFIGURE_FILE(
@@ -378,6 +382,14 @@
"${OpenAL_SOURCE_DIR}/admin/pkgconfig/openal.pc.in"
"${OpenAL_BINARY_DIR}/admin/pkgconfig/openal.pc"
@ONLY)
+CONFIGURE_FILE(
+ "${OpenAL_SOURCE_DIR}/admin/openal-config.in"
+ "${OpenAL_BINARY_DIR}/admin/openal-config"
+ @ONLY)
+CONFIGURE_FILE(
+ "${OpenAL_SOURCE_DIR}/admin/openal-config.1.in"
+ "${OpenAL_BINARY_DIR}/admin/openal-config.1"
+ @ONLY)
ADD_DEFINITIONS(-DAL_BUILD_LIBRARY)
@@ -407,6 +419,10 @@
)
INSTALL(FILES "${OpenAL_BINARY_DIR}/admin/pkgconfig/openal.pc"
DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+INSTALL(FILES "${OpenAL_BINARY_DIR}/admin/openal-config"
+ DESTINATION bin)
+INSTALL(FILES "${OpenAL_BINARY_DIR}/admin/openal-config.1"
+ DESTINATION /usr/share/man/man1)
# Install alsoft.conf configuration file
IF(ALSOFT_CONFIG)
[add-openal-config.patch]
Add openal-config.in file
==========================================================================
--- /dev/null
+++ b/admin/openal-config.in
@@ -0,0 +1,173 @@
+#!/bin/sh
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+bindir="@bindir@"
+includedir="@includedir@"
+libdir="@libdir@"
+PACKAGE_VERSION="@PACKAGE_VERSION@"
+
+openal_dynamic_ldflags="-lopenal"
+openal_static_ldflags="-lopenal"
+
+prefix_set=no
+echo_prefix=no
+exec_prefix_set=no
+echo_exec_prefix=no
+bindir_set=no
+echo_bindir=no
+includedir_set=no
+echo_includedir=no
+libdir_set=no
+echo_libdir=no
+echo_version=no
+echo_cflags=no
+static_libs=no
+echo_libs=no
+
+usage()
+{
+ cat <<EOF 1>&2
+Usage: openal-config [OPTIONS]
+Options:
+ --prefix[=DIR] print/set default prefix
+ --exec-prefix[=DIR] print/set prefix for machine-specific files
+ --bindir[=DIR] print/set prefix for executable programs
+ --includedir[=DIR] print/set prefix for include files
+ --libdir[=DIR] print/set prefix for libraries
+ --version print OpenAL package version
+ --cflags print flags for C compiler
+ --static specify that static linker flags are wanted
+ --libs print flags for linker
+EOF
+ exit 1
+}
+
+if test $# -eq 0; then
+ usage
+fi
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg="" ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix="${optarg}"
+ prefix_set="yes"
+ ;;
+ --prefix)
+ echo_prefix="yes"
+ ;;
+ --exec-prefix=*)
+ exec_prefix="${optarg}"
+ exec_prefix_set="yes"
+ ;;
+ --exec-prefix)
+ echo_exec_prefix="yes"
+ ;;
+ --bindir=*)
+ bindir="${optarg}"
+ bindir_set="yes"
+ ;;
+ --bindir)
+ echo_bindir="yes"
+ ;;
+ --includedir=*)
+ includedir="${optarg}"
+ includedir_set="yes"
+ ;;
+ --includedir)
+ echo_includedir="yes"
+ ;;
+ --libdir=*)
+ libdir="${optarg}"
+ libdir_set="yes"
+ ;;
+ --libdir)
+ echo_libdir="yes"
+ ;;
+ --version)
+ echo_version="yes"
+ ;;
+ --cflags)
+ echo_cflags="yes"
+ ;;
+ --static)
+ static_libs="yes"
+ ;;
+ --libs)
+ echo_libs="yes"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ shift
+done
+
+if test "${echo_prefix}" = "yes"; then
+ echo "${prefix}"
+fi
+
+if test "${exec_prefix_set}" = "no" && test "${prefix_set}" = "yes"; then
+ exec_prefix="$prefix"
+ exec_prefix_set="yes"
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+ echo "${exec_prefix}"
+fi
+
+if test "${bindir_set}" = "no" && test "${exec_prefix_set}" = "yes"; then
+ bindir="${exec_prefix}/bin"
+fi
+
+if test "$echo_bindir" = "yes"; then
+ echo "${bindir}"
+fi
+
+if test "${includedir_set}" = "no" && test "${prefix_set}" = "yes"; then
+ includedir="${prefix}/include"
+fi
+
+if test "$echo_includedir" = "yes"; then
+ echo "${includedir}"
+fi
+
+if test "${libdir_set}" = "no" && test "${exec_prefix_set}" = "yes"; then
+ libdir="${exec_prefix}/lib"
+fi
+
+if test "$echo_libdir" = "yes"; then
+ echo "${libdir}"
+fi
+
+if test "$echo_version" = "yes"; then
+ echo "${PACKAGE_VERSION}"
+fi
+
+if test "$echo_cflags" = "yes"; then
+ if test "${includedir}" = "/usr/include" ; then
+ incpath=""
+ else
+ incpath="-I${includedir}"
+ fi
+ echo "${incpath}"
+fi
+
+if test "$echo_libs" = "yes"; then
+ if test "${libdir}" = "/usr/lib" ; then
+ libpathflag=""
+ else
+ libpathflag="-L${libdir}"
+ fi
+ if test "${static_libs}" = "yes"; then
+ ldflags="${openal_static_ldflags}"
+ else
+ ldflags="${openal_dynamic_ldflags}"
+ fi
+ echo "${libpathflag} ${ldflags}"
+fi
[add-openal-config-manpage.patch]
Add the openal-config manpage.
==========================================================================
--- /dev/null
+++ b/admin/openal-config.1.in
@@ -0,0 +1,57 @@
+.TH openal-config 1 "@DATE@" "@PACKAGE_VERSION@"
+.SH NAME
+openal-config \- script to get information about the installed version of OpenAL
+.SH SYNOPSIS
+.B openal-config
+[ \-\-prefix=\fIDIR\fR ]
+[ \-\-exec-prefix=\fIDIR\fR ]
+[ \-\-version ] [ \-\-cflags ] [ \-\-libs ]
+.SH DESCRIPTION
+.B openal-config
+is a tool that is used to configure and determine the compiler and linker flags
+that should be used to compile and link programs and libraries that use OpenAL.
+.SH OPTIONS
+.TP
+.B \-\-cflags
+Print the compiler flags that are necessary to compile a program or library that
+uses OpenAL.
+.TP
+.BI \-\-exec\-prefix= DIR
+If specified, use \fIDIR\fR instead of the installation exec prefix that OpenAL
+was built with when computing the output for the \-\-cflags and \-\-libs
+options. This option must be specified before any of the \-\-cflags and \-\-libs
+options.
+.TP
+.B \-\-libs
+Print the linker flags that are necessary to link a program or library that uses
+OpenAL.
+.TP
+.BI \-\-prefix= DIR
+If specified, use \fIDIR\fR instead of the installation prefix that OpenAL was
+built with when computing the output for the \-\-cflags and \-\-libs options.
+If \-\-exec\-prefix was not specified, \fIDIR\fR is also used as exec prefix.
+This option must be specified before any of the \-\-cflags and \-\-libs options.
+.TP
+.B \-\-version
+Prints the currently installed version of OpenAL on standard output.
+.SH EXAMPLES
+.PP
+To compile a C source file for use in an executable program that uses OpenAL,
+type a command like this:
+.IP
+.B gcc $(openal\-config \-\-cflags) \-c main.c \-o main.o
+.PP
+To link the resulting object file into an executable program, use a command like
+the following:
+.IP
+.B gcc \-o my_app main.o util.o $(openal\-config \-\-libs)
+.SH AUTHOR
+OpenAL was written by Juan Carlos Arevalo Baeza, Jonathan Blow, Keith Charley,
+Scott Draeker, John Grantham, Jacob Hawley, Garin Hiebert, Carlos Hasan, Nathan
+Hill, Bill Huey, Mike Jarosch, Jean-Marc Jot, Maxim Kizub, John Kraft, Bernd
+Kreimeier, Ian Ollmann, Rick Overman, Sean L. Palmer, Sven Panne, Pierre
+Phaneuf, Terry Sikes, Joseph Valenzuela, Michael Vance, Carlo Vogelsang, and
+Chris Robinson.
+.PP
+This manual page was written by Thierry Reding for the Debian Project (but may
+be used by others).
[static_lib.patch]
Support building of static libraries
=====================================================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,9 @@
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
+# Add option to build static libraries
+OPTION(BUILD_STATIC "build static library too" OFF)
+
OPTION(ALSA "Check for ALSA backend" ON)
OPTION(OSS "Check for OSS backend" ON)
@@ -406,6 +409,21 @@
TARGET_LINK_LIBRARIES(${LIBNAME} ${EXTRA_LIBS})
+# Build static libraries if specified
+IF(BUILD_STATIC)
+ # we can't create a static library with the same name
+ # as the shared one, so we use OUTPUT_NAME
+ ADD_LIBRARY(openal_static STATIC ${OPENAL_OBJS} ${ALC_OBJS})
+ SET_TARGET_PROPERTIES(openal_static PROPERTIES OUTPUT_NAME ${LIBNAME})
+ IF(WIN32)
+ SET_TARGET_PROPERTIES(openal_static PROPERTIES PREFIX "")
+ ENDIF()
+ TARGET_LINK_LIBRARIES(openal_static ${EXTRA_LIBS})
+ INSTALL(TARGETS openal_static
+ ARCHIVE DESTINATION lib
+ )
+ENDIF(BUILD_STATIC)
+
# Add an install target here
INSTALL(TARGETS ${LIBNAME}
RUNTIME DESTINATION bin
_______________________________________________
Openal-devel mailing list
Openal-devel@...
http://opensource.creative.com/mailman/listinfo/openal-devel