Article delegate-en/3822 of [1-4112] on the server localhost:7119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A3818@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: 9.7.0 compile error on OpenBSD
31 Aug 2007 08:37:57 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project

In message <_A3818@delegate-en.ML_> on 08/30/07(16:57:17) I wrote:
 | |I'm preparing a new machine with Delegate on it. It runs OpenBSD 
 | |3.7 (genuine installation out-of-box), while compiling DG 9.7.0 it 
 | |stops saying:
 | |
 | |In file included from teleportd.cc:25:
 | |../include/ystring.h:985: error: declaration does not declare 
 | |anything
 | |../include/ystring.h:986: error: declaration does not declare 
 | |anything
 | |*** Error code 1

I tested the compilation of DeleGate on OpenBSD(4.1) and saw the
same errors.

 | |It doesn't matter if i'm using cc or gcc. These two lines in 
 |
 |I'm curious why and what are you using instread of cc or gcc...
 |
 | |ystring.h are:
 | |
 | |void flockfile(FILE *fp);
 | |void funlockfile(FILE *fp);
 | |
 | |Can I ask for some clues?
 |
 |It might be solved by removing the lines...

It can be solved by it but I'll do more generic solution in ystring.h
as the enclosed patch.
Another problem I found on OpenBSD is that it fails to detect the C99
capability of the gcc.  It is because the ld on OpenBSD fails even with
a program without any external reference as follows.

  echo 'int main(int ac,char *av[]){ return 0; }' > c.c

  % cc -x c++ c.c -lstdc++
  /usr/lib/libstdc++.so.42.0: undefined reference to `log'
  /usr/lib/libstdc++.so.42.0: undefined reference to `sqrt'
  /usr/lib/libstdc++.so.42.0: undefined reference to `cosh'
  ...
  collect2: ld returned 1 exit status

  % cc -x c++ c.c -lstdc++ -lm
  (ok)

Thus I added "-lm" option to the detection of capability of compiler
and loader in "mkmake.c"

Cheers,
Yutaka
--
  9 9   Yutaka Sato <pfqcabdyi-mykgh4zgj6tw.ml@delegate.org> http://delegate.org/y.sato/
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


diff -cr delegate9.7.0-pre1/include/ystring.h delegate9.7.0-pre2/include/ystring.h
*** delegate9.7.0-pre1/include/ystring.h	Fri Aug 17 19:02:50 2007
--- delegate9.7.0-pre2/include/ystring.h	Fri Aug 31 02:07:36 2007
***************
*** 982,989 ****
--- 982,991 ----
  #ifdef __cplusplus
  extern "C" {
  #endif
+ #ifndef flockfile
  void flockfile(FILE *fp);
  void funlockfile(FILE *fp);
+ #endif
  #ifdef __cplusplus
  }
  #endif
diff -cr delegate9.7.0-pre1/maker/mkmake.c delegate9.7.0-pre2/maker/mkmake.c
*** delegate9.7.0-pre1/maker/mkmake.c	Mon Mar 26 16:49:36 2007
--- delegate9.7.0-pre2/maker/mkmake.c	Fri Aug 31 10:12:28 2007
***************
*** 1919,1925 ****
--- 1919,1930 ----
  	if( strstr(flags,"-m32") != 0 && strstr(command,"-m32") == 0 )
  		strcat(command," -m32");
  	if( strstr(flags," -x c++") )
+ 	{
  		strcat(command," -lstdc++");
+ #if defined(__OpenBSD__)
+ 		strcat(command," -lm");
+ #endif
+ 	}
  
  	rcode = msystem(1,res+strlen(res),sizeof(res)-strlen(res),command);
  

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V