Building OSSv4 from source
- 1 Building the OSS sound system from source
- 1.1 Requirements to build the source code
- 1.2 Building the source
- 1.2.1 Obtain the OSS source
- 1.2.2 Make the source directory, current
- 1.2.3 Extract the source tarball
- 1.2.4 Create a build directory, and make it current
- 1.2.5 Run the configure script
- 1.2.6 Run make build
- 1.2.7 Packing Open Sound System (optional)
- 1.2.8 Installing the OSS kernel modules
- 1.3 Testing the Open Sound System
- 2 Errors during build
- 2.1 Error: Cannot open: No such file or directory
- 2.2 Error: Too many levels of symbolic links
- 2.3 Error: No such file or directory
- 2.4 Error: undefined reference to `oss_strcmp'
- 2.5 Error related to "warnings being treated as errors"
- 2.6 Error: /bin/sh: scripts/mod/modpost: No such file or directory
- 2.7 Error: cp: cannot stat `lib/libsalsa/.libs/libsalsa.so.2.0.0': No such file or directory
Building the OSS sound system from source
Requirements to build the source code
- OS: Linux 2.6+, Solaris v10+, FreeBSD 6+, UnixWare7
- OS system headers, development libraries
- Compiler: GCC, Sun Studio 10+, UnixWare C Compiler
- Tools: GNU gawk - (Solaris versions at: http://www.sun.com/software/solaris/freeware/s10pkgs_download.xml) (used for creating man pages)
- Graphics Libraries: Runtime libraries and header files for GTK1 or for GTK2 (used by ossxmix)
Building the source
Basic use of the build system is close to autoconf ("configure && make && make install"), with one very important difference: The OSS build system must use separate build and source directories (unlike GNU autoconf where both are mixed), so a command like "./configure" will NOT work. These instructions will show how it's used.
Obtain the OSS source
Mercurial repository - requires mercurial to get the source, e.g.
hg clone http://mercurial.opensound.com
Make the source directory, current
Extract the source tarball
tar -xvjf ~/oss-v*.tar.bz2
if you're using mercurial, instead use the repository you have cloned previously:
mv mercurial.opensound.com /usr/src/oss
Create a build directory, and make it current
rm -rf ~/oss mkdir ~/oss cd ~/oss
Do not use a directory which is a subdirectory of the extracted source - the configure script will fail. Also, the build directory must be empty.
Run the configure script
Note that the configure script must be invoked using a full pathname. OSSv4.0's configure script will fail if a relative pathname is used.
Notable configure switches
- GTK1 environment variable: Force use of GTK1 for ossxmix rather than GTK2.
- NO_WARNING_CHECKS env var: don't use -Werror and -Wall flags.
- --only-drv=[list]: Compile only the drivers listed in the comma delimited list.
- --config-vmix=FIXEDPOINT: Use only int arithmetic for vmix. (Useful on Linux/geode systems).
- --enable-libsalsa=NO switch: Dpn't build libsalsa (Linux only).
Run make build
Packing Open Sound System (optional)
The package target creates a native package for the currently compiled-for OS. On Linux an RPM package will be generated.
There are two alternative targets when compiling for the Linux OS:
- make tarball
- make deb
Installing the OSS kernel modules
The kernel modules are build during a separate phase of the installation. It is necessary to become root to build the kernel modules:
su root make install
This will create the appropriate kernel modules, and the Open Sound System tools.
Installation is now complete.
Testing the Open Sound System
To test the Open Sound System:
Errors during build
Error: Cannot open: No such file or directory
This error can occur when tar tries to extract to /usr/src but doesn't have write permissions.
bunzip2 -c /tmp/oss-v4.1-build*-src-gpl.tar.bz2 | tar xvf - oss-v4.1-build080509-src-gpl/RELNOTES.txt tar: oss-v4.1-build080509-src-gpl/RELNOTES.txt: Cannot open: No such file or directory tar: Error exit delayed from previous errors
Use a directory which you have write permissions to, or change to root (su/sudo), or change /usr/src permissions to allow writing.
This error may occur when the configure script is being run within a subdirectory of the project directory:
# This may produce an error cd ~/oss-v* mkdir build cd build ../configure
This produces an error:
../build/cmd/.config: Too many levels of symbolic links
Use a build directory outside of the current project directory:
cd mkdir oss cd oss /usr/src/oss/oss-v*/configure
Error: No such file or directory
The configure script must be invoked using a full pathname. This error occurs, if a relative pathname is used. This restriction does not apply to 4.1.
Scanning . Scanning ./cmd Scanning ./cmd/ossdevlinks ./cmd/ossdevlinks/ossdevlinks.c: No such file or directory
Invoke the configure script with a full pathname.
Error: undefined reference to `oss_strcmp'
ossdevlinks.c:(.text+0x21c): undefined reference to `oss_strcmp'
You probably have had CFLAGS, OSFLAGS or LIBRARIES set in the environment before running configure. The best option is to unset them all and not to try to pass manual flags via configure - it's unlikely any flags will provide any performance gain at all, and far more likely they'll make the compilation fail somewhere.
cc1: warnings being treated as errors
OSS compile uses -Wall and -Werror. A few compilers/headers may be more strict than the usual, causing the compile to fail. Set the NO_WARNING_CHECKS environment variable when calling configure to avoid this.
Error: /bin/sh: scripts/mod/modpost: No such file or directory
This error may occur during "make install". The error occurs because the kernel headers scripts have not been built.
Build the kernel header scripts as follows:
cd /usr/src/linux make scripts
Error: cp: cannot stat `lib/libsalsa/.libs/libsalsa.so.2.0.0': No such file or directory
This error occurs during compilation.
This error can be safely ignored.