You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Mo DeJong <md...@cygnus.com> on 2001/07/09 09:07:18 UTC

Why host_alias?

Hi all.

I don't follow why ${host_alias} is being used in the toplevel
apr configure.in file when the ${OS} variable is used in other
places. The OS variable is set to ${host} which is expanded
from the value passed in on the configure command line after
being filtered through config.sub.

For example:

% ./config.sub mingw32
i386-pc-mingw32

% ./configure --host=mingw32
loading cache ./config.cache
checking host system type... i386-pc-mingw32
host is "i386-pc-mingw32"
host_alias is "mingw32"

As you can see, the ${host} value is almost always
the "more correct" value to use in this case. There
could be any number of aliases, but one should not
need to deal with that if you just stick to using
$host. Here is a quick patch that should fix things.

cheers
Mo

Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.331
diff -u -r1.331 configure.in
--- configure.in	2001/07/08 02:48:53	1.331
+++ configure.in	2001/07/09 06:54:09
@@ -91,7 +91,7 @@
 dnl
 echo "performing libtool configuration..."
 
-case "$host_alias" in
+case "$OS" in
 *os2*)
     # Use a custom-made libtool replacement
     echo "using aplibtool"
@@ -1255,7 +1255,7 @@
 dnl
 dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
 dnl
-case "$host_alias" in
+case "$OS" in
 *bsdi*)
     # Check whether they've installed GNU make
     if make --version > /dev/null 2>&1; then 



Re: Why host_alias?

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
On Mon, Jul 09, 2001 at 03:05:29PM -0700, Mo DeJong wrote:
> On Mon, 9 Jul 2001, Roy T. Fielding wrote:
> 
> > I agree that $host should be used, but $OS is not the same as $host.
> 
> I don't follow, this is from configure.in:

Oops, right, I was looking at configure.in in httpd-2.0, which does almost
the same thing but then overrides OS to be a generic platform name.  It
looks like the APR stuff was cut and pasted from that.  I'll fix it.

....Roy


Re: Why host_alias?

Posted by Mo DeJong <md...@cygnus.com>.
On Mon, 9 Jul 2001, Roy T. Fielding wrote:

> I agree that $host should be used, but $OS is not the same as $host.

I don't follow, this is from configure.in:

AC_CANONICAL_SYSTEM
echo "Configuring APR library"
OS=$host
echo "Platform: $OS"

I guess I don't follow why OS exists at all, why not replace
it with $host in configure.in?

> I'll try replacing host_alias when I get a chance.

The patch I posted should do the trick.

> Looking at the autoconf code, though, I am wondering if we should be
> using $target instead.

No, an application should not concern itself with $target. Only
a compiler/debugger/simulator that could deal with some cross
case needs to worry about $target.

This is an area of widespread confusion. Here is the way things
are meant to work (despite what you might have heard).

--build=TRIPLE
   Triple for the system a package is built on.
--host=TRIPLE
   Triple for the system the compiled package will be hosted on.
--target=TRIPLE
   Triple for the system the package will target.

For example, if you wanted to cross compile an application
that would run under Win32 from Linux, you could run:

.../configure --build=i386-pc-linux-gnu --host=i686-pc-windows32-msvcrt

Now, you should not actually need to pass --build to make this
work, but it is a bug/feature of autoconf 2.13 that is
kept around in autoconf 2.50 for backwards compatibility
(except that there is an exception that I will not mention here).

One should only use --target in the case where you are building
a tool that needs to be cross compiled and needs to target
a different arch than the --host. For example:

.../configure --build=i386-pc-linux-gnu --host=i686-pc-windows32-msvcrt \
              --target=sparc-sun-solaris2.6

This would build a windows executable (under Linux) that could
understand Solaris Sparc executables, object files, and the like:

Mo DeJong
Red Hat Inc

Re: Why host_alias?

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
I agree that $host should be used, but $OS is not the same as $host.
I'll try replacing host_alias when I get a chance.

Looking at the autoconf code, though, I am wondering if we should be
using $target instead.

....Roy