unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Guile on Mac OS X
@ 2002-08-04 12:34 Michael Tuexen
  2002-08-04 18:21 ` Rob Browning
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tuexen @ 2002-08-04 12:34 UTC (permalink / raw)


Dear all,

I found three problems when building guile 1.5.6 on Mac OS X.

1. In gc_os_dep.c line 242 I had to use __APPLE__.
    Could anyone fix this for upcoming releases?

2. The configure does not detect the sleep/usleep declarations. They
    are available but are not detected. So there is a type conflict in
    scmsigs.c. Does anyone knows why the configure script fails to
    detect the declarions?

3. I have to use manually --disable-shared for the configure script and
    must set CFLAGS=-no-cpp-precomp. Could someone put in the platform
    specific gcc flag in the configure.in file.

Thank you very much for your support.

Best regards
Michael

--
Michael.Tuexen@micmac.franken.de


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
  2002-08-04 12:34 Guile on Mac OS X Michael Tuexen
@ 2002-08-04 18:21 ` Rob Browning
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Browning @ 2002-08-04 18:21 UTC (permalink / raw)
  Cc: guile-devel

Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:

> I found three problems when building guile 1.5.6 on Mac OS X.
>
> 1. In gc_os_dep.c line 242 I had to use __APPLE__.
>     Could anyone fix this for upcoming releases?

Hmm.  I'd be happy to, but first, I see we're using macosx there.
Anyone know why that's not being defined, or is that not the "offical"
macosx tag for configure (if there is one yet)...

Could you run ./config.guess and see what it says?

> 2. The configure does not detect the sleep/usleep declarations. They
>     are available but are not detected. So there is a type conflict in
>     scmsigs.c. Does anyone knows why the configure script fails to
>     detect the declarions?

My guess is that there's a extra header needed or something similar on
macosx that's not getting included when the test runs.  I usually have
to look at the config.log and/or play with the actual configure.in to
see what's going on.  You might be able to put an exit 1 into the
configure.in just after that test so you can find the result easier in
the log.

> 3. I have to use manually --disable-shared for the configure script and
>     must set CFLAGS=-no-cpp-precomp. Could someone put in the platform
>     specific gcc flag in the configure.in file.

How to handle this will probably depend on the answer to 1 above.
What does -no-cpp-precomp do?

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
       [not found] <87znw2xy71.fsf@raven.i.defaultvalue.org>
@ 2002-08-04 18:59 ` Michael Tuexen
  2002-08-05  5:24   ` Rob Browning
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tuexen @ 2002-08-04 18:59 UTC (permalink / raw)


Rob,

thank you for your response. I looked a bit into this. Maybe some
can give me a hint...

The output of the configure script is

checking for crypt in -lcrypt... no
checking for strptime declaration... yes
checking for sleep declaration... no
checking for usleep declaration... no

But the declarations are there. See

[Powerbook:~/guile-1.5.6] tuexen% grep strptime /usr/include/time.h
char *strptime __P((const char *, const char *, struct tm *));
[Powerbook:~/guile-1.5.6] tuexen% grep sleep /usr/include/unistd.h
unsigned int     sleep __P((unsigned int));
int      usleep __P((unsigned int));
[Powerbook:~/guile-1.5.6] tuexen% grep usleep /usr/include/unistd.h
int      usleep __P((unsigned int));
[Powerbook:~/guile-1.5.6] tuexen%

The config.log gives no read help:

configure:10836: result: no
configure:10855: checking for strptime declaration
configure:10875: result: yes
configure:10884: checking for sleep declaration
configure:10904: result: no
configure:10913: checking for usleep declaration
configure:10933: result: no

The code in the configure.in is the following

### Some systems don't declare some functions.  On such systems, we
### need to at least provide our own K&R-style declarations.

### GUILE_FUNC_DECLARED(function, headerfile)

### Check for a declaration of FUNCTION in HEADERFILE; if it is
### not there, #define MISSING_FUNCTION_DECL.
AC_DEFUN(GUILE_FUNC_DECLARED, [
   AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
     AC_EGREP_HEADER($1, $2,
                     guile_cv_func_$1_declared=yes,
                     guile_cv_func_$1_declared=no))
   if test [x$guile_cv_func_]$1[_declared] = xno; then
     AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL])
   fi
])

GUILE_FUNC_DECLARED(strptime, time.h)
GUILE_FUNC_DECLARED(sleep, unistd.h)
GUILE_FUNC_DECLARED(usleep, unistd.h)

Any help is welcome.

Best regards
Michael

On Sonntag, Aug 4, 2002, at 20:42 Europe/Berlin, Rob Browning wrote:

> Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:
>
>> see my comments below.
>
> Thanks.  I'll look at this in a bit.  BTW, in general, if you don't
> mind, it might be better to send info like this to the list -- that
> way if I drop the ball (get too busy or whatever), someone else will
> be able to fix the problem.
>
> No big deal either way.
>
> -- 
> Rob Browning
> rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
> Previously @cs.utexas.edu
> GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD
>
>
--
Michael.Tuexen@micmac.franken.de


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
  2002-08-04 18:59 ` Michael Tuexen
@ 2002-08-05  5:24   ` Rob Browning
  2002-08-05  7:44     ` Michael Tuexen
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Browning @ 2002-08-05  5:24 UTC (permalink / raw)
  Cc: guile-devel

Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:

> ### GUILE_FUNC_DECLARED(function, headerfile)
> ### Check for a declaration of FUNCTION in HEADERFILE; if it is
> ### not there, #define MISSING_FUNCTION_DECL.
> AC_DEFUN(GUILE_FUNC_DECLARED, [
>    AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
>      AC_EGREP_HEADER($1, $2,
>                      guile_cv_func_$1_declared=yes,
>                      guile_cv_func_$1_declared=no))
>    if test [x$guile_cv_func_]$1[_declared] = xno; then
>      AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL])
>    fi
> ])
>
> GUILE_FUNC_DECLARED(strptime, time.h)
> GUILE_FUNC_DECLARED(sleep, unistd.h)
> GUILE_FUNC_DECLARED(usleep, unistd.h)

Looks like usleep and sleep are in unistd.h on (most?) platforms, but
on yours they're in time.h.

Unfortunately GUILE_FUNC_DECLARED may not make it easy to test a
second location since it looks like if the function isn't found the
first time, it takes actions that wouldn't be undone by a later
successful test.

One option would be to change GUILE_FUNC_DECLARED to allow multiple
headers like this:

  GUILE_FUNC_DECLARED([sleep], [unistd.h time.h])

or can m4, etc. handle ... args?

  GUILE_FUNC_DECLARED([sleep], [unistd.h], [time.h])

I'll look in to a solution of some kind unless someone else knows how
to write this up off the top of their head.

Alternately I suppose we could use two functions, one to check a
header and one to call later to take action if none of the checks
succeeded:

  GUILE_CHECK_HEADER_FOR_FUNC([sleep], [unistd.h])
  GUILE_CHECK_HEADER_FOR_FUNC([sleep], [time.h])
  GUILE_CHECK_FOR_MISSING_FUNC_DECLARATION([sleep])

not a big deal to me either way.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
  2002-08-05  5:24   ` Rob Browning
@ 2002-08-05  7:44     ` Michael Tuexen
  2002-08-05 15:53       ` Rob Browning
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tuexen @ 2002-08-05  7:44 UTC (permalink / raw)
  Cc: guile-devel

Rob,

see my comments below.

Best regards
Michael

On Montag, Aug 5, 2002, at 07:24 Europe/Berlin, Rob Browning wrote:

> Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:
>
>> ### GUILE_FUNC_DECLARED(function, headerfile)
>> ### Check for a declaration of FUNCTION in HEADERFILE; if it is
>> ### not there, #define MISSING_FUNCTION_DECL.
>> AC_DEFUN(GUILE_FUNC_DECLARED, [
>>    AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
>>      AC_EGREP_HEADER($1, $2,
>>                      guile_cv_func_$1_declared=yes,
>>                      guile_cv_func_$1_declared=no))
>>    if test [x$guile_cv_func_]$1[_declared] = xno; then
>>      AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL])
>>    fi
>> ])
>>
>> GUILE_FUNC_DECLARED(strptime, time.h)
>> GUILE_FUNC_DECLARED(sleep, unistd.h)
>> GUILE_FUNC_DECLARED(usleep, unistd.h)
>
> Looks like usleep and sleep are in unistd.h on (most?) platforms, but
> on yours they're in time.h.
>
No, see the the following output (from an earlier e-mail):

[Powerbook:~/guile-1.5.6] tuexen% grep strptime /usr/include/time.h
char *strptime __P((const char *, const char *, struct tm *));
[Powerbook:~/guile-1.5.6] tuexen% grep sleep /usr/include/unistd.h
unsigned int     sleep __P((unsigned int));
int      usleep __P((unsigned int));
[Powerbook:~/guile-1.5.6] tuexen% grep usleep /usr/include/unistd.h
int      usleep __P((unsigned int));
[Powerbook:~/guile-1.5.6] tuexen%

They are in /usr/include/unistd.h.

I have the impression that grep can find it but AC_EGREP_HEADER fails
to find it. I have no idea why. For strptime everything works as 
expected.
> Unfortunately GUILE_FUNC_DECLARED may not make it easy to test a
> second location since it looks like if the function isn't found the
> first time, it takes actions that wouldn't be undone by a later
> successful test.
>
> One option would be to change GUILE_FUNC_DECLARED to allow multiple
> headers like this:
>
>   GUILE_FUNC_DECLARED([sleep], [unistd.h time.h])
>
> or can m4, etc. handle ... args?
>
>   GUILE_FUNC_DECLARED([sleep], [unistd.h], [time.h])
>
> I'll look in to a solution of some kind unless someone else knows how
> to write this up off the top of their head.
>
> Alternately I suppose we could use two functions, one to check a
> header and one to call later to take action if none of the checks
> succeeded:
>
>   GUILE_CHECK_HEADER_FOR_FUNC([sleep], [unistd.h])
>   GUILE_CHECK_HEADER_FOR_FUNC([sleep], [time.h])
>   GUILE_CHECK_FOR_MISSING_FUNC_DECLARATION([sleep])
>
> not a big deal to me either way.
>
We do not need this.
> -- 
> Rob Browning
> rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
> Previously @cs.utexas.edu
> GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD
>
>
--
Michael.Tuexen@micmac.franken.de


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
  2002-08-05  7:44     ` Michael Tuexen
@ 2002-08-05 15:53       ` Rob Browning
  2002-08-05 16:37         ` Michael Tuexen
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Browning @ 2002-08-05 15:53 UTC (permalink / raw)
  Cc: guile-devel

Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:

>>> GUILE_FUNC_DECLARED(strptime, time.h)
>>> GUILE_FUNC_DECLARED(sleep, unistd.h)
>>> GUILE_FUNC_DECLARED(usleep, unistd.h)
>>
>> Looks like usleep and sleep are in unistd.h on (most?) platforms, but
>> on yours they're in time.h.
>>
> No, see the the following output (from an earlier e-mail):

OK.

What happens if you:

  1) create a tiny C file containing

       #include <unistd.h>
       int main(int argc, char *argv[]) { sleep(1); return 0; }

     and try to compile it with "gcc -Wall myfile.c"?

  2) Put an AC_EGREP_HEADER([sleep], [unistd.h]) followed by an "exit
     1" into your configure.in and then re-run autoconf, and then
     re-run configure?  After the exit, is there anything useful in
     the log? (may not be).

  3) examine the configure script itself -- find the sleep or usleep
     test and see what it's doing.  Stick an "exit 1" or some echoes
     in there somewhere useful (if possible) so you can see what's
     going on.  I believe if you want to see the output of an echo,
     you will need to redirect it to fd 5 like this:

       echo "Howdy!" >&5

     This may allow you to see what gcc command it's running, and the
     contents of the relevant source file.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
  2002-08-05 15:53       ` Rob Browning
@ 2002-08-05 16:37         ` Michael Tuexen
  2002-08-05 18:23           ` Rob Browning
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tuexen @ 2002-08-05 16:37 UTC (permalink / raw)
  Cc: guile-devel

Rob,
see my comments below.
Best regards
Michael

On Montag, Aug 5, 2002, at 17:53 Europe/Berlin, Rob Browning wrote:

> Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:
>
>>>> GUILE_FUNC_DECLARED(strptime, time.h)
>>>> GUILE_FUNC_DECLARED(sleep, unistd.h)
>>>> GUILE_FUNC_DECLARED(usleep, unistd.h)
>>>
>>> Looks like usleep and sleep are in unistd.h on (most?) platforms, but
>>> on yours they're in time.h.
>>>
>> No, see the the following output (from an earlier e-mail):
>
> OK.
>
> What happens if you:
>
>   1) create a tiny C file containing
>
>        #include <unistd.h>
>        int main(int argc, char *argv[]) { sleep(1); return 0; }
>
>      and try to compile it with "gcc -Wall myfile.c"?
No warnings. The program is completely valid:
[Powerbook:~] tuexen% gcc -Wall test.c
[Powerbook:~] tuexen%

>
>   2) Put an AC_EGREP_HEADER([sleep], [unistd.h]) followed by an "exit
>      1" into your configure.in and then re-run autoconf, and then
>      re-run configure?  After the exit, is there anything useful in
>      the log? (may not be).
Well, there is simply no output.
>
>   3) examine the configure script itself -- find the sleep or usleep
>      test and see what it's doing.  Stick an "exit 1" or some echoes
>      in there somewhere useful (if possible) so you can see what's
>      going on.  I believe if you want to see the output of an echo,
>      you will need to redirect it to fd 5 like this:
>
>        echo "Howdy!" >&5
>
>      This may allow you to see what gcc command it's running, and the
>      contents of the relevant source file.
The code which performs the check is:

### Check for a declaration of FUNCTION in HEADERFILE; if it is
### not there, #define MISSING_FUNCTION_DECL.
AC_DEFUN(GUILE_FUNC_DECLARED, [
   AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
     AC_EGREP_HEADER($1, $2,
                     guile_cv_func_$1_declared=yes,
                     guile_cv_func_$1_declared=no))
   if test [x$guile_cv_func_]$1[_declared] = xno; then
     AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL])
   fi
])

GUILE_FUNC_DECLARED(strptime, time.h)
GUILE_FUNC_DECLARED(sleep, unistd.h)
GUILE_FUNC_DECLARED(usleep, unistd.h)

My problem is that it IS working for strptime but NOT for sleep and
usleep and I do not see the difference.
>
> -- 
> Rob Browning
> rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
> Previously @cs.utexas.edu
> GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD
>
>
--
Michael.Tuexen@micmac.franken.de


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
  2002-08-05 16:37         ` Michael Tuexen
@ 2002-08-05 18:23           ` Rob Browning
  2002-08-05 22:03             ` Michael Tuexen
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Browning @ 2002-08-05 18:23 UTC (permalink / raw)
  Cc: guile-devel

Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:

> The code which performs the check is:

This is not the code in the resulting configure file.  That code will
be expanded, and I believe if you search for usleep, you'll find it in
a for loop like this:

  for ac_func in ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer

  do
    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
    echo "$as_me:$LINENO: checking for $ac_func" >&5
    echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
    ...

That's where I'm talking about adding the echo/exit/whatever debugging
statements and then re-running configure.  If you try this, make sure
you rm config.cache between runs.

> My problem is that it IS working for strptime but NOT for sleep and
> usleep and I do not see the difference.

Right.  My guess is that there may be some preprocessor #ifdefery or
something causing the trouble.  If you can use the above tricks to
actually see the code it's running to test you should be able to run
that code directly from a prompt and see what the actual gcc/cpp error
msgs are, if any.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Guile on Mac OS X
  2002-08-05 18:23           ` Rob Browning
@ 2002-08-05 22:03             ` Michael Tuexen
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Tuexen @ 2002-08-05 22:03 UTC (permalink / raw)
  Cc: guile-devel

Rob,

oh, I got it. I have to play with configure, not configure.in.
I will try.

Thank you very much
Michael
On Montag, Aug 5, 2002, at 20:23 Europe/Berlin, Rob Browning wrote:

> Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:
>
>> The code which performs the check is:
>
> This is not the code in the resulting configure file.  That code will
> be expanded, and I believe if you search for usleep, you'll find it in
> a for loop like this:
>
>   for ac_func in ctermid ftime fchown getcwd geteuid gettimeofday 
> lstat mkdir mknod nice readlink rename rmdir select setegid seteuid 
> setlocale setpgid setsid sigaction siginterrupt strftime strptime 
> symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system 
> usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill 
> getppid getpgrp fork setitimer getitimer
>
>   do
>     as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
>     echo "$as_me:$LINENO: checking for $ac_func" >&5
>     echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
>     ...
>
> That's where I'm talking about adding the echo/exit/whatever debugging
> statements and then re-running configure.  If you try this, make sure
> you rm config.cache between runs.
>
>> My problem is that it IS working for strptime but NOT for sleep and
>> usleep and I do not see the difference.
>
> Right.  My guess is that there may be some preprocessor #ifdefery or
> something causing the trouble.  If you can use the above tricks to
> actually see the code it's running to test you should be able to run
> that code directly from a prompt and see what the actual gcc/cpp error
> msgs are, if any.
>
> -- 
> Rob Browning
> rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
> Previously @cs.utexas.edu
> GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD
>
>
--
Michael.Tuexen@micmac.franken.de


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-08-05 22:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-04 12:34 Guile on Mac OS X Michael Tuexen
2002-08-04 18:21 ` Rob Browning
     [not found] <87znw2xy71.fsf@raven.i.defaultvalue.org>
2002-08-04 18:59 ` Michael Tuexen
2002-08-05  5:24   ` Rob Browning
2002-08-05  7:44     ` Michael Tuexen
2002-08-05 15:53       ` Rob Browning
2002-08-05 16:37         ` Michael Tuexen
2002-08-05 18:23           ` Rob Browning
2002-08-05 22:03             ` Michael Tuexen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).