Skip to content

Commit b7152e3

Browse files
committed
Submitted by: Hongxu Jia <[email protected]>
https://patch-diff.githubusercontent.com/raw/apache/apr/pull/8.patch While cross-compiling, the tools/gen_test_char could not be executed at build time, use AX_PROG_CC_FOR_BUILD to build native tools/gen_test_char Support explicit libtool by variable assigning before buildcheck.sh, it is helpful for cross-compiling (such as libtool=aarch64-linux-libtool) Backports: r1839627 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1839628 13f79535-47bb-0310-9956-ffa450edef68
1 parent e0f3b1f commit b7152e3

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Makefile.in

+3-7
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ LT_VERSION = @LT_VERSION@
4646

4747
CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
4848
build/apr_rules.out tools/gen_test_char@EXEEXT@ \
49-
tools/gen_test_char.o tools/gen_test_char.lo \
49+
tools/gen_test_char.o \
5050
include/private/apr_escape_test_char.h
5151
DISTCLEAN_TARGETS = config.cache config.log config.status \
5252
include/apr.h include/arch/unix/apr_private.h \
@@ -130,13 +130,9 @@ check: $(TARGET_LIB)
130130
etags:
131131
etags `find . -name '*.[ch]'`
132132

133-
OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
134-
tools/gen_test_char.lo: tools/gen_test_char.c
133+
tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
135134
$(APR_MKDIR) tools
136-
$(LT_COMPILE)
137-
138-
tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
139-
$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
135+
$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@
140136

141137
include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
142138
$(APR_MKDIR) include/private

build/buildcheck.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ fi
4040
# output is multiline from 1.5 onwards
4141

4242
# Require libtool 1.4 or newer
43-
libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
43+
if test -z "$libtool"; then
44+
libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
45+
fi
4446
lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
4547
if test -z "$lt_pversion"; then
4648
echo "buildconf: libtool not found."

configure.in

+3
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ dnl can only be used once within a configure script, so this prevents a
183183
dnl preload section from invoking the macro to get compiler info.
184184
AC_PROG_CC
185185

186+
dnl Check build CC for gen_test_char compiling which is executed at build time.
187+
AX_PROG_CC_FOR_BUILD
188+
186189
dnl AC_PROG_SED is only avaliable in recent autoconf versions.
187190
dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present.
188191
ifdef([AC_PROG_SED],

0 commit comments

Comments
 (0)