1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-13 21:05:05 -05:00
pacman/configure.ac

256 lines
7.2 KiB
Plaintext
Raw Normal View History

ENV_CFLAGS=$CFLAGS
CFLAGS=""
AC_PREREQ(2.59)
2006-10-15 15:38:02 -04:00
dnl Update it right before the release since $pkgver_foo are all _post_ release snapshots
AC_INIT([Pacman package manager], 3.0.0, [pacman-dev@archlinux.org], pacman)
AC_LANG(C)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
2006-06-28 01:37:15 -04:00
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.13.1)
2006-01-02 07:31:22 -05:00
dnl Host dependant flags
case "${host}" in
*-*-cygwin*)
ENV_CFLAGS="$ENV_CFLAGS -DCYGWIN"
;;
esac
dnl Define here the libalpm version number
PM_MAJOR_VERSION=0
PM_MINOR_VERSION=1
PM_MICRO_VERSION=0
PM_VERSION=$PM_MAJOR_VERSION.$PM_MINOR_VERSION.$PM_MICRO_VERSION
dnl Needed for libtool to create proper shared lib version
PM_VERSION_INFO=`expr $PM_MAJOR_VERSION + $PM_MINOR_VERSION`:$PM_MICRO_VERSION:$PM_MINOR_VERSION
AC_SUBST(PM_MAJOR_VERSION)
AC_SUBST(PM_MINOR_VERSION)
AC_SUBST(PM_MICRO_VERSION)
AC_SUBST(PM_VERSION)
AC_SUBST(PM_VERSION_INFO)
dnl Put out version numbers to config.h
AC_DEFINE_UNQUOTED([PM_VERSION], ["$PM_VERSION"], [libalpm version number])
2006-10-15 15:38:02 -04:00
dnl Configuration files
dnl AC_CONFIG_FILES([etc/makepkg.conf] [etc/pacman.conf])
2006-10-15 15:38:02 -04:00
AC_PROG_CC
AC_HEADER_STDC
AC_PROG_INSTALL
AC_CHECK_FUNCS([strverscmp])
AM_PROG_LIBTOOL
AM_CONDITIONAL(LINKSTATIC, test "$enable_static" = "yes")
2006-10-15 15:38:02 -04:00
dnl Humor lowers blood pressure
AC_MSG_CHECKING(your blood pressure)
AC_MSG_RESULT([a bit high, but we can proceed])
dnl Help line for man2html
AC_ARG_ENABLE(man2html,
AC_HELP_STRING([--enable-man2html], [Build html docs via man2html]),
[wantman2html=$enableval], [wantman2html=no])
2006-10-15 15:38:02 -04:00
dnl Help line for doxygen
AC_ARG_ENABLE(doxygen,
AC_HELP_STRING([--disable-doxygen], [Build API docs via Doxygen]),
[wantdoxygen=$enableval], [wantdoxygen=yes])
dnl Check for architecture
case "$host" in
i686-*) AC_DEFINE_UNQUOTED([CARCH], ["i686"], [Architecture])
AC_DEFINE_UNQUOTED([CARCHFLAGS], ["i686"], [Architecture])
AC_DEFINE_UNQUOTED([ARCHSWITCH], ["march"], [Architecture])
2006-10-15 15:38:02 -04:00
CARCH="i686"
CARCHFLAGS="i686"
ARCHSWITCH="march"
2006-10-15 15:38:02 -04:00
CHOST="${host}"
;;
x86_64-*) AC_DEFINE_UNQUOTED([CARCH], ["x86_64"], [Architecture])
2007-02-12 19:57:08 -05:00
AC_DEFINE_UNQUOTED([CARCHFLAGS], ["x86-64"], [Architecture])
AC_DEFINE_UNQUOTED([ARCHSWITCH], ["march"], [Architecture])
2006-10-15 15:38:02 -04:00
CARCH="x86_64"
2007-02-12 19:57:08 -05:00
CARCHFLAGS="x86-64"
ARCHSWITCH="march"
2006-10-15 15:38:02 -04:00
CHOST="${host}"
;;
ia64-*) AC_DEFINE_UNQUOTED([CARCH], ["ia64"], [Architecture])
AC_DEFINE_UNQUOTED([CARCHFLAGS], ["ia64"], [Architecture])
AC_DEFINE_UNQUOTED([ARCHSWITCH], ["march"], [Architecture])
2006-10-15 15:38:02 -04:00
CARCH="ia64"
CARCHFLAGS="ia64"
ARCHSWITCH="march"
2006-10-15 15:38:02 -04:00
CHOST="${host}"
;;
sparc-*) AC_DEFINE_UNQUOTED([CARCH], ["sparc"], [Architecture])
AC_DEFINE_UNQUOTED([CARCHFLAGS], ["v9"], [Architecture])
AC_DEFINE_UNQUOTED([ARCHSWITCH], ["mcpu"], [Architecture])
2006-10-15 15:38:02 -04:00
CARCH="sparc"
CARCHFLAGS="v9"
ARCHSWITCH="mcpu"
2006-10-15 15:38:02 -04:00
CHOST="${host}"
;;
ppc-* | powerpc-*)
AC_DEFINE_UNQUOTED([CARCH], ["ppc"], [Architecture])
AC_DEFINE_UNQUOTED([CARCHFLAGS], ["750"], [Architecture])
AC_DEFINE_UNQUOTED([ARCHSWITCH], ["mcpu"], [Architecture])
2006-10-15 15:38:02 -04:00
CARCH="ppc"
CARCHFLAGS="750"
ARCHSWITCH="mcpu"
2006-10-15 15:38:02 -04:00
CHOST="${host}"
;;
i386-*) AC_DEFINE_UNQUOTED([CARCH], ["i386"], [Architecture])
AC_DEFINE_UNQUOTED([CARCHFLAGS], ["i386"], [Architecture])
AC_DEFINE_UNQUOTED([ARCHSWITCH], ["march"], [Architecture])
2006-10-15 15:38:02 -04:00
CARCH="i386"
CARCHFLAGS="i386"
ARCHSWITCH="march"
2006-10-15 15:38:02 -04:00
CHOST="${host}"
;;
*)
AC_MSG_ERROR([Your architecture is not supported])
;;
esac
AC_SUBST(CARCH)
AC_SUBST(CARCHFLAGS)
AC_SUBST(ARCHSWITCH)
2006-10-15 15:38:02 -04:00
AC_SUBST(CHOST)
dnl Help line for config file
AC_ARG_WITH(config-file,
AC_HELP_STRING([ --with-config-file=path], [Set the name and path for pacman's config file]),
[configfile=$withval], [configfile=/etc/pacman.conf])
dnl Help line for debug
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [Enable debugging support]),
2007-01-30 03:17:02 -05:00
[debug=$enableval], [debug=no])
dnl Help line for fakeroot
AC_ARG_ENABLE(fakeroot,
AC_HELP_STRING([--disable-fakeroot], [Disable fakeroot proof support]),
[fakeroot=$enableval], [fakeroot=yes])
dnl Check for man2html binary
AC_MSG_CHECKING(for support man2html)
if test x$wantman2html = xyes ; then
AC_CHECK_PROGS([MAN2HTML], [man2html])
AM_CONDITIONAL(HAS_MAN2HTML, test $MAN2HTML)
if test $MAN2HTML ; then
AC_DEFINE([HAS_MAN2HTML], [TRUE], [Enabled HTML generation from man via man2html])
AC_MSG_RESULT(yes)
else
AC_DEFINE([HAS_MAN2HTML], [FALSE], [Disabled HTML generation from man via man2html])
AC_MSG_RESULT(no, man2html missing)
fi
else
AM_CONDITIONAL(HAS_MAN2HTML, test $MAN2HTML)
AC_DEFINE([HAS_MAN2HTML], [FALSE], [Not specified at configure line])
AC_MSG_RESULT(not requested by configure)
fi
dnl Check for doxygen support
if test x$wantdoxygen = xyes ; then
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test $DOXYGEN ; then
DOXYSTATUS="yes, path: `which $DOXYGEN`"
else
DOXYSTATUS="doxygen binary not found"
fi
else
2006-10-15 15:38:02 -04:00
DOXYSTATUS="no, disabled by configure"
fi
2007-01-30 15:37:59 -05:00
AM_CONDITIONAL(HAS_DOXYGEN, test $DOXYGEN)
2006-10-15 15:38:02 -04:00
dnl Check for math
AC_CHECK_LIB([m], [sqrt], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
if test -z "$LIBM"; then
AC_MSG_ERROR("math library needed to compile pacman!");
fi
dnl Check for libarchive
AC_CHECK_LIB([archive], [archive_read_data], [AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
if test -z "$LIBARCHIVE"; then
2006-10-15 15:38:02 -04:00
AC_MSG_ERROR("libarchive is needed to compile pacman!");
fi
dnl Check for libdownload
AC_CHECK_LIB([download], [downloadParseURL], [AC_CHECK_HEADER([download.h], [LIBDOWNLOAD='-ldownload'])])
if test -z "$LIBDOWNLOAD"; then
AC_MSG_ERROR("libdownload is needed to compile pacman!");
fi
dnl Set config location
AC_MSG_CHECKING(for configuration file name)
if test -n "$configfile"; then
CFLAGS="$CFLAGS -D'PACCONF=\"$configfile\"'"
AC_MSG_RESULT(["$configfile"])
else
AC_MSG_ERROR(["pacman config file (--with-config-file is not set"])
fi
2006-10-15 15:38:02 -04:00
dnl Enable or disable debug code
AC_MSG_CHECKING(for debug mode request)
if test "$debug" = "yes" ; then
AM_CONDITIONAL(PACMAN_DEBUG, test "$debug" = "yes")
CFLAGS="$CFLAGS -g -Wall -Werror -std=c99 -DPACMAN_DEBUG"
LDFLAGS="$LDFLAGS -lmcheck"
2006-10-15 15:38:02 -04:00
AC_MSG_RESULT(yes)
else
AM_CONDITIONAL(PACMAN_DEBUG, test "$debug" = "no")
CFLAGS="$CFLAGS -Wall -std=c99"
2006-10-15 15:38:02 -04:00
AC_MSG_RESULT(no)
fi
dnl Enable or disable fakeroot code
AC_MSG_CHECKING(for fakeroot proof support)
if test "$fakeroot" = "yes" ; then
2006-10-15 15:38:02 -04:00
AC_MSG_RESULT(yes)
else
CFLAGS="$CFLAGS -DFAKEROOT"
AC_MSG_RESULT(no)
fi
dnl ==========================================================================
AC_OUTPUT([
lib/libalpm/Makefile
2006-06-28 01:37:15 -04:00
lib/libalpm/po/Makefile.in
src/pacman/Makefile
2006-06-28 01:37:15 -04:00
src/pacman/po/Makefile.in
src/util/Makefile
scripts/Makefile
doc/Makefile
2006-10-15 15:38:02 -04:00
etc/Makefile
etc/makepkg.conf
etc/pacman.conf
2006-10-15 15:38:02 -04:00
etc/pacman.d/Makefile
etc/pacman.d/mirrorlist
etc/abs/Makefile
Makefile
])
echo "
pacman-$VERSION:
2006-10-15 15:38:02 -04:00
prefix : ${prefix}
source code location : ${srcdir}
compiler : ${CC}
compiler flags : ${CFLAGS}
2006-10-15 15:38:02 -04:00
libalpm version : ${PM_VERSION}
pacman.conf location : ${configfile}
2006-10-15 15:38:02 -04:00
Architecture CARCH : ${CARCH}
Architecture used cflag : ${CARCHFLAGS}
Architecture CHOST : ${CHOST}
Doxygen support : ${DOXYSTATUS}
2006-10-15 15:38:02 -04:00
debug support : ${debug}
"