mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-19 21:07:54 +00:00
Add a check for gperf function signature.
Loosely based on:
c9f7b4d356
Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
parent
dc9dac2220
commit
3bb2bcd2a3
@ -69,6 +69,7 @@ export objdump := @OBJDUMP@
|
||||
export readelf := @READELF@
|
||||
export patch := @PATCH@
|
||||
export gperf := @GPERF@
|
||||
export gperf_len_type := @GPERF_LEN_TYPE@
|
||||
export CC := @CC@
|
||||
export CPP := @CPP@
|
||||
export CPPFLAGS := @CPPFLAGS@
|
||||
|
22
configure.ac
22
configure.ac
@ -134,9 +134,9 @@ AS_IF([test -z "$CC"],
|
||||
AC_PROG_CPP
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Check to see if gcc can static link
|
||||
AC_MSG_CHECKING([if gcc can static link])
|
||||
echo "int main() {}" | gcc -static -o /dev/null -xc - > /dev/null 2>&1
|
||||
# Check to see if the compiler can link statically
|
||||
AC_MSG_CHECKING([if $CC can static link])
|
||||
echo "int main() {}" | ${CC} -static -o /dev/null -xc - > /dev/null 2>&1
|
||||
static_test=$?
|
||||
AS_IF([test $static_test -eq 0],
|
||||
[static_link=y
|
||||
@ -305,6 +305,22 @@ AC_CACHE_CHECK([for GNU automake >= 1.10], [ac_cv_path_automake],
|
||||
AC_MSG_ERROR([could not find GNU automake >= 1.10])])])
|
||||
AC_SUBST([automake], [$ac_cv_path_automake])
|
||||
|
||||
#----------------------------------------
|
||||
# Gperf 3.1 started generating functions with size_t rather than unsigned int
|
||||
AC_MSG_CHECKING([for the type used in gperf declarations])
|
||||
echo "#include <string.h>" > conftest.gperf.c
|
||||
echo "const char * in_word_set(const char *, GPERF_LEN_TYPE);" >> conftest.gperf.c
|
||||
echo foo,bar | ${GPERF} -L ANSI-C >> conftest.gperf.c
|
||||
AS_IF([${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='size_t' >/dev/null 2>&1],
|
||||
[AC_MSG_RESULT([size_t])
|
||||
GPERF_LEN_TYPE='size_t'],
|
||||
[${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='unsigned int' >/dev/null 2>&1],
|
||||
[AC_MSG_RESULT([unsigned int])
|
||||
GPERF_LEN_TYPE='unsigned int'],
|
||||
[AC_MSG_ERROR([unable to determine gperf len type])])
|
||||
rm -f conftest.gperf.c
|
||||
AC_SUBST([GPERF_LEN_TYPE])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Boring again... But still a bit of work to do...
|
||||
#--------------------------------------------------------------------
|
||||
|
@ -6,7 +6,8 @@ all: conf mconf nconf
|
||||
@true # Just be silent, you fscking son of a fscking beach...
|
||||
|
||||
# Build flags
|
||||
CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\""
|
||||
CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\"" \
|
||||
-DGPERF_LEN_TYPE="$(gperf_len_type)"
|
||||
LDFLAGS = $(INTL_LIBS)
|
||||
|
||||
# Compiler flags to use gettext
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
struct kconf_id;
|
||||
|
||||
static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
|
||||
static const struct kconf_id *kconf_id_lookup(register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
%%
|
||||
mainmenu, T_MAINMENU, TF_COMMAND
|
||||
|
Loading…
Reference in New Issue
Block a user