make depend fails when building Wine 1.1.40

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
nucleo
Level 2
Level 2
Posts: 31
Joined: Sat Feb 14, 2009 6:22 am

make depend fails when building Wine 1.1.40

Post by nucleo »

I am trying to build Wine 1.1.40 in Fedora 12 with wine.spec from src.rpm but I get this error:

configure: Finished. Do 'make' to compile Wine.

+ /usr/bin/make depend
config.status: creating tools/Makefile
make[1]: Entering directory `/home/user/rpmbuild/BUILD/wine-1.1.40/tools'
gcc -c -I. -I. -I../include -I../include -I/usr/include/freetype2 -D__WINESRC__ -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -Werror -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -o makedep.o makedep.c
cc1: warnings being treated as errors
makedep.c: In function 'get_line':
makedep.c:207: error: ignoring return value of 'fgets', declared with attribute warn_unused_result
makedep.c:219: error: ignoring return value of 'fgets', declared with attribute warn_unused_result
make[1]: *** [makedep.o] Error 1
make[1]: Leaving directory `/home/user/rpmbuild/BUILD/wine-1.1.40/tools'
make: *** [tools/Makefile] Error 2
hellork
Level 3
Level 3
Posts: 82
Joined: Thu Mar 27, 2008 7:13 pm

Re: make depend fails when building Wine 1.1.40

Post by hellork »

*I made some headway by removing -Wp,-D_FORTIFY_SOURCE=2 from the global cflags (by creating a custom %__global_cflags in ~/.rpmmacros (the default values are in /usr/lib/rpm/redhat/macros but it is better to put custom changes in ~/.rpmmacros because that file doesn't get overwritten by every yum update...)

The new line looks like:
%__global_cflags -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4

*There is a big update today for Fedora 12. kernel, x, everything. Try getting the updates first. It might work.
hellork
Level 3
Level 3
Posts: 82
Joined: Thu Mar 27, 2008 7:13 pm

Re: make depend fails when building Wine 1.1.40

Post by hellork »

Forget about that. The maintainers, for whatever reason, enabled maintainer mode in the wine.spec file and wine's configure.ac is enabling -Werror in maintainer mode, which doesn't belong in there. Maintainer mode is for automatically detecting when files like configure.ac change and rebuilding them, but anyway I don't want to get into an argument over what maintainer mode is for. Personally, I don't use it... My relevant section now looks like:

Code: Select all

autoreconf

%build
export CFLAGS="$RPM_OPT_FLAGS"
%configure \
	--sysconfdir=%{_sysconfdir}/wine \
	--x-includes=%{_includedir} --x-libraries=%{_libdir} \
	--with-pulse \
        --with-x \
%ifarch x86_64
	--enable-win64 \
%endif
	--disable-tests > /dev/null

%{__make} TARGETFLAGS="" %{?_smp_mflags} -s > /dev/null

%install
rm -rf %{buildroot}
  • Notice I got rid of the extraneous "make depend" as it is no longer needed.
  • Ignore the -s > /dev/null bits. Those are my personal preferences and I sometimes use them at my own risk and discretion ;)
  • Also add after %{_libdir}/wine/dinput8.dll.so the line:
    %{_libdir}/wine/dispex.dll.so
64Bit Note: On x86_64 systems wine.spec builds 64 bit wine, which might not be what you want, since it will only run 64 bit windows programs. I had to change the first line in wine.spec to read "%define no64bit 1", create a new wine.src.rpm with rpmbuild -bs and install mock to rebuild the new .src rpm as 32 bit.
nucleo
Level 2
Level 2
Posts: 31
Joined: Sat Feb 14, 2009 6:22 am

Post by nucleo »

Thank you, hellork.

I have successfully build Wine 1.1.40 after removing of --enable-maintainer-mode and %{__make} depend.

But previous attempt to build without -Wp,-D_FORTIFY_SOURCE=2 failed because of other error:

cc1: warnings being treated as errors
net.c: In function 'netconn_init':
net.c:463: error: assignment discards qualifiers from pointer target type
make[1]: *** [net.o] Error 1
make[1]: Leaving directory `/home/user/rpmbuild/BUILD/wine-1.1.40/dlls/winhttp'
make: *** [dlls/winhttp] Error 2
Locked