From d0c022f0ca07606ad4588ee84829802d85b77c5c Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 24 Aug 2001 20:30:05 +0000 Subject: [PATCH] * acinclude.m4: Include all used macros from the macros directory. * autogen.sh: Remove all references to "macros". * Makefile.am: Likewise. --- ChangeLog | 5 ++ Makefile.am | 11 +-- acinclude.m4 | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++ autogen.sh | 7 +- 4 files changed, 193 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2fd22e62c..69be81213 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2001-08-24 Pavel Roskin + * acinclude.m4: Include all used macros from the macros + directory. + * autogen.sh: Remove all references to "macros". + * Makefile.am: Likewise. + * configure.in: Remove all GNOME stuff except GNOME_VFS_CHECKS. * Makefile.am (SUBDIRS): Remove all GNOME-related directories. diff --git a/Makefile.am b/Makefile.am index 29e3911e6..4a1859248 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,18 +2,9 @@ SUBDIRS = intl po vfs slang edit src lib doc syntax pc -ACLOCAL_AMFLAGS = -I macros - -ACLOCAL_M4_SOURCES = \ - macros/gnome.m4 \ - macros/gnome-vfs.m4 \ - macros/gnome-undelfs.m4 \ - macros/linger.m4 - EXTRA_DIST = FAQ INSTALL.FAST MAINTAINERS \ README.PC README.QNX README.smbfs \ - extraconf.h \ - $(ACLOCAL_M4_SOURCES) + extraconf.h noinst_DATA = mc.spec diff --git a/acinclude.m4 b/acinclude.m4 index 91999cc7d..3498a451e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,3 +1,188 @@ +dnl GNOME_UNDELFS_CHECKS +dnl Check for ext2fs undel support. +dnl Set shell variable ext2fs_undel to "yes" if we have it, +dnl "no" otherwise. May define USE_EXT2FSLIB for cpp. +dnl Will set EXT2FS_UNDEL_LIBS to required libraries. + +AC_DEFUN([GNOME_UNDELFS_CHECKS], [ + ext2fs_undel=no + EXT2FS_UNDEL_LIBS= + AC_CHECK_HEADERS(linux/ext2_fs.h) + if test x$ac_cv_header_linux_ext2_fs_h = xyes + then + AC_CHECK_HEADERS(ext2fs/ext2fs.h, , , [#include +#include ]) + if test x$ac_cv_header_ext2fs_ext2fs_h = xyes + then + AC_DEFINE(USE_EXT2FSLIB) + ext2fs_undel=yes + EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err" + fi + fi +]) + + + +dnl GNOME_VFS_CHECKS +dnl Check for various functions needed by libvfs. +dnl This has various effects: +dnl Sets GNOME_VFS_LIBS to libraries required +dnl Sets termnet to true or false depending on whether it is required. +dnl If yes, defines USE_TERMNET. +dnl Sets vfs_flags to "pretty" list of vfs implementations we include. +dnl Sets shell variable use_vfs to yes (default, --with-vfs) or +dnl "no" (--without-vfs). +dnl Calls AC_SUBST(mcserv), which is either empty or "mcserv". + +dnl Private define +AC_DEFUN([GNOME_WITH_VFS],[ + dnl FIXME: network checks should probably be in their own macro. + AC_CHECK_LIB(nsl, t_accept) + AC_CHECK_LIB(socket, socket) + + have_socket=no + AC_CHECK_FUNCS(socket, have_socket=yes) + if test $have_socket = no; then + # socket is not in the default libraries. See if it's in some other. + for lib in bsd socket inet; do + AC_CHECK_LIB($lib, socket, [ + LIBS="$LIBS -l$lib" + have_socket=yes + AC_DEFINE(HAVE_SOCKET) + break]) + done + fi + + have_gethostbyname=no + AC_CHECK_FUNC(gethostbyname, have_gethostbyname=yes) + if test $have_gethostbyname = no; then + # gethostbyname is not in the default libraries. See if it's in some other. + for lib in bsd socket inet; do + AC_CHECK_LIB($lib, gethostbyname, [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break]) + done + fi + + vfs_flags="tarfs" + use_net_code=false + if test $have_socket = yes; then + AC_STRUCT_LINGER + AC_CHECK_FUNCS(pmap_set, , [ + AC_CHECK_LIB(rpc, pmap_set, [ + LIBS="-lrpc $LIBS" + AC_DEFINE(HAVE_PMAP_SET) + ])]) + AC_CHECK_FUNCS(pmap_getport pmap_getmaps rresvport) + dnl add for source routing support setsockopt + AC_CHECK_HEADERS(rpc/pmap_clnt.h, , , [ +#include +#include +#include +#include +#include + ]) + vfs_flags="$vfs_flags, mcfs, ftpfs, fish" + use_net_code=true + fi + + dnl + dnl Samba support + dnl + smbfs="" + SAMBAFILES="" + AC_ARG_WITH(samba, + [--with-samba Support smb virtual file system],[ + if test "x$withval" != "xno"; then + AC_DEFINE(WITH_SMBFS) + vfs_flags="$vfs_flags, smbfs" + smbfs="smbfs.o" + SAMBAFILES="\$(SAMBAFILES)" + fi + ]) + AC_SUBST(smbfs) + AC_SUBST(SAMBAFILES) + + dnl + dnl The termnet support + dnl + termnet=false + AC_ARG_WITH(termnet, + [--with-termnet If you want a termified net support],[ + if test x$withval = xyes; then + AC_DEFINE(USE_TERMNET) + termnet=true + fi + ]) + + TERMNET="" + AC_DEFINE(USE_VFS) + if $use_net_code; then + AC_DEFINE(USE_NETCODE) + fi + mcserv= + if test $have_socket = yes; then + mcserv="mcserv" + if $termnet; then + TERMNET="-ltermnet" + fi + fi + + AC_SUBST(TERMNET) + AC_SUBST(mcserv) + +dnl FIXME: +dnl GNOME_VFS_LIBS= + +]) + + + +AC_DEFUN([GNOME_VFS_CHECKS],[ + use_vfs=yes + AC_ARG_WITH(vfs, + [--with-vfs Compile with the VFS code], + use_vfs=$withval + ) + case $use_vfs in + yes) GNOME_WITH_VFS;; + no) use_vfs=no;; + *) use_vfs=no;; + dnl Should we issue a warning? + esac +]) + + + +dnl +dnl Check for struct linger +dnl +AC_DEFUN([AC_STRUCT_LINGER], [ +av_struct_linger=no +AC_MSG_CHECKING([struct linger is available]) +AC_TRY_RUN([ +#include +#include + +struct linger li; + +int main () +{ + li.l_onoff = 1; + li.l_linger = 120; + return 0; +} +],[ +AC_DEFINE(HAVE_STRUCT_LINGER) +av_struct_linger=yes +],[ +av_struct_linger=no +],[ +av_struct_linger=no +]) +AC_MSG_RESULT($av_struct_linger) +]) + + + dnl dnl Check for size of d_name dirent member dnl diff --git a/autogen.sh b/autogen.sh index 656493191..0afeff3af 100755 --- a/autogen.sh +++ b/autogen.sh @@ -14,9 +14,6 @@ test -z "$srcdir" && srcdir=. ( cd $srcdir -: ${CVS=cvs} -test -d macros || $CVS co -d macros gnome-common/macros || exit 1 - # Ensure that gettext is reasonably new. gettext_ver=`$GETTEXTIZE --version | sed -n '1s/^.* //p'` @@ -41,8 +38,8 @@ for i in $m4files; do cp -f $fromdir/$i gettext.m4 done -$ACLOCAL -I macros -I gettext.m4 $ACLOCAL_FLAGS || \ - $ACLOCAL -I macros $ACLOCAL_FLAGS || \ +$ACLOCAL -I gettext.m4 $ACLOCAL_FLAGS || \ + $ACLOCAL $ACLOCAL_FLAGS || \ exit 1 $AUTOHEADER || exit 1 $AUTOCONF || exit 1