~extension-hackers/globalmenu-extension/3.5

« back to all changes in this revision

Viewing changes to build/autoconf/mozheader.m4

  • Committer: Chris Coulson
  • Date: 2011-08-05 17:37:02 UTC
  • Revision ID: chrisccoulson@ubuntu.com-20110805173702-n11ykbt0tdp5u07q
Refresh build system from FIREFOX_6_0b5_BUILD1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl ***** BEGIN LICENSE BLOCK *****
 
2
dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
dnl
 
4
dnl The contents of this file are subject to the Mozilla Public License Version
 
5
dnl 1.1 (the "License"); you may not use this file except in compliance with
 
6
dnl the License. You may obtain a copy of the License at
 
7
dnl http://www.mozilla.org/MPL/
 
8
dnl
 
9
dnl Software distributed under the License is distributed on an "AS IS" basis,
 
10
dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
dnl for the specific language governing rights and limitations under the
 
12
dnl License.
 
13
dnl
 
14
dnl The Original Code is mozilla.org code.
 
15
dnl
 
16
dnl The Initial Developer of the Original Code is the
 
17
dnl Mozilla Foundation <http://www.mozilla.org>
 
18
dnl
 
19
dnl Portions created by the Initial Developer are Copyright (C) 2009
 
20
dnl the Initial Developer. All Rights Reserved.
 
21
dnl
 
22
dnl Contributor(s):
 
23
dnl   Neil Rashbrook <neil@parkwaycc.co.uk>
 
24
dnl
 
25
dnl Alternatively, the contents of this file may be used under the terms of
 
26
dnl either of the GNU General Public License Version 2 or later (the "GPL"),
 
27
dnl or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
28
dnl in which case the provisions of the GPL or the LGPL are applicable instead
 
29
dnl of those above. If you wish to allow use of your version of this file only
 
30
dnl under the terms of either the GPL or the LGPL, and not to allow others to
 
31
dnl use your version of this file under the terms of the MPL, indicate your
 
32
dnl decision by deleting the provisions above and replace them with the notice
 
33
dnl and other provisions required by the GPL or the LGPL. If you do not delete
 
34
dnl the provisions above, a recipient may use your version of this file under
 
35
dnl the terms of any one of the MPL, the GPL or the LGPL.
 
36
dnl
 
37
dnl ***** END LICENSE BLOCK *****
 
38
 
 
39
dnl MOZ_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
40
AC_DEFUN(MOZ_CHECK_HEADER,
 
41
[ dnl Do the transliteration at runtime so arg 1 can be a shell variable.
 
42
  ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
 
43
  AC_MSG_CHECKING([for $1])
 
44
  AC_CACHE_VAL(ac_cv_header_$ac_safe,
 
45
 [ AC_TRY_COMPILE([#include <$1>], ,
 
46
                  eval "ac_cv_header_$ac_safe=yes",
 
47
                  eval "ac_cv_header_$ac_safe=no") ])
 
48
  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 
49
    AC_MSG_RESULT(yes)
 
50
    ifelse([$2], , :, [$2])
 
51
  else
 
52
    AC_MSG_RESULT(no)
 
53
    ifelse([$3], , , [$3])
 
54
  fi
 
55
])
 
56
 
 
57
dnl MOZ_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
58
AC_DEFUN(MOZ_CHECK_HEADERS,
 
59
[ for ac_hdr in $1
 
60
  do
 
61
    MOZ_CHECK_HEADER($ac_hdr,
 
62
                     [ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
 
63
                       AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)
 
64
  done
 
65
])