We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 704 - parallel make broken: SDL_revision.h: No such file or directory
Summary: parallel make broken: SDL_revision.h: No such file or directory
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-20 15:36 UTC by Dennis
Modified: 2009-09-26 02:45 UTC (History)
1 user (show)

See Also:


Attachments
Patches Makefile.in to allow parallel building. (374 bytes, patch)
2009-02-21 12:36 UTC, Sami Näätänen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis 2009-02-20 15:36:49 UTC
When trying to run a parallel build, gcc will not be able to find SDL_revision.h


What I did:

./autogen.sh
mkdir build
cd build
../configure
make -j3


Results:

/bin/sh ../build-scripts/mkinstalldirs build                                                                         
/bin/sh ../build-scripts/updaterev.sh                                                                                
/bin/sh ./libtool --mode=compile gcc -g -O2  -Iinclude -I../include -D_GNU_SOURCE=1 -mmmx -m3dnow -msse -msse2 -fvisibility=hidden   -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ../src/SDL.c  -o build/SDL.lo                                                                                                                   
mkdir -p -- build                                                                                                                                             
/bin/sh ./libtool --mode=compile gcc -g -O2  -Iinclude -I../include -D_GNU_SOURCE=1 -mmmx -m3dnow -msse -msse2 -fvisibility=hidden   -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ../src/SDL_compat.c  -o build/SDL_compat.lo                                                                                                     
mkdir build/.libs                                                                                                                                             
 gcc -g -O2 -Iinclude -I../include -D_GNU_SOURCE=1 -mmmx -m3dnow -msse -msse2 -fvisibility=hidden -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ../src/SDL.c  -fPIC -DPIC -o build/.libs/SDL.o                                                                                                                                      
 gcc -g -O2 -Iinclude -I../include -D_GNU_SOURCE=1 -mmmx -m3dnow -msse -msse2 -fvisibility=hidden -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ../src/SDL_compat.c-fPIC -DPIC -o build/.libs/SDL_compat.o
In file included from ../include/SDL.h:91,
                 from ../src/SDL_compat.c:26:
../include/SDL_version.h:33:26: error: SDL_revision.h: No such file or directory
In file included from ../include/SDL.h:91,
                 from ../src/SDL.c:26:
../include/SDL_version.h:33:26: error: SDL_revision.h: No such file or directory
../src/SDL.c: In function 'SDL_GetRevision':
../src/SDL.c:303: error: 'SDL_REVISION' undeclared (first use in this function)
../src/SDL.c:303: error: (Each undeclared identifier is reported only once
../src/SDL.c:303: error: for each function it appears in.)
make: *** [build/SDL.lo] Error 1


Also: SDL_revision.h seems to be created in srcdir, not in builddir.


A repeated invokation "works".
Comment 1 Sami Näätänen 2009-02-21 11:35:58 UTC
I did just like you described and for me it worked. (revision #4444)
I even tried different -j options.

my build tools:

autoconf (GNU Autoconf) 2.63
automake (GNU automake) 1.10.2
GNU Make 3.81
gcc (Gentoo 4.3.3 p1.0, pie-10.1.5) 4.3.3

And obviously Gentoo Linux.

My checkout is not in it's initial stage, but I did make distclean and removed configure before testing.
Comment 2 Sami Näätänen 2009-02-21 12:35:10 UTC
Well in fact Dennis was right.
As I found out `make distclean` doesn't remove the SDL_revision.h.

I fixed this by adding another build rule, which will make the header if it is needed and it doesn't exist.

Anything else will simply not work as the `make -jn` will pick n first deps from the target 'all' and even if update-revision would be the first dep for the target 'all' the parallel make will start to build the targets that depend from the SDL_revision.h header for all n >= 4.

With the patch parallel building works.
Comment 3 Sami Näätänen 2009-02-21 12:36:37 UTC
Created attachment 300 [details]
Patches Makefile.in to allow parallel building.
Comment 4 Sam Lantinga 2009-09-26 02:45:11 UTC
This is fixed in subversion, thanks!