CFLAGS vs EXTRA_CFLAGS, Ubuntu server 9.04 error while running "make install"
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Last edited by Invisible-Man; 07-02-2009 at 11:42 AM.
Reason: fixed typo in file pathname
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!
Last edited by GrapefruiTgirl; 06-18-2009 at 09:31 PM.
Reason: added += part.
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.
Last edited by Invisible-Man; 06-19-2009 at 06:47 AM.
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.
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...
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.
[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.
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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.