CFLAGS vs EXTRA_CFLAGS, Ubuntu server 9.04 error while running "make install"
While running "make install" on an Intel driver download, the following error occurred:
make -C /lib/modules/2.6.28-11-server/build SUBDIRS=/home/pete/drivers/e100-3.5.17/src modules make[1]: Entering directory '/usr/src/linux-headers-2.6.28-11-server' scripts/Makefile.build:46: *** CFLAGS was changed in "/home/operator/drivers/e100-3.5.17/src/Makefile". Fix it to use EXTRA_CFLAGS. Stop. make[1]: *** [_module_/home/pete/drivers/e100-3.5.17/src] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-2.6.28-11-server' make: *** [default] Error 2 "KBUILD_NOPEDANTIC=1 make" and "KBUILD_NOPEDANTIC=1 make install" both produced the same error as before. Replacing CFLAGS with EXTRA_CFLAGS everywhere in Makefile produced the same errors as the unedited Makefile: unknown fields, implicit declaration of a function, INIT_WORK undeclared, etc. KBUILD_NOPEDANTIC didn't help with the edited Makefile either: same errors. I've googled a lot and searched various forums, but nothing matches this exactly, and the solutions for the partial matches (EXTRA_CFLAGS vs CFLAGS_EXTRA) don't work. Any ideas, anyone? |
If there's a higher level Makefile, change the CFLAGS variable in there. I had the same crap happen with older Intel modem drivers, and fixing it in the uppermost makefile solved the problem (maybe fix it in BOTH Makefiles).
Don't be surprised however if this fixes that problem, but then the driver still won't build. For some reason, Intel's drivers don't seem IMHO to be very widely compatible with many different configurations of system. Sasha PS - Another option is to change the CFLAGS = to CFLAGS += so it will append to the existing CFLAGS environment variable. Try the first way first, though. Good luck! |
which Makefile?
A quick counts shows over 1100 Makefiles here and there throughout the filesystem, with over 100 in some /net directory or /networking directory or referencing "eth" or "e100". Can you suggest which one might be the higher level Makefile to edit? What would its location be? There are no other Makefiles in the unzipped Intel driver.
Unfortunately (for me, anyway) "CFLAGS +=" is already used throughout this Makefile. "CFLAGS =" is not used at all. |
How about this.. If this driver is a non-distro-specific source archive, and is reasonably un-large (like 2MB or so, or less), provide a link to it and I will download it and have a look.
It can't be an Ubuntu-specific driver, as I'm using Slackware. It's gotta be a generic sourcecode. SVA |
It's an Intel download for a Pro/100 VE, generic for Linux. About 60K.
e100-3.5.17.tar.gz http://downloadcenter.intel.com/filt...s=39&submit=Go! |
Patch file.
OK, what a horrible little chunk of code that is :confused:
Anyhow, below is a patch file I made, which fixes the CFLAGS issue. Just copy this entire patch file here, and save it as filename patch inside the /src directory of the driver. Then while inside that /src directory, get a console window and type: patch -i patch And it should say 'Patching file Makefile' if all is well (I tried it several times, worked fine here). Now, you can try to build the driver, but as I said, it still may not work and might need more adjustments. To try building the driver, type: make -j1 and see what happens. For me, I got an error telling me that the e100.c on line 144 is looking for a file called /linux/config.h which it can't find. Because it cannot find this header file, the rest of the build fails. But maybe it will find the config.h file on your system, with any luck.. Might be that my kernel is too new, who knows... Good luck, lemme know how it goes. PATCH FILE BELOW: Code:
--- ./e100-old/src/Makefile 2006-09-14 17:58:08.000000000 -0300 |
Oh, and PS - if `make -j1' does work, then `make install` should also work.
Good luck, Sasha |
Wow. I'm substantially impressed.
I won't have access to the computer in question until Monday, but I'll give it a shot then and let you know how it worked. Thanks a lot, really. Pete |
Sorry for the delay, but I had to put this project on the back burner for a week.
I created "patch" and put it in the /src directory. I ran "patch -i patch" Results: (Stripping trailing CRs from patch.) patching file Makefile Hunk #7 FAILED at 217 patch unexpected end in middle of line Hunk #8 succeeded at 236 with fuzz 1. 1 out of 8 hunks FAILED -- saving rejects to file Makefile.rej I haven't tried running "make -j1" or "make install" until I take a look at the patch again. I assume this is the offending Hunk from patch: CODE SECTION START @@ -217,7 +217,7 @@ ifneq ($(PATCHLEVEL),) EXTRA_CFLAGS += $(CFLAGS_EXTRA) obj-m += e100.o else -default: +default: ifeq ($(KOBJ),$(KSRC)) make -C $(KSRC) SUBDIRS=$(shell pwd) modules else CODE SECTION END |
Remember, the patch file needs to be in the exact same directory as the Makefile itself.
All that stuff about failed hunks, means it was likely not in the right location. Try again :) Sasha |
Double checked the directory:
/home/pete/drivers/e100-3.5.17/src (NOTE: My original question referenced /home/operator, not /home/pete) # patch i patch (Stripping trailing CRs from patch.) patching file Makefile Reversed (or previously applied patch detected! Assume -R/ [n] [NOTE: Choosing NO at this point made all 8 hunks fail. Choosing YES produced the following results.] Hunk #7 FAILED at 217 patch unexpectedly ends in middle of line Hunk #8 succeeded at 236 with fuzz 1. 1 out of 8 hunks FAILED -- saving rejects to Makefile.rej There's no e100.o to be found on the hard drive, if that helps. |
OK, I'm somewhat perplexed as to why the patch is not applying for you.
I am going to edit my post above, where I put the patch file for you, and re-paste the patch in there. Just in case that for some reason, either I pasted it in funny, or you copied it funny, and it's missing something. I just ran the routine again on a freshly unpacked driver source, and the patch works cleanly for me. Give me a few minutes for me to re-paste the patch above. SVA |
OK, I re-pasted in the patch file above.
Copy it exactly as is, save as a text file called 'patch' Extract the driver source afresh, and put the patch file in with the Makefile, then try 'patch -i patch' It *should* work. It works here, so again, I'm really sorry if it doesn't patch cleanly for you; I can't explain it, but if it persists on not patching, I could post for you the actual patched Makefile itself. Let me know.. Sasha |
Nope, same result.
"Hunk #7 FAILED at 217" |
Makefile
Here's the patched Makefile. Let me know how this works :)
Code:
################################################################################ |
All times are GMT -5. The time now is 01:10 AM. |