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?
This isn't mine, please re-assign
x11: this package is homeless, but perhaps you can suggest a fix.
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
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.
Actually, looking at the compile line, I'm not sure if it's linking at all...I think the configuration script is messed up.
Note that I meant "linking to the right library". I'll stop talking now :P
Yeah, the -L<nothing> is very suspicious. Reporter, can you attach config.log if it exists, and if not, attach a full compilation log?
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.
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.
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.
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.
Created attachment 53816 [details] joy2key-1.6-r1.ebuild - New ebuild using the above patch.
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... ;)
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?
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.
Created attachment 53839 [details, diff] fix-configure.diff - Cleaned up version
You need to fix the source, not a generated file, so we can send the fix upstream.
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.
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.
Uh, 2.13 is our _oldest_ version. Use a new one.
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
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.
How come you're using all those funny command lines? Just use autoreconf, with --force if needed.
Ohoho, aren't we Mr. Fancypants? Because I'm new at this :P Fixed:
Created attachment 53936 [details] joy2key-1.6-r1.ebuild - fixed
Can someone confirm this fix? It works fine on my box and this has been open for a month now.
Fixed in portage, thanks for help.