Configure script tidying

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9259 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
jagapen 2001-03-01 11:03:39 +00:00
parent 3e1e8d43d7
commit 45e6948842
7 changed files with 734 additions and 564 deletions

View file

@ -33,9 +33,6 @@
/* Define if you have the register_printf_function function. */
#undef HAVE_REGISTER_PRINTF_FUNCTION
/* Define if your kernel supports the /proc filesystem */
#undef HAVE_PROC_FS
/* Define if your Obj-C compiler calls +load methods before main */
#undef HAVE_LOAD_METHOD
@ -45,9 +42,6 @@
/* Define if your Lib C defines program_invocation_name */
#undef HAVE_PROGRAM_INVOCATION_NAME
/* Define if your system has a /proc/self/exe symlink to the executable */
#undef HAVE_PROC_FS_EXE_LINK
/* Define if using the libffi library for invocations */
#undef USE_LIBFFI
@ -278,3 +272,10 @@
/* Define if you have the iconv library (-liconv). */
#undef HAVE_LIBICONV
/* Define if system supports the /proc filesystem */
#undef HAVE_PROCFS
/* Define as the link to exe of process in /proc filesystem. */
#undef PROCFS_EXE_LINK

View file

@ -541,9 +541,10 @@ _bundle_load_callback(Class theClass, Category *theCategory)
[system appendString: @"/Libraries"];
_executable_path = nil;
#ifdef HAVE_PROC_FS_EXE_LINK
#ifdef PROCFS_EXE_LINK
_executable_path = [[NSFileManager defaultManager]
pathContentOfSymbolicLinkAtPath: @"/proc/self/exe"];
pathContentOfSymbolicLinkAtPath:
[NSString stringWithCString: PROCFS_EXE_LINK]];
#endif
if (_executable_path == nil || [_executable_path length] == 0)
{
@ -714,7 +715,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
return AUTORELEASE([[NSBundle alloc] initWithPath: path]);
}
- initWithPath:(NSString *)path;
- (id) initWithPath:(NSString *)path;
{
[super init];
@ -989,7 +990,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
NSEnumerator* enumerate;
array = [NSMutableArray arrayWithCapacity: 8];
languages = [NSUserDefaults userLanguages];
languages = [[NSUserDefaults standardUserDefaults] stringArrayForKey: @"NSLanguages"];
primary = [rootPath stringByAppendingPathComponent: @"Resources"];
[array addObject: _bundle_resource_path(primary, bundlePath, nil)];

View file

@ -242,7 +242,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
[arp release];
}
#if !GS_FAKE_MAIN && (defined(HAVE_PROC_FS) && defined(HAVE_LOAD_METHOD))
#if !GS_FAKE_MAIN && (defined(HAVE_PROCFS) && defined(HAVE_LOAD_METHOD))
/*
* We have to save program arguments and environment before main () is
* executed, because main () could modify their values before we get a
@ -478,7 +478,7 @@ _gnu_noobjc_free_vars(void)
_gnu_noobjc_free_vars();
}
}
#else /* !HAVE_PROC_FS || !HAVE_LOAD_METHOD */
#else /* !HAVE_PROCFS || !HAVE_LOAD_METHOD */
#ifdef __MINGW__
/* For WindowsAPI Library, we know the global variables (argc, etc) */
@ -516,7 +516,7 @@ int main(int argc, char *argv[], char *env[])
#endif /* !GS_PASS_ARGUMENTS */
#endif /* __MINGW__ */
#endif /* HAS_LOAD_METHOD && HAS_PROC_FS */
#endif /* HAS_LOAD_METHOD && HAS_PROCFS */
/* Fallback method. User must call this method if none of the other
above hacks is being used

View file

@ -124,9 +124,6 @@
/* Define if you have the <values.h> header file. */
#undef HAVE_VALUES_H
/* Define if your kernel supports the /proc filesystem */
#undef HAVE_PROC_FS
/* Define if your Obj-C compiler calls +load methods before main */
#undef HAVE_LOAD_METHOD
@ -136,9 +133,6 @@
/* Define if your Lib C defines program_invocation_name */
#undef HAVE_PROGRAM_INVOCATION_NAME
/* Define if your system has a /proc/self/exe symlink to the executable */
#undef HAVE_PROC_FS_EXE_LINK
/* Define if using the libffi library for invocations */
#undef USE_LIBFFI

226
aclocal.m4 vendored
View file

@ -1,66 +1,14 @@
# aclocal.m4 - configure macros for libobjects and projects that depend on it.
#
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
#
# Written by: Adam Fedor <fedor@boulder.colorado.edu>
#
# This file is part of the GNU Objective-C library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN(OBJC_CON_AUTOLOAD,
#--------------------------------------------------------------------
# Guess if we are using a object file format that supports automatic
# loading of constructor functions.
#
# If this system supports autoloading of constructors, that means that gcc
# doesn't have to do it for us via collect2. This routine tests for this
# in a very roundabout way by compiling a program with a constructor and
# testing the file, via nm, for certain symbols that collect2 includes to
# handle loading of constructors.
#
# Makes the following substitutions:
# Defines CON_AUTOLOAD (whether constructor functions are autoloaded)
#--------------------------------------------------------------------
[dnl
AC_MSG_CHECKING(loading of constructor functions)
AC_CACHE_VAL(objc_cv_con_autoload,
[dnl
cat > conftest.constructor.c <<EOF
void cons_functions() __attribute__ ((constructor));
void cons_functions() {}
int main()
{
return 0;
}
EOF
${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.constructor.$ac_ext $LIBS 1>&5
if test -n "`nm conftest | grep _ctors_aux`"; then
objc_cv_con_autoload=yes
else
objc_cv_con_autoload=no
fi
])
if test $objc_cv_con_autoload = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(CON_AUTOLOAD)
else
AC_MSG_RESULT(no)
fi
])
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
AC_DEFUN(OBJC_SYS_DYNAMIC_LINKER,
[dnl
@ -91,7 +39,6 @@ fi
AC_SUBST(DYNAMIC_LINKER)dnl
])
AC_DEFUN(OBJC_SYS_DYNAMIC_FLAGS,
[dnl
AC_REQUIRE([OBJC_CON_AUTOLOAD])dnl
@ -149,9 +96,157 @@ AC_SUBST(DYNAMIC_LDFLAGS)dnl
AC_SUBST(DYNAMIC_CFLAGS)dnl
])
#-----------------------------------------------------------------------------
# Check for libxml; macro taken from libxml 2.2.10 installation
#-----------------------------------------------------------------------------
AC_DEFUN(OBJC_CON_AUTOLOAD,
#--------------------------------------------------------------------
# Guess if we are using a object file format that supports automatic
# loading of constructor functions.
#
# If this system supports autoloading of constructors, that means that gcc
# doesn't have to do it for us via collect2. This routine tests for this
# in a very roundabout way by compiling a program with a constructor and
# testing the file, via nm, for certain symbols that collect2 includes to
# handle loading of constructors.
#
# Makes the following substitutions:
# Defines CON_AUTOLOAD (whether constructor functions are autoloaded)
#--------------------------------------------------------------------
[dnl
AC_MSG_CHECKING(loading of constructor functions)
AC_CACHE_VAL(objc_cv_con_autoload,
[dnl
cat > conftest.constructor.c <<EOF
void cons_functions() __attribute__ ((constructor));
void cons_functions() {}
int main()
{
return 0;
}
EOF
${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.constructor.$ac_ext $LIBS 1>&5
if test -n "`nm conftest | grep _ctors_aux`"; then
objc_cv_con_autoload=yes
else
objc_cv_con_autoload=no
fi
])
if test $objc_cv_con_autoload = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(CON_AUTOLOAD)
else
AC_MSG_RESULT(no)
fi
])
dnl AC_PROG_OBJCC
dnl Macro checks for Objective C compiler.
AC_DEFUN(AC_PROG_OBJCC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_CHECK_PROGS(OBJCC, gcc objc objcc)
if test -z "$OBJCC"; then
AC_CHECK_PROG(OBJCC, cc, cc, , , /usr/ucb/cc)
test -z "$OBJCC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi
AC_PROG_OBJCC_WORKS
])
AC_DEFUN(AC_PROG_OBJCC_WORKS,
[AC_MSG_CHECKING([whether the Objective C compiler ($OBJCC $CFLAGS $LDFLAGS) works])
AC_LANG_SAVE
AC_LANG_OBJC
AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_objcc_works, ac_cv_prog_objcc_cross)
AC_LANG_RESTORE
AC_MSG_RESULT($ac_cv_prog_objcc_works)
if test $ac_cv_prog_objcc_works = no; then
AC_MSG_ERROR([installation or configuration problem: Objective C compiler cannot create executables.])
fi
AC_MSG_CHECKING([whether the Objective C compiler ($OBJCC $CFLAGS $LDFLAGS) is a cross-compiler])
AC_MSG_RESULT($ac_cv_prog_objcc_cross)
cross_compiling=$ac_cv_prog_objcc_cross
])
dnl AC_LANG_OBJC()
AC_DEFUN(AC_LANG_OBJC,
[define([AC_LANG], [OBJC])dnl
ac_ext=m
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${OBJCC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC'
ac_link='${OBJCC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
cross_compiling=$ac_cv_prog_cc_cross
])
dnl AC_PROG_NEXTCC
dnl Check for NeXT compiler.
AC_DEFUN(AC_PROG_NEXTCC,
[ AC_CACHE_CHECK(whether we are using the NeXT compiler, ac_prog_nextcc,
[AC_EGREP_CPP(yes,
[#if defined(NeXT)
#if defined(_NEXT_SOURCE)
no
#else
yes
#endif
#else
no
#endif], ac_prog_nextcc=yes, ac_prog_nextcc=no)])
if test "$ac_prog_nextcc" = yes; then
NeXTCC=yes
fi
])
dnl AC_SYS_PROCFS
dnl This macro defines HAVE_PROCFS if either it finds a mounted /proc
dnl or the user explicitly enables it for cross-compiles.
AC_DEFUN(AC_SYS_PROCFS,
[ AC_ARG_WITH(enable_procfs,
[ --enable-procfs Use /proc filesystem (default)],
enable_procfs="$enableval", if test "$cross_compiling" = yes; then enable_procfs=cross; else enable_procfs=yes; fi;)
AC_CACHE_CHECK([kernel support for /proc filesystem], ac_cv_sys_procfs,
[if test "$enable_procfs" = yes; then
if test -d /proc/0; then
ac_cv_sys_procfs=yes
else
ac_cv_sys_procfs=no
fi
elif test "$enable_procfs" = cross; then
AC_MSG_WARN(Pass --enable-procfs argument to enable use of /proc filesystem.)
fi])
if test $ac_cv_sys_procfs = yes; then
AC_DEFINE(HAVE_PROCFS, 1, [Define if system supports the /proc filesystem])
fi
]
)
dnl AC_SYS_PROCFS_EXE_LINK
dnl This macro checks for the existence of a symlink in /proc to the executable
dnl file associated with the current process, and defines PROCFS_EXE_LINK to
dnl the path it finds. Currently supports Linux and FreeBSD variants.
AC_DEFUN(AC_SYS_PROCFS_EXE_LINK,
[ AC_REQUIRE([AC_SYS_PROCFS])
AC_CACHE_CHECK([link to exe of process in /proc], ac_cv_sys_procfs_exe_link,
[if test "$ac_cv_sys_procfs" = yes; then
# Linux 2.2.x and up
if test -L /proc/self/exe; then
ac_cv_sys_procfs_exe_link=/proc/self/exe
# FreeBSD 4.x and up
elif test -L /proc/curproc/file; then
ac_cv_sys_procfs_exe_link=/proc/curproc/file
else
ac_cv_sys_procfs_exe_link=no
fi
fi])
if test "$ac_cv_sys_procfs_exe_link" != no; then
AC_DEFINE_UNQUOTED(PROCFS_EXE_LINK, ["$ac_cv_sys_procfs_exe_link"],
[Define as the link to exe of process in /proc filesystem.])
fi
])
dnl Code shamelessly stolen from glib-config by Sebastian Rittau
dnl AM_PATH_XML([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
AC_DEFUN(AM_PATH_XML,[
@ -300,3 +395,4 @@ main()
AC_SUBST(XML_LIBS)
rm -f conf.xmltest
])

988
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -42,12 +42,6 @@ AC_PROG_CPP
AC_PATH_PROG(WHOAMI, whoami, echo, $PATH:/usr/ucb)
#--------------------------------------------------------------------
# -pipe option for compiler
#--------------------------------------------------------------------
PIPE='-pipe'
AC_SUBST(PIPE)
#--------------------------------------------------------------------
# specific target_os options
#--------------------------------------------------------------------
@ -63,11 +57,8 @@ esac
# if no:
# include implementations of List, HashTable etc.
#--------------------------------------------------------------------
AC_MSG_CHECKING(whether we are using NeXT's compiler)
AC_TRY_CPP([#include "$srcdir/config/config.nextcc.h"], NeXTCC=0, NeXTCC=1)
# Was using this too: -o `basename $CC` = "gcc" -o `basename $CC` = "xgcc"
if test $NeXTCC = 0; then
AC_MSG_RESULT(no)
AC_PROG_NEXTCC
if test "$NeXTCC" != yes; then
#----------------------------------------------------------------
# Find out if nested functions work on this machine
#----------------------------------------------------------------
@ -145,7 +136,6 @@ if test $NeXTCC = 0; then
else
AC_MSG_RESULT(yes)
AC_MSG_ERROR(Sorry, $(LIBRARY_NAME) does not currently work with NeXT's cc; use gcc)
#----------------------------------------------------------------
# Find out if we have NEXTSTEP 3.2 or lower
@ -657,36 +647,11 @@ else
fi
#--------------------------------------------------------------------
# Defines HAVE_PROC_FS if the kernel supports the /proc filesystem.
# Defines HAVE_PROCFS if the kernel supports the /proc filesystem.
# Needed by NSProcessInfo.m
#--------------------------------------------------------------------
AC_MSG_CHECKING(kernel support for /proc filesystem)
if (grep proc /etc/fstab >/dev/null 2>/dev/null); then
sys_proc_fs=yes;
AC_DEFINE(HAVE_PROC_FS)
AC_MSG_RESULT(yes)
# Solaris has proc, but for some reason the dir is not readable
#elif (grep proc /etc/vfstab >/dev/null 2>/dev/null); then
# sys_proc_fs=yes;
# AC_DEFINE(HAVE_PROC_FS)
# AC_MSG_RESULT(yes)
else
sys_proc_fs=no;
AC_MSG_RESULT(no)
fi
# Linux (and others?) /proc contains a symlink to the executable
# file from which the process loaded its code. This can be used
# by NSBundle.m to locate the main bundle.
sys_proc_fs_exe=no;
if test $sys_proc_fs = yes; then
AC_MSG_CHECKING(link to executable in /proc)
if test -L /proc/self/exe; then
sys_proc_fs_exe=yes;
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
AC_SYS_PROCFS
AC_SYS_PROCFS_EXE_LINK
#--------------------------------------------------------------------
# Check if short and int values need to be word aligned
@ -743,15 +708,12 @@ GS_FAKE_MAIN=0
if test "$enable_fake_main" = "yes"; then
GS_FAKE_MAIN=1
elif test "$enable_pass_arguments" = "no"; then
if test $objc_load_method_worked = yes -a $sys_proc_fs = yes; then
if test "$objc_load_method_worked" = yes -a "$ac_sys_procfs" = yes; then
GS_FAKE_MAIN=0
else
GS_FAKE_MAIN=1
enable_fake_main=yes
fi
if test $sys_proc_fs_exe = yes; then
AC_DEFINE(HAVE_PROC_FS_EXE_LINK)
fi
fi
case "$target_os" in
mingw*) enable_fake_main=no; GS_FAKE_MAIN=0;;