Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 82685 - Can't emerge joy2key because of compilation failure
Summary: Can't emerge joy2key because of compilation failure
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-20 07:55 UTC by Douglas Bollinger
Modified: 2005-03-22 12:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for configure script (configure.diff,531 bytes, patch)
2005-03-18 13:53 UTC, Joshua Baergen (RETIRED)
Details | Diff
fix-configure.diff - Patch for configure script v2 (fix-configure.diff,711 bytes, patch)
2005-03-18 14:26 UTC, Joshua Baergen (RETIRED)
Details | Diff
joy2key-1.6-r1.ebuild - New ebuild using the above patch. (joy2key-1.6-r1.ebuild,866 bytes, text/plain)
2005-03-18 14:27 UTC, Joshua Baergen (RETIRED)
Details
fix-configure.diff - Cleaned up version (fix-configure.diff,550 bytes, patch)
2005-03-18 22:12 UTC, Joshua Baergen (RETIRED)
Details | Diff
fix-configure.in.diff (fix-configure.in.diff,908 bytes, patch)
2005-03-19 08:12 UTC, Joshua Baergen (RETIRED)
Details | Diff
Makefile.diff (Makefile.diff,1.50 KB, text/plain)
2005-03-19 08:15 UTC, Joshua Baergen (RETIRED)
Details
joy2key-1.6-r1.ebuild - uses new fix-configure.in.diff patch (joy2key-1.6-r1.ebuild,1.12 KB, text/plain)
2005-03-19 12:57 UTC, Joshua Baergen (RETIRED)
Details
joy2key-1.6-r1.ebuild - fixed (joy2key-1.6-r1.ebuild,1.10 KB, text/plain)
2005-03-20 08:06 UTC, Joshua Baergen (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Bollinger 2005-02-20 07:55:17 UTC
gcc  -march=athlon-xp -fomit-frame-pointer -pipe  -o joy2key  joy2key.o -L -lX11
joy2key.o(.text+0x482): In function `main':
: undefined reference to `XFlush'
joy2key.o(.text+0x976): In function `main':
: undefined reference to `XFlush'
joy2key.o(.text+0x199b): In function `process_args':
: undefined reference to `XOpenDisplay'
joy2key.o(.text+0x1e06): In function `argtokey':
: undefined reference to `XStringToKeysym'
joy2key.o(.text+0x1e3b): In function `argtokey':
: undefined reference to `XKeysymToKeycode'
joy2key.o(.text+0x1f20): In function `repeat_handler':
: undefined reference to `XFlush'
joy2key.o(.text+0x2081): In function `sendkey':
: undefined reference to `XSendEvent'
joy2key.o(.text+0x21c5): In function `RegisterCloseEvent':
: undefined reference to `XQueryTree'
joy2key.o(.text+0x21e8): In function `RegisterCloseEvent':
: undefined reference to `XSelectInput'
joy2key.o(.text+0x21fb): In function `RegisterCloseEvent':
: undefined reference to `XFree'
joy2key.o(.text+0x2230): In function `CheckIfWindowClosed':
: undefined reference to `XCheckWindowEvent'
collect2: ld returned 1 exit status
make: *** [joy2key] Error 1

Reproducible: Always
Steps to Reproduce:
1.emerge joy2key
2.observe failed compilation
3.

Actual Results:  
It didn't compile

Expected Results:  
It should compile and install

Perhaps Xorg is breaking joy2key?
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2005-02-25 06:28:35 UTC
This isn't mine, please re-assign
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-02-25 17:40:20 UTC
x11: this package is homeless, but perhaps you can suggest a fix.
Comment 3 Eric Andry 2005-03-16 20:31:55 UTC
Same problem on pentium4 too:

gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=pentium4 -pipe -fforce-addr -fomit-frame-pointer -fweb  -c joy2key.c
gcc  -march=pentium4 -pipe -fforce-addr -fomit-frame-pointer -fweb   -o joy2key  joy2key.o -L -lX11
joy2key.o(.text+0x4ab): In function `main':
: undefined reference to `XFlush'
joy2key.o(.text+0x9a4): In function `main':
: undefined reference to `XFlush'
joy2key.o(.text+0x1a8d): In function `process_args':
: undefined reference to `XOpenDisplay'
joy2key.o(.text+0x1f14): In function `argtokey':
: undefined reference to `XStringToKeysym'
joy2key.o(.text+0x1f4a): In function `argtokey':
: undefined reference to `XKeysymToKeycode'
joy2key.o(.text+0x2031): In function `repeat_handler':
: undefined reference to `XFlush'
joy2key.o(.text+0x2195): In function `sendkey':
: undefined reference to `XSendEvent'
joy2key.o(.text+0x22dc): In function `RegisterCloseEvent':
: undefined reference to `XQueryTree'
joy2key.o(.text+0x22ff): In function `RegisterCloseEvent':
: undefined reference to `XSelectInput'
joy2key.o(.text+0x2312): In function `RegisterCloseEvent':
: undefined reference to `XFree'
joy2key.o(.text+0x2347): In function `CheckIfWindowClosed':
: undefined reference to `XCheckWindowEvent'
collect2: ld returned 1 exit status
make: *** [joy2key] Error 1
Comment 4 Joshua Baergen (RETIRED) gentoo-dev 2005-03-17 05:46:15 UTC
The fact that it's breaking on linking suggests that it's not looking for libX11 in the right place (it's in /usr/lib).  I can take a look at this later after school today.
Comment 5 Joshua Baergen (RETIRED) gentoo-dev 2005-03-17 05:49:13 UTC
Actually, looking at the compile line, I'm not sure if it's linking at all...I think the configuration script is messed up.
Comment 6 Joshua Baergen (RETIRED) gentoo-dev 2005-03-17 05:50:20 UTC
Note that I meant "linking to the right library".  I'll stop talking now :P
Comment 7 Donnie Berkholz (RETIRED) gentoo-dev 2005-03-18 01:32:31 UTC
Yeah, the -L<nothing> is very suspicious. Reporter, can you attach config.log if it exists, and if not, attach a full compilation log?
Comment 8 Joshua Baergen (RETIRED) gentoo-dev 2005-03-18 10:47:27 UTC
The -L<empty> is causing the linker to miss the -lX11 link.  I tracked it down to configure.in, lines 23 and 24, when it refers to -L$x_libraries -lX11.  Somehow it's evaluating $x_libraries to null, and if I remove the -L part from the file everything works.  I doubt this is the right solution though, and I don't know enough about configure scripting to fix this.
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2005-03-18 12:00:30 UTC
It's making an assumption that X libraries will not be in the standard path, therefore assuming it'll need -L. Someone suitably motivated can dig through configure / autoconf stuff to find this.
Comment 10 Joshua Baergen (RETIRED) gentoo-dev 2005-03-18 13:53:21 UTC
Created attachment 53812 [details, diff]
Patch for configure script

This should fix the blank -L issue.  It adds a quick test to see if it will be
blank, and gets rid of it if it will be.
Comment 11 Joshua Baergen (RETIRED) gentoo-dev 2005-03-18 14:26:37 UTC
Created attachment 53815 [details, diff]
fix-configure.diff - Patch for configure script v2

Sorry, apparently I knew less about patching than I thought.  This works with
the following ebuild.
Comment 12 Joshua Baergen (RETIRED) gentoo-dev 2005-03-18 14:27:19 UTC
Created attachment 53816 [details]
joy2key-1.6-r1.ebuild - New ebuild using the above patch.
Comment 13 Joshua Baergen (RETIRED) gentoo-dev 2005-03-18 14:28:36 UTC
The above ebuild and patch fix the issue on my system.  Could someone else please test?  Also, I haven't tested for non-standard X11 paths, but my patch is rather simple and so I can't see it being an issue... ;)
Comment 14 Donnie Berkholz (RETIRED) gentoo-dev 2005-03-18 19:08:57 UTC
Wow, that configure script looks weird even from that small patch. Could you drop the gratuitous whitespace change, please, and confirm that the package doesn't use autotools?
Comment 15 Joshua Baergen (RETIRED) gentoo-dev 2005-03-18 21:54:46 UTC
The packages comes with autotool scripts, but configure was already generated using autoconf 2.13 so I decided to patch that.  The offending code originates within configure.in, but unless we change how autoconf generates the link command (IE AC_CHECK_LIB possibly?) I don't see much reason to call autoconf again on a patched configure.in.

And thank you for pointing out the whitespace change, I didn't notice it in the new diff.  I'll fix that up right now.
Comment 16 Joshua Baergen (RETIRED) gentoo-dev 2005-03-18 22:12:17 UTC
Created attachment 53839 [details, diff]
fix-configure.diff - Cleaned up version
Comment 17 Donnie Berkholz (RETIRED) gentoo-dev 2005-03-19 00:13:40 UTC
You need to fix the source, not a generated file, so we can send the fix upstream.
Comment 18 Joshua Baergen (RETIRED) gentoo-dev 2005-03-19 08:12:53 UTC
Created attachment 53868 [details, diff]
fix-configure.in.diff

This just applies the changes from fix-configure.diff to configure.in instead. 
However, I'm having issues using our autoconf-2.13 (latest version) as it's
generating a slightly different Makefile.  I'll attach the Makefile diff below.
Comment 19 Joshua Baergen (RETIRED) gentoo-dev 2005-03-19 08:15:20 UTC
Created attachment 53869 [details]
Makefile.diff

The fixes can be seen working here, taking out the blank -L, but it also
drops/adds some lines that I don't think it should.  I'm alittle lost here,
your help would be much appreciated.
Comment 20 Donnie Berkholz (RETIRED) gentoo-dev 2005-03-19 11:30:55 UTC
Uh, 2.13 is our _oldest_ version. Use a new one.
Comment 21 Joshua Baergen (RETIRED) gentoo-dev 2005-03-19 12:16:04 UTC
Sorry, I meant newest of the 2.1 series, which is what the creator of joy2key was using.  Same issue with 2.59:

joy2key-1.6 # make
cd . && aclocal
cd . && automake --gnu --include-deps Makefile
automake: configure.in: required file `./config.guess' not found
automake: configure.in: required file `./config.sub' not found
make: *** [Makefile.in] Error 1
Comment 22 Joshua Baergen (RETIRED) gentoo-dev 2005-03-19 12:57:36 UTC
Created attachment 53881 [details]
joy2key-1.6-r1.ebuild - uses new fix-configure.in.diff patch

This ebuild will use the newer patch then libtoolize the working directory,
fixing the Makefile issue I've been having.  Package compiles and installs fine
on my system.  

Only issue is that it appears to configure twice during install, and since I've
seen this in other packages I'm not sure if this is an issue or not.
Comment 23 Donnie Berkholz (RETIRED) gentoo-dev 2005-03-19 17:13:05 UTC
How come you're using all those funny command lines? Just use autoreconf, with --force if needed.
Comment 24 Joshua Baergen (RETIRED) gentoo-dev 2005-03-20 08:05:38 UTC
Ohoho, aren't we Mr. Fancypants?

Because I'm new at this :P

Fixed:
Comment 25 Joshua Baergen (RETIRED) gentoo-dev 2005-03-20 08:06:30 UTC
Created attachment 53936 [details]
joy2key-1.6-r1.ebuild - fixed
Comment 26 Joshua Baergen (RETIRED) gentoo-dev 2005-03-22 08:18:47 UTC
Can someone confirm this fix?  It works fine on my box and this has been open for a month now.
Comment 27 Karol Wojtaszek (RETIRED) gentoo-dev 2005-03-22 12:16:09 UTC
Fixed in portage, thanks for help.