]>
Commit | Line | Data |
---|---|---|
795ca3e5 AK |
1 | ################################################################################ |
2 | ## | |
3 | ## Copyright 1999-2000 Sistina Software, Inc. | |
4 | ## | |
5 | ## This is free software released under the GNU General Public License. | |
6 | ## There is no warranty for this software. See the file COPYING for | |
7 | ## details. | |
8 | ## | |
9 | ## See the file CONTRIBUTORS for a list of contributors. | |
10 | ## | |
11 | ## This file is maintained by: | |
12 | ## AJ Lewis <lewis@sistina.com> | |
13 | ## | |
14 | ## File name: configure.in | |
15 | ## | |
16 | ## Description: Input file for autoconf. Generates the configure script | |
17 | ## that tries to keep everything nice and portable. It also | |
18 | ## simplifies distribution package building considerably. | |
19 | ################################################################################ | |
20 | ||
21 | dnl Process this file with autoconf to produce a configure script. | |
13c7b701 | 22 | AC_INIT(lib/device/dev-cache.h) |
795ca3e5 AK |
23 | |
24 | dnl setup the directory where autoconf has auxilary files | |
25 | AC_CONFIG_AUX_DIR(autoconf) | |
26 | ||
27 | dnl Checks for programs. | |
28 | AC_PROG_AWK | |
29 | AC_PROG_CC | |
30 | AC_PROG_INSTALL | |
31 | AC_PROG_LN_S | |
32 | AC_PROG_MAKE_SET | |
33 | AC_PROG_RANLIB | |
34 | ||
35 | dnl Checks for header files. | |
36 | AC_HEADER_DIRENT | |
37 | AC_HEADER_STDC | |
38 | AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h) | |
39 | ||
40 | dnl Checks for typedefs, structures, and compiler characteristics. | |
41 | AC_C_CONST | |
42 | AC_C_INLINE | |
43 | AC_TYPE_OFF_T | |
44 | AC_TYPE_PID_T | |
45 | AC_TYPE_SIZE_T | |
46 | AC_STRUCT_ST_RDEV | |
47 | AC_HEADER_TIME | |
48 | ||
49 | dnl -- prefix is /usr by default, the exec_prefix default is setup later | |
50 | AC_PREFIX_DEFAULT(/usr) | |
51 | ||
52 | dnl -- setup the ownership of the files | |
53 | AC_ARG_WITH(user, | |
54 | [ --with-user=USER Set the owner of installed files ], | |
55 | [ OWNER="$withval" ], | |
56 | [ OWNER="root" ]) | |
57 | ||
58 | dnl -- setup the group ownership of the files | |
59 | AC_ARG_WITH(group, | |
60 | [ --with-group=GROUP Set the group owner of installed files ], | |
61 | [ GROUP="$withval" ], | |
62 | [ GROUP="root" ]) | |
63 | ||
5a52dca9 AK |
64 | dnl -- format1 inclusion type |
65 | AC_ARG_WITH(lvm1, | |
66 | [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none | |
67 | [TYPE=internal] ], | |
68 | [ LVM1="$withval" ], | |
69 | [ LVM1="internal" ]) | |
70 | ||
71 | if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]]; | |
72 | then AC_MSG_ERROR( | |
73 | --with-lvm1 parameter invalid | |
74 | ) | |
75 | exit | |
76 | fi; | |
77 | ||
8ef2b021 | 78 | AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2) |
795ca3e5 AK |
79 | |
80 | dnl Enables staticly linked tools | |
81 | AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to the liblvm library | |
82 | statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no) | |
83 | ||
5a52dca9 AK |
84 | dnl Enable readline |
85 | AC_ARG_ENABLE(readline, [ --enable-readline Enable readline support], \ | |
86 | READLINE=$enableval, READLINE=no) | |
795ca3e5 | 87 | |
8ef2b021 AK |
88 | dnl Enable Debugging |
89 | AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], \ | |
90 | DEBUG=yes, DEBUG=no) | |
91 | ||
199e490e AK |
92 | dnl Disable devmapper |
93 | AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], \ | |
94 | DEVMAPPER=no, DEVMAPPER=yes) | |
95 | ||
795ca3e5 AK |
96 | dnl Mess with default exec_prefix |
97 | if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; | |
98 | then exec_prefix=""; | |
99 | fi; | |
100 | ||
101 | dnl Checks for library functions. | |
102 | AC_PROG_GCC_TRADITIONAL | |
103 | AC_TYPE_SIGNAL | |
104 | AC_FUNC_VPRINTF | |
105 | AC_CHECK_FUNCS(mkdir rmdir uname) | |
106 | ||
107 | dnl check for termcap (Shamelessly copied from parted 1.4.17) | |
108 | if test x$READLINE = xyes; then | |
109 | AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, , | |
110 | AC_MSG_ERROR( | |
111 | termcap could not be found which is required for the | |
112 | --enable-readline option (which is enabled by default). Either disable readline | |
113 | support with --disable-readline or download and install termcap from: | |
114 | ftp.gnu.org/gnu/termcap | |
115 | Note: if you are using precompiled packages you will also need the development | |
116 | package as well (which may be called termcap-devel or something similar). | |
117 | Note: (n)curses also seems to work as a substitute for termcap. This was | |
118 | not found either - but you could try installing that as well. | |
119 | ) | |
120 | exit | |
121 | ) | |
122 | fi | |
123 | ||
26e7f2e0 AK |
124 | dnl Check for dlopen |
125 | AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no) | |
126 | ||
127 | if test x$HAVE_LIBDL = xyes; then | |
128 | LIBS="-ldl $LIBS" | |
129 | fi | |
130 | ||
795ca3e5 AK |
131 | dnl Check for readline (Shamelessly copied from parted 1.4.17) |
132 | if test x$READLINE = xyes; then | |
133 | AC_CHECK_LIB(readline, readline, , | |
134 | AC_MSG_ERROR( | |
135 | GNU Readline could not be found which is required for the | |
136 | --enable-readline option (which is enabled by default). Either disable readline | |
137 | support with --disable-readline or download and install readline from: | |
138 | ftp.gnu.org/gnu/readline | |
139 | Note: if you are using precompiled packages you will also need the development | |
140 | package as well (which may be called readline-devel or something similar). | |
141 | ) | |
142 | exit | |
143 | ) | |
83912faa AK |
144 | AC_CHECK_FUNC(rl_completion_matches, HAVE_RL_COMPLETION_MATCHES=yes, |
145 | HAVE_RL_COMPLETION_MATCHES=no) | |
795ca3e5 AK |
146 | fi |
147 | ||
fae0c576 AK |
148 | if test "-f VERSION"; then |
149 | LVM_VERSION="\"`cat VERSION`\"" | |
150 | else | |
151 | LVM_VERSION="Unknown" | |
152 | fi | |
153 | ||
795ca3e5 AK |
154 | AC_SUBST(JOBS) |
155 | AC_SUBST(STATIC_LINK) | |
156 | AC_SUBST(READLINE) | |
5a52dca9 | 157 | AC_SUBST(LVM1) |
83912faa | 158 | AC_SUBST(HAVE_RL_COMPLETION_MATCHES) |
795ca3e5 AK |
159 | AC_SUBST(OWNER) |
160 | AC_SUBST(GROUP) | |
5f68d858 | 161 | AC_SUBST(LIBS) |
fae0c576 | 162 | AC_SUBST(LVM_VERSION) |
8ef2b021 | 163 | AC_SUBST(DEBUG) |
199e490e | 164 | AC_SUBST(DEVMAPPER) |
26e7f2e0 | 165 | AC_SUBST(HAVE_LIBDL) |
795ca3e5 AK |
166 | dnl First and last lines should not contain files to generate in order to |
167 | dnl keep utility scripts running properly | |
168 | AC_OUTPUT( \ | |
169 | Makefile \ | |
170 | make.tmpl \ | |
fa42e649 | 171 | include/Makefile \ |
795ca3e5 | 172 | lib/Makefile \ |
5a52dca9 | 173 | lib/format1/Makefile \ |
795ca3e5 AK |
174 | man/Makefile \ |
175 | tools/Makefile \ | |
fae0c576 | 176 | tools/version.h \ |
e6efb2b0 | 177 | test/mm/Makefile \ |
43b7b8cf | 178 | test/device/Makefile \ |
e0304b58 | 179 | test/format1/Makefile \ |
d1b28647 | 180 | test/regex/Makefile \ |
291ec3b6 | 181 | test/filters/Makefile \ |
795ca3e5 | 182 | ) |