X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/f4981b7e31e98ed2f2d46733961c5ca211cc41c4..8d1d9587c92457e1a7171493fdd1bccf682d26f0:/configure.in diff --git a/configure.in b/configure.in index bb2866b665..8512c852c4 100644 --- a/configure.in +++ b/configure.in @@ -305,6 +305,16 @@ if test x$ac_gc_check_cons_list != x ; then [Define this to check for errors in cons list.]) fi +AC_ARG_ENABLE(use-lisp-union-type, +[AS_HELP_STRING([--enable-use-lisp-union-type], + [use a union for the Lisp_Object data type. + This is only useful for development for catching certain types of bugs.])], +if test "${enableval}" != "no"; then + AC_DEFINE(USE_LISP_UNION_TYPE, 1, + [Define this to use a lisp union for the Lisp_Object data type.]) +fi) + + AC_ARG_ENABLE(profiling, [AS_HELP_STRING([--enable-profiling], [build emacs with profiling support. @@ -317,6 +327,8 @@ else PROFILING_CFLAGS= PROFILING_LDFLAGS= fi +AC_SUBST(PROFILING_CFLAGS) +AC_SUBST(PROFILING_LDFLAGS) AC_ARG_ENABLE(autodepend, [AS_HELP_STRING([--enable-autodepend], @@ -710,15 +722,6 @@ then CC="$NON_GNU_CC" fi -if test x$GCC = xyes; then - C_OPTIMIZE_SWITCH=-O2 - test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS" -else - dnl FIXME? unused. - C_OPTIMIZE_SWITCH=-O - test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS" -fi - dnl checks for Unix variants AC_USE_SYSTEM_EXTENSIONS @@ -748,6 +751,22 @@ CFLAGS="$SAVE_CFLAGS" unset has_option unset SAVE_CFLAGS +### Use -Wold-style-definition if the compiler supports it +# This can be removed when conversion to standard C is finished. +AC_MSG_CHECKING([whether gcc understands -Wold-style-definition]) +SAVE_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wold-style-definition" +AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) +if test $has_option = yes; then + C_WARNINGS_SWITCH="-Wold-style-definition $C_WARNINGS_SWITCH" +fi +AC_MSG_RESULT($has_option) +CFLAGS="$SAVE_CFLAGS" +unset has_option +unset SAVE_CFLAGS +AC_SUBST(C_WARNINGS_SWITCH) + + #### Some other nice autoconf tests. dnl checks for programs @@ -837,39 +856,12 @@ AC_LINK_IFELSE([main(){return 0;}], LDFLAGS=$late_LDFLAGS [AC_MSG_RESULT(no)]) -LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}" - # The value of CPP is a quoted variable reference, so we need to do this # to get its actual value... CPP=`eval "echo $CPP"` -### First figure out CFLAGS (which we use for running the compiler here) -### and REAL_CFLAGS (which we use for real compilation). -### The two are the same except on a few systems, where they are made -### different to work around various lossages. For example, -### GCC 2.5 on GNU/Linux needs them to be different because it treats -g -### as implying static linking. - -### If the CFLAGS env var is specified, we use that value -### instead of the default. - -dnl C_OPTIMIZE_SWITCH unused save for gcc, so why set it for non-gcc? -dnl Note AC_PROG_CC sets CFLAGS to -g -O2 for gcc anyway. -if test "x$SPECIFIED_CFLAGS" = x; then - if test x$GCC = xyes; then - CFLAGS="-g $C_OPTIMIZE_SWITCH" - REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS" - else - CFLAGS= - REAL_CFLAGS= - fi -else - REAL_CFLAGS="$CFLAGS" -fi - - dnl Not used by any currently supported platform. dnl The function dump-emacs will not be defined and temacs will do dnl (load "loadup") automatically unless told otherwise. @@ -885,6 +877,8 @@ AC_SUBST(CANNOT_DUMP) UNEXEC_OBJ=unexelf.o case "$opsys" in + # MSDOS uses unexec.o + # MSWindows uses unexw32.o aix4-2) UNEXEC_OBJ=unexaix.o ;; @@ -1066,7 +1060,7 @@ START_FILES= case $opsys in cygwin ) LIB_MATH= - START_FILES='ecrt0.o' + START_FILES='pre-crt0.o' ;; darwin ) ## Adding -lm confuses the dynamic linker, so omit it. @@ -1210,7 +1204,7 @@ AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \ linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \ stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \ sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \ - sys/utsname.h pwd.h utmp.h) + sys/utsname.h pwd.h utmp.h dirent.h) AC_MSG_CHECKING(if personality LINUX32 can be set) AC_TRY_COMPILE([#include ], [personality (PER_LINUX32)], @@ -1475,7 +1469,7 @@ tmp_CPPFLAGS="$CPPFLAGS" tmp_CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS -x objective-c" CFLAGS="$CFLAGS -x objective-c" -TEMACS_LDFLAGS2="\${LDFLAGS}" +TEMACS_LDFLAGS2="\${LDFLAGS} \${PROFILING_LDFLAGS}" dnl I don't think it's especially important, but src/Makefile.in dnl (now the only user of ns_appdir) used to go to the trouble of adding a dnl trailing "/" to it, so now we do it here. @@ -1504,7 +1498,6 @@ if test "${with_ns}" != no; then GNUSTEP_LOCAL_LIBRARIES="-L${GNUSTEP_LOCAL_LIBRARIES}" CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" - REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}" LIB_STANDARD= START_FILES= @@ -1710,6 +1703,7 @@ esac # used for the tests that follow. We set them back to REAL_CFLAGS and # REAL_CPPFLAGS later on. +REAL_CFLAGS="$CFLAGS" REAL_CPPFLAGS="$CPPFLAGS" if test "${HAVE_X11}" = "yes"; then @@ -2610,14 +2604,14 @@ AC_SUBST(BLESSMAIL_TARGET) AC_CHECK_FUNCS(gethostname getdomainname dup2 \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ -random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ +random lrand48 logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \ -__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ +__fpending mblen mbrlen mbsinit strsignal setitimer ualarm strchr strrchr \ sendto recvfrom getsockopt setsockopt getsockname getpeername \ -gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \ +gai_strerror mkstemp getline getdelim mremap memmove fsync sync \ memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \ -cfmakeraw cfsetspeed isnan copysign) +cfmakeraw cfsetspeed isnan copysign __executable_start) AC_CHECK_HEADERS(sys/un.h) @@ -3332,9 +3326,7 @@ LINKER= ORDINARY_LINK= case "$opsys" in ## gnu: GNU needs its own crt0. - aix4-2|darwin|gnu|usg5-4|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;; - - cygwin) LINKER="\$(CC)" ;; + aix4-2|cygwin|darwin|gnu|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;; ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the ## library search parth, i.e. it won't search /usr/lib for libc and @@ -3353,8 +3345,6 @@ case "$opsys" in esac -PRE_EDIT_LDFLAGS= -POST_EDIT_LDFLAGS= if test "x$ORDINARY_LINK" = "xyes"; then LINKER="\$(CC)" @@ -3373,17 +3363,7 @@ elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then ## searching for libraries in its internal directories, so we have to ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). LINKER="\$(CC) -nostdlib" - ## GCC passes any argument prefixed with -Xlinker directly to the linker. - ## See prefix-args.c for an explanation of why we do not do this with the - ## shell''s ``for'' construct. Note that sane people do not have '.' in - ## their paths, so we must use ./prefix-args. - ## TODO either make prefix-args check ORDINARY_LINK internally, - ## or remove it altogether (bug#6184), removing the need for this hack. - PRE_EDIT_LDFLAGS='`./prefix-args -Xlinker' - POST_EDIT_LDFLAGS='`' -fi -AC_SUBST(PRE_EDIT_LDFLAGS) -AC_SUBST(POST_EDIT_LDFLAGS) +fi test "x$LINKER" = "x" && LINKER=ld ## FIXME? What setting of EDIT_LDFLAGS should this have? @@ -3399,8 +3379,7 @@ LIB_GCC= if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then case "$opsys" in - ## cygwin: don't link against static libgcc. - cygwin|freebsd|netbsd|openbsd) LIB_GCC= ;; + freebsd|netbsd|openbsd) LIB_GCC= ;; gnu-*) ## armin76@gentoo.org reported that the lgcc_s flag is necessary to @@ -3535,11 +3514,6 @@ SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ #define my_strftime nstrftime /* for strftime.c */ -/* Some of the files of Emacs which are intended for use with other - programs assume that if you have a config.h file, you must declare - the type of getenv. */ -extern char *getenv (); - /* These default definitions are good for almost all machines. The exceptions override them in m/MACHINE.h. */ @@ -3569,23 +3543,11 @@ extern char *getenv (); /* Define if the compiler supports function prototypes. It may do so but not define __STDC__ (e.g. DEC C by default) or may define it as zero. */ #undef PROTOTYPES -/* For mktime.c: */ -#ifndef __P -# if defined PROTOTYPES -# define __P(args) args -# else -# define __P(args) () -# endif /* GCC. */ -#endif /* __P */ #ifdef HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H -#include /* May be needed for bcopy & al. */ -#endif - #ifdef HAVE_STDLIB_H #include #endif @@ -3608,6 +3570,14 @@ void *alloca (size_t); typedef unsigned size_t; #endif +#ifndef HAVE_STRCHR +#define strchr(a, b) index (a, b) +#endif + +#ifndef HAVE_STRRCHR +#define strrchr(a, b) rindex (a, b) +#endif + #if defined __GNUC__ && (__GNUC__ > 2 \ || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) #define NO_RETURN __attribute__ ((__noreturn__)) @@ -3627,16 +3597,6 @@ typedef unsigned size_t; # endif #endif -#ifndef HAVE_BCOPY -#define bcopy(a,b,s) memcpy (b,a,s) -#endif -#ifndef HAVE_BZERO -#define bzero(a,s) memset (a,0,s) -#endif -#ifndef HAVE_BCMP -#define BCMP memcmp -#endif - #endif /* EMACS_CONFIG_H */ /*