When cross compiling RPM 4.3.2-2, some mysterious failures occur. Errors similar to below occur: checking libelf.h usability... no checking libelf.h presence... yes configure: WARNING: libelf.h: present but cannot be compiled configure: WARNING: libelf.h: check for missing prerequisite headers? configure: WARNING: libelf.h: see the Autoconf documentation configure: WARNING: libelf.h: section "Present But Cannot Be Compiled" configure: WARNING: libelf.h: proceeding with the preprocessor's result configure: WARNING: libelf.h: in the future, the compiler will take precedence configure: WARNING: ## ---------------------------------- ## configure: WARNING: ## Report this to rpm-list ## configure: WARNING: ## ---------------------------------- ##
The problem was tracked down to a configure.ac statement: dnl dnl use defaults if cross-compiling, otherwise use the default path. dnl if test "$cross_compiling" = "yes"; then MYPATH="" else # MYPATH="/bin:/usr/bin:/usr/local/bin:$PATH:/sbin:/usr/sbin:/usr/local/sbin:/opt/gnu/bin" MYPATH=$PATH fi If you change 'MYPATH=""' to 'MYPATH=":"' the problem goes away, and the desired behavior (according to the comment) occurs.
Created attachment 110382 [details] Patch to fix the MYPATH for crosscompilation.
Checked in on HEAD and rpm-4_{4,3,2} branches. Thanks for the patch. Should be in rpm-4.4.1-0.13 and later when built.