mirror of
https://github.com/strongtz/i915-sriov-dkms.git
synced 2026-05-06 13:42:34 +08:00
25 lines
743 B
Bash
Executable File
25 lines
743 B
Bash
Executable File
#!/bin/sh
|
|
#configure script to determine some symbols of kernel
|
|
|
|
if [ "$KBUILD_MODULES" != "1" ]; then
|
|
exit 0 # exit if not building modules
|
|
fi
|
|
|
|
CONFIGURE_CFLAGS="$KBUILD_CPPFLAGS $KBUILD_CFLAGS $LINUXINCLUDE"
|
|
module_version=$(grep "^PACKAGE_VERSION" "$KBUILD_EXTMOD/dkms.conf" | grep -o "[0-9]*\.[0-9]*\.[0-9]*")
|
|
|
|
cat <<EOF > "$KBUILD_EXTMOD/include/config.h"
|
|
#include <linux/version.h>
|
|
|
|
#define DKMS_MODULE_VERSION "$module_version.sriov-6.12"
|
|
EOF
|
|
|
|
# conftest
|
|
for symbol_test in "$KBUILD_EXTMOD"/config/*.c
|
|
do
|
|
$CC $CONFIGURE_CFLAGS -c "$symbol_test" -o /dev/null > /dev/null 2>&1
|
|
if [ $? -eq 0 ]; then
|
|
grep '// \?build success:' "$symbol_test" | sed 's/^.*\/\/ \?build success: *//g' >> "$KBUILD_EXTMOD/include/config.h"
|
|
fi
|
|
done
|