aboutsummaryrefslogtreecommitdiffstats
path: root/macros/gnome-objc-checks.m4
diff options
context:
space:
mode:
authorJames Henstridge <jamesh@src.gnome.org>2001-12-05 12:54:00 +0800
committerJames Henstridge <jamesh@src.gnome.org>2001-12-05 12:54:00 +0800
commit64262ad7f2c7f72a3dffc5aa39372dbb41bdd451 (patch)
tree8e4c0b994170318d2cd7917d15826f07e92cabd6 /macros/gnome-objc-checks.m4
parentdbfa5bf980f3032503c71c6b1d88239c7c501eb9 (diff)
downloadgsoc2013-evolution-64262ad7f2c7f72a3dffc5aa39372dbb41bdd451.tar
gsoc2013-evolution-64262ad7f2c7f72a3dffc5aa39372dbb41bdd451.tar.gz
gsoc2013-evolution-64262ad7f2c7f72a3dffc5aa39372dbb41bdd451.tar.bz2
gsoc2013-evolution-64262ad7f2c7f72a3dffc5aa39372dbb41bdd451.tar.lz
gsoc2013-evolution-64262ad7f2c7f72a3dffc5aa39372dbb41bdd451.tar.xz
gsoc2013-evolution-64262ad7f2c7f72a3dffc5aa39372dbb41bdd451.tar.zst
gsoc2013-evolution-64262ad7f2c7f72a3dffc5aa39372dbb41bdd451.zip
back again !!!
svn path=/trunk/; revision=14875
Diffstat (limited to 'macros/gnome-objc-checks.m4')
-rw-r--r--macros/gnome-objc-checks.m483
1 files changed, 83 insertions, 0 deletions
diff --git a/macros/gnome-objc-checks.m4 b/macros/gnome-objc-checks.m4
new file mode 100644
index 0000000000..c69acb077e
--- /dev/null
+++ b/macros/gnome-objc-checks.m4
@@ -0,0 +1,83 @@
+AC_DEFUN([GNOME_CHECK_OBJC],
+[
+dnl Look for an ObjC compiler.
+dnl FIXME: extend list of possible names of ObjC compilers.
+ AC_CHECK_PROGS(OBJC, $OBJC egcs, "")
+ if test "x$OBJC" = "x" ; then
+ AC_CHECK_PROGS(OBJC, $OBJC egcc, "")
+ if test "x$OBJC" = "x" ; then
+ AC_CHECK_PROGS(OBJC, $OBJC gcc, "")
+ fi
+ fi
+
+ AC_REQUIRE([GNOME_PTHREAD_CHECK])
+
+ OBJC_LIBS="-lobjc $PTHREAD_LIB"
+ AC_CHECK_FUNC(sched_yield,,[
+ AC_CHECK_LIB(rt,sched_yield,
+ OBJC_LIBS="$OBJC_LIBS -lrt",[
+ AC_CHECK_LIB(posix4,sched_yield,
+ OBJC_LIBS="$OBJC_LIBS -lposix4",,
+ $OBJC_LIBS)],
+ $OBJC_LIBS)])
+ AC_SUBST(OBJC_LIBS)
+
+ AC_CACHE_CHECK([if Objective C compiler ($OBJC) works],
+ ac_cv_prog_objc_works, [
+ if test -n "$OBJC"; then
+ cat > conftest.m <<EOF
+#include <objc/Object.h>
+@interface myRandomObj : Object
+{
+}
+@end
+@implementation myRandomObj
+@end
+int main () {
+ /* No, you are not seeing double. Remember that square brackets
+ are the autoconf m4 quotes. */
+ id myid = [[myRandomObj alloc]];
+ [[myid free]];
+ return 0;
+}
+EOF
+
+ $OBJC $CFLAGS -o conftest $LDFLAGS conftest.m $OBJC_LIBS 1>&AC_FD_CC 2>&1
+ result=$?
+ rm -f conftest*
+
+ if test $result -eq 0; then
+ ac_cv_prog_objc_works=yes
+ fi
+ else
+ ac_cv_prog_objc_works=no
+ fi
+ ])
+
+ AM_CONDITIONAL(OBJECTIVE_C, test x$ac_cv_prog_objc_works = xyes)
+ dnl Also set the shell variable OBJECTIVE_C to "yes" or "no".
+ OBJECTIVE_C=$ac_cv_prog_objc_works
+])
+
+AC_DEFUN([GNOME_INIT_OBJC],
+[
+ AC_MSG_CHECKING(for an obGnomeConf.sh)
+ my_gnome_libdir=`$GNOME_CONFIG --libdir`
+ if test -f $my_gnome_libdir/obGnomeConf.sh; then
+ . $my_gnome_libdir/obGnomeConf.sh
+ AC_MSG_RESULT(found $my_gnome_libdir)
+ ac_cv_have_gnome_objc=yes
+ else
+ AC_MSG_RESULT(not found)
+ AC_MSG_WARN(Could not find the obGnomeConf.sh file that is generated by gnome-objc install)
+ ac_cv_have_gnome_objc=no
+ fi
+
+ dnl Add a conditional on whether or not we have gnome-objc
+ AM_CONDITIONAL(HAVE_GNOME_OBJC, test x$ac_cv_have_gnome_objc = xyes)
+ HAVE_GNOME_OBJC=$ac_cv_have_gnome_objc
+
+ AC_SUBST(OBGNOME_INCLUDEDIR)
+ AC_SUBST(OBGNOME_LIBS)
+ AC_SUBST(OBGTK_LIBS)
+])