fi
OPTION_DEFAULT_OFF([hesiod],[support Hesiod to get the POP server host])
+dnl FIXME hesiod support may not be present, so it seems like an error
+dnl to define, or at least use, this unconditionally.
if test "$with_hesiod" != no; then
AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])
fi
+OPTION_DEFAULT_OFF([mmdf],[support MMDF mailboxes])
+if test "$with_mmdf" != no; then
+ AC_DEFINE(MAIL_USE_MMDF, 1, [Define to support MMDF mailboxes in movemail.])
+fi
+
+OPTION_DEFAULT_OFF([mail-unlink],[unlink, rather than empty, mail spool after reading])
+if test "$with_mail_unlink" != no; then
+ AC_DEFINE(MAIL_UNLINK_SPOOL, 1, [Define to unlink, rather than empty, mail spool after reading.])
+fi
+
+AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME],
+ [string giving default POP mail host])],
+ AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.]))
+
OPTION_DEFAULT_ON([sound],[don't compile with sound support])
OPTION_DEFAULT_ON([sync-input],[process async input synchronously])
### Use -lXpm if available, unless `--with-xpm=no'.
HAVE_XPM=no
+LIBXPM=
if test "${HAVE_X11}" = "yes"; then
if test "${with_xpm}" != "no"; then
AC_CHECK_HEADER(X11/xpm.h,
if test "${HAVE_XPM}" = "yes"; then
AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
+ LIBXPM=-lXpm
fi
fi
+AC_SUBST(LIBXPM)
### Use -ljpeg if available, unless `--with-jpeg=no'.
HAVE_JPEG=no
+LIBJPEG=
if test "${HAVE_X11}" = "yes"; then
if test "${with_jpeg}" != "no"; then
dnl Checking for jpeglib.h can lose because of a redefinition of
[AC_MSG_WARN([libjpeg found, but not version 6b or later])
HAVE_JPEG=no])
fi
+ if test "${HAVE_JPEG}" = "yes"; then
+ LIBJPEG=-ljpeg
+ fi
fi
+AC_SUBST(LIBJPEG)
### Use -lpng if available, unless `--with-png=no'.
HAVE_PNG=no
+LIBPNG=
if test "${HAVE_X11}" = "yes"; then
if test "${with_png}" != "no"; then
# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
if test "${HAVE_PNG}" = "yes"; then
AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
+ LIBPNG="-lpng -lz -lm"
fi
fi
+AC_SUBST(LIBPNG)
### Use -ltiff if available, unless `--with-tiff=no'.
HAVE_TIFF=no
+LIBTIFF=
if test "${HAVE_X11}" = "yes"; then
if test "${with_tiff}" != "no"; then
AC_CHECK_HEADER(tiffio.h,
if test "${HAVE_TIFF}" = "yes"; then
AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
+ dnl FIXME -lz -lm, as per libpng?
+ LIBTIFF=-ltiff
fi
fi
+AC_SUBST(LIBTIFF)
### Use -lgif or -lungif if available, unless `--with-gif=no'.
HAVE_GIF=no
+LIBGIF=
if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
# Earlier versions can crash Emacs.
- [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, try_libungif=yes)])
+ [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])
if test "$HAVE_GIF" = yes; then
- ac_gif_lib_name="-lgif"
- fi
-
+ LIBGIF=-lgif
+ elif test "$HAVE_GIF" = maybe; then
# If gif_lib.h but no libgif, try libungif.
- if test x"$try_libungif" = xyes; then
- AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes)
-
- if test "$HAVE_GIF" = yes; then
- AC_DEFINE(LIBGIF, -lungif, [Compiler option to link with the gif library (if not -lgif).])
- ac_gif_lib_name="-lungif"
- fi
+ AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=no)
+ test "$HAVE_GIF" = yes && LIBGIF=-lungif
fi
if test "${HAVE_GIF}" = "yes"; then
- AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif library (default -lgif; otherwise specify with LIBGIF).])
+ AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
fi
fi
+AC_SUBST(LIBGIF)
dnl Check for required libraries.
if test "${HAVE_X11}" = "yes"; then
### Use -lgpm if available, unless `--with-gpm=no'.
HAVE_GPM=no
+LIBGPM=
if test "${with_gpm}" != "no"; then
AC_CHECK_HEADER(gpm.h,
[AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
-fi
-if test "${HAVE_GPM}" = "yes"; then
- AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
+ if test "${HAVE_GPM}" = "yes"; then
+ AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
+ LIBGPM=-lgpm
+ fi
fi
+AC_SUBST(LIBGPM)
dnl Check for malloc/malloc.h on darwin
AC_CHECK_HEADER(malloc/malloc.h, [AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.])])
# Check for mail-locking functions in a "mail" library. Probably this should
# have the same check as for liblockfile below.
-AC_CHECK_LIB(mail, maillock)
+AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no)
+if test $have_mail = yes; then
+ LIBS_MAIL=-lmail
+ LIBS="$LIBS_MAIL $LIBS"
+ AC_DEFINE(HAVE_LIBMAIL, 1, [Define to 1 if you have the `mail' library (-lmail).])
+else
+ LIBS_MAIL=
+fi
dnl Debian, at least:
-AC_CHECK_LIB(lockfile, maillock)
+AC_CHECK_LIB(lockfile, maillock, have_lockfile=yes, have_lockfile=no)
+if test $have_lockfile = yes; then
+ LIBS_MAIL=-llockfile
+ LIBS="$LIBS_MAIL $LIBS"
+ AC_DEFINE(HAVE_LIBLOCKFILE, 1, [Define to 1 if you have the `lockfile' library (-llockfile).])
+else
# If we have the shared liblockfile, assume we must use it for mail
# locking (e.g. Debian). If we couldn't link against liblockfile
# (no liblockfile.a installed), ensure that we don't need to.
-if test "$ac_cv_lib_lockfile_maillock" = no; then
dnl This works for files generally, not just executables.
dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf?
AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
AC_MSG_ERROR([Shared liblockfile found but can't link against it.
This probably means that movemail could lose mail.
There may be a `development' package to install containing liblockfile.])
- else :
fi
fi
AC_CHECK_FUNCS(touchlock)
AC_CHECK_HEADERS(maillock.h)
+AC_SUBST(LIBS_MAIL)
AC_CHECK_FUNCS(gethostname getdomainname dup2 \
rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
fi
# Do we need the Hesiod library to provide the support routines?
+LIBHESIOD=
if test "$with_hesiod" != no ; then
- # Don't set $LIBS here -- see comments above.
+ # Don't set $LIBS here -- see comments above. FIXME which comments?
AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
[AC_CHECK_LIB(resolv, res_send, resolv=yes,
[AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
RESOLVLIB=
fi
AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
- [AC_DEFINE(HAVE_LIBHESIOD, 1,
- [Define to 1 if you have the hesiod library (-lhesiod).])],
- :, $RESOLVLIB)])
+ hesiod=yes, :, $RESOLVLIB)])
+
+ if test x"$hesiod" = xyes; then
+ AC_DEFINE(HAVE_LIBHESIOD, 1,
+ [Define to 1 if you have the hesiod library (-lhesiod).])
+ LIBHESIOD=-lhesiod
+ fi
fi
+AC_SUBST(LIBHESIOD)
# Do we need libresolv (due to res_init or Hesiod)?
if test "$resolv" = yes ; then
AC_DEFINE(HAVE_LIBRESOLV, 1,
[Define to 1 if you have the resolv library (-lresolv).])
+ LIBRESOLV=-lresolv
+else
+ LIBRESOLV=
fi
+AC_SUBST(LIBRESOLV)
# These tell us which Kerberos-related libraries to use.
+COM_ERRLIB=
+CRYPTOLIB=
+KRB5LIB=
+DESLIB=
+KRB4LIB=
+
if test "${with_kerberos}" != no; then
- AC_CHECK_LIB(com_err, com_err)
- AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
- AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
- AC_CHECK_LIB(krb5, krb5_init_context)
+ AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no)
+ if test $have_com_err = yes; then
+ COM_ERRLIB=-lcom_err
+ LIBS="$COM_ERRLIB $LIBS"
+ AC_DEFINE(HAVE_LIBCOM_ERR, 1, [Define to 1 if you have the `com_err' library (-lcom_err).])
+ fi
+ AC_CHECK_LIB(crypto, mit_des_cbc_encrypt, have_crypto=yes, have_crypto=no)
+ if test $have_crypto = yes; then
+ CRYPTOLIB=-lcrypto
+ LIBS="$CRYPTOLIB $LIBS"
+ AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).])
+ fi
+ AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt, have_k5crypto=yes, have_k5crypto=no)
+ if test $have_k5crypto = yes; then
+ CRYPTOLIB=-lk5crypto
+ LIBS="$CRYPTOLIB $LIBS"
+ AC_DEFINE(HAVE_LIBK5CRYPTO, 1, [Define to 1 if you have the `k5crypto' library (-lk5crypto).])
+ fi
+ AC_CHECK_LIB(krb5, krb5_init_context, have_krb5=yes, have_krb5=no)
+ if test $have_krb5=yes; then
+ KRB5LIB=-lkrb5
+ LIBS="$KRB5LIB $LIBS"
+ AC_DEFINE(HAVE_LIBKRB5, 1, [Define to 1 if you have the `krb5' library (-lkrb5).])
+ fi
+ dnl FIXME Simplify. Does not match 22 logic, thanks to default_off?
if test "${with_kerberos5}" = no; then
- AC_CHECK_LIB(des425, des_cbc_encrypt,,
- [AC_CHECK_LIB(des, des_cbc_encrypt)])
- AC_CHECK_LIB(krb4, krb_get_cred,,
- [AC_CHECK_LIB(krb, krb_get_cred)])
+ AC_CHECK_LIB(des425, des_cbc_encrypt, have_des425=yes, have_des425=no )
+ if test $have_des425 = yes; then
+ DESLIB=-ldes425
+ LIBS="$DESLIB $LIBS"
+ AC_DEFINE(HAVE_LIBDES425, 1, [Define to 1 if you have the `des425' library (-ldes425).])
+ else
+ AC_CHECK_LIB(des, des_cbc_encrypt, have_des=yes, have_des=no)
+ if test $have_des = yes; then
+ DESLIB=-ldes
+ LIBS="$DESLIB $LIBS"
+ AC_DEFINE(HAVE_LIBDES, 1, [Define to 1 if you have the `des' library (-ldes).])
+ fi
+ fi
+ AC_CHECK_LIB(krb4, krb_get_cred, have_krb4=yes, have_krb4=no)
+ if test $have_krb4 = yes; then
+ KRB4LIB=-lkrb4
+ LIBS="$KRB4LIB $LIBS"
+ AC_DEFINE(HAVE_LIBKRB4, 1, [Define to 1 if you have the `krb4' library (-lkrb4).])
+ else
+ AC_CHECK_LIB(krb, krb_get_cred, have_krb=yes, have_krb=no)
+ if test $have_krb = yes; then
+ KRB4LIB=-lkrb
+ LIBS="$KRB4LIB $LIBS"
+ AC_DEFINE(HAVE_LIBKRB, 1, [Define to 1 if you have the `krb' library (-lkrb).])
+ fi
+ fi
fi
if test "${with_kerberos5}" != no; then
AC_CHECK_HEADERS(com_err.h)
fi
+AC_SUBST(COM_ERRLIB)
+AC_SUBST(CRYPTOLIB)
+AC_SUBST(KRB5LIB)
+AC_SUBST(DESLIB)
+AC_SUBST(KRB4LIB)
+
# Solaris requires -lintl if you want strerror (which calls dgettext)
# to return localized messages.
AC_CHECK_LIB(intl, dgettext)
echo " Does Emacs use -lXpm? ${HAVE_XPM}"
echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
-echo " Does Emacs use a gif library? ${HAVE_GIF} $ac_gif_lib_name"
+echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF"
echo " Does Emacs use -lpng? ${HAVE_PNG}"
echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
echo " Does Emacs use -lgpm? ${HAVE_GPM}"
# Makefile for lib-src subdirectory in GNU Emacs.
# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010
+# Free Software Foundation, Inc.
# This file is part of GNU Emacs.
EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
-# Additional -D flags for movemail (add to MOVE_FLAGS if desired):
-# MAIL_USE_POP Support mail retrieval from a POP mailbox.
-# MAIL_USE_MMDF Support MMDF mailboxes.
-# MAIL_USE_FLOCK Use flock for file locking (see the comments
-# about locking in movemail.c)
-# MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
-# it (instead of just emptying it).
-# KERBEROS Support Kerberized POP.
-# KRB5 Support Kerberos Version 5 pop instead of
-# Version 4 (define this in addition to
-# KERBEROS).
-# HESIOD Support Hesiod lookups of user mailboxes.
-# MAILHOST A string, the host name of the default POP
-# mail host for the site.
+# Specify additional -D flags for movemail. Options:
+# -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
+# See the comments about locking in movemail.c. Normally the values
+# in ../src/[ms]/*.h should be correct and you should not need to do anything.
+# If neither flag is set, blessmail is used.
MOVE_FLAGS=
# ========================== start of cpp stuff =======================
#define BLESSMAIL
#endif
-#ifdef KERBEROS
-# ifdef HAVE_LIBKRB
- KRB4LIB = -lkrb
-# else
-# ifdef HAVE_LIBKRB4
- KRB4LIB = -lkrb4
-# endif
-# endif
-# ifdef HAVE_LIBDES
- DESLIB = -ldes
-# else
-# ifdef HAVE_LIBDES425
- DESLIB = -ldes425
-# endif
-# endif
-# ifdef HAVE_LIBKRB5
- KRB5LIB = -lkrb5
-# endif
-# ifdef HAVE_LIBK5CRYPTO
- CRYPTOLIB = -lk5crypto
-# else
-# ifdef HAVE_LIBCRYPTO
- CRYPTOLIB = -lcrypto
-# endif
-# endif
-# ifdef HAVE_LIBCOM_ERR
- COM_ERRLIB = -lcom_err
-# endif
-#endif /* KERBEROS */
-
-/* If HESIOD is defined, set this to "-lhesiod". */
-#ifdef HAVE_LIBHESIOD
-# ifdef HAVE_LIBRESOLV
- HESIODLIB= -lhesiod -lresolv
-# else
- HESIODLIB= -lhesiod
-# endif
-#endif
-
-LIBS_MOVE=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
+LIBS_MOVE=@KRB4LIB@ @DESLIB@ @KRB5LIB@ @CRYPTOLIB@ @COM_ERRLIB@ @LIBHESIOD@ @LIBRESOLV@
-#ifdef HAVE_LIBLOCKFILE
-LIBS_MAIL=-llockfile
-#else
-#ifdef HAVE_LIBMAIL
-LIBS_MAIL=-lmail
-#endif
-#endif
+LIBS_MAIL=@LIBS_MAIL@
LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
-/* We need to #define emacs to get the right versions of some files.
- Some other files - those shared with other GNU utilities - need
- HAVE_CONFIG_H #defined before they know they can take advantage of
- the information in ../src/config.h. */
+/* Those files shared with other GNU utilities need HAVE_CONFIG_H
+ defined before they know they can take advantage of the information
+ in ../src/config.h. */
ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
-I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
-I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
-I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
-/* This was all of CPP_CFLAGS except -Demacs.
- Now that -Demacs has been deleted from CPP_CFLAGS,
- this is actually the same as CPP_CFLAGS, but let\'s not delete it yet. */
-BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
- -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
\f
.SUFFIXES: .m
REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
- ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
+ ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
$(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
$(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
+/* We need to define emacs to get the right version of something (what?). */
movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c