From 97efb62959d9ce3ad359243711ae2a7f55a38881 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 9 May 2010 19:16:09 -0700 Subject: [PATCH] Move LIBS_SYSTEM from cpp to configure. * configure.in (LIBS_SYSTEM): New output variable, replacing cpp. * lib-src/Makefile.in (LIBS_SYSTEM) [!MSDOS]: Set with configure, not cpp. (LIBS_SYSTEM) [MSDOS]: Use MSDOS_LIBS_SYSTEM. (NOT_C_CODE): Remove, no longer used. (config.h) [!MSDOS]: No longer include. (LOADLIBES): Use LIBS_SYSTEM as a variable. * src/Makefile.in (LIBS_SYSTEM): Set using configure, not cpp. (LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM. (LIBES): Use LIBS_SYSTEM as a variable. * src/s/msdos.h (LIBS_SYSTEM): Rename to MSDOS_LIBS_SYSTEM. Always define. * src/s/aix4-2.h (LIBS_SYSTEM): * src/s/freebsd.h (LIBS_SYSTEM): * src/s/hpux10-20.h (LIBS_SYSTEM): * src/s/sol2-6.h (LIBS_SYSTEM): * src/s/unixware.h (LIBS_SYSTEM): Move to configure. * msdos/sed1v2.inp, msdos/sed3v2.inp (LIBS_SYSTEM): Edit to empty. --- ChangeLog | 4 +++- configure.in | 35 ++++++++++++++++++++++++++++++----- lib-src/ChangeLog | 6 ++++++ lib-src/Makefile.in | 13 +++++++------ msdos/ChangeLog | 2 ++ msdos/sed1v2.inp | 1 + msdos/sed3v2.inp | 1 + src/ChangeLog | 11 +++++++++++ src/Makefile.in | 14 ++++++-------- src/s/aix4-2.h | 9 --------- src/s/freebsd.h | 2 -- src/s/hpux10-20.h | 8 +++----- src/s/msdos.h | 7 ++++--- src/s/sol2-6.h | 2 -- src/s/unixware.h | 7 ++----- 15 files changed, 76 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index 355f21fb21..b6caa8bff9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2010-05-10 Glenn Morris + * configure.in (LIBS_SYSTEM): New output variable, replacing cpp. + * configure.in (MAIL_USE_FLOCK, MAIL_USE_LOCKF): New AC_DEFINEs. (BLESSMAIL_TARGET): New output variable. @@ -155,7 +157,7 @@ * configure.in (REAL_CFLAGS, CFLAGS): Restore -g for gcc. -2010-04-22 Miles Bader +2010-04-22 Miles Bader * configure.in: Get rid of "unix" pre-defined macro when preprocessing Makefile. (Bug#5857) diff --git a/configure.in b/configure.in index 383e80ba1a..c99167f205 100644 --- a/configure.in +++ b/configure.in @@ -859,10 +859,6 @@ tempcname="conftest.c" echo ' #include "'${srcdir}'/src/'${opsysfile}'" #include "'${srcdir}'/src/'${machfile}'" -#ifndef LIBS_SYSTEM -#define LIBS_SYSTEM -#endif -configure___ libsrc_libs=LIBS_SYSTEM configure___ LIBX=-lX11 @@ -1003,6 +999,23 @@ test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \ AC_SUBST(C_SWITCH_SYSTEM) +LIBS_SYSTEM= +case "$opsys" in + ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2. + aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;; + + freebsd) LIBS_SYSTEM="-lutil" ;; + + hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; + + sol2*) LIBS_SYSTEM="-lsocket -lnsl -lkstat" ;; + + ## Motif needs -lgen. + unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;; +esac +AC_SUBST(LIBS_SYSTEM) + + ### Make sure subsequent tests use flags consistent with the build flags. if test x"${OVERRIDE_CPPFLAGS}" != x; then @@ -1586,7 +1599,7 @@ if test $use_mmap_for_buffers = yes; then REL_ALLOC=no fi -LIBS="$libsrc_libs $LIBS" +LIBS="$LIBS_SYSTEM $LIBS" dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks, dnl and also adds -ldnet to LIBS, which Autoconf uses for checks. @@ -1600,6 +1613,18 @@ AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") AC_CHECK_LIB(pthreads, cma_open) +## Note: when using cpp in s/aix4.2.h, this definition depended on +## HAVE_LIBPTHREADS. That was not defined earlier in configure when +## the system file was sourced. Hence the value of LIBS_SYSTEM +## added to LIBS in configure would never contain the pthreads part, +## but the value used in Makefiles might. FIXME? +## +## -lpthreads seems to be necessary for Xlib in X11R6, and should +## be harmless on older versions of X where it happens to exist. +test "$opsys" = "aix4-2" && \ + test $ac_cv_lib_pthreads_cma_open = yes && \ + LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads" + dnl Check for need for bigtoc support on IBM AIX case ${host_os} in diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index c2a7b6f9ce..608d5c618b 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,11 @@ 2010-05-10 Glenn Morris + * Makefile.in (LIBS_SYSTEM): Set with configure, not cpp. + (LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM. + (NOT_C_CODE): Remove, no longer used. + (config.h) [!MSDOS]: No longer include. + (LOADLIBES): Use LIBS_SYSTEM as a variable. + * Makefile.in (BLESSMAIL_TARGET): Set with configure, not cpp. 2010-05-08 Christoph (tiny change) diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index cde26a5411..5f0fb6e671 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -154,6 +154,9 @@ LIBS_MAIL=@LIBS_MAIL@ ## Extra libraries to use when linking movemail. LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) +## Some systems define this to request special libraries. +LIBS_SYSTEM = @LIBS_SYSTEM@ + # 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. @@ -164,14 +167,12 @@ CPP_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src # ========================== start of cpp stuff ======================= /* From here on, comments must be done in C syntax. */ -#define NOT_C_CODE +#ifdef MSDOS #include "../src/config.h" - -/* Some s/SYSTEM.h files define this to request special libraries. */ -#ifndef LIBS_SYSTEM -#define LIBS_SYSTEM +LIBS_SYSTEM = MSDOS_LIBS_SYSTEM #endif -LOADLIBES=LIBS_SYSTEM + +LOADLIBES=$(LIBS_SYSTEM) .SUFFIXES: .m diff --git a/msdos/ChangeLog b/msdos/ChangeLog index 996b9c0d02..6922c6f55d 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,5 +1,7 @@ 2010-05-10 Glenn Morris + * sed1v2.inp, sed3v2.inp (LIBS_SYSTEM): Edit to empty. + * sed3v2.inp (BLESSMAIL_TARGET): Edit to need-blessmail. 2010-05-07 Chong Yidong diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index a3ad070c41..db6944ec13 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -50,6 +50,7 @@ s/@LIB_MATH@/-lm/ /^LD_SWITCH_X_SITE_AUX_RPATH *=/s/@LD_SWITCH_X_SITE_AUX_RPATH@// /^LD_SWITCH_SYSTEM *=/s/@LD_SWITCH_SYSTEM@// /^LD_SWITCH_SYSTEM_EXTRA *=/s/@LD_SWITCH_SYSTEM_EXTRA@// +/^LIBS_SYSTEM *=/s/@LIBS_SYSTEM@// /^LIBTIFF *=/s/@LIBTIFF@// /^LIBJPEG *=/s/@LIBJPEG@// /^LIBPNG *=/s/@LIBPNG@// diff --git a/msdos/sed3v2.inp b/msdos/sed3v2.inp index b0182a72fd..d5a4a3335b 100644 --- a/msdos/sed3v2.inp +++ b/msdos/sed3v2.inp @@ -35,6 +35,7 @@ /^LIBHESIOD *=/s/@[^@\n]*@//g /^LIBRESOLV *=/s/@[^@\n]*@//g /^LIBS_MAIL *=/s/@[^@\n]*@//g +/^LIBS_SYSTEM *=/s/@[^@\n]*@//g /^CFLAGS *=/s!=.*$!=-O2 -g! /^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS! /^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@// diff --git a/src/ChangeLog b/src/ChangeLog index c0a264d46c..c0e37f70c9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,16 @@ 2010-05-10 Glenn Morris + * Makefile.in (LIBS_SYSTEM): Set using configure, not cpp. + (LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM. + (LIBES): Use LIBS_SYSTEM as a variable. + * s/msdos.h (LIBS_SYSTEM): Rename to MSDOS_LIBS_SYSTEM. Always define. + * s/aix4-2.h (LIBS_SYSTEM): + * s/freebsd.h (LIBS_SYSTEM): + * s/hpux10-20.h (LIBS_SYSTEM): + * s/sol2-6.h (LIBS_SYSTEM): + * s/unixware.h (LIBS_SYSTEM): + Move to configure. + * s/aix4-2.h (MAIL_USE_LOCKF): * s/bsd-common.h (MAIL_USE_FLOCK): * s/darwin.h (MAIL_USE_FLOCK): diff --git a/src/Makefile.in b/src/Makefile.in index f956d03e33..69e37fb236 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -88,6 +88,9 @@ LD_SWITCH_SYSTEM_EXTRA=@LD_SWITCH_SYSTEM_EXTRA@ ## Flags to pass to ld only for temacs. TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTEM_TEMACS) +## Some systems define this to request special libraries. +LIBS_SYSTEM=@LIBS_SYSTEM@ + LIBTIFF=@LIBTIFF@ LIBJPEG=@LIBJPEG@ LIBPNG=@LIBPNG@ @@ -195,11 +198,6 @@ DEPFLAGS = -MMD -MF deps/$*.d do not let it interfere with this file. */ #undef register -/* Some s/SYSTEM.h files define this to request special libraries. */ -#ifndef LIBS_SYSTEM -#define LIBS_SYSTEM -#endif - /* This macro is for switches specifically related to X Windows. */ #ifndef LD_SWITCH_X_SITE #define LD_SWITCH_X_SITE @@ -324,9 +322,9 @@ LD=ld #endif #ifdef MSDOS +LIBS_SYSTEM = MSDOS_LIBS_SYSTEM #ifdef HAVE_X_WINDOWS MSDOS_OBJ = dosfns.o msdos.o -#define LIBS_SYSTEM -lxext -lsys #else MSDOS_OBJ = dosfns.o msdos.o w16select.o termcap.o #endif @@ -656,8 +654,8 @@ SOME_MACHINE_LISP = ../lisp/mouse.elc \ with GCC, we might need gnulib again after them. */ LIBES = $(LOADLIBES) $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ - $(RSVG_LIBS) $(DBUS_LIBS) @LIBGPM@ @LIBRESOLV@ LIBS_SYSTEM $(LIBS_TERMCAP) \ - $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \ + $(RSVG_LIBS) $(DBUS_LIBS) @LIBGPM@ @LIBRESOLV@ $(LIBS_SYSTEM) \ + $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \ @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \ $(GNULIB_VAR) @LIB_MATH@ @LIB_STANDARD@ $(GNULIB_VAR) diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index dc6ba71ab6..8f506cb182 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -87,15 +87,6 @@ along with GNU Emacs. If not, see . */ #define LINKER cc #endif -/* -lpthreads seems to be necessary for Xlib in X11R6, and should be harmless - on older versions of X where it happens to exist. */ -#ifdef HAVE_LIBPTHREADS -#define LIBS_SYSTEM -lrts -lIM -liconv -lpthreads -#else -/* IBM's X11R5 use -lIM and -liconv in AIX 3.2.2. */ -#define LIBS_SYSTEM -lrts -lIM -liconv -#endif - /* The following definition seems to be needed in AIX version 3.1.6.8. It may not have been needed in certain earlier versions. */ #define HAVE_TCATTR diff --git a/src/s/freebsd.h b/src/s/freebsd.h index 50fdf65a1b..78c7dfdf6b 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h @@ -30,8 +30,6 @@ along with GNU Emacs. If not, see . */ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) -#define LIBS_SYSTEM -lutil - #undef LIB_GCC #define LIB_GCC diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h index 8dc2f4d97d..0dc8276c44 100644 --- a/src/s/hpux10-20.h +++ b/src/s/hpux10-20.h @@ -1,6 +1,7 @@ /* System description file for hpux version 10.20. - Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -126,13 +127,10 @@ along with GNU Emacs. If not, see . */ /* AlainF 20-Jul-1996 says this is right. */ #define KERNEL_FILE "/stand/vmunix" -#define LIBS_SYSTEM -l:libdld.sl - /* Rainer Malzbender says definining HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC. */ - #ifndef HAVE_XRMSETDATABASE #define HAVE_XRMSETDATABASE #endif diff --git a/src/s/msdos.h b/src/s/msdos.h index 5199799a22..a594bb850f 100644 --- a/src/s/msdos.h +++ b/src/s/msdos.h @@ -1,7 +1,7 @@ /* System description file for MS-DOS - Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -140,8 +140,9 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ commentary below, in the non-X branch. The 140KB number was measured on GNU/Linux and on MS-WIndows. */ #define SYSTEM_PURESIZE_EXTRA (-170000+140000) -#define LIBS_SYSTEM -lxext -lsys +#define MSDOS_LIBS_SYSTEM -lxext -lsys #else +#define MSDOS_LIBS_SYSTEM /* We need a little extra space, see ../../lisp/loadup.el. As of 20091024, DOS-specific files use up 62KB of pure space. But overall, we end up wasting 130KB of pure space, because diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h index 78d2bfb3b6..f9a4c44d74 100644 --- a/src/s/sol2-6.h +++ b/src/s/sol2-6.h @@ -27,8 +27,6 @@ along with GNU Emacs. If not, see . */ #define POSIX -#define LIBS_SYSTEM -lsocket -lnsl -lkstat - /* Prefer kstat over kvm in getloadavg.c, kstat doesn't require root. ghazi@caip.rutgers.edu, 7/21/97. Don't redefine if already defined (e.g., by config.h). */ diff --git a/src/s/unixware.h b/src/s/unixware.h index 6e42a0d4c5..31d7b25269 100644 --- a/src/s/unixware.h +++ b/src/s/unixware.h @@ -1,7 +1,7 @@ /* s/ file for Unixware. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -28,9 +28,6 @@ along with GNU Emacs. If not, see . */ #undef HAVE_SYSV_SIGPAUSE -/* Motif needs -lgen. */ -#define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen - /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock rather than sighold/sigrelse, which appear to be BSD4.1 specific. It may also be appropriate for SVR4.x -- 2.20.1