]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/io/usb/slave/v2_0/host/configure.in
Initial revision
[karo-tx-redboot.git] / packages / io / usb / slave / v2_0 / host / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl ====================================================================
3 dnl
4 dnl     configure.in
5 dnl
6 dnl     configure script for eCos USB host-side support
7 dnl
8 dnl ====================================================================
9 dnl ####ECOSGPLCOPYRIGHTBEGIN####
10 dnl -------------------------------------------
11 dnl This file is part of eCos, the Embedded Configurable Operating System.
12 dnl Copyright (C) 2005 eCosCentric Ltd    
13 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14 dnl
15 dnl eCos is free software; you can redistribute it and/or modify it under
16 dnl the terms of the GNU General Public License as published by the Free
17 dnl Software Foundation; either version 2 or (at your option) any later version.
18 dnl
19 dnl eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22 dnl for more details.
23 dnl
24 dnl You should have received a copy of the GNU General Public License along
25 dnl with eCos; if not, write to the Free Software Foundation, Inc.,
26 dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 dnl
28 dnl As a special exception, if other files instantiate templates or use macros
29 dnl or inline functions from this file, or you compile this file and link it
30 dnl with other works to produce a work based on this file, this file does not
31 dnl by itself cause the resulting work to be covered by the GNU General Public
32 dnl License. However the source code for this file must still be made available
33 dnl in accordance with section (3) of the GNU General Public License.
34 dnl
35 dnl This exception does not invalidate any other reasons why a work based on
36 dnl this file might be covered by the GNU General Public License.
37 dnl
38 dnl Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 dnl at http://sources.redhat.com/ecos/ecos-license/
40 dnl -------------------------------------------
41 dnl ####ECOSGPLCOPYRIGHTEND####
42 dnl ====================================================================
43 dnl#####DESCRIPTIONBEGIN####
44 dnl
45 dnl Author(s):  bartv
46 dnl Contact(s): bartv
47 dnl Date:       2002/01/10
48 dnl Version:    0.01
49 dnl
50 dnl####DESCRIPTIONEND####
51 dnl ====================================================================
52
53
54 AC_INIT(usbhost.c)
55
56 dnl Pick up the support files from the top-level acsupport directory.
57 AC_CONFIG_AUX_DIR(../../../../../../acsupport)
58
59 ECOS_CHECK_BUILD_ne_SRC
60 AC_CANONICAL_HOST
61 AM_INIT_AUTOMAKE(usbhost,0.1,0)
62 AM_MAINTAINER_MODE
63
64 dnl The current version of the USB testing support depends on 
65 dnl functionality provided only by Linux platforms, and has only been
66 dnl tested on x86 machines, so a test is appropriate here. However
67 dnl it is not a good idea for the configure script to report an error:
68 dnl that would prevent any top-level configury working for other
69 dnl platforms. Instead an automake conditional is used to suppress adding
70 dnl targets to the build.
71 case "${host}" in
72     *-*-linux-gnu* ) SUPPORTED="yes";;
73     * ) SUPPORTED="no"
74 esac
75
76 if test "${SUPPORTED}" = "no" ; then
77     AC_MSG_WARN([USB testing is only supported on Linux hosts])
78 else   
79     AC_PROG_CC
80     AC_PROG_CXX
81     AC_PROG_LN_S
82     AC_OBJEXT
83     AC_EXEEXT
84     ECOS_PROG_MSVC
85     ECOS_PROG_STANDARD_COMPILER_FLAGS
86     ECOS_PACKAGE_DIRS
87
88     ECOS_PATH_TCL
89     dnl Check that the version of tcl is sufficiently recent.
90     dnl e.g. "end" only became a valid index for the
91     dnl string commands after 8.1
92     if test "${TK_MAJOR_VERSION}" = "8" ; then
93         if test ${TK_MINOR_VERSION} -lt 2 ; then
94             AC_MSG_WARN([Version 8.2 or greater of Tcl/Tk is required])
95             SUPPORTED="no"
96         fi
97     fi
98     if test "${SUPPORTED}" = "yes" ; then
99         AC_CHECK_HEADERS("linux/usb.h" "linux/usbdevice_fs.h",,SUPPORTED="no")
100         if test "${SUPPORTED}" = "no" ; then
101             AC_MSG_WARN([Required Linux kernel functionality does not appear to be available])
102         else
103           AC_TRY_COMPILE([
104                   #include <linux/usbdevice_fs.h>
105               ], [
106                   static struct usbdevfs_ctrltransfer xx = { .bRequestType = 0 };
107               ],
108                   AC_DEFINE(CYGBLD_USE_NEW_FIELD_NAMES)
109               )
110         fi
111     fi
112 fi
113         
114 if test "${SUPPORTED}" = "no" ; then
115     AC_MSG_WARN([The USB testing support cannot be built on this platform.])
116 fi
117         
118 AM_CONDITIONAL(SUPPORTED, test "${SUPPORTED}" = "yes")
119
120 AM_CONFIG_HEADER(config.h:config.h.in)
121 AC_OUTPUT(Makefile:Makefile.in)