Re: Cross compiling APR

2023-05-02 Thread Graham Leggett via dev
On 02 May 2023, at 08:16, Stephen Webb  wrote:

> Does cross compilation work in theory?
>  
> Am I wasting my time attempting to add support for cross compilation to the 
> conan package manager?

As I recall the cross complication I got to work was for the benefit of 
openwrt, which a while back got a makeover with proper modular APR(-util) 
builds. The apr_escape API has a code-generator that needs to run locally to 
generate the code for cross compilation.

I have no experience with the conan package manager, but any modifications you 
need to make, post them here so they can be included so it all works out the 
box.

Regards,
Graham
—



Cross compiling APR

2023-05-02 Thread Stephen Webb
I notice in release notes for 1.7 the entry

Add the ability to cross compile APR. [Graham Leggett]

Using a cache file generated on the host system, and the command:

"./configure" '--disable-shared' '--enable-static' '--prefix=/' 
'--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' 
'--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' 
'--host=arm-linux-gnueabihf' '--build=x86_64-linux-gnu' 
'--with-installbuilddir=${prefix}/res/build-1' 'apr_cv_mutex_robust_shared=yes' 
'--cache-file=../cross-build/arm-linux-gnueabihf.cache'

The following errors are reported.

configure: error: `build_alias' was not set in the previous run
configure: error: `host_alias' was not set in the previous run
configure: error: `CC' was not set in the previous run
configure: error: `CFLAGS' was not set in the previous run
configure: error: `LDFLAGS' was not set in the previous run
configure: error: `CPPFLAGS' was not set in the previous run
configure: error: in 
`/home/stephen/.conan/data/apr/1.7.4/_/_/build/0a55575c31cb553c11a11103974cbcf4338da16c/build-release':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm 
../cross_build/arm-linux-gnueabihf.cache'
and start over

Does cross compilation work in theory?

Am I wasting my time attempting to add support for cross compilation to the 
conan package manager?

Thanks
Stephen Webb



--
This email has been checked for viruses by Avast antivirus software.
www.avast.com

Cross compiling APR

2014-02-07 Thread Quartier Thomas
Hi,

I'm trying to cross compile APR for the eCos real time operating system (I need 
APR  to use the Celix OSGI framework for my thesis). I don't have a lot of 
experience with cross compiling and can't fix the following error when running 
./configure:

thomas@thomas-VB:~/aprCCTest/apr-1.5.0$
 ./configure --prefix=/home/thomas/aprCCTest/build 
--build=x86_64-unknown-linux-gnu --host=arm-elf ac_cv_file__dev_zero="yes" 
ac_cv_type_size_t="no"
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-elf
checking target system type... arm-unknown-elf
Configuring APR library
Platform: arm-unknown-elf
checking for working mkdir -p... yes
APR Version: 1.5.0
checking for chosen layout... apr
checking for arm-elf-gcc... arm-elf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-elf-gcc accepts -g... yes
checking for arm-elf-gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
Applying APR hints file rules for arm-unknown-elf
(Default will be unix)
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... arm-elf-gcc -E
checking for gawk... no
checking for mawk... mawk
checking whether ln -s works... yes
checking for arm-elf-ranlib... arm-elf-ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking for rm... rm
checking for as... as
checking for cpp... cpp
checking for arm-elf-ar... arm-elf-ar
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking whether system uses EBCDIC... no
performing libtool configuration...
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by arm-elf-gcc... 
/home/thomas/ecos/pr_7336/compiler/arm-elf/bin/ld
checking if the linker (/home/thomas/ecos/pr_7336/compiler/arm-elf/bin/ld) is 
GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... 
/home/thomas/ecos/pr_7336/compiler/bin//arm-elf-nm -B
checking the name lister (/home/thomas/ecos/pr_7336/compiler/bin//arm-elf-nm 
-B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to arm-unknown-elf 
format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain 
format... func_convert_file_noop
checking for /home/thomas/ecos/pr_7336/compiler/arm-elf/bin/ld option to reload 
object files... -r
checking for arm-elf-objdump... objdump
checking how to recognize dependent libraries... unknown
checking for arm-elf-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-elf-ar... (cached) arm-elf-ar
checking for archiver @FILE support... no
checking for arm-elf-strip... arm-elf-strip
checking for arm-elf-ranlib... (cached) arm-elf-ranlib
checking command to parse /home/thomas/ecos/pr_7336/compiler/bin//arm-elf-nm -B 
output from arm-elf-gcc object... ok
checking for sysroot... no
checking for arm-elf-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking for dlfcn.h... no
checking for objdir... .libs
checking if arm-elf-gcc supports -fno-rtti -fno-exceptions... yes
checking for arm-elf-gcc option to produce PIC... -fPIC -DPIC
checking if arm-elf-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-elf-gcc static flag -static works... yes
checking if arm-elf-gcc supports -c -o file.o... rm: cannot remove `conftest*': 
No such file or directory
yes
checking if arm-elf-gcc supports -c -o file.o... (cached) yes
checking whether the arm-elf-gcc linker 
(/home/thomas/ecos/pr_7336/compiler/arm-elf/bin/ld) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... rm: cannot remove 
`conftest*': No such file or directory
yes
checking dynamic linker characteristics... no
checking how to hardcode library p

Re: cross compiling apr failure (mingw32)

2006-03-19 Thread William A. Rowe, Jr.

Jeff,

even if cross-compilation succeeded, our platform tests would not.  Fortunately,
they aren't actually needed since we have fixed values for what is and is not
supported on w32.  But this does involve some glue that isn't present at the
moment to move apr.hw -> apr.h etc.  Unfortunately some of our tests are
build-time detection, some of our tests are run-time detection, and we've done
a poor job of deliniating them or supporting cross compilation :(

Help is always appreciated.

Bill



Jeff Koftinoff wrote:

It would be really nice if configure worked for cross-compiling for
mingw32 from linux/mac osx.  I have the cross tools installed.

I tried this command line:

../../apr/configure --host=i386-mingw32msvc --prefix=$PWD/usr

and after many successful tests using i386-mingw32msvc-* tools in the
log, I got this:

Checking for Shared Memory Support...
checking for library containing shm_open... no
checking for sys/types.h... (cached) yes
checking sys/mman.h usability... no
checking sys/mman.h presence... no
checking for sys/mman.h... no
checking sys/ipc.h usability... no
checking sys/ipc.h presence... no
checking for sys/ipc.h... no
checking sys/mutex.h usability... no
checking sys/mutex.h presence... no
checking for sys/mutex.h... no
checking sys/shm.h usability... no
checking sys/shm.h presence... no
checking for sys/shm.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking kernel/OS.h usability... no
checking kernel/OS.h presence... no
checking for kernel/OS.h... no
checking os2.h usability... no
checking os2.h presence... no
checking for os2.h... no
checking for mmap... no
checking for munmap... no
checking for shm_open... no
checking for shm_unlink... no
checking for shmget... no
checking for shmat... no
checking for shmdt... no
checking for shmctl... no
checking for create_area... no
checking for MAP_ANON in sys/mman.h... no
checking for /dev/zero... yes
../../apr/configure:Error: decision on anonymous shared memory
allocation method failed



Jeff Koftinoff







cross compiling apr failure (mingw32)

2006-03-19 Thread Jeff Koftinoff
It would be really nice if configure worked for cross-compiling for
mingw32 from linux/mac osx.  I have the cross tools installed.

I tried this command line:

../../apr/configure --host=i386-mingw32msvc --prefix=$PWD/usr

and after many successful tests using i386-mingw32msvc-* tools in the
log, I got this:

Checking for Shared Memory Support...
checking for library containing shm_open... no
checking for sys/types.h... (cached) yes
checking sys/mman.h usability... no
checking sys/mman.h presence... no
checking for sys/mman.h... no
checking sys/ipc.h usability... no
checking sys/ipc.h presence... no
checking for sys/ipc.h... no
checking sys/mutex.h usability... no
checking sys/mutex.h presence... no
checking for sys/mutex.h... no
checking sys/shm.h usability... no
checking sys/shm.h presence... no
checking for sys/shm.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking kernel/OS.h usability... no
checking kernel/OS.h presence... no
checking for kernel/OS.h... no
checking os2.h usability... no
checking os2.h presence... no
checking for os2.h... no
checking for mmap... no
checking for munmap... no
checking for shm_open... no
checking for shm_unlink... no
checking for shmget... no
checking for shmat... no
checking for shmdt... no
checking for shmctl... no
checking for create_area... no
checking for MAP_ANON in sys/mman.h... no
checking for /dev/zero... yes
../../apr/configure:Error: decision on anonymous shared memory
allocation method failed



Jeff Koftinoff



Re: cross-compiling apr

2004-09-16 Thread Joe Orton
On Thu, Sep 16, 2004 at 12:41:36PM +0200, Jens Syckor wrote:
> I started configure script to cross-compile apr lib
> but got the following error:
> 
> checking if setpgrp takes no argument
> error: can not check setpgrp if cross-compiling
> 
> My question: Is it possible to cross-compile apr
> and if Yes how can I modify it to preconfigure
> setpgrp option?

You can use a config.site file to pre-cache results for the configure
checks which are appropriate for the target rather than the host.  But
you will probably have to do a lot of work on the configure script since
it does not use AC_CACHE_CHECK everywhere it should do.

joe



cross-compiling apr

2004-09-16 Thread Jens Syckor
Hi,

I started configure script to cross-compile apr lib
but got the following error:

checking if setpgrp takes no argument
error: can not check setpgrp if cross-compiling

My question: Is it possible to cross-compile apr
and if Yes how can I modify it to preconfigure
setpgrp option?

Regards,
Jens