mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 01:21:08 +00:00
Split autoconf macros out of aclocal.m4
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9470 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
af46212b24
commit
ffa79f407d
6 changed files with 204 additions and 0 deletions
40
config/objc-con-autoload.m4
Normal file
40
config/objc-con-autoload.m4
Normal file
|
@ -0,0 +1,40 @@
|
|||
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
|
||||
])
|
Loading…
Add table
Add a link
Reference in a new issue