NeXT Computers Forum Index NeXT Computers
www.NeXTComputers.org
 
Log in to check your private messagesLog in to check your private messages

Log inLog in  RegisterRegister


Profile  Search  Memberlist  FAQ  Usergroups
Previous fails to build on F25 (Fedora)

 
Post new topic   Reply to topic    NeXT Computers Forum Index -> Emulation / Virtualization
View previous topic :: View next topic  
Author Message
tingo



Joined: 28 Jun 2017
Posts: 4
Location: Oslo, Norway

PostPosted: Wed Jun 28, 2017 11:45 pm    Post subject: Previous fails to build on F25 (Fedora) Reply with quote

A week ago I learned about Previous. So I tried to build it on my laptop, which is running Fedora 25
Code:

[tingo@kg-elitebook ~]$ cat /etc/fedora-release
Fedora release 25 (Twenty Five)
[tingo@kg-elitebook ~]$ uname -a
Linux kg-elitebook.kg4.no 4.11.5-200.fc25.x86_64 #1 SMP Wed Jun 14 17:17:29 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I checked out the latest version from the repository:
Code:

[tingo@kg-elitebook previous-code]$ svn info
Path: .
Working Copy Root Path: /zs/tingo/work/previous/previous-code
URL: svn://svn.code.sf.net/p/previous/code/branches/branch_realtime
Relative URL: ^/branches/branch_realtime
Repository Root: svn://svn.code.sf.net/p/previous/code
Repository UUID: 9ba66e4b-2233-44b8-a46a-7e93b2105c9e
Revision: 823
Node Kind: directory
Schedule: normal
Last Changed Author: andreas-g1
Last Changed Rev: 791
Last Changed Date: 2017-05-01 10:09:25 +0200 (Mon, 01 May 2017)

but when I try to build it, it fails:
Code:

[tingo@kg-elitebook previous-code]$ mkdir -p build
[tingo@kg-elitebook previous-code]$ cd build
[tingo@kg-elitebook build]$ cmake ..
[...]
-- Build files have been written to: /zs/tingo/work/previous/previous-code/build

[tingo@kg-elitebook build]$ make
Scanning dependencies of target Slirp
[  1%] Building C object src/slirp/CMakeFiles/Slirp.dir/bootp.c.o
In file included from /usr/include/string.h:630:0,
                 from /usr/include/sys/un.h:37,
                 from /zs/tingo/work/previous/previous-code/src/slirp/slirp.h:162,
                 from /zs/tingo/work/previous/previous-code/src/slirp/bootp.c:24:
/zs/tingo/work/previous/previous-code/src/slirp/misc.h:27:7: error: expected identifier or ( before __extension__
 char *strdup(const char *);
       ^
src/slirp/CMakeFiles/Slirp.dir/build.make:62: recipe for target 'src/slirp/CMakeFiles/Slirp.dir/bootp.c.o' failed
make[2]: *** [src/slirp/CMakeFiles/Slirp.dir/bootp.c.o] Error 1
CMakeFiles/Makefile2:607: recipe for target 'src/slirp/CMakeFiles/Slirp.dir/all' failed
make[1]: *** [src/slirp/CMakeFiles/Slirp.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Also, trying to build via ./configure doesn't help:
Code:

[tingo@kg-elitebook previous-code]$ ./configure
[...]
-- Build files have been written to: /zs/tingo/work/previous/previous-code

[tingo@kg-elitebook previous-code]$ make
Scanning dependencies of target Slirp
[  1%] Building C object src/slirp/CMakeFiles/Slirp.dir/bootp.c.o
In file included from /usr/include/string.h:630:0,
                 from /usr/include/sys/un.h:37,
                 from /zs/tingo/work/previous/previous-code/src/slirp/slirp.h:162,
                 from /zs/tingo/work/previous/previous-code/src/slirp/bootp.c:24:
/zs/tingo/work/previous/previous-code/src/slirp/misc.h:27:7: error: expected identifier or ( before __extension__
 char *strdup(const char *);
       ^
src/slirp/CMakeFiles/Slirp.dir/build.make:62: recipe for target 'src/slirp/CMakeFiles/Slirp.dir/bootp.c.o' failed
make[2]: *** [src/slirp/CMakeFiles/Slirp.dir/bootp.c.o] Error 1
CMakeFiles/Makefile2:607: recipe for target 'src/slirp/CMakeFiles/Slirp.dir/all' failed
make[1]: *** [src/slirp/CMakeFiles/Slirp.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

I wasn't expecting it too, just trying all options.
Any idea on how to fix this?
Back to top
View user's profile Send private message
tingo



Joined: 28 Jun 2017
Posts: 4
Location: Oslo, Norway

PostPosted: Thu Jun 29, 2017 1:05 am    Post subject: Fails on Debian 9 too Reply with quote

FWIW, it fails in the same place on Debian 9:
Code:

bitraf@desktop-41nl8sd:~/work/previous/previous-code/build$ cat /etc/debian_version
9.0
bitraf@desktop-41nl8sd:~/work/previous/previous-code/build$ uname -a
Linux desktop-41nl8sd 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u1 (2017-06-18) x86_64 GNU/Linux
Back to top
View user's profile Send private message
andreas_g



Joined: 30 Jan 2009
Posts: 413
Location: Austria

PostPosted: Thu Jun 29, 2017 3:26 am    Post subject: Reply with quote

Hello tingo!

As a quick fix try to comment the affected line:

Code:
// char *strdup(const char *);


I hope this solves it. There might be some more problems of this kind in the SLiRP code.
Back to top
View user's profile Send private message Send e-mail
tingo



Joined: 28 Jun 2017
Posts: 4
Location: Oslo, Norway

PostPosted: Thu Jun 29, 2017 6:33 am    Post subject: Reply with quote

Yep, that fixed it, now it builds.
It seems like the HAVE_STRDUP define isn't defined on Fedora and Debian, for some reason.
Commented out in misc.h
Code:

#ifndef HAVE_STRDUP
// char *strdup(const char *);
#endif


and misc.c
Code:

#ifndef HAVE_STRDUP
/* char *strdup(const char *str)
{
   char *bptr;
   
   bptr = (char *)malloc(strlen(str)+1);
   strcpy(bptr, str);
   
   return bptr;
}
*/
#endif

Thanks!
--
Torfinn
Back to top
View user's profile Send private message
andreas_g



Joined: 30 Jan 2009
Posts: 413
Location: Austria

PostPosted: Thu Jun 29, 2017 7:05 am    Post subject: Reply with quote

I'm glad it worked! But we should find a proper patch for that. It seems there is something missing for CMake. Please try adding this line to CMakeLists.txt (the one in the lowest directory under topic "Check for optional functions") using a fresh copy of the sources and check if it compiles without further modifications:

Code:
check_function_exists(strdup HAVE_STRDUP)
Back to top
View user's profile Send private message Send e-mail
tingo



Joined: 28 Jun 2017
Posts: 4
Location: Oslo, Norway

PostPosted: Fri Jun 30, 2017 4:49 am    Post subject: Reply with quote

I patched CMakeLists.txt as suggested
Code:

[tingo@kg-elitebook previous-code]$ grep STRDUP CMakeLists.txt
check_function_exists(strdup HAVE_STRDUP)

and Prevoius now builds (and works). Thanks!
Back to top
View user's profile Send private message
andreas_g



Joined: 30 Jan 2009
Posts: 413
Location: Austria

PostPosted: Sat Jul 01, 2017 2:35 am    Post subject: Reply with quote

Thank you for testing! This will be added to the next release of Previous (coming soon!).
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    NeXT Computers Forum Index -> Emulation / Virtualization All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2017 phpBB Group