~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to config/objc-con-autoload.m4

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
[dnl
16
16
AC_MSG_CHECKING(loading of constructor functions)
17
17
AC_CACHE_VAL(objc_cv_con_autoload,
18
 
[dnl 
19
 
cat > conftest.constructor.c <<EOF
20
 
void cons_functions() __attribute__ ((constructor));
21
 
void cons_functions() {}
22
 
int main()
23
 
{
24
 
  return 0;
25
 
}
26
 
EOF
27
 
${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.constructor.$ac_ext $LIBS 1>&5
28
 
if test -n "`nm conftest | grep _ctors_aux`"; then 
29
 
  objc_cv_con_autoload=yes
30
 
else
31
 
  objc_cv_con_autoload=no
32
 
fi
 
18
[dnl
 
19
AC_TRY_RUN([static int loaded = 0;
 
20
        void cons_functions() __attribute__ ((constructor));
 
21
        void cons_functions() { loaded = 1; }
 
22
        int main()
 
23
        {
 
24
          return ( (loaded == 1) ? 0 : 1);
 
25
        }],
 
26
        objc_cv_con_autoload=yes, objc_cv_con_autoload=no, 
 
27
        objc_cv_con_autoload=no)
 
28
case "$target_os" in
 
29
    cygwin*)    objc_cv_con_autoload=yes;;
 
30
esac
33
31
])
34
32
if test $objc_cv_con_autoload = yes; then
35
33
  AC_MSG_RESULT(yes)
36
 
  AC_DEFINE(CON_AUTOLOAD)
 
34
  AC_DEFINE(CON_AUTOLOAD,1,[Define if constructors are automatically loaded])
37
35
else
38
36
  AC_MSG_RESULT(no)
39
37
fi