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