~ubuntu-branches/ubuntu/trusty/log4shib/trusty

« back to all changes in this revision

Viewing changes to m4/BB_CHECK_OMNITHREADS.m4

  • Committer: Package Import Robot
  • Author(s): Russ Allbery
  • Date: 2013-05-22 20:21:15 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130522202115-2qzanli9fue82x24
Tags: 1.0.5-1
* New upstream release.
* Switch to xz compression for *.debian.tar and the *.deb packages.
* Use canonical URLs for Vcs-Browser and Vcs-Git.
* Update standards version to 3.9.4 (no changes required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl@synposis BB_CHECK_OMNITHREADS.m4
2
 
dnl
3
 
AC_DEFUN([BB_CHECK_OMNITHREADS],[
4
 
AC_REQUIRE([AC_PROG_CC])dnl
5
 
AC_REQUIRE([AC_PROG_CXX])dnl
6
 
AC_REQUIRE([AC_PROG_CPP])dnl
7
 
AC_REQUIRE([AC_PROG_CXXCPP])dnl
8
 
 
9
 
 
10
 
AC_ARG_WITH(omnithreads, [  --with-omnithreads      include omnithreads support], [OMNIDIR=${with_omnithreads}], [OMNIDIR=no])
11
 
 
12
 
if test "x$OMNIDIR" = "xyes"; then
13
 
    OMNIDIR=/usr
14
 
fi
15
 
 
16
 
if test "x$OMNIDIR" = "x"; then
17
 
    OMNIDIR=no
18
 
fi
19
 
 
20
 
if test "x$OMNIDIR" != "xno"; then
21
 
    case $host_cpu in
22
 
        sparc*)
23
 
            OMNIDEFINES=-D__sparc__
24
 
            ;;
25
 
        i386)
26
 
            OMNIDEFINES=-D__x86__
27
 
            ;;
28
 
        i486)
29
 
            OMNIDEFINES=-D__x86__
30
 
            ;;
31
 
        i586)
32
 
            OMNIDEFINES=-D__x86__
33
 
            ;;
34
 
        i686)
35
 
            OMNIDEFINES=-D__x86__
36
 
            ;;
37
 
        *)
38
 
            AC_MSG_ERROR([unknown CPU: $host_cpu])
39
 
            ;;
40
 
    esac
41
 
 
42
 
    case $host_os in
43
 
        solaris*)
44
 
            OMNIDEFINES="$OMNIDEFINES -D__sunos__ -D__OSVERSION__=5"
45
 
            ;;
46
 
        linux*)
47
 
            OMNIDEFINES="$OMNIDEFINES -D__linux__ -D__OSVERSION__=2"
48
 
            ;;
49
 
        *)
50
 
            AC_MSG_ERROR([unknown OS: $host_os])
51
 
            ;;
52
 
    esac
53
 
 
54
 
    CPPFLAGS="$CPPFLAGS -D_PTHREADS -D_REENTRANT -D_THREAD_SAFE"
55
 
    CFLAGS="$CFLAGS $OMNIDEFINES -I$OMNIDIR/include"
56
 
    CXXFLAGS="$CXXCFLAGS $OMNIDEFINES -I$OMNIDIR/include"
57
 
    dnl AC_CHECK_HEADERS([omnithread.h])
58
 
 
59
 
    AC_LANG_PUSH(C++)
60
 
 
61
 
    LIBS="$LIBS -L$OMNIDIR/lib -lomnithread"
62
 
    AC_CACHE_CHECK([for omnithreads library],
63
 
    bb_cv_check_omnithreads,
64
 
    AC_TRY_LINK(
65
 
        #include <omnithread.h>
66
 
        ,omni_mutex my_mutex,
67
 
        bb_cv_check_omnithreads=yes,bb_cv_check_omnithreads=no)
68
 
    )
69
 
    if test "x$bb_cv_check_omnithreads" = "xno"; then
70
 
        AC_MSG_ERROR([omnithreads not found])
71
 
    fi
72
 
 
73
 
    AC_DEFINE(HAVE_THREADING,,[define if threading is enabled])
74
 
    AC_DEFINE(USE_OMNITHREADS,,[define if omnithread library is available])
75
 
 
76
 
    AC_LANG_POP(C++)
77
 
fi
78
 
])