]> git.proxmox.com Git - grub2.git/blame - genkernsyms.sh.in
Export serial-related functions from kernel
[grub2.git] / genkernsyms.sh.in
CommitLineData
7b455f4d 1#! /bin/sh
2#
f36cc108 3# Copyright (C) 2002,2006,2008 Free Software Foundation, Inc.
7b455f4d 4#
5# This gensymlist.sh is free software; the author
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14### The configure script will replace these variables.
15
26887f22 16: ${srcdir=@srcdir@}
473df63d 17: ${CC=@TARGET_CC@}
7b455f4d 18
2a8a80e4 19u=
20grep "^#define HAVE_ASM_USCORE" config.h >/dev/null 2>&1 && u="_"
21
f84b481b 22$CC @TARGET_CFLAGS@ -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \
7b455f4d 23 | grep -v '^#' \
24 | sed -n \
2a8a80e4 25 -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$u"'\1 kernel/;p;}' \
26 -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/'"$u"'\1 kernel/;p;}' \
7b455f4d 27 | sort -u