Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MODULE_VERSION and MODULE_NAME



It turns ot that when building IOKit drivers, something (I'm assuming some pre-build script - but it does not show up as a build phase) auto-generates a source file such as <yourkextname>_info.c in the DerivedSources folder.

This file contains something like:

KMOD_EXPLICIT_DECL(<your module name from project settings>, <your module version from project settings>, _start, _stop)

So, the question is - will declaring these variables in a project source not cause a conflict?

The only way that I could think of doing this automatically (using a single header with a version constant/define) was:

a. Use an xcconfig file (which I would do in any case in my project).

b. Specify an include directive in the xcconfig file like (that's because I could get xcconfig files to use #include but couldn't get them to be properly preprocessed)

    #include "common/prodver.xcconfig"

c. Run a pre-build script that generates this prodver.xcconfig from a template .c file and the common .h that contains the version number. This can be done by running gcc in preprocess only mode.

The template file (I call it xcconfig.c) would have just one line:

MODULE_VERSION=MYVERSION_NUMBER

The script that genreates the xcconfig would be:

gcc -include ./common/prodver.h -E -x c -P ./common/xcconfig.c >./common/prodver.xcconfig

I'm not sure this is the best way to do it though!

There has to be something simpler!

Thanks.
Devendra.

websrvr wrote:
Yes but you can use variables in the project files so they should always match.

On Aug 20, 2008, at 01:28 AM, AI Developer wrote:

Are these two required to match with the info.plist's module version and name any more?

We have a driver in which if we load the driver with kextlaod -t, we get the following output:

Warnings
{
    "Kext has a kernel dependency prior to version 6.0 and CFBundleVersion does not match executable's MODULE_VERSION" = true
    "Kext has a kernel dependency prior to version 6.0 and CFBundleIdentifier does not match executable's MODULE_NAME" = true
}


But the driver loads anyway (tried on 10.5.x and 10.4.11)!

I'm wondering if this can cause problems in future.

It becomes little bit of a hassle to update these values in project settings (or an xcconfig file) manually. The info.plist for the kext is preprocessed, so we don't need to change the version in a number of places.

Thanks.
Devendra.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden

References: 
 >MODULE_VERSION and MODULE_NAME (From: AI Developer <email@hidden>)
 >Re: MODULE_VERSION and MODULE_NAME (From: websrvr <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.