]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - configure.in
remove rules to tidy up tmp libtool files - we use the installed version now.
[thirdparty/xfsprogs-dev.git] / configure.in
1 dnl unpacking check - this file must exist
2 AC_INIT(include/libxfs.h)
3 pkg_name="xfsprogs"
4 AC_SUBST(pkg_name)
5
6 #
7 # Note: the following environment variables may be set to override the
8 # defaults (to change paths and/or executables, build parameters, etc):
9 #
10 # DEBUG OPTIMIZER MAKE CC LD TAR ZIP RPM AWK SED ECHO
11 # MALLOCLIB DISTRIBUTION PACKAGE_BUILDER PREFIX ROOT_PREFIX
12 #
13
14 DEBUG=${DEBUG:-'-DDEBUG'} # -DNDEBUG
15 OPTIMIZER=${OPTIMIZER:-'-g'} # (-O1 enforced default)
16 MALLOCLIB=${MALLOCLIB:-''} # /usr/lib/libefence.a
17
18 dnl Debug build?
19 debug_build="$DEBUG"
20 AC_SUBST(debug_build)
21
22 dnl Optimization options?
23 opt_build="$OPTIMIZER"
24 AC_SUBST(opt_build)
25
26 dnl Alternate malloc library?
27 malloc_lib="$MALLOCLIB"
28 AC_SUBST(malloc_lib)
29
30 dnl Set version
31 . ./VERSION
32
33 pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
34 pkg_release=$PKG_BUILD
35 AC_SUBST(pkg_version)
36 AC_SUBST(pkg_release)
37
38 pkg_distribution="SGI XFS"
39 test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
40 AC_SUBST(pkg_distribution)
41
42 pkg_builder=`id -u -n`@`hostname -f`
43 test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
44 AC_SUBST(pkg_builder)
45
46
47 dnl output header with cpp defs HAVE_*, etc
48 AC_CONFIG_HEADER(include/platform_defs.h)
49
50 dnl check if user wants their own C compiler
51 test -z "$CC" && AC_PROG_CC
52 cc=$CC
53 AC_SUBST(cc)
54
55 dnl check if users wants their own make
56 test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make)
57 make=$MAKE
58 AC_SUBST(make)
59
60 dnl check if users wants their own linker
61 test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld)
62 ld=$LD
63 AC_SUBST(ld)
64
65 dnl check if the tar program is available
66 test -z "$TAR" && AC_PATH_PROG(TAR, tar)
67 tar=$TAR
68 AC_SUBST(tar)
69
70 dnl check if the gzip program is available
71 test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip)
72 zip=$ZIP
73 AC_SUBST(zip)
74
75 dnl check if the rpm program is available
76 test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
77 rpm=$RPM
78 AC_SUBST(rpm)
79
80 dnl .. and what version is rpm
81 rpm_version=0
82 test -x $RPM && \
83 rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
84 AC_SUBST(rpm_version)
85
86 dnl check if the makedepend program is available
87 test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
88 makedepend=$MAKEDEPEND
89 AC_SUBST(makedepend)
90
91 dnl check if symbolic links are supported
92 AC_PROG_LN_S
93
94 dnl check if user wants their own awk, sed and echo
95 test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk)
96 awk=$AWK
97 AC_SUBST(awk)
98 test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)
99 sed=$SED
100 AC_SUBST(sed)
101 test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo)
102 echo=$ECHO
103 AC_SUBST(echo)
104
105 dnl ensure libtool is installed
106 AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
107 if test "$LIBTOOL" = ""; then
108 echo
109 echo 'FATAL ERROR: libtool does not seem to be installed.'
110 echo $pkg_name cannot be built without a working libtool installation.
111 exit 1
112 fi
113 libtool=$LIBTOOL
114 AC_SUBST(libtool)
115
116 dnl libtool to build libraries static only?
117 AC_ARG_ENABLE(enable_shared,
118 [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes].],
119 ,
120 enable_shared=yes)
121 AC_SUBST(enable_shared)
122
123 dnl Checks for UUID header and library.
124 AC_CHECK_HEADER(uuid/uuid.h,, [
125 echo
126 echo 'FATAL ERROR: could not find a valid UUID header.'
127 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
128 exit 1
129 ])
130 AC_CHECK_LIB(uuid, uuid_generate,, [
131 echo
132 echo 'FATAL ERROR: could not find a valid UUID library.'
133 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
134 exit 1
135 ])
136 libuuid="/usr/lib/libuuid.a"
137 AC_SUBST(libuuid)
138
139 dnl Checks for LVM library
140 AC_MSG_CHECKING([for liblvm.a])
141 liblvm=""
142 for dir in /usr/local/lib /usr/lib /lib; do
143 if test -f $dir/liblvm.a; then
144 liblvm=$dir/liblvm.a
145 fi
146 done
147 if test -n "$liblvm"; then
148 AC_MSG_RESULT(yes)
149 have_liblvm=1
150 else
151 AC_MSG_RESULT(no)
152 have_liblvm=0
153 fi
154 AC_SUBST(liblvm)
155 AC_SUBST(have_liblvm)
156
157 dnl Check if we have a type for the pointer's size integer (__psint_t)
158 AC_MSG_CHECKING([for __psint_t ])
159 AC_TRY_COMPILE(
160 [
161 #include <sys/types.h>
162 #include <stdlib.h>
163 #include <stddef.h>
164 ],
165 [
166 __psint_t psint;
167 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
168
169 dnl Check if we have a type for the pointer's size unsigned (__psunsigned_t)
170 AC_MSG_CHECKING([for __psunsigned_t ])
171 AC_TRY_COMPILE(
172 [
173 #include <sys/types.h>
174 #include <stdlib.h>
175 #include <stddef.h>
176 ],
177 [
178 __psunsigned_t psuint;
179 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
180
181
182 dnl check sizeof long
183 AC_MSG_CHECKING([sizeof long])
184 cat <<End-of-File >conftest.c
185 #include <stdio.h>
186 main() { printf("%d\n", sizeof(long)); }
187 End-of-File
188 (eval $ac_compile) 2>&5
189 (eval $ac_link) 2>&5
190 ans=`./conftest`
191 echo "./conftest -> \"$ans\"" >&5
192 AC_MSG_RESULT($ans)
193 test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_LONG)
194 test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_LONG)
195 rm -f conftest conftest.*
196
197 dnl check sizeof pointer
198 AC_MSG_CHECKING([sizeof pointer])
199 cat <<End-of-File >conftest.c
200 #include <stdio.h>
201 main() { printf("%d\n", sizeof(char *)); }
202 End-of-File
203 (eval $ac_compile) 2>&5
204 (eval $ac_link) 2>&5
205 ans=`./conftest`
206 echo "./conftest -> \"$ans\"" >&5
207 AC_MSG_RESULT($ans)
208 test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_PTR)
209 test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_PTR)
210 rm -f conftest conftest.*
211
212
213 dnl alternate root and usr prefixes
214 test -z "$ROOT_PREFIX" && ROOT_PREFIX=""
215 root_prefix="$ROOT_PREFIX"
216 test -z "$PREFIX" && PREFIX="/usr"
217 prefix="$PREFIX"
218
219 dnl man pages (source)
220 dnl also check if man page source is gzipped
221 dnl (usually on Debian, but not Redhat pre-7.0)
222 pkg_man_dir=${prefix}/share/man
223 have_zipped_manpages=false
224 for d in ${prefix}/share/man ${prefix}/man ; do
225 if test -f $d/man1/man.1.gz
226 then
227 pkg_man_dir=$d
228 have_zipped_manpages=true
229 break
230 fi
231 done
232 AC_SUBST(pkg_man_dir)
233 AC_SUBST(have_zipped_manpages)
234
235 dnl binaries
236 pkg_bin_dir=${prefix}/sbin
237 AC_SUBST(pkg_bin_dir)
238
239 dnl static libraries
240 pkg_lib_dir=${prefix}/lib
241 AC_SUBST(pkg_lib_dir)
242
243 dnl runtime shared system libraries
244 pkg_slib_dir=${root_prefix}/lib
245 AC_SUBST(pkg_slib_dir)
246
247 dnl system binaries
248 pkg_sbin_dir=${root_prefix}/sbin
249 AC_SUBST(pkg_sbin_dir)
250
251 dnl include files
252 pkg_inc_dir=${prefix}/include/xfs
253 AC_SUBST(pkg_inc_dir)
254 dk_inc_dir=${prefix}/include/disk
255 AC_SUBST(dk_inc_dir)
256
257 dnl doc directory
258 pkg_doc_dir=${prefix}/share/doc/${pkg_name}
259 AC_SUBST(pkg_doc_dir)
260
261
262 dnl
263 dnl output files
264 dnl
265
266 AC_OUTPUT( \
267 dnl Build definitions for use in Makefiles
268 include/builddefs \
269 )