Permalink
Fetching contributors…
Cannot retrieve contributors at this time
747 lines (656 sloc) 21.2 KB
AC_INIT
AC_CONFIG_HEADER(config.h)
dnl Define the release numbers here
SETUP_VERSION_MAJOR=1
SETUP_VERSION_MINOR=6
SETUP_VERSION_RELEASE=5
PACKAGE_NAME="Loki Setup"
PACKAGE_TARNAME="setup"
PACKAGE_VERSION="$SETUP_VERSION_MAJOR.$SETUP_VERSION_MINOR.$SETUP_VERSION_RELEASE"
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PATH_PROGS(AR, [ar gar])
AC_PATH_XTRA
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(pwd.h)
AC_CHECK_HEADERS(carbon/carbon.h)
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(sys/dirent.h)
AC_CHECK_HEADERS(sys/ndir.h)
AC_CHECK_HEADERS(ndir.h)
AC_CHECK_HEADERS(sys/dir.h)
AC_CHECK_HEADERS(sys/statfs.h)
AC_CHECK_HEADERS(sys/statvfs.h)
AC_CHECK_HEADERS(sys/vfs.h)
AC_CHECK_HEADERS(sys/mount.h)
AC_CHECK_HEADERS(sys/mnttab.h)
AC_CHECK_HEADERS(sys/ucred.h)
AC_CHECK_HEADERS(mntent.h)
AC_CHECK_HEADERS(fstab.h)
AC_CHECK_HEADERS(dir.h)
AC_CHECK_HEADERS(util.h)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_HEADERS(libgen.h)
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(sys/ptms.h)
AC_CHECK_HEADERS(sys/stropts.h)
AC_CHECK_HEADERS(selinux/selinux.h)
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_HEADERS(osreldate.h)
AC_CHECK_FILES(/dev/ptmx)
AC_CHECK_FILES(/dev/pts)
AC_CHECK_FILES(/dev/ptc)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(ptsname_r)
AC_CHECK_FUNCS(vhangup)
AC_CHECK_FUNCS(_getpty)
AC_CHECK_FUNCS(ttyname_r)
AC_CHECK_FUNCS(nl_langinfo)
AC_CHECK_FUNCS(strlcpy)
AC_CHECK_FUNCS(waitpid)
AC_PATH_PROG(SU_PATH, su, /bin/su, $PATH:/usr/sbin:/sbin)
AC_PATH_PROG(MOUNT_PATH, mount, /sbin/mount, $PATH:/usr/sbin:/sbin)
AC_PATH_PROG(UMOUNT_PATH, umount, /sbin/umount, $PATH:/usr/sbin:/sbin)
AC_PATH_PROG(BRANDELF, brandelf, true)
LD="$CC"
CFLAGS="-fsigned-char -funroll-loops -Wall -g -O2 -I. $X_CFLAGS"
CONSOLE_LIBS=""
if test -d /usr/codehost/lib; then
LIBS="-L/usr/codehost/lib"
elif test -d /opt/codehost/lib; then
LIBS="-L/opt/codehost/lib"
elif test -d /sw/lib; then
case "$target" in
*-apple-darwin*)
LIBS="-L/sw/lib" ;;
esac
else
LIBS="$LIBS -L/usr/local/lib"
fi
SETUP_GTK=setup.gtk
GTK_SUBDIR=gtk1
# Build some static binaries by default when possible
STATIC="-static"
RDYNAMIC="-rdynamic"
BSTATIC="-Wl,-Bstatic"
BDYNAMIC="-Wl,-Bdynamic"
LIBDL="-ldl"
LIBTINFO=""
EXTRA_LIBS=""
REENTRANT="-D_REENTRANT"
case "$target" in
*i?86*OpenUNIX*)
STATIC=""
CFLAGS="$CFLAGS -Dsco"
RDYNAMIC="-Wl,-Bexport"
EXTRA_LIBS="-lsocket -lnsl -lresolv -lcdfs"
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
ARCH=x86 ;;
*i?86*sco*)
STATIC=""
CFLAGS="$CFLAGS -Dsco"
RDYNAMIC="-Wl,-Bexport"
LIBDL=""
EXTRA_LIBS="-L/udk/usr/lib -lsocket -lnsl -lresolv -lgen"
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
ARCH=x86 ;;
*aix*)
STATIC=""
BSTATIC=""
BDYNAMIC=""
RDYNAMIC="-Wl,-bexpall"
LDFLAGS="$LDFLAGS -lpthread"
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
ARCH=`uname -p`
if test "$ARCH" = powerpc; then
ARCH=ppc
fi
;;
*i?86*freebsd*)
LIBDL=""
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
ARCH=x86 ;;
amd64*freebsd*)
LIBDL=""
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
ARCH=x86_64 ;;
*alpha*)
CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
ARCH=alpha ;;
*sgi*)
LIBSUFFIX=32
CFLAGS="$CFLAGS -D_SGI_SOURCE"
EXTRA_LIBS="-L/usr/freeware/lib$LIBSUFFIX"
RDYNAMIC=""
STATIC=""
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
ARCH=mips ;;
hppa*hpux*)
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED -Dhpux -Dhppa"
LDFLAGS="$LDFLAGS -Wl,-a,archive_shared"
LIBDL="-ldld -lpthread"
STATIC="-Wl,-E -Wl,-a,archive_shared"
RDYNAMIC="-Wl,-E"
BSTATIC=""
BDYNAMIC="-Wl,-a,archive_shared"
CONSOLE_LIBS="$LIBDL"
ARCH=hppa ;;
ia64*hpux*)
LIBSUFFIX=/hpux32
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED -Dhpux -Dia64"
LDFLAGS="$LDFLAGS -Wl,-a,archive_shared"
LIBDL="-ldld -lpthread"
LIBS="-L/usr/local/lib$LIBSUFFIX $LIBS"
STATIC="-Wl,-E -Wl,-a,archive_shared"
RDYNAMIC="-Wl,-E"
BSTATIC=""
BDYNAMIC="-Wl,-a,archive_shared"
CONSOLE_LIBS="$LIBDL"
ARCH=ia64 ;;
i?86*solaris*)
EXTRA_LIBS="-lsocket -lnsl -lresolv -ldl"
STATIC=""
RDYNAMIC=""
LIBDL=""
ARCH=x86 ;;
sparc*solaris*)
EXTRA_LIBS="-lsocket -lnsl -lresolv -ldl"
STATIC=""
RDYNAMIC=""
LIBDL=""
ARCH=`uname -p` ;;
*-apple-darwin*)
STATIC="-static"
RDYNAMIC="-Wl,-Sn"
BSTATIC=""
BDYNAMIC=""
REENTRANT=""
CFLAGS="$CFLAGS -I/sw/include -Ddarwin"
LDFLAGS="$LDFLAGS -framework Carbon -framework Security -framework IOKit"
COMMON_LIBS="carbon/carbonres.o carbon/carbondebug.o carbon/STUPControl.o carbon/YASTControl.o carbon/appbundle.o"
ARCH=`uname -p` ;;
*ppc64* | *powerpc64*)
ARCH=ppc64 ;;
*ppc* | *powerpc*)
ARCH=ppc ;;
*i?86*)
BSTATIC=""
BDYNAMIC=""
ARCH=x86 ;;
*x86_64*)
STATIC=""
LIBTINFO="-ltinfo"
LIBSUFFIX=64
ARCH=x86_64 ;;
*)
ARCH=`uname -p 2> /dev/null || uname -m` ;;
esac
GTK_STATIC=$BSTATIC
case "$target" in
*i?86*linux*)
# Newer glibc's require to depend at least on them
STATIC=""
GTK_STATIC="\$(BDYNAMIC)" ;;
esac
CFLAGS="$CFLAGS $REENTRANT"
AC_CHECK_FUNCS(getopt)
AC_CHECK_LIB(gnugetopt, getopt_long, LIBS="$LIBS $BSTATIC -lgnugetopt $BDYNAMIC")
AC_CHECK_FUNCS(getopt_long)
AC_CHECK_LIB(util, forkpty, LIBUTIL="-lutil"; LIBS="$LIBS -lutil")
AC_CHECK_FUNCS(openpty)
AC_CHECK_LIB(selinux, is_selinux_enabled, LIBS="$LIBS $BSTATIC -lselinux $BDYNAMIC")
SETUPDB_NAME=loki_setupdb
SETUPDB="`pwd`/../loki_setupdb-$PACKAGE_VERSION"
if test ! -d "$SETUPDB"; then
SETUPDB="`pwd`/../loki_setupdb"
if test ! -d "$SETUPDB"; then
SETUPDB="`pwd`/../setupdb"
SETUPDB_NAME=setupdb
fi
fi
AC_ARG_WITH(setupdb,
[ --with-setupdb with setupdb library at [default=../loki_setupdb]],
, with_setupdb=$SETUPDB)
if test x$with_setupdb != x$SETUPDB; then
SETUPDB=$with_setupdb
fi
dnl Check for correct setupdb installation
if test -f $SETUPDB/$ARCH/libsetupdb.a; then
for ac_SETUPDB_INCDIR in $SETUPDB $SETUPDB/include
do
if test -f $ac_SETUPDB_INCDIR/setupdb.h; then
SETUPDB_INCDIR=$ac_SETUPDB_INCDIR
break
fi
done
if test x$SETUPDB_INCDIR = x; then
AC_MSG_ERROR([*** $SSETUPDB_NAME headers not found. ***])
else
AC_MSG_RESULT([SetupDB library found in $SETUPDB/$ARCH])
fi
else
AC_MSG_ERROR([*** Please compile $SETUPDB_NAME first!])
fi
CFLAGS="$CFLAGS -I$SETUPDB_INCDIR"
GUI_LIBS=$GTK_STATIC
GTK_LIBS=$GTK_STATIC
#!!!TODO - Add carbon libs as necessary
CARBON_LIBS=
LIBS="$LIBS $EXTRA_LIBS"
AC_CHECK_LIB(iconv, iconv_open,
LIBINTL="-liconv"
LIBS="$LIBS $BSTATIC $LIBINTL"
)
AC_CHECK_LIB(intl, gettext,
USE_LIBINTL=yes
LIBINTL="-lintl $LIBINTL",
if test -f /usr/local/lib/libintl.a; then
LIBINTL="/usr/local/lib/libintl.a /usr/local/lib/libiconv.a"
LIBS="$LIBS $LIBINTL"
GUILIBS="$GUI_LIBS $LIBINTL"
CARBONLIBS="$CARBON_LIBS $LIBINTL"
# CFLAGS="$CFLAGS -I/opt/gettext/include"
fi
)
case "$target" in
powerpc-apple-darwin*)
if test -f /sw/lib/libintl.a; then
LIBINTL="/sw/lib/libintl.a /sw/lib/libiconv.a"
LIBS="$LIBS $LIBINTL"
GUILIBS="$GUI_LIBS $LIBINTL"
CARBONLIBS="$CARBON_LIBS $LIBINTL"
CFLAGS="$CFLAGS -I/sw/include"
fi
esac
AC_CHECK_HEADERS(libintl.h)
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_HEADERS(locale.h)
AC_CHECK_LIB(gpm, Gpm_Open, USE_GPM=yes)
dnl If NCURSES_MOUSE_VERSION is defined, we don't use GPM, so let's not link it in
AC_TRY_COMPILE([#include <ncurses.h>], [int n = NCURSES_MOUSE_VERSION;], unset USE_GPM)
dnl Check for gtk12 libraries in case those are available (FreeBSD)
AC_CHECK_LIB(glib12, g_log, GTK12="12")
AC_CHECK_LIB(dl, dlopen, USE_LIBDL=yes)
AC_ARG_ENABLE(bzip2,
[ --enable-bzip2 enable bzip2 support [default=no]],
, enable_bzip2=no)
if test x$enable_bzip2 = xyes; then
HAVE_BZIP2_SUPPORT="no"
AC_CHECK_LIB(bz2, BZ2_bzopen, HAVE_BZ2_BZOPEN=yes)
AC_CHECK_LIB(bz2, bzopen, HAVE_NORMAL_BZOPEN=yes)
if test x$HAVE_NORMAL_BZOPEN = xyes; then
LIBBZ2_PREFIX="no"
HAVE_BZIP2_SUPPORT="yes"
fi
dnl favor the BZ2_ prefix version, since it's a later revision of the lib.
if test x$HAVE_BZ2_BZOPEN = xyes; then
LIBBZ2_PREFIX="yes"
HAVE_BZIP2_SUPPORT="yes"
fi
if test x$HAVE_BZIP2_SUPPORT = xno; then
AC_MSG_WARN([*** libbz2 not found. bzip2 support has been disabled!])
AC_MSG_WARN([*** you can disable this warning with --disable-bzip2])
fi
elif test x$enable_bzip2 = xdlopen; then
HAVE_BZIP2_SUPPORT="yes"
BZIP2_DLOPEN="yes"
fi
dnl Detect the LibC version
AC_MSG_CHECKING(libc version)
if test `uname -s` != Linux; then
LIBC=glibc-2.1
else
if test -f `echo /lib/libc.so.6* | tail -n 1`; then
dnl This should cover all other releases post 2.1
if grep GLIBC_2.1 /lib/libc.so.6* 2>&1 >/dev/null; then
LIBC="glibc-2.1"
else
LIBC="glibc-2.0"
fi
elif [ -f /lib/libc.so.5 ]; then
LIBC="libc5"
else
LIBC="unknown"
fi
fi
AC_MSG_RESULT($LIBC)
PLUGINS="tar.c"
AC_ARG_WITH(ncurses,
[ --with-ncurses specify ncurses library location],
CONSOLE_LIBS="$CONSOLE_LIBS -L$with_ncurses/lib$LIBSUFFIX"
CFLAGS="$CFLAGS -I$with_ncurses/include"
USE_NCURSES=yes
)
AC_ARG_ENABLE(libglade-static,
[ --enable-libglade-static whether to statically link libglade (default=yes)],,
enable_libglade_static=yes)
if test "x$enable_libglade_static" = "xyes"; then
GLADE_STATIC="$BSTATIC"
fi
AC_ARG_ENABLE(libxml-static,
[ --enable-libxml-static whether to statically link libxml (default=yes)],,
enable_libxml_static=yes)
if test "x$enable_libxml_static" = "xyes"; then
XML_STATIC="$BSTATIC"
fi
AC_ARG_ENABLE(libncurses-static,
[ --enable-libncurses-static whether to statically link libncurses (default=yes)],,
enable_libncurses_static=yes)
if test "x$enable_libncurses_static" = "xyes"; then
NCURSES_STATIC="$BSTATIC"
fi
AC_CHECK_HEADERS(ncurses/term.h)
AC_CHECK_HEADERS(ncurses/curses.h)
AC_CHECK_HEADERS(ncurses.h)
AC_CHECK_LIB(ncurses, keypad, USE_NCURSES=yes)
dnl Check for libglade 1
AC_PATH_PROG(HAVEGLADE, libglade-config, $PATH)
if test ! -z "$HAVEGLADE"; then
GLADE_CFLAGS=`$HAVEGLADE --cflags`
GLADE_PREFIX=`$HAVEGLADE --prefix`
else
AC_MSG_ERROR([*** libglade-config not found. You need a working libglade installation.])
fi
dnl Check for GTK 1.X
AC_PATH_PROG(HAVEGTK, gtk$GTK12-config, $PATH)
AC_PATH_PROG(HAVEGLIB, glib$GTK12-config, $PATH)
if test ! -z "$HAVEGTK"; then
GTK_CFLAGS=`$HAVEGTK --cflags`
GTK_PREFIX=`$HAVEGTK --prefix`
GLIB_PREFIX=`$HAVEGLIB --prefix`
GTK_LIBS="$GTK_LIBS -L$GTK_PREFIX/lib$LIBSUFFIX -L$GLIB_PREFIX/lib$LIBSUFFIX -lgtk$GTK12 -lgdk$GTK12 $RDYNAMIC -lgmodule$GTK12 -lglib$GTK12"
else
AC_MSG_ERROR([*** gtk-config not found. You need a working GTK+ 1.2 installation.])
fi
XMLVER=""
AC_ARG_ENABLE(gtk2,
[ --enable-gtk2 Use gtk2 support, not gtk1 [default=no]],
, enable_gtk2=no)
if test x$enable_gtk2 = xyes; then
AC_DEFINE(ENABLE_GTK2, 1, GTK2 support.)
dnl Check for glade2 and gtk2 libraries
AC_PATH_PROG(HAVEPKGCONFIG, pkg-config, $PATH)
if test ! -z "$HAVEPKGCONFIG"; then
if $HAVEPKGCONFIG --exists libglade-2.0 gtk+-2.0 ; then
GTK2_CFLAGS=`$HAVEPKGCONFIG --cflags libglade-2.0 gtk+-2.0`
GTK2_LIBS=`$HAVEPKGCONFIG --libs libglade-2.0 gtk+-2.0`
dnl Pkg-config is supposed to add the export-dynamic, but it doesn't, at least on my system
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
CFLAGS="$CFLAGS $GTK2_CFLAGS"
if test ! -z "GLADE_STATIC" ; then
GTK2_LIBS=`echo $GTK2_LIBS | sed "s/-lglade-2.0/$GLADE_STATIC -lglade-2.0 $BDYNAMIC/g"`
fi
dnl Ignore unnecessary dependency on libpng12, not used by our binaries, creates problems with newer distros
GTK2_LIBS=`echo $GTK2_LIBS | sed "s/-lpng12//g"`
GUI_LIBS="$GUI_LIBS $GTK2_LIBS"
SETUP_GTK="setup.gtk2"
GTK_SUBDIR=gtk2
XMLVER="2"
else
AC_MSG_ERROR([*** Either libglade-2.0 or gtk+-2.0 are not available.])
fi
else
AC_MSG_ERROR([*** pkg-config not found. Cannot probe for libglade-2.0 or gtk+-2.0.])
fi
else
CFLAGS="$CFLAGS $GLADE_CFLAGS $GTK_CFLAGS"
GUI_LIBS="$GUI_LIBS $GLADE_STATIC -L$GLADE_PREFIX/lib$LIBSUFFIX -lglade $BDYNAMIC $GTK_LIBS"
fi
dnl Look for the XML libraries
AC_ARG_WITH(libxml2,
[ --with-libxml2 use libxml2 [default=libxml1 unless GTK2 is enabled]],
, with_libxml2=no)
if test x$with_libxml2 != xno; then
XMLVER="2"
EXTRA_LIBS="$EXTRA_LIBS -lm"
fi
AC_PATH_PROG(HAVEXML, xml${XMLVER}-config, $PATH)
if test ! -z "$HAVEXML"; then
XML_CFLAGS=`$HAVEXML --cflags`
XML_PREFIX=`$HAVEXML --prefix`
if "$HAVEXML" --help|grep libtool-libs > /dev/null; then
XML_LIBTOOL=`$HAVEXML --libtool-libs`
if test -f "$XML_LIBTOOL"; then
. "$XML_LIBTOOL"
XML_LIBS="$dependency_libs"
else
XML_LIBS="-lm"
fi
elif "$HAVEXML" --libs | grep thread > /dev/null; then
XML_LIBS="$PTHREAD -lm"
fi
CFLAGS="$CFLAGS $XML_CFLAGS"
if test "$STATIC" = ""; then
LIBS="$LIBS $XML_STATIC -L$XML_PREFIX/lib$LIBSUFFIX -lxml${XMLVER} $BDYNAMIC $XML_LIBS"
GUI_LIBS="$GUI_LIBS $XML_STATIC -L$XML_PREFIX/lib$LIBSUFFIX -lxml${XMLVER} $BDYNAMIC $XML_LIBS"
CARBON_LIBS="$CARBON_LIBS -L$XML_PREFIX/lib$LIBSUFFIX -lxml${XMLVER} $XML_LIBS"
else
LIBS="$LIBS $XML_PREFIX/lib$LIBSUFFIX/libxml${XMLVER}.a $XML_LIBS"
GUI_LIBS="$GUI_LIBS $XML_PREFIX/lib$LIBSUFFIX/libxml${XMLVER}.a $XML_LIBS"
CARBON_LIBS="$CARBON_LIBS $XML_PREFIX/lib$LIBSUFFIX/libxml${XMLVER}.a $XML_LIBS"
fi
else
AC_MSG_ERROR([*** xml${XMLVER}-config not found. You need a working libxml${XMLVER} installation.])
fi
if test x$HAVE_BZIP2_SUPPORT = xyes; then
AC_DEFINE(HAVE_BZIP2_SUPPORT, 1, libbz2 support.)
if test x$BZIP2_DLOPEN = xyes; then
AC_DEFINE(BZIP2_DLOPEN, 1, open libbz2 using dlopen)
BZ2LIB="-ldl"
BZ2_STATIC=""
else
BZ2LIB="-lbz2"
BZ2_STATIC="$BSTATIC"
if test x$LIBBZ2_PREFIX = xyes; then
AC_DEFINE(LIBBZ2_PREFIX, 1, libbz2 has "BZ_" prefix.)
fi
# Use static version of BZIP2 under Carbon if it's available, otherwise
# just stick with the dynamic version
case "$target" in
powerpc-apple-darwin*)
if test -f /usr/lib/libbz2.a; then
BZ2LIB=""
LIBS="$LIBS /usr/lib/libbz2.a"
GUI_LIBS="$GUI_LIBS /usr/lib/libbz2.a"
CARBON_LIBS="$CARBON_LIBS /usr/lib/libbz2.a"
fi
esac
fi
fi
AC_ARG_ENABLE(dialog,
[ --enable-dialog enable the ncurses/dialog UI [default=yes]],
, enable_dialog=yes)
if test x$enable_dialog = xyes; then
CFLAGS="$CFLAGS -DENABLE_DIALOG"
COMMON_LIBS="$COMMON_LIBS dialog/libdialog.a"
CONSOLE_OBJS="dialog_ui.o"
DO_DIALOG="do-dialog"
fi
dnl enable ZIP support
AC_ARG_ENABLE(zip,
[ --enable-zip enable ZIP archives support [default=yes]],
, enable_zip=yes)
if test x$enable_zip = xyes; then
PLUGINS="$PLUGINS zip.c"
CFLAGS="$CFLAGS -DZIP_SUPPORT"
AC_DEFINE(ENABLE_ZIP, 1, ZIP support.)
fi
dnl enable UZ2 support
AC_ARG_ENABLE(uz2,
[ --enable-uz2 enable UZ2 archives support [default=yes]],
, enable_uz2=yes)
if test x$enable_uz2 = xyes; then
PLUGINS="$PLUGINS uz2.c"
CFLAGS="$CFLAGS -DUZ2_SUPPORT"
AC_DEFINE(ENABLE_UZ2, 1, UZ2 support.)
fi
dnl enable RAR support
AC_ARG_ENABLE(rar,
[ --enable-rar enable RAR archives support [default=no]],
, enable_rar=no)
if test x$enable_rar = xyes; then
PLUGINS="$PLUGINS rar.c"
LD="$CXX"
CFLAGS="$CFLAGS -DRAR_SUPPORT -DRARDLL -DSILENT"
COMMON_LIBS="$COMMON_LIBS unrar/filestr.o unrar/scantree.o unrar/dll.o unrar/rar.o unrar/strlist.o unrar/strfn.o unrar/pathfn.o unrar/int64.o unrar/savepos.o unrar/global.o unrar/file.o unrar/filefn.o unrar/filcreat.o unrar/archive.o unrar/arcread.o unrar/unicode.o unrar/system.o unrar/isnt.o unrar/crypt.o unrar/crc.o unrar/rawread.o unrar/encname.o unrar/resource.o unrar/match.o unrar/timefn.o unrar/rdwrfn.o unrar/consio.o unrar/options.o unrar/ulinks.o unrar/errhnd.o unrar/rarvm.o unrar/rijndael.o unrar/getbits.o unrar/sha1.o unrar/extinfo.o unrar/extract.o unrar/volume.o unrar/list.o unrar/find.o unrar/unpack.o unrar/cmddata.o"
AC_DEFINE(ENABLE_RAR, 1, RAR support.)
fi
dnl enable RPM support
AC_ARG_ENABLE(rpm,
[ --enable-rpm enable RPM archives support [default=no]],
, enable_rpm=no)
if test x$enable_rpm = xyes; then
CFLAGS="$CFLAGS -DRPM_SUPPORT=3 -I/usr/include/rpm"
PLUGINS="$PLUGINS rpm.c"
# This is for RPM 3.x
RPM_LIBS="$BSTATIC -lrpm -ldb1 -lpopt"
LIBS="$LIBS $RPM_LIBS"
GUI_LIBS="$GUI_LIBS $RPM_LIBS"
CARBON_LIBS="$CARBON_LIBS $RPM_LIBS"
AC_DEFINE(ENABLE_RPM, 1, RPM support.)
fi
dnl RPM 4.x support, needs additional libraries
AC_ARG_ENABLE(rpm4,
[ --enable-rpm4 enable RPM4 archives support [default=no]],
, enable_rpm=no)
if test x$enable_rpm4 = xyes; then
if test x$HAVE_BZIP2_SUPPORT != xyes; then
AC_MSG_ERROR([*** You need libbz2 to have RPM 4.x support.])
fi
CFLAGS="$CFLAGS -DRPM_SUPPORT=4 -I/usr/include/rpm"
PLUGINS="$PLUGINS rpm.c"
# This is for RPM 4.x
AC_CHECK_LIB(rpmdb, rpmdbInit, RPMDB=yes)
if test x$RPMDB = xyes; then # Mostly Mandrake it looks like
RPM_LIBS="$BSTATIC -lrpm -lrpmio -lrpmdb -ldb1 -ldb-3.1 -lpopt"
else
RPM_LIBS="$BSTATIC -lrpm -lrpmio -ldb1 -ldb-3.1 -lpopt"
fi
LIBS="$LIBS $RPM_LIBS"
GUI_LIBS="$GUI_LIBS $RPM_LIBS"
CARBON_LIBS="$CARBON_LIBS $RPM_LIBS"
AC_DEFINE(ENABLE_RPM, 1, RPM support.)
fi
LIBS="$LIBS $BZ2_STATIC $BZ2LIB $BDYNAMIC"
if test ! -z "$USE_LIBINTL"; then
LIBINTL="$BSTATIC $LIBINTL -lz \$(BDYNAMIC)"
LIBS="$LIBS $LIBINTL"
GUI_LIBS="$GUI_LIBS $LIBINTL"
CARBON_LIBS="$CARBON_LIBS $LIBINTL"
else
if test "$STATIC" = ""; then
LIBS="$LIBS $BSTATIC -lz \$(BDYNAMIC)"
else
LIBS="$LIBS -lz"
fi
GUI_LIBS="$GUI_LIBS $BSTATIC -lz \$(BDYNAMIC)"
CARBON_LIBS="$CARBON_LIBS $BSTATIC -lz \$(BDYNAMIC)"
fi
if test ! -z "$USE_NCURSES"; then
if test "$STATIC" = ""; then
CONSOLE_LIBS="$CONSOLE_LIBS $NCURSES_STATIC -lncurses $LIBTINFO \$(BDYNAMIC)"
else
CONSOLE_LIBS="$CONSOLE_LIBS $NCURSES_STATIC -lncurses $LIBTINFO"
fi
else
if test "$STATIC" = ""; then
CONSOLE_LIBS="$CONSOLE_LIBS $BSTATIC -lcurses \$(BDYNAMIC)"
else
CONSOLE_LIBS="$CONSOLE_LIBS -lcurses"
fi
fi
if test ! -z "$USE_GPM"; then
AC_CHECK_HEADERS(gpm.h)
CONSOLE_LIBS="$CONSOLE_LIBS -lgpm $LIBDL"
else
CONSOLE_LIBS="$CONSOLE_LIBS $LIBDL"
fi
X11_LIBS="\$(BDYNAMIC) $X_PRE_LIBS -L$x_libraries -lXi -lXext -lX11 -lm"
GUI_LIBS="$GUI_LIBS $X11_LIBS"
if test ! -z "$HAVEGTK"; then
GUI_LIBS="$GUI_LIBS $LIBDL"
GTK_LIBS="$GTK_LIBS \$(BDYNAMIC) $LIBDL $BSTATIC"
fi
dnl Check for various options
dnl enable dynamic plugins ?
DYN_PLUGINS=false
AC_ARG_ENABLE(dynamic-plugins,
[ --enable-dynamic-plugins enable dynamic plugins [default=no]],
, enable_dynamic=no)
if test x$enable_dynamic = xyes; then
CFLAGS="$CFLAGS -DDYNAMIC_PLUGINS"
LIBS="$LIBS -ldl"
GUI_LIBS="$GUI_LIBS -ldl"
CARBON_LIBS="$CARBON_LIBS -ldl"
DYN_PLUGINS=true
AC_DEFINE(DYNAMIC_PLUGINS, 1, Dynamic plugin support.)
fi
AC_ARG_WITH(image,
[ --with-image specifiy the CD image path [default=../../spp/private/image]],
, with_image=../../spp/private/image)
IMAGE="$with_image"
AC_ARG_WITH(vendor,
[ --with-vendor specify the vendor prefix [default=loki]],
, with_vendor=loki)
BRAND="$with_vendor"
#dnl enable the Outrage plugin (proprietary)
#AC_ARG_ENABLE(outrage,
#[ --enable-outrage enable the Outrage plugin [default=no]],
# , enable_outrage=no)
#if test x$enable_outrage = xyes; then
# CFLAGS="$CFLAGS -DOUTRAGE_SUPPORT"
# PLUGINS="$PLUGINS outrage.c"
# AC_DEFINE(ENABLE_OUTRAGE, 1, Outrage package decoder.)
#fi
OS=`uname -s`
CXXFLAGS="$CFLAGS"
AC_SUBST(SETUPDB)
AC_SUBST(PLUGINS)
AC_SUBST(DYN_PLUGINS)
AC_SUBST(GUI_LIBS)
AC_SUBST(CARBON_LIBS)
AC_SUBST(GTK_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(EXTRA_LIBS)
AC_SUBST(CONSOLE_LIBS)
AC_SUBST(CONSOLE_OBJS)
AC_SUBST(COMMON_LIBS)
AC_SUBST(BZ2LIB)
AC_SUBST(ARCH)
AC_SUBST(LIBC)
AC_SUBST(OS)
AC_SUBST(STATIC)
AC_SUBST(LIBUTIL)
AC_SUBST(LIBINTL)
AC_SUBST(SU_PATH)
AC_SUBST(MOUNT_PATH)
AC_SUBST(UMOUNT_PATH)
AC_SUBST(SETUP_VERSION_MAJOR)
AC_SUBST(SETUP_VERSION_MINOR)
AC_SUBST(SETUP_VERSION_RELEASE)
AC_SUBST(BRANDELF)
AC_SUBST(DO_DIALOG)
AC_SUBST(IMAGE)
AC_SUBST(BRAND)
AC_SUBST(BDYNAMIC)
AC_SUBST(LD)
AC_SUBST(SETUP_GTK)
AC_SUBST(GTK_SUBDIR)
AC_OUTPUT(Makefile plugins/Makefile dialog/Makefile)