Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:3737] autoconf OSX

Date2003-12-11 05:42
Fromstevenyi
Subject[CSOUND-DEV:3737] autoconf OSX
Hi All,

I've started to use the sourceforge compile farm to try out compiles on
MacOSX (trying out their 10.1 OSX Server currently).  Due to troubles
running autotools, I did a make dist on the latest from cvs and moved it
over.  Running configure, I got a message that seemed alarming:

checking for supported operating system... configure: WARNING:
powerpc-apple-darwin5.5
configure: WARNING:  Unable to configure for your system automatically

Doing a build dies pretty early.  config.h doesn't have DARWIN defined. 
I tried manually editing the generated configure script to look for case
in darwin* instead of apple-darwin* and that seemed to have got the host
detection going fine. (I committed configure.ac in csound4 with that
change)

Running make dies pretty quickly.  I don't have more time tonight to
spend on this but I've attached what I got from running make below. 

steven




Making all in csound
make  all-am
source='main.c' object='libcsound_a-main.o' libtool=no \
depfile='.deps/libcsound_a-main.Po'
tmpdepfile='.deps/libcsound_a-main.TPo' \
depmode=gcc /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I. -I.    -DXMGDIR=\"/usr/local/share/csound\"
-DUSE_CSOUND_YIELD -g -O2 -Wall -malign-loops=4 -malign-jumps=4
-ffast-math -fomit-frame-pointer -finline-functions -funroll-loops
-I/usr/X11R6/include -c -o libcsound_a-main.o `test -f 'main.c' || echo
'./'`main.c
/usr/include/sys/cdefs.h:84: warning: redefinition of macro const
config.h:359: warning: this is the location of the previous definition
/usr/include/sys/cdefs.h:86: warning: redefinition of macro volatile
config.h:385: warning: this is the location of the previous definition
/usr/include/sys/types.h:97: typedef names cannot being mixed with other
type specifiers, found `long'
/usr/include/sys/types.h:98: typedef names cannot being mixed with other
type specifiers, found `int'
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode
cc1obj: Invalid option `align-loops=4'
cc1obj: Invalid option `align-jumps=4'
In file included from cs.h:33,
                 from main.c:24:
/usr/include/stdlib.h:64: warning: useless keyword or type name in empty
declaration
/usr/include/stdlib.h:64: warning: empty declaration
In file included from /usr/include/stdio.h:64,
                 from cs.h:34,
                 from main.c:24:
/usr/include/sys/types.h:97: warning: useless keyword or type name in
empty declaration
/usr/include/sys/types.h:97: warning: empty declaration
/usr/include/sys/types.h:98: warning: useless keyword or type name in
empty declaration
/usr/include/sys/types.h:98: warning: empty declaration
In file included from /usr/include/strings.h:57,
                 from sysdep.h:125,
                 from cs.h:36,
                 from main.c:24:
/usr/include/string.h:74: warning: conflicting types for built-in
function `memcmp'
/usr/include/string.h:75: warning: conflicting types for built-in
function `memcpy'
/usr/include/string.h:77: warning: conflicting types for built-in
function `memset'
make[2]: *** [libcsound_a-main.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1


Date2003-12-11 05:59
Fromstevenyi
Subject[CSOUND-DEV:3738] Re: autoconf OSX
Well, I ended up spending a little more time on this, this time using
the compile farm's OSX 10.2 server.  Doing another configure (disabling
X as the compile farm has Fink installed and most OSX users don't have
X) and running make this time got pretty far.  Compilation died in
pvoc.c, dpwelib.h, and other places.  The reason as I understand is that
the #ifdef's in these files have not yet been modified to work with the
DARWIN #define.  I'm not sure if it's as easy as adding a "||
defined(DARWIN)" in the same plcases where "|| defined (__FreeBSD__)". 
Will have to try again later!

steven

Date2003-12-11 06:49
FromJohn ffitch
Subject[CSOUND-DEV:3739] Re: autoconf OSX
I am confused.  I thought matt agreed that __MACH__ should be the correct 
macro.  I did not attempt the configuration stuff, but just got it to 
compile.  I am using 10.1
==John

Date2003-12-11 13:32
Fromramsdell@mitre.org (John D. Ramsdell)
Subject[CSOUND-DEV:3740] Re: autoconf OSX
John ffitch  writes:

> I am confused.  I thought matt agreed that __MACH__ should be the correct 
> macro.  I did not attempt the configuration stuff, but just got it to 
> compile.  I am using 10.1
> ==John

Steven, 

Please look at csound/autoheader.h.  It currently contains

#if defined DARWIN
#define MACOSX 1
#endif

but I think John and Matt are saying it should be

#if defined DARWIN
#define MACOSX 1
#define __MACH__ 1
#endif

(Or should MACOSX be left undefined, I'm not sure.)

I have not made any changes to this file in the repository, so you'll
have no conflicts should you want to check in changes.

John

Date2003-12-11 13:40
Fromramsdell@mitre.org (John D. Ramsdell)
Subject[CSOUND-DEV:3741] Re: autoconf OSX
stevenyi  writes:

> Hi All,
> 
> I've started to use the sourceforge compile farm to try out compiles
> on MacOSX (trying out their 10.1 OSX Server currently).  Due to
> troubles running autotools, I did a make dist on the latest from cvs
> and moved it over.  Running configure, I got a message that seemed
> alarming:
> 
> checking for supported operating system... configure: WARNING:
> powerpc-apple-darwin5.5
> configure: WARNING:  Unable to configure for your system automatically

This *is* pretty alarming.  The configure.ac script starts with

AC_MSG_CHECKING([for supported operating system])
case "$host_os" in
....
  darwin*)
    opsys=darwin
    AC_DEFINE([DARWIN], 1, [Define for the Mac OS X operating system.])
    ;;
...

and your message suggests that $host_os does not match the pattern
darwin*, but the message states that $host is powerpc-apple-darwin5.5!
Something is very wrong as $host_vendor should be apple, and $host_os
should be darwin5.5.

> (I committed configure.ac in csound4 with that change)

I did not see the change when I updated this morning.  Thanks for
pursing this.

John

Date2003-12-11 14:19
Fromramsdell@mitre.org (John D. Ramsdell)
Subject[CSOUND-DEV:3742] FLTK on Cygwin
I think the only thing wrong with the csound.exe program generated on
Cygwin with FLTK enabled is that output to stdout and stderr is being
dropped.  I now strongly suspect we are generating a WIN32 application
when we want to generate a console application.  Does anyone know the
ld flags used to force the generation of a console application on
Cygwin?  Here is what the FLTK documentation says:

http://fltk.org/doc-1.1/osissues.html#16_3

John

Date2003-12-11 15:46
Fromramsdell@mitre.org (John D. Ramsdell)
Subject[CSOUND-DEV:3743] Re: FLTK on Cygwin
ramsdell@mitre.org (John D. Ramsdell) writes:

> Does anyone know the ld flags used to force the generation of a
> console application on Cygwin?

I figured out the problem.  The fltk-config script assumes everyone
wants to build a WIN32 program when using FLTK on Cygwin, so it adds
-mwindows to the compiler and linker flags.  We need -mconsole when
building console csound.  I'm not quite sure how to fix the GNU build
system, but at least we're closer.

John

Date2003-12-11 20:53
From"Matt J. Ingalls"
Subject[CSOUND-DEV:3746] Re: autoconf OSX
do not #define __MACH__ ! it is already defined by the compiler or apple
or something.. as far as i understand, this is the best way to check if you
are compiling for OSX, so use #ifdef __MACH__ as your initial check.

-m