Commit | Line | Data |
---|---|---|
a3da1d95 GE |
1 | dnl This file is part of the KDE libraries/packages |
2 | dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org) | |
3 | dnl modified by Walter Tasin (tasin@kdevelop.org) | |
4 | dnl for c++ console applications | |
5 | ||
6 | dnl This file is free software; you can redistribute it and/or | |
7 | dnl modify it under the terms of the GNU Library General Public | |
8 | dnl License as published by the Free Software Foundation; either | |
9 | dnl version 2 of the License, or (at your option) any later version. | |
10 | ||
11 | dnl This library is distributed in the hope that it will be useful, | |
12 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | dnl Library General Public License for more details. | |
15 | ||
16 | dnl You should have received a copy of the GNU Library General Public License | |
17 | dnl along with this library; see the file COPYING.LIB. If not, write to | |
18 | dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 | dnl Boston, MA 02111-1307, USA. | |
20 | ||
21 | # Original Author was Kalle@kde.org | |
22 | # I lifted it in some mater. (Stephan Kulow) | |
23 | # I used much code from Janos Farkas | |
24 | ||
25 | dnl Process this file with autoconf to produce a configure script. | |
26 | ||
27 | AC_INIT(acinclude.m4) dnl a source file from your sub dir | |
28 | ||
29 | dnl This is so we can use kde-common | |
30 | AC_CONFIG_AUX_DIR(admin) | |
31 | ||
32 | dnl This ksh/zsh feature conflicts with `cd blah ; pwd` | |
33 | unset CDPATH | |
34 | ||
35 | dnl Checking host/target/build systems, for make, install etc. | |
36 | AC_CANONICAL_SYSTEM | |
37 | dnl Perform program name transformation | |
38 | AC_ARG_PROGRAM | |
39 | ||
40 | dnl Automake doc recommends to do this only here. (Janos) | |
41b8ae57 | 41 | AM_INIT_AUTOMAKE(libftdi, 0.4) dnl searches for some needed programs |
a3da1d95 GE |
42 | |
43 | dnl almost the same like KDE_SET_PEFIX but the path is /usr/local | |
44 | dnl | |
45 | unset CDPATH | |
46 | dnl make /usr/local the default for the installation | |
47 | AC_PREFIX_DEFAULT(/usr/local) | |
48 | ||
49 | if test "x$prefix" = "xNONE"; then | |
50 | prefix=$ac_default_prefix | |
51 | ac_configure_args="$ac_configure_args --prefix $prefix" | |
52 | fi | |
53 | dnl KDE_FAST_CONFIGURE | |
54 | dnl KDE_CONF_FILES | |
55 | ||
56 | dnl without this order in this file, automake will be confused! | |
57 | dnl | |
58 | AM_CONFIG_HEADER(config.h) | |
59 | ||
60 | dnl checks for programs. | |
61 | dnl first check for c compiler | |
62 | AC_CHECK_C_COMPILER | |
63 | ||
64 | dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__ | |
65 | ||
66 | dnl create only shared libtool-libraries | |
67 | AC_ENABLE_SHARED(yes) | |
68 | ||
69 | dnl set the following to yes, if you want to create static | |
70 | dnl libtool-libraries, too. | |
71 | AC_ENABLE_STATIC(yes) | |
72 | ||
73 | dnl create a working libtool-script | |
74 | KDEV_PROG_LIBTOOL | |
75 | ||
76 | dnl activate the next macro call for DLOPEN tests and setting LIBDL | |
77 | dnl (n.b. KDE_MISC_TESTS does the same to you, so use either this or the next one) | |
78 | dnl KDE_CHECK_DLOPEN | |
79 | ||
80 | dnl activate the next macro call for some additional tests | |
81 | dnl (compat, crypt, socket, nsl, dlopen, ...) | |
82 | dnl KDE_MISC_TESTS dnl __kdevelop__ | |
83 | ||
84 | dnl KDE_NEED_FLEX dnl __kdevelop__ | |
85 | dnl AC_PROG_YACC dnl __kdevelop__ | |
86 | ||
ed475f55 TJ |
87 | |
88 | dnl check for libusb-config | |
89 | AC_PATH_PROG(HAVELIBUSB, libusb-config, $PATH) | |
90 | ||
91 | if test ! -z "$HAVELIBUSB"; then | |
92 | dnl LIBUSB_CFLAGS=`$HAVELIBUSB --cflags` | |
93 | LIBUSB_LIBS=`$HAVELIBUSB --libs` | |
94 | ||
95 | CFLAGS="$CFLAGS $LIBUSB_CFLAGS" | |
96 | LIBS="$LIBS $LIBUSB_LIBS" | |
97 | else | |
98 | AC_MSG_ERROR([*** libusb-config not found. You need a working libusb installation.]) | |
99 | fi | |
100 | ||
101 | dnl check for version of libusb | |
102 | AC_MSG_CHECKING([if libusb version is >= 0.1.7]) | |
103 | libusb_version_needed="1007" | |
104 | libusb_version=`$HAVELIBUSB --version | sed -e "s/libusb //" | awk 'BEGIN { FS = "."; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'` | |
105 | ||
106 | if test $libusb_version -lt $libusb_version_needed; then | |
107 | AC_MSG_RESULT(no) | |
108 | AC_MSG_ERROR([*** libusb is too old ($libusb_version). You need a libusb installation newer or equal to 0.1.7.]) | |
109 | else | |
110 | AC_MSG_RESULT(yes) | |
111 | fi | |
112 | ||
113 | ||
a3da1d95 GE |
114 | dnl KDE_CHECK_EXTRA_LIBS |
115 | all_libraries="$all_libraries $USER_LDFLAGS" | |
116 | all_includes="$all_includes $USER_INCLUDES" | |
117 | AC_SUBST(all_includes) | |
118 | AC_SUBST(all_libraries) | |
119 | ||
120 | AC_SUBST(AUTODIRS) | |
121 | ||
3def7c7e | 122 | AC_OUTPUT([libftdi-config],[chmod a+x libftdi-config]) |