]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - configure.in
Sync up userspace with some recent kernel changes, no functional change.
[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 # LIBTOOL MALLOCLIB DISTRIBUTION PACKAGE_BUILDER
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`
43 test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
44 AC_SUBST(pkg_builder)
45
46 dnl output header with cpp defs HAVE_*, etc
47 AC_CONFIG_HEADER(include/platform_defs.h)
48
49 dnl check if user wants their own C compiler
50 test -z "$CC" && AC_PROG_CC
51 cc=$CC
52 AC_SUBST(cc)
53
54 dnl check if users wants their own make
55 test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make)
56 make=$MAKE
57 AC_SUBST(make)
58
59 dnl check if users wants their own linker
60 test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld)
61 ld=$LD
62 AC_SUBST(ld)
63
64 dnl check if the tar program is available
65 test -z "$TAR" && AC_PATH_PROG(TAR, tar)
66 tar=$TAR
67 AC_SUBST(tar)
68
69 dnl check if the gzip program is available
70 test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip)
71 zip=$ZIP
72 AC_SUBST(zip)
73
74 dnl check if the rpm program is available
75 test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
76 rpm=$RPM
77 AC_SUBST(rpm)
78
79 dnl .. and what version is rpm
80 rpm_version=0
81 test -x $RPM && \
82 rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
83 AC_SUBST(rpm_version)
84
85 dnl At some point in rpm 4.0, rpm can no longer build rpms, and
86 dnl rpmbuild is needed (rpmbuild may go way back; not sure)
87 dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
88
89 if test $rpm_version -ge 4; then
90 AC_PATH_PROG(RPMBUILD, rpmbuild)
91 rpmbuild=$RPMBUILD
92 else
93 rpmbuild=$RPM
94 fi
95
96 AC_SUBST(rpmbuild)
97
98 dnl check if the msgfmt program is available
99 test -z "$MSGFMT" && AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
100 msgfmt=$MSGFMT
101 AC_SUBST(msgfmt)
102
103 dnl check if the makedepend program is available
104 test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
105 makedepend=$MAKEDEPEND
106 AC_SUBST(makedepend)
107
108 dnl check if symbolic links are supported
109 AC_PROG_LN_S
110
111 dnl check if user wants their own awk, sed and echo
112 test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk)
113 awk=$AWK
114 AC_SUBST(awk)
115 test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)
116 sed=$SED
117 AC_SUBST(sed)
118 test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo)
119 echo=$ECHO
120 AC_SUBST(echo)
121
122 dnl ensure libtool is installed
123 test -z "$LIBTOOL" && AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
124 if test "$LIBTOOL" = ""; then
125 echo
126 echo 'FATAL ERROR: libtool does not seem to be installed.'
127 echo $pkg_name cannot be built without a working libtool installation.
128 exit 1
129 fi
130 libtool=$LIBTOOL
131 AC_SUBST(libtool)
132
133 dnl libtool to build libraries static only?
134 AC_ARG_ENABLE(shared,
135 [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
136 enable_shared=yes)
137 AC_SUBST(enable_shared)
138
139 dnl Checks for UUID header and library.
140 AC_CHECK_HEADER(uuid/uuid.h,, [
141 echo
142 echo 'FATAL ERROR: could not find a valid UUID header.'
143 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
144 exit 1
145 ])
146 AC_CHECK_LIB(uuid, uuid_generate,, [
147 echo
148 echo 'FATAL ERROR: could not find a valid UUID library.'
149 echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
150 exit 1
151 ])
152 dnl
153 dnl Caution - using libuuid shared adds an additional runtime dependency,
154 dnl but the rpm spec file and debian control file do _not_ enforce this.
155 dnl We want to keep our runtime dependencies to an absolute minimum for
156 dnl this particular package, but the option is there.
157 dnl
158 AC_ARG_ENABLE(shared-uuid,
159 [ --enable-shared-uuid=[yes/no] Link shared libuuid [default=no].],
160 libuuid="/usr/lib/libuuid.a"
161 if test "$enable_shared_uuid" = yes; then
162 libuuid="-luuid"
163 fi,
164 libuuid="/usr/lib/libuuid.a")
165 AC_SUBST(libuuid)
166
167 dnl Check if we have a type for the pointer's size integer (__psint_t)
168 AC_MSG_CHECKING([for __psint_t ])
169 AC_TRY_COMPILE(
170 [
171 #include <sys/types.h>
172 #include <stdlib.h>
173 #include <stddef.h>
174 ],
175 [
176 __psint_t psint;
177 ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
178
179 dnl Check if we have a type for the pointer's size unsigned (__psunsigned_t)
180 AC_MSG_CHECKING([for __psunsigned_t ])
181 AC_TRY_COMPILE(
182 [
183 #include <sys/types.h>
184 #include <stdlib.h>
185 #include <stddef.h>
186 ],
187 [
188 __psunsigned_t psuint;
189 ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
190
191 dnl Check type sizes
192 if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
193 AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
194 fi
195 AC_CHECK_SIZEOF(long, 4)
196 AC_CHECK_SIZEOF(char *, 4)
197 test $ac_cv_sizeof_long -eq 4 && AC_DEFINE(HAVE_32BIT_LONG)
198 test $ac_cv_sizeof_long -eq 8 && AC_DEFINE(HAVE_64BIT_LONG)
199 test $ac_cv_sizeof_char_p -eq 4 && AC_DEFINE(HAVE_32BIT_PTR)
200 test $ac_cv_sizeof_char_p -eq 8 && AC_DEFINE(HAVE_64BIT_PTR)
201
202 dnl man pages (source)
203 dnl also check if man page source is gzipped
204 dnl (usually on Debian, but not Redhat pre-7.0)
205 have_zipped_manpages=false
206 for d in ${prefix}/share/man ${prefix}/man ; do
207 if test -f $d/man1/man.1.gz
208 then
209 have_zipped_manpages=true
210 break
211 fi
212 done
213 AC_SUBST(have_zipped_manpages)
214
215 dnl build definitions for use in Makefiles
216 AC_OUTPUT(include/builddefs)