Subject: [ecasound] Porting ecasound to FreeBSD 4.1
From: Antoine Beaupre (beaupran@IRO.UMontreal.CA)
Date: Thu Oct 19 2000 - 20:24:51 EEST
Hi!
I'm trying to port ecasound 1.8.2r14 to FreeBSD. I have succeeded in
compiling ecasound in itself, but only after a few hacks. Here are the
modifications I made to the dist in order to have it compile on FreeBSD:
[the first diff is for configure to recognize the oddness of freebsd
pthread compilation process, some of it have been taken from licq's
configure script]
diff -rc ecasound-1.8.2r14/configure.in
ecasound-1.8.2r14.port/configure.in
*** ecasound-1.8.2r14/configure.in Sat Sep 16 06:35:00 2000
--- ecasound-1.8.2r14.port/configure.in Wed Oct 18 15:54:35 2000
***************
*** 55,60 ****
--- 55,85 ----
CXXFLAGS="-O2 -D_REENTRANT -DNDEBUG -ffast-math -fstrict-aliasing
-funroll-loo
ps"
dnl CXXFLAGS="-O2 -D_REENTRANT -fomit-frame-pointer -finline-functions
-ffast-
math -funroll-loops -Wall -Wstrict-prototypes -pedantic -fstrict-aliasing"
+ dnl Set up some operating system specific options
+ case "$host" in
+ *-*-openbsd*)
+ CFLAGS="$CFLAGS -pthread"
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ CXXFLAGS="$CXXFLAGS -pthread"
+ echo "Setting OpenBSD compilation options"
+ ;;
+ *-*-freebsd*)
+ CFLAGS="$CFLAGS -pthread"
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+ CXXFLAGS="$CXXFLAGS -pthread"
+ echo "Setting FreeBSD compilation options"
+ ;;
+ *-*-solaris*)
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -DUS
E_SOLARIS -DPIC -fPIC"
+ echo "Setting Solaris compilation options"
+ ;;
+ *-*-linux*)
+ CPPFLAGS="$CPPFLAGS -fPIC -DPIC -D_REENTRANT"
+ echo "Setting Linux compilation options"
+ ;;
+ esac
+
+
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging (default = no)],
include_debug=yes)
***************
*** 106,114 ****
dnl ---
dnl POSIX.4 threads
dnl ---
! AC_CHECK_LIB(pthread,pthread_create, ,
! AC_CHECK_LIB(c_r,pthread_create,
! LDFLAGS="-pthreads",
AC_MSG_ERROR([** POSIX.4 threads not installed or broken
**])))
dnl ---
--- 131,140 ----
dnl ---
dnl POSIX.4 threads
dnl ---
!
! dnl AC_CHECK_LDFLAG(-pthread,pthread_create, LDFLAGS="-pthread",
! AC_CHECK_LIB(pthread,pthread_create, [],
! AC_CHECK_LIB(c_r,pthread_create, [],
AC_MSG_ERROR([** POSIX.4 threads not installed or broken
**])))
dnl ---
These other diffs are simply porting. I don't know why it does not compile
without the patch, but it gcc says something like "parse error before ::"
diff -rc ecasound-1.8.2r14/libecasound/audioio-cdr.cpp
ecasound-1.8.2r14.port/li
becasound/audioio-cdr.cpp
*** ecasound-1.8.2r14/libecasound/audioio-cdr.cpp Mon Jun 5
16:49:23 2000
--- ecasound-1.8.2r14.port/libecasound/audioio-cdr.cpp Thu Oct 12
00:55:45 2000
***************
*** 108,115 ****
}
bool CDRFILE::finished(void) const {
! if (::ferror(fobject) ||
! ::feof(fobject))
return true;
return false;
--- 108,115 ----
}
bool CDRFILE::finished(void) const {
! if (ferror(fobject) ||
! feof(fobject))
return true;
return false;
diff -rc ecasound-1.8.2r14/libecasound/eca-fileio-stream.cpp
ecasound-1.8.2r14.p
ort/libecasound/eca-fileio-stream.cpp
*** ecasound-1.8.2r14/libecasound/eca-fileio-stream.cpp Mon Jun 5
16:49:23 2000
--- ecasound-1.8.2r14.port/libecasound/eca-fileio-stream.cpp Thu Oct 12
02:46
:11 2000
***************
*** 74,86 ****
long int ECA_FILE_IO_STREAM::file_bytes_processed(void) const {
return(bytes_r
ep); }
bool ECA_FILE_IO_STREAM::is_file_ready(void) const {
! if (::feof(f1) ||
! ::ferror(f1)) return(false);
return(true);
}
bool ECA_FILE_IO_STREAM::is_file_error(void) const {
! if (::ferror(f1)) return(true);
return(false);
}
--- 74,86 ----
long int ECA_FILE_IO_STREAM::file_bytes_processed(void) const {
return(bytes_r
ep); }
bool ECA_FILE_IO_STREAM::is_file_ready(void) const {
! if (feof(f1) ||
! ferror(f1)) return(false);
return(true);
}
bool ECA_FILE_IO_STREAM::is_file_error(void) const {
! if (ferror(f1)) return(true);
return(false);
}
So now I can run ecasound properly:
$ ecasound -c
****************************************************************************
* ecasound v1.8.2r14 (C) 1997-2000 Kai Vehmanen
*
****************************************************************************
(eca-session) Interactive mode enabled.
(eca-static-object-maps) Internal-plugin directory not found. Check your
~/.ecasoundrc!
ecasound ('h' for help)>
Yay. But I do not like the text interface. Also, I'm curious about the
other programs that appear with ecasound. So I'm trying to compile
ecawave:
shall# ./configure --prefix=/usr/X11R6
[...]
checking for libecasound... checking for main in -lecasound... no
configure: error: ** libecasound not installed/found **
Woops. config.log tells me:
configure:1399: checking for main in -lecasound
configure:1414: gcc -o conftest -g -O2 conftest.c -lecasound -lkvutils
1>&5
/usr/libexec/elf/ld: cannot find -lecasound
configure: failed program was:
#line 1407 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
Hum. Can't find libecasound??? But it's there alright:
shall# ldconfig -r | grep ecasound
search
directories: /usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib:/usr/local/lib/ecasound-plugins
255:-lecasound.6 => /usr/local/lib/libecasound.so.6
258:-laudioio_af.0 =>
/usr/local/lib/ecasound-plugins/libaudioio_af.so.0
[...]
I don't understand. There are also strange things happening during
ecasound's compilation. When linking:
c++ -O2 -D_REENTRANT -DNDEBUG -ffast-math -fstrict-aliasing -funroll-loops
-pthr
ead -o ecasound eca-text.o textdebug.o -lncurses -L../libecasound/.libs
-lecasou
nd -L../kvutils/.libs -lkvutils -lhistory -lreadline -lc_r -lm
../libecasound/.libs/libecasound.so: warning: tmpnam() possibly used
unsafely; c
onsider using mkstemp()
/usr/lib/libc.so.4: WARNING! setkey(3) not present in the system!
/usr/lib/libc.so.4: warning: this program uses gets(), which is unsafe.
/usr/lib/libc.so.4: warning: mktemp() possibly used unsafely; consider
using mks
temp()
/usr/lib/libc.so.4: WARNING! des_setkey(3) not present in the system!
/usr/lib/libc.so.4: WARNING! encrypt(3) not present in the system!
/usr/lib/libc.so.4: warning: this program uses f_prealloc(), which is
stupid.
/usr/lib/libc.so.4: WARNING! des_cipher(3) not present in the system!
/usr/lib/libc.so.4: warning: tempnam() possibly used unsafely; consider
using mk
stemp()
gmake[2]: Leaving directory
`/u/anarcat/src/port/ecasound-1.8.2r14/ecasound'
I was wondering wether it was because "-D_THREAD_SAFE" wasn't included on
the command line, but then again, preprocessing is already done right?
I've never seen such a warning on my machine, and it may be my OS that's
going crazy. I you think this is so, I will ask my question elsewhere.
But please, help... I really need a multitrack record on my UNIX machine
and ecasound seems to be THE one. :)
Thanks for your help,
A.
Here are some supplemental information on my machine (gcc, uname, etc)
bash-2.04# libtool --version
ltmain.sh (GNU libtool) 1.3.4-freebsd-ports (1.385.2.196
1999/12/07 21:47:57)
bash-2.04# ar -V
GNU ar 2.10.0
Copyright 1997, 98, 99, 2000 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the
terms of
the GNU General Public License. This program has absolutely no
warranty.
bash-2.04# gcc
-v
Using builtin specs.
gcc version 2.95.2 19991024 (release)
bash-2.04# uname -a
FreeBSD shall.anarcat.yi.org 4.1.1-STABLE FreeBSD 4.1.1-STABLE #0: Tue Oct
17 10:52:04 EDT 2000 root@:/usr/src/sys/compile/HALL i386
bash-2.04#
Si l'image donne l'illusion de savoir
C'est que l'adage pretend que pour croire,
L'important ne serait que de voir
Lofofora
-- To unsubscribe send message 'unsubscribe' in the body of the message to <ecasound-list-request@wakkanet.fi>.
This archive was generated by hypermail 2b28 : Thu Oct 19 2000 - 20:33:28 EEST