apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55199] New: broken APR cross-compile build on Linux for FreeBSD platform
Date Fri, 05 Jul 2013 09:25:32 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55199

            Bug ID: 55199
           Summary: broken APR cross-compile build on Linux for FreeBSD
                    platform
           Product: APR
           Version: HEAD
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: vdm-photo@ya.ru

APR failed to configure properly in following cross-compiler configuration:
Build system: Linux
Target platform: FreeBSD (8.0 and 9.0 in my case, but it doesn't matter).

Current configure script uses /sbin/sysctl to get exact FreeBSD version using
parameter kern.osreldate:

if test -x /sbin/sysctl; then
  os_version=`/sbin/sysctl -n kern.osreldate`
else
  os_version=000000
fi

This code, obviously, doesn't work while cross-compiling on Linux. Moreover, it
works INCORRECTLY if build platform is FreeBSD - it'll detect BUILD system's
version, not TARGET one.

I fixed this using $host variable:

case $host in
  *freebsd7*)
    os_version=700000;;
  *freebsd8*)
    os_version=800000;;
  *freebsd9*)
   os_version=900000;;
  *)
  # old default behavior for systems we don't intrested in
  if test -x /sbin/sysctl; then
    os_version=`/sbin/sysctl -n kern.osreldate`
  else
    os_version=000000
  fi;;
esac

I guess this is not very good and universal solution. But this is only way to
detect target system version programmatically.  Another way is to pass
OS_VERSION to configure script as a parameter.

Note: the most annoying part of this bug is that this error is swallowed by
configure:

Configuring APR library
Platform: x86_64-pc-freebsd8.0
checking for working mkdir -p... yes
APR Version: 1.4.8
checking for chosen layout... apr
checking for x86_64-pc-freebsd8.0-gcc... x86_64-pc-freebsd8.0-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 x86_64-pc-freebsd8.0-gcc accepts -g... yes
checking for x86_64-pc-freebsd8.0-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 x86_64-pc-freebsd8.0
  setting apr_lock_method to "USE_FLOCK_SERIALIZE"
/proc/sys/kern/osreldate: No such file or directory
/tmp/automate-temp.1372947938.24033/httpd-apr4-2.4.4/httpd-2.4.4/srclib/apr/configure:
line 6651: test: -ge: unary operator expected
  setting CPPFLAGS to "-D_THREAD_SAFE -D_REENTRANT"
  setting enable_threads to "no"
/tmp/automate-temp.1372947938.24033/httpd-apr4-2.4.4/httpd-2.4.4/srclib/apr/configure:
line 6684: test: -lt: unary operator expected

... and continuing. Configure process is not stopped, but it results in various
errors during compiling.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message