How to tell autoconf about cross-HOST function violations?

I am trying to cross-build a package with autotools enabled for an unusual embedded system with a very incomplete libc. (If relevant: the CPython 3.4.2 package and "embedded system" is a command line wrapper on Android 4.4.)

AFAIK no way the configure

build works on my machine can detect which functions on the host are corrupted. ( configure

can and does, compiles and links test programs on the build machine, but it does not have access to run the program on the host.) For example, it is declared in the host header and defined in the host libc, but the implementation is incorrect. wcsftime()

<wchar.h>

A configure

file config.h

with a C macro is generated for this package HAS_WCSFTIME

, which is defined if it configure

thinks the host has a worker wcsftime()

and is not specified otherwise. And the source code of the package is correctly ifdefed, so if wcsftime()

missing, it is used instead strftime()

, with the correct conversions between 7-bit ascii and UCS-4.

I can't just run configure

with:

CPPFLAGS=-UHAS_WCSFTIME configure --build=... --host=... ...

      

because the config.h file just overrides it.

The options I've come up with so far:

  • add variable ac_cv_broken_host_wcsftime

    to configure.ac file
  • add ifdef

    for macro HAS_BROKEN_WCSFTIME

    to sources
  • fix host libc
  • create a patch for config.h that flips HAS_WCSFTIME from defined to undefined and don't forget to run patch

    every time after startupconfigure

I have already implemented option (4) and it is ... unsatisfactory. I can do (1) or (2) and submit it back to the developers of the package, but then it will take several months before the changes are enabled. I am working on option (3), but many of my custom phones and tablets will take many years.

What's the correct way to deal with this problem? (I expect this to come up with a lot, as I have many different packages that I want to get and there are dozens of broken functions in libc.)

Is there any command line option for configure

that will allow me to control which CPP macros are executed and not defined?

+3


source to share


1 answer


Is there any command line parameter to configure that will allow me to control which CPP macros are executed and not defined?

Not.

Your best bet is to talk to the package maintainers. They can help you install an acceptable patch for your package. Then you can apply this patch until it is pressed in the following way.

Alternatively 4) you might as well fix configure

, especially if the configure

bootstrap script is called to build . Doing actions in bootstrap script to fix configure

or libtool

etc. Is one of the ways to solve this problem in the past.



If in 3) you mean Bionic as libc, I think "never" is probably a more precise timetable than "it takes years" to get broad character features in it.

AFAIK there is no way to set up a build to run on my machine to determine what functions are broken on the host. (configure can and does, compiles and links test programs on the build machine, but it does not have access to run the program on the host.)

Mostly true. Scratchbox2 will allow you to run runtime tests configure

on the host, but unfortunately it doesn't support Android.

+2


source







All Articles