]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Added support for --with-host
authorJaroslav Kysela <perex@perex.cz>
Sun, 3 Mar 2002 09:25:02 +0000 (09:25 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sun, 3 Mar 2002 09:25:02 +0000 (09:25 +0000)
INSTALL
configure.in

diff --git a/INSTALL b/INSTALL
index 8443034b38b75defb0a01090355b63400350da9b..2a9991d06591c9aab23d9d4a21bd0336a9fece8c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -74,3 +74,40 @@ options for the configure script:
 
 Unfortunately, due to bug in the libtool script, the shared and static
 library cannot be built together.
+
+Configuration for cross-compilation
+-----------------------------------
+
+When you would like to cross-compile ALSA library (e.g. compile on
+i686 host but for arm architecture) you will need to call ./configure
+script with aditional parameters:
+
+CC=arm-linux-gcc ./configure --target=arm-linux \
+--with-soundbase=/usr/local/arm/src/linux/include
+
+In this example host where the library is build is guessed (should be
+given with --host=platform) and target for which is the library build is
+Linux on ARM architecture. You need to specify location of kernel includes
+configured for target architecture. This is used to find ALSA include
+files and so it should be set to prefix where '/sound' directory should
+be found. You should ommit setting 'CC' variable and cross-compiler will
+be guessed too. You could also use option '--prefix' to specify ALSA include
+directory directly if $prefix/include/sound exists.
+
+So simplest version would be:
+
+./configure --target=arm-linux --with-soundbase=/usr/local/arm/include
+
+or
+
+./configure --target=arm-linux --prefix=/usr/local/arm
+
+As you will likely specify the prefix, the last posibbility would be
+the best if everything match. On the listing of 'configure' script
+check if directory with ALSA headers was found properly same as platform
+specific configurations like processor type and selected cross-compiler. 
+
+For platform names in the form cpu-vendor-os (or aliases for this)
+you should look in 'config.guess' script. Target and all paths
+used here are only examples and should not be directly applicable to
+your system.
index 3e12427b59b803d9198a68f795f465f8da55ebc1..e0b4453e0cc2fa9498ddf9af9a162287f2e64a6b 100644 (file)
@@ -7,6 +7,7 @@ dnl change API = c+1:0:a
 dnl add API = c+1:0:a+1
 dnl remove API = c+1:0:0
 dnl *************************************************
+AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(alsa-lib, 0.9.0beta12)
 eval LIBTOOL_VERSION_INFO="2:0:0"
 dnl *************************************************
@@ -15,6 +16,22 @@ AM_CONDITIONAL(INSTALL_M4, test "x${ACLOCAL}" = "xaclocal")
 AC_PREFIX_DEFAULT(/usr)
 
 dnl Checks for programs.
+
+dnl try to gues cross-compiler if not set
+if test "x$target" != "x$host" -a -z "`echo $CC | grep -e '-gcc'`";
+then
+  AC_MSG_CHECKING(for cross-compiler)
+
+  which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
+  which ${target_cpu}-${target_os}-gcc >/dev/null 2>&1 \
+  && CC=${target_cpu}-${target-os}-gcc
+  which ${target_cpu}-${target_vendor}-${target_os}-gcc >/dev/null 2>&1 \
+  && CC=${target_cpu}-${target_vendor}-${target_os}-gcc
+
+  AC_MSG_RESULT($CC)
+fi
+           
+
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_LN_S 
@@ -105,7 +122,7 @@ fi
 
 dnl Check for architecture
 AC_MSG_CHECKING(for architecture)
-case "$host_cpu" in
+case "$target" in
 i?86*)
   AC_MSG_RESULT(x86)
   ;;