[BACK]Return to configure.in CVS log [TXT][DIR] Up to [Development] / xfs-cmds / xfsprogs

File: [Development] / xfs-cmds / xfsprogs / configure.in (download)

Revision 1.5, Wed May 9 06:56:06 2001 UTC (16 years, 5 months ago) by nathans
Branch: MAIN
CVS Tags: Linux-2_4_5-merge
Changes since 1.4: +1 -1 lines

update a comment.

dnl unpacking check - this file must exist
AC_INIT(include/libxfs.h)
pkg_name="xfsprogs"
AC_SUBST(pkg_name)

#
# Note: the following environment variables may be set to override the
# defaults (to change paths and/or executables, build parameters, etc):
#
#   DEBUG  OPTIMIZER  MAKE  CC  LD  TAR  ZIP  RPM  AWK  SED  ECHO
#   MALLOCLIB  DISTRIBUTION  PACKAGE_BUILDER  PREFIX  ROOT_PREFIX
#

DEBUG=${DEBUG:-'-DDEBUG'}		# -DNDEBUG
OPTIMIZER=${OPTIMIZER:-'-g'}		# (-O1 enforced default)
MALLOCLIB=${MALLOCLIB:-''}		# /usr/lib/libefence.a

dnl Debug build?
debug_build="$DEBUG"
AC_SUBST(debug_build)

dnl Optimization options?
opt_build="$OPTIMIZER"
AC_SUBST(opt_build)

dnl Alternate malloc library?
malloc_lib="$MALLOCLIB"
AC_SUBST(malloc_lib)

dnl Set version
. VERSION

pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
pkg_release=$PKG_BUILD
AC_SUBST(pkg_version)
AC_SUBST(pkg_release)

pkg_distribution="SGI ProPack"
test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
AC_SUBST(pkg_distribution)

pkg_builder=`id -u -n`@`hostname -f`
test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER"
AC_SUBST(pkg_builder)


dnl output header with cpp defs HAVE_*, etc
AC_CONFIG_HEADER(include/platform_defs.h)

dnl check if user wants their own C compiler
test -z "$CC" && AC_PROG_CC
cc=$CC
AC_SUBST(cc)

dnl check if users wants their own make
test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make)
make=$MAKE
AC_SUBST(make)

dnl check if users wants their own linker
test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld)
ld=$LD
AC_SUBST(ld)

dnl check if the tar program is available
test -z "$TAR" && AC_PATH_PROG(TAR, tar)
tar=$TAR
AC_SUBST(tar)

dnl check if the gzip program is available
test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip)
zip=$ZIP
AC_SUBST(zip)

dnl check if the rpm program is available
test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
rpm=$RPM
AC_SUBST(rpm)

dnl .. and what version is rpm
rpm_version=0
test -x $RPM && \
	rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
AC_SUBST(rpm_version)

dnl check if the makedepend program is available
test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
makedepend=$MAKEDEPEND
AC_SUBST(makedepend)

dnl check if symbolic links are supported
AC_PROG_LN_S

dnl check if user wants their own awk, sed and echo
test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk)
awk=$AWK
AC_SUBST(awk)
test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)
sed=$SED
AC_SUBST(sed)
test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo)
echo=$ECHO
AC_SUBST(echo)

dnl Checks for UUID header and library.
AC_CHECK_HEADER(uuid/uuid.h,, [
	echo
	echo 'FATAL ERROR: could not find a valid UUID header.'
	echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
	exit 1
])
AC_CHECK_LIB(uuid, uuid_generate,, [
	echo
	echo 'FATAL ERROR: could not find a valid UUID library.'
	echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
	exit 1
])
libuuid="/usr/lib/libuuid.a"
AC_SUBST(libuuid)

dnl Checks for LVM library
AC_MSG_CHECKING([for liblvm.a])
liblvm=""
for dir in /usr/local/lib /usr/lib /lib; do
        if test -f $dir/liblvm.a; then
                liblvm=$dir/liblvm.a
        fi
done
if test -n "$liblvm"; then
	AC_MSG_RESULT(yes)
        have_liblvm=1
else
	AC_MSG_RESULT(no)
        have_liblvm=0
fi
AC_SUBST(liblvm) 
AC_SUBST(have_liblvm) 

dnl Check if we have a type for the pointer's size integer (__psint_t)
AC_MSG_CHECKING([for __psint_t ])
AC_TRY_COMPILE(
[  
    #include <sys/types.h>
    #include <stdlib.h> 
    #include <stddef.h>
],
[
    __psint_t  psint;
], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))

dnl Check if we have a type for the pointer's size unsigned (__psunsigned_t)
AC_MSG_CHECKING([for __psunsigned_t ])
AC_TRY_COMPILE(
[  
    #include <sys/types.h>
    #include <stdlib.h> 
    #include <stddef.h>
],
[
    __psunsigned_t  psuint;
], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))


dnl check sizeof long
AC_MSG_CHECKING([sizeof long])
cat <<End-of-File >conftest.c
#include <stdio.h>
main() { printf("%d\n", sizeof(long)); }
End-of-File
(eval $ac_compile) 2>&5
(eval $ac_link) 2>&5
ans=`./conftest`
echo "./conftest -> \"$ans\"" >&5
AC_MSG_RESULT($ans)
test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_LONG)
test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_LONG)
rm -f conftest conftest.*

dnl check sizeof pointer
AC_MSG_CHECKING([sizeof pointer])
cat <<End-of-File >conftest.c
#include <stdio.h>
main() { printf("%d\n", sizeof(char *)); }
End-of-File
(eval $ac_compile) 2>&5
(eval $ac_link) 2>&5
ans=`./conftest`
echo "./conftest -> \"$ans\"" >&5
AC_MSG_RESULT($ans)
test $ans -eq 4 && AC_DEFINE(HAVE_32BIT_PTR)
test $ans -eq 8 && AC_DEFINE(HAVE_64BIT_PTR)
rm -f conftest conftest.*


dnl alternate root and usr prefixes
test -z "$ROOT_PREFIX" && ROOT_PREFIX=""
root_prefix="$ROOT_PREFIX"
test -z "$PREFIX" && PREFIX="/usr"
prefix="$PREFIX"

dnl man pages (source)
dnl also check if man page source is gzipped
dnl (usually on Debian, but not Redhat pre-7.0)
pkg_man_dir=${prefix}/share/man
have_zipped_manpages=false
for d in ${prefix}/share/man ${prefix}/man ; do
    if test -f $d/man1/man.1.gz
    then
	pkg_man_dir=$d
	have_zipped_manpages=true
	break
    fi
done
AC_SUBST(pkg_man_dir)
AC_SUBST(have_zipped_manpages)

dnl binaries
pkg_bin_dir=${prefix}/sbin
AC_SUBST(pkg_bin_dir)

dnl static libraries
pkg_lib_dir=${prefix}/lib
AC_SUBST(pkg_lib_dir)

dnl runtime shared system libraries
pkg_slib_dir=${root_prefix}/lib
AC_SUBST(pkg_slib_dir)

dnl system binaries
pkg_sbin_dir=${root_prefix}/sbin
AC_SUBST(pkg_sbin_dir)

dnl include files
pkg_inc_dir=${prefix}/include/xfs
AC_SUBST(pkg_inc_dir)

dnl doc directory
pkg_doc_dir=${prefix}/share/doc/${pkg_name}
AC_SUBST(pkg_doc_dir)


dnl
dnl output files
dnl

AC_OUTPUT( \
dnl  Build definitions for use in Makefiles
    include/builddefs \
)