Commit 7990bfda 7990bfda27d86d0433ff0ef6e348b1df89cd168e by Sergey Poznyakoff

Add

1 parent bd891ede
1 # codeset.m4 serial AM1 (gettext-0.10.40)
2 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Bruno Haible.
8
9 AC_DEFUN([AM_LANGINFO_CODESET],
10 [
11 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
12 [AC_TRY_LINK([#include <langinfo.h>],
13 [char* cs = nl_langinfo(CODESET);],
14 am_cv_langinfo_codeset=yes,
15 am_cv_langinfo_codeset=no)
16 ])
17 if test $am_cv_langinfo_codeset = yes; then
18 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
19 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
20 fi
21 ])
1 # glibc2.m4 serial 1
2 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 # Test for the GNU C Library, version 2.0 or newer.
8 # From Bruno Haible.
9
10 AC_DEFUN([gt_GLIBC2],
11 [
12 AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
13 ac_cv_gnu_library_2,
14 [AC_EGREP_CPP([Lucky GNU user],
15 [
16 #include <features.h>
17 #ifdef __GNU_LIBRARY__
18 #if (__GLIBC__ >= 2)
19 Lucky GNU user
20 #endif
21 #endif
22 ],
23 ac_cv_gnu_library_2=yes,
24 ac_cv_gnu_library_2=no)
25 ]
26 )
27 AC_SUBST(GLIBC2)
28 GLIBC2="$ac_cv_gnu_library_2"
29 ]
30 )
1 # glibc21.m4 serial 3
2 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 # Test for the GNU C Library, version 2.1 or newer.
8 # From Bruno Haible.
9
10 AC_DEFUN([gl_GLIBC21],
11 [
12 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
13 ac_cv_gnu_library_2_1,
14 [AC_EGREP_CPP([Lucky GNU user],
15 [
16 #include <features.h>
17 #ifdef __GNU_LIBRARY__
18 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
19 Lucky GNU user
20 #endif
21 #endif
22 ],
23 ac_cv_gnu_library_2_1=yes,
24 ac_cv_gnu_library_2_1=no)
25 ]
26 )
27 AC_SUBST(GLIBC21)
28 GLIBC21="$ac_cv_gnu_library_2_1"
29 ]
30 )
1 # intdiv0.m4 serial 1 (gettext-0.11.3)
2 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Bruno Haible.
8
9 AC_DEFUN([gt_INTDIV0],
10 [
11 AC_REQUIRE([AC_PROG_CC])dnl
12 AC_REQUIRE([AC_CANONICAL_HOST])dnl
13
14 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
15 gt_cv_int_divbyzero_sigfpe,
16 [
17 AC_TRY_RUN([
18 #include <stdlib.h>
19 #include <signal.h>
20
21 static void
22 #ifdef __cplusplus
23 sigfpe_handler (int sig)
24 #else
25 sigfpe_handler (sig) int sig;
26 #endif
27 {
28 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
29 exit (sig != SIGFPE);
30 }
31
32 int x = 1;
33 int y = 0;
34 int z;
35 int nan;
36
37 int main ()
38 {
39 signal (SIGFPE, sigfpe_handler);
40 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
41 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
42 signal (SIGTRAP, sigfpe_handler);
43 #endif
44 /* Linux/SPARC yields signal SIGILL. */
45 #if defined (__sparc__) && defined (__linux__)
46 signal (SIGILL, sigfpe_handler);
47 #endif
48
49 z = x / y;
50 nan = y / y;
51 exit (1);
52 }
53 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
54 [
55 # Guess based on the CPU.
56 case "$host_cpu" in
57 alpha* | i[34567]86 | m68k | s390*)
58 gt_cv_int_divbyzero_sigfpe="guessing yes";;
59 *)
60 gt_cv_int_divbyzero_sigfpe="guessing no";;
61 esac
62 ])
63 ])
64 case "$gt_cv_int_divbyzero_sigfpe" in
65 *yes) value=1;;
66 *) value=0;;
67 esac
68 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
69 [Define if integer division by zero raises signal SIGFPE.])
70 ])
1 # inttypes-h.m4 serial 1 (gettext-0.15)
2 dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Paul Eggert.
8
9 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
10 # <sys/types.h>.
11
12 AC_DEFUN([gl_HEADER_INTTYPES_H],
13 [
14 AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
15 [
16 AC_TRY_COMPILE(
17 [#include <sys/types.h>
18 #include <inttypes.h>],
19 [], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)
20 ])
21 if test $gl_cv_header_inttypes_h = yes; then
22 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
23 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
24 fi
25 ])
1 # inttypes-pri.m4 serial 2 (gettext-0.15)
2 dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Bruno Haible.
8
9 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
10 # macros to non-string values. This is the case on AIX 4.3.3.
11
12 AC_DEFUN([gt_INTTYPES_PRI],
13 [
14 AC_REQUIRE([gl_HEADER_INTTYPES_H])
15 if test $gl_cv_header_inttypes_h = yes; then
16 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
17 gt_cv_inttypes_pri_broken,
18 [
19 AC_TRY_COMPILE([#include <inttypes.h>
20 #ifdef PRId32
21 char *p = PRId32;
22 #endif
23 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
24 ])
25 fi
26 if test "$gt_cv_inttypes_pri_broken" = yes; then
27 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
28 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
29 fi
30 ])
1 # inttypes_h.m4 serial 6
2 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Paul Eggert.
8
9 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
10 # doesn't clash with <sys/types.h>, and declares uintmax_t.
11
12 AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
13 [
14 AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
15 [AC_TRY_COMPILE(
16 [#include <sys/types.h>
17 #include <inttypes.h>],
18 [uintmax_t i = (uintmax_t) -1;],
19 gl_cv_header_inttypes_h=yes,
20 gl_cv_header_inttypes_h=no)])
21 if test $gl_cv_header_inttypes_h = yes; then
22 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
23 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
24 and declares uintmax_t. ])
25 fi
26 ])
1 # isc-posix.m4 serial 2 (gettext-0.11.2)
2 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License. As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
8
9 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
10
11 # This test replaces the one in autoconf.
12 # Currently this macro should have the same name as the autoconf macro
13 # because gettext's gettext.m4 (distributed in the automake package)
14 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
15 # give these diagnostics:
16 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
17 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
18
19 undefine([AC_ISC_POSIX])
20
21 AC_DEFUN([AC_ISC_POSIX],
22 [
23 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
24 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
25 ]
26 )
1 # lcmessage.m4 serial 4 (gettext-0.14.2)
2 dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6 dnl
7 dnl This file can can be used in projects which are not available under
8 dnl the GNU General Public License or the GNU Library General Public
9 dnl License but which still want to provide support for the GNU gettext
10 dnl functionality.
11 dnl Please note that the actual code of the GNU gettext library is covered
12 dnl by the GNU Library General Public License, and the rest of the GNU
13 dnl gettext package package is covered by the GNU General Public License.
14 dnl They are *not* in the public domain.
15
16 dnl Authors:
17 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
18
19 # Check whether LC_MESSAGES is available in <locale.h>.
20
21 AC_DEFUN([gt_LC_MESSAGES],
22 [
23 AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
24 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
25 gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
26 if test $gt_cv_val_LC_MESSAGES = yes; then
27 AC_DEFINE(HAVE_LC_MESSAGES, 1,
28 [Define if your <locale.h> file defines LC_MESSAGES.])
29 fi
30 ])
1 # lib-ld.m4 serial 3 (gettext-0.13)
2 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl Subroutines of libtool.m4,
8 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
9 dnl with libtool.m4.
10
11 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
12 AC_DEFUN([AC_LIB_PROG_LD_GNU],
13 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
14 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
15 case `$LD -v 2>&1 </dev/null` in
16 *GNU* | *'with BFD'*)
17 acl_cv_prog_gnu_ld=yes ;;
18 *)
19 acl_cv_prog_gnu_ld=no ;;
20 esac])
21 with_gnu_ld=$acl_cv_prog_gnu_ld
22 ])
23
24 dnl From libtool-1.4. Sets the variable LD.
25 AC_DEFUN([AC_LIB_PROG_LD],
26 [AC_ARG_WITH(gnu-ld,
27 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
28 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
29 AC_REQUIRE([AC_PROG_CC])dnl
30 AC_REQUIRE([AC_CANONICAL_HOST])dnl
31 # Prepare PATH_SEPARATOR.
32 # The user is always right.
33 if test "${PATH_SEPARATOR+set}" != set; then
34 echo "#! /bin/sh" >conf$$.sh
35 echo "exit 0" >>conf$$.sh
36 chmod +x conf$$.sh
37 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
38 PATH_SEPARATOR=';'
39 else
40 PATH_SEPARATOR=:
41 fi
42 rm -f conf$$.sh
43 fi
44 ac_prog=ld
45 if test "$GCC" = yes; then
46 # Check if gcc -print-prog-name=ld gives a path.
47 AC_MSG_CHECKING([for ld used by GCC])
48 case $host in
49 *-*-mingw*)
50 # gcc leaves a trailing carriage return which upsets mingw
51 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
52 *)
53 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
54 esac
55 case $ac_prog in
56 # Accept absolute paths.
57 [[\\/]* | [A-Za-z]:[\\/]*)]
58 [re_direlt='/[^/][^/]*/\.\./']
59 # Canonicalize the path of ld
60 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
61 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
62 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
63 done
64 test -z "$LD" && LD="$ac_prog"
65 ;;
66 "")
67 # If it fails, then pretend we aren't using GCC.
68 ac_prog=ld
69 ;;
70 *)
71 # If it is relative, then search for the first ld in PATH.
72 with_gnu_ld=unknown
73 ;;
74 esac
75 elif test "$with_gnu_ld" = yes; then
76 AC_MSG_CHECKING([for GNU ld])
77 else
78 AC_MSG_CHECKING([for non-GNU ld])
79 fi
80 AC_CACHE_VAL(acl_cv_path_LD,
81 [if test -z "$LD"; then
82 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
83 for ac_dir in $PATH; do
84 test -z "$ac_dir" && ac_dir=.
85 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
86 acl_cv_path_LD="$ac_dir/$ac_prog"
87 # Check to see if the program is GNU ld. I'd rather use --version,
88 # but apparently some GNU ld's only accept -v.
89 # Break only if it was the GNU/non-GNU ld that we prefer.
90 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
91 *GNU* | *'with BFD'*)
92 test "$with_gnu_ld" != no && break ;;
93 *)
94 test "$with_gnu_ld" != yes && break ;;
95 esac
96 fi
97 done
98 IFS="$ac_save_ifs"
99 else
100 acl_cv_path_LD="$LD" # Let the user override the test with a path.
101 fi])
102 LD="$acl_cv_path_LD"
103 if test -n "$LD"; then
104 AC_MSG_RESULT($LD)
105 else
106 AC_MSG_RESULT(no)
107 fi
108 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
109 AC_LIB_PROG_LD_GNU
110 ])
1 # lib-prefix.m4 serial 5 (gettext-0.15)
2 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Bruno Haible.
8
9 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
10 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
11 dnl require excessive bracketing.
12 ifdef([AC_HELP_STRING],
13 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
14 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
15
16 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
17 dnl to access previously installed libraries. The basic assumption is that
18 dnl a user will want packages to use other packages he previously installed
19 dnl with the same --prefix option.
20 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
21 dnl libraries, but is otherwise very convenient.
22 AC_DEFUN([AC_LIB_PREFIX],
23 [
24 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
25 AC_REQUIRE([AC_PROG_CC])
26 AC_REQUIRE([AC_CANONICAL_HOST])
27 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
28 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
29 dnl By default, look in $includedir and $libdir.
30 use_additional=yes
31 AC_LIB_WITH_FINAL_PREFIX([
32 eval additional_includedir=\"$includedir\"
33 eval additional_libdir=\"$libdir\"
34 ])
35 AC_LIB_ARG_WITH([lib-prefix],
36 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
37 --without-lib-prefix don't search for libraries in includedir and libdir],
38 [
39 if test "X$withval" = "Xno"; then
40 use_additional=no
41 else
42 if test "X$withval" = "X"; then
43 AC_LIB_WITH_FINAL_PREFIX([
44 eval additional_includedir=\"$includedir\"
45 eval additional_libdir=\"$libdir\"
46 ])
47 else
48 additional_includedir="$withval/include"
49 additional_libdir="$withval/$acl_libdirstem"
50 fi
51 fi
52 ])
53 if test $use_additional = yes; then
54 dnl Potentially add $additional_includedir to $CPPFLAGS.
55 dnl But don't add it
56 dnl 1. if it's the standard /usr/include,
57 dnl 2. if it's already present in $CPPFLAGS,
58 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
59 dnl 4. if it doesn't exist as a directory.
60 if test "X$additional_includedir" != "X/usr/include"; then
61 haveit=
62 for x in $CPPFLAGS; do
63 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
64 if test "X$x" = "X-I$additional_includedir"; then
65 haveit=yes
66 break
67 fi
68 done
69 if test -z "$haveit"; then
70 if test "X$additional_includedir" = "X/usr/local/include"; then
71 if test -n "$GCC"; then
72 case $host_os in
73 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
74 esac
75 fi
76 fi
77 if test -z "$haveit"; then
78 if test -d "$additional_includedir"; then
79 dnl Really add $additional_includedir to $CPPFLAGS.
80 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
81 fi
82 fi
83 fi
84 fi
85 dnl Potentially add $additional_libdir to $LDFLAGS.
86 dnl But don't add it
87 dnl 1. if it's the standard /usr/lib,
88 dnl 2. if it's already present in $LDFLAGS,
89 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
90 dnl 4. if it doesn't exist as a directory.
91 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
92 haveit=
93 for x in $LDFLAGS; do
94 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
95 if test "X$x" = "X-L$additional_libdir"; then
96 haveit=yes
97 break
98 fi
99 done
100 if test -z "$haveit"; then
101 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
102 if test -n "$GCC"; then
103 case $host_os in
104 linux*) haveit=yes;;
105 esac
106 fi
107 fi
108 if test -z "$haveit"; then
109 if test -d "$additional_libdir"; then
110 dnl Really add $additional_libdir to $LDFLAGS.
111 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
112 fi
113 fi
114 fi
115 fi
116 fi
117 ])
118
119 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
120 dnl acl_final_exec_prefix, containing the values to which $prefix and
121 dnl $exec_prefix will expand at the end of the configure script.
122 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
123 [
124 dnl Unfortunately, prefix and exec_prefix get only finally determined
125 dnl at the end of configure.
126 if test "X$prefix" = "XNONE"; then
127 acl_final_prefix="$ac_default_prefix"
128 else
129 acl_final_prefix="$prefix"
130 fi
131 if test "X$exec_prefix" = "XNONE"; then
132 acl_final_exec_prefix='${prefix}'
133 else
134 acl_final_exec_prefix="$exec_prefix"
135 fi
136 acl_save_prefix="$prefix"
137 prefix="$acl_final_prefix"
138 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
139 prefix="$acl_save_prefix"
140 ])
141
142 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
143 dnl variables prefix and exec_prefix bound to the values they will have
144 dnl at the end of the configure script.
145 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
146 [
147 acl_save_prefix="$prefix"
148 prefix="$acl_final_prefix"
149 acl_save_exec_prefix="$exec_prefix"
150 exec_prefix="$acl_final_exec_prefix"
151 $1
152 exec_prefix="$acl_save_exec_prefix"
153 prefix="$acl_save_prefix"
154 ])
155
156 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
157 dnl the basename of the libdir, either "lib" or "lib64".
158 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
159 [
160 dnl There is no formal standard regarding lib and lib64. The current
161 dnl practice is that on a system supporting 32-bit and 64-bit instruction
162 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
163 dnl libraries go under $prefix/lib. We determine the compiler's default
164 dnl mode by looking at the compiler's library search path. If at least
165 dnl of its elements ends in /lib64 or points to a directory whose absolute
166 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
167 dnl default, namely "lib".
168 acl_libdirstem=lib
169 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
170 if test -n "$searchpath"; then
171 acl_save_IFS="${IFS= }"; IFS=":"
172 for searchdir in $searchpath; do
173 if test -d "$searchdir"; then
174 case "$searchdir" in
175 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
176 *) searchdir=`cd "$searchdir" && pwd`
177 case "$searchdir" in
178 */lib64 ) acl_libdirstem=lib64 ;;
179 esac ;;
180 esac
181 fi
182 done
183 IFS="$acl_save_IFS"
184 fi
185 ])
This diff is collapsed. Click to expand it.
1 # longlong.m4 serial 5
2 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Paul Eggert.
8
9 # Define HAVE_LONG_LONG if 'long long' works.
10
11 AC_DEFUN([gl_AC_TYPE_LONG_LONG],
12 [
13 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
14 [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
15 [long long llmax = (long long) -1;
16 return ll << i | ll >> i | llmax / ll | llmax % ll;],
17 ac_cv_type_long_long=yes,
18 ac_cv_type_long_long=no)])
19 if test $ac_cv_type_long_long = yes; then
20 AC_DEFINE(HAVE_LONG_LONG, 1,
21 [Define if you have the 'long long' type.])
22 fi
23 ])
This diff is collapsed. Click to expand it.
1 # stdint_h.m4 serial 5
2 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Paul Eggert.
8
9 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
10 # doesn't clash with <sys/types.h>, and declares uintmax_t.
11
12 AC_DEFUN([gl_AC_HEADER_STDINT_H],
13 [
14 AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
15 [AC_TRY_COMPILE(
16 [#include <sys/types.h>
17 #include <stdint.h>],
18 [uintmax_t i = (uintmax_t) -1;],
19 gl_cv_header_stdint_h=yes,
20 gl_cv_header_stdint_h=no)])
21 if test $gl_cv_header_stdint_h = yes; then
22 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
23 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
24 and declares uintmax_t. ])
25 fi
26 ])
1 # uintmax_t.m4 serial 9
2 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Paul Eggert.
8
9 AC_PREREQ(2.13)
10
11 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
12 # if it is not already defined in <stdint.h> or <inttypes.h>.
13
14 AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
15 [
16 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
17 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
18 if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
19 AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG])
20 test $ac_cv_type_unsigned_long_long = yes \
21 && ac_type='unsigned long long' \
22 || ac_type='unsigned long'
23 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
24 [Define to unsigned long or unsigned long long
25 if <stdint.h> and <inttypes.h> don't define.])
26 else
27 AC_DEFINE(HAVE_UINTMAX_T, 1,
28 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
29 fi
30 ])
1 # ulonglong.m4 serial 4
2 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Paul Eggert.
8
9 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
10
11 AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
12 [
13 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
14 [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
15 [unsigned long long ullmax = (unsigned long long) -1;
16 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
17 ac_cv_type_unsigned_long_long=yes,
18 ac_cv_type_unsigned_long_long=no)])
19 if test $ac_cv_type_unsigned_long_long = yes; then
20 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
21 [Define if you have the 'unsigned long long' type.])
22 fi
23 ])
1 # visibility.m4 serial 1 (gettext-0.15)
2 dnl Copyright (C) 2005 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Bruno Haible.
8
9 dnl Tests whether the compiler supports the command-line option
10 dnl -fvisibility=hidden and the function and variable attributes
11 dnl __attribute__((__visibility__("hidden"))) and
12 dnl __attribute__((__visibility__("default"))).
13 dnl Does *not* test for __visibility__("protected") - which has tricky
14 dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
15 dnl MacOS X.
16 dnl Does *not* test for __visibility__("internal") - which has processor
17 dnl dependent semantics.
18 dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
19 dnl "really only recommended for legacy code".
20 dnl Set the variable CFLAG_VISIBILITY.
21 dnl Defines and sets the variable HAVE_VISIBILITY.
22
23 AC_DEFUN([gl_VISIBILITY],
24 [
25 AC_REQUIRE([AC_PROG_CC])
26 CFLAG_VISIBILITY=
27 HAVE_VISIBILITY=0
28 if test -n "$GCC"; then
29 AC_MSG_CHECKING([for simple visibility declarations])
30 AC_CACHE_VAL(gl_cv_cc_visibility, [
31 gl_save_CFLAGS="$CFLAGS"
32 CFLAGS="$CFLAGS -fvisibility=hidden"
33 AC_TRY_COMPILE(
34 [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
35 extern __attribute__((__visibility__("default"))) int exportedvar;
36 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
37 extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
38 [],
39 gl_cv_cc_visibility=yes,
40 gl_cv_cc_visibility=no)
41 CFLAGS="$gl_save_CFLAGS"])
42 AC_MSG_RESULT([$gl_cv_cc_visibility])
43 if test $gl_cv_cc_visibility = yes; then
44 CFLAG_VISIBILITY="-fvisibility=hidden"
45 HAVE_VISIBILITY=1
46 fi
47 fi
48 AC_SUBST([CFLAG_VISIBILITY])
49 AC_SUBST([HAVE_VISIBILITY])
50 AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
51 [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
52 ])