]>
Commit | Line | Data |
---|---|---|
0662f2bb ML |
1 | ## |
2 | ## This file is part of the libserialport project. | |
3 | ## | |
4 | ## Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com> | |
5 | ## Copyright (C) 2013 Martin Ling <martin-libserialport@earth.li> | |
6 | ## | |
7 | ## This program is free software: you can redistribute it and/or modify | |
8 | ## it under the terms of the GNU Lesser General Public License as | |
9 | ## published by the Free Software Foundation, either version 3 of the | |
10 | ## License, or (at your option) any later version. | |
11 | ## | |
12 | ## This program is distributed in the hope that it will be useful, | |
13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ## GNU General Public License for more details. | |
16 | ## | |
17 | ## You should have received a copy of the GNU Lesser General Public License | |
18 | ## along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | ## | |
20 | ||
21 | # We require at least autoconf 2.63 (AC_INIT format changed there). | |
22 | AC_PREREQ([2.63]) | |
23 | ||
24 | # libserialport package version number (NOT the same as shared lib version!). | |
25 | m4_define([sp_package_version_major], [0]) | |
26 | m4_define([sp_package_version_minor], [1]) | |
27 | m4_define([sp_package_version], [sp_package_version_major.sp_package_version_minor]) | |
28 | ||
29 | AC_INIT([libserialport], [sp_package_version], [martin-libserialport@earth.li], | |
30 | [libserialport], [http://github.com/martinling/libserialport]) | |
31 | AC_CONFIG_MACRO_DIR([autostuff]) | |
32 | AC_CONFIG_AUX_DIR([autostuff]) | |
33 | ||
34 | # We require at least automake 1.11 (needed for 'silent rules'). | |
35 | AM_INIT_AUTOMAKE([1.11 -Wall -Werror]) | |
36 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | |
37 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) | |
38 | ||
39 | AH_TOP([#ifndef SP_CONFIG_H | |
40 | #define SP_CONFIG_H /* To stop multiple inclusions. */]) | |
41 | AH_BOTTOM([#endif /* SP_CONFIG_H */]) | |
42 | ||
43 | # Enable more compiler warnings via -Wall and -Wextra. | |
44 | CFLAGS="$CFLAGS -Wall -Wextra" | |
45 | ||
46 | # Checks for programs. | |
47 | AC_PROG_CC | |
48 | AC_PROG_CPP | |
49 | AC_PROG_INSTALL | |
50 | AC_PROG_LN_S | |
51 | ||
52 | # Required for per-target flags or subdir-objects with C sources. | |
53 | AM_PROG_CC_C_O | |
54 | ||
55 | # Initialize libtool. | |
56 | LT_INIT | |
57 | ||
58 | # Initialize pkg-config. | |
59 | PKG_PROG_PKG_CONFIG([0.22]) | |
60 | ||
61 | # Library version for libserialport (NOT the same as the package version). | |
62 | # Carefully read the libtool docs before updating these numbers! | |
63 | # The algorithm for determining which number to change (and how) is nontrivial! | |
64 | # http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info | |
65 | SP_LIB_VERSION_CURRENT=0 | |
66 | SP_LIB_VERSION_REVISION=0 | |
67 | SP_LIB_VERSION_AGE=0 | |
68 | SP_LIB_VERSION="$SP_LIB_VERSION_CURRENT:$SP_LIB_VERSION_REVISION:$SP_LIB_VERSION_AGE" | |
69 | SP_LIB_LDFLAGS="-version-info $SP_LIB_VERSION" | |
70 | AC_SUBST(SP_LIB_VERSION_CURRENT) | |
71 | AC_SUBST(SP_LIB_VERSION_REVISION) | |
72 | AC_SUBST(SP_LIB_VERSION_AGE) | |
73 | AC_SUBST(SP_LIB_VERSION) | |
74 | AC_SUBST(SP_LIB_LDFLAGS) | |
75 | ||
76 | # Checks for header files. | |
77 | # These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h. | |
78 | AC_CHECK_HEADERS([sys/types.h sys/stat.h fcntl.h termios.h sys/ioctl.h errno.h]) | |
79 | ||
80 | # Checks for typedefs, structures, and compiler characteristics. | |
81 | AC_C_INLINE | |
82 | AC_TYPE_SIZE_T | |
83 | AC_TYPE_SSIZE_T | |
84 | ||
85 | # Checks for library functions. | |
86 | AC_CHECK_FUNCS([strerror]) | |
87 | ||
88 | AC_SUBST(MAKEFLAGS, '--no-print-directory') | |
89 | AC_SUBST(AM_LIBTOOLFLAGS, '--silent') | |
90 | ||
91 | SP_PACKAGE_VERSION_MAJOR=sp_package_version_major | |
92 | SP_PACKAGE_VERSION_MINOR=sp_package_version_minor | |
93 | SP_PACKAGE_VERSION=sp_package_version | |
94 | ||
95 | AC_SUBST(SP_PACKAGE_VERSION_MAJOR) | |
96 | AC_SUBST(SP_PACKAGE_VERSION_MINOR) | |
97 | AC_SUBST(SP_PACKAGE_VERSION) | |
98 | ||
99 | AC_CONFIG_FILES([Makefile libserialport.pc]) | |
100 | ||
101 | AC_OUTPUT | |
102 | ||
103 | echo | |
104 | echo "libserialport configuration summary:" | |
105 | echo | |
106 | echo " - Package version (major.minor): $SP_PACKAGE_VERSION" | |
107 | echo " - Library version (current:revision:age): $SP_LIB_VERSION" | |
108 | echo " - Prefix: $prefix" | |
109 | echo " - Building on: $build" | |
110 | echo " - Building for: $host" | |
111 | echo |