annotate aclocal.m4 @ 46:3da7765bc439

2002-10-31 Brian Masney <masneyb@gftp.org> * lib/protocols.c (gftp_get_next_file) - don't use g_filename_to_utf8. If g_locale_to_utf8 fails, print out a warning to the user on the console
author masneyb
date Fri, 01 Nov 2002 00:10:08 +0000
parents c8ec7877432e
children c01d91c10f6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
2
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
4 dnl This file is free software; the Free Software Foundation
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
5 dnl gives unlimited permission to copy and/or distribute it,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
6 dnl with or without modifications, as long as this notice is preserved.
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
7
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
8 dnl This program is distributed in the hope that it will be useful,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
11 dnl PARTICULAR PURPOSE.
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
12
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
13 # Like AC_CONFIG_HEADER, but automatically create stamp file.
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
14
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
15 AC_DEFUN([AM_CONFIG_HEADER],
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
16 [AC_PREREQ([2.12])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
17 AC_CONFIG_HEADER([$1])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
18 dnl When config.status generates a header, we must update the stamp-h file.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
19 dnl This file resides in the same directory as the config header
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
20 dnl that is generated. We must strip everything past the first ":",
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
21 dnl and everything past the last "/".
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
22 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
23 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
24 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
25 <<am_indx=1
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
26 for am_file in <<$1>>; do
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
27 case " <<$>>CONFIG_HEADERS " in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
28 *" <<$>>am_file "*<<)>>
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
29 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
30 ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
31 esac
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
32 am_indx=`expr "<<$>>am_indx" + 1`
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
33 done<<>>dnl>>)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
34 changequote([,]))])
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
35
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
36 # Do all the work for Automake. This macro actually does too much --
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
37 # some checks are only needed if your package does certain things.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
38 # But this isn't really a big deal.
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
39
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
40 # serial 1
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
41
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
42 dnl Usage:
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
43 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
44
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
45 AC_DEFUN([AM_INIT_AUTOMAKE],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
46 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
47 AC_REQUIRE([AC_PROG_INSTALL])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
48 PACKAGE=[$1]
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
49 AC_SUBST(PACKAGE)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
50 VERSION=[$2]
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
51 AC_SUBST(VERSION)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
52 dnl test to see if srcdir already configured
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
53 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
54 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
55 fi
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
56 ifelse([$3],,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
57 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
58 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
59 AC_REQUIRE([AM_SANITY_CHECK])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
60 AC_REQUIRE([AC_ARG_PROGRAM])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
61 dnl FIXME This is truly gross.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
62 missing_dir=`cd $ac_aux_dir && pwd`
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
63 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
64 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
65 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
66 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
67 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
68 AC_REQUIRE([AC_PROG_MAKE_SET])])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
69
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
70 # Copyright 2002 Free Software Foundation, Inc.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
71
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
72 # This program is free software; you can redistribute it and/or modify
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
73 # it under the terms of the GNU General Public License as published by
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
74 # the Free Software Foundation; either version 2, or (at your option)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
75 # any later version.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
76
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
77 # This program is distributed in the hope that it will be useful,
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
78 # but WITHOUT ANY WARRANTY; without even the implied warranty of
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
79 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
80 # GNU General Public License for more details.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
81
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
82 # You should have received a copy of the GNU General Public License
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
83 # along with this program; if not, write to the Free Software
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
84 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
85
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
86 # AM_AUTOMAKE_VERSION(VERSION)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
87 # ----------------------------
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
88 # Automake X.Y traces this macro to ensure aclocal.m4 has been
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
89 # generated from the m4 files accompanying Automake X.Y.
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
90 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
91
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
92 # AM_SET_CURRENT_AUTOMAKE_VERSION
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
93 # -------------------------------
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
94 # Call AM_AUTOMAKE_VERSION so it can be traced.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
95 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
96 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
97 [AM_AUTOMAKE_VERSION([1.4-p6])])
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
98
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
99 #
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
100 # Check to make sure that the build environment is sane.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
101 #
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
102
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
103 AC_DEFUN([AM_SANITY_CHECK],
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
104 [AC_MSG_CHECKING([whether build environment is sane])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
105 # Just in case
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
106 sleep 1
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
107 echo timestamp > conftestfile
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
108 # Do `set' in a subshell so we don't clobber the current shell's
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
109 # arguments. Must try -L first in case configure is actually a
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
110 # symlink; some systems play weird games with the mod time of symlinks
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
111 # (eg FreeBSD returns the mod time of the symlink's containing
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
112 # directory).
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
113 if (
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
114 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
115 if test "[$]*" = "X"; then
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
116 # -L didn't work.
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
117 set X `ls -t $srcdir/configure conftestfile`
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
118 fi
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
119 if test "[$]*" != "X $srcdir/configure conftestfile" \
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
120 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
121
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
122 # If neither matched, then we have a broken ls. This can happen
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
123 # if, for instance, CONFIG_SHELL is bash and it inherits a
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
124 # broken ls alias from the environment. This has actually
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
125 # happened. Such a system could not be considered "sane".
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
126 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
127 alias in your environment])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
128 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
129
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
130 test "[$]2" = conftestfile
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
131 )
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
132 then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
133 # Ok.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
134 :
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
135 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
136 AC_MSG_ERROR([newly created file is older than distributed files!
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
137 Check your system clock])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
138 fi
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
139 rm -f conftest*
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
140 AC_MSG_RESULT(yes)])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
141
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
142 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
143 dnl The program must properly implement --version.
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
144 AC_DEFUN([AM_MISSING_PROG],
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
145 [AC_MSG_CHECKING(for working $2)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
146 # Run test in a subshell; some versions of sh will print an error if
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
147 # an executable is not found, even if stderr is redirected.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
148 # Redirect stdin to placate older versions of autoconf. Sigh.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
149 if ($2 --version) < /dev/null > /dev/null 2>&1; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
150 $1=$2
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
151 AC_MSG_RESULT(found)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
152 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
153 $1="$3/missing $2"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
154 AC_MSG_RESULT(missing)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
155 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
156 AC_SUBST($1)])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
157
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
158 #serial 4
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
159
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
160 dnl By default, many hosts won't let programs access large files;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
161 dnl one must use special compiler options to get large-file access to work.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
162 dnl For more details about this brain damage please see:
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
163 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
164
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
165 dnl Written by Paul Eggert <eggert@twinsun.com>.
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
166
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
167 dnl Internal subroutine of AC_SYS_LARGEFILE.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
168 dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
169 AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
170 [AC_CACHE_CHECK([for $1 value to request large file support],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
171 ac_cv_sys_largefile_$1,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
172 [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
173 ac_cv_sys_largefile_$1=no
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
174 ifelse($1, CFLAGS,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
175 [case "$host_os" in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
176 # IRIX 6.2 and later require cc -n32.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
177 changequote(, )dnl
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
178 irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
179 changequote([, ])dnl
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
180 if test "$GCC" != yes; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
181 ac_cv_sys_largefile_CFLAGS=-n32
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
182 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
183 ac_save_CC="$CC"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
184 CC="$CC $ac_cv_sys_largefile_CFLAGS"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
185 AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
186 CC="$ac_save_CC"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
187 esac])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
188 }])])
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
189
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
190 dnl Internal subroutine of AC_SYS_LARGEFILE.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
191 dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
192 AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
193 [case $2 in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
194 no) ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
195 ?*)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
196 case "[$]$1" in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
197 '') $1=$2 ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
198 *) $1=[$]$1' '$2 ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
199 esac ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
200 esac])
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
201
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
202 dnl Internal subroutine of AC_SYS_LARGEFILE.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
203 dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
204 AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
205 [AC_CACHE_CHECK([for $1], $2,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
206 [$2=no
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
207 changequote(, )dnl
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
208 $4
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
209 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
210 case "$ac_flag" in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
211 -D$1)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
212 $2=1 ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
213 -D$1=*)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
214 $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
215 esac
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
216 done
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
217 changequote([, ])dnl
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
218 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
219 if test "[$]$2" != no; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
220 AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
221 fi])
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
222
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
223 AC_DEFUN(AC_SYS_LARGEFILE,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
224 [AC_REQUIRE([AC_CANONICAL_HOST])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
225 AC_ARG_ENABLE(largefile,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
226 [ --disable-largefile omit support for large files])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
227 if test "$enable_largefile" != no; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
228 AC_CHECK_TOOL(GETCONF, getconf)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
229 AC_SYS_LARGEFILE_FLAGS(CFLAGS)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
230 AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
231 AC_SYS_LARGEFILE_FLAGS(LIBS)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
232
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
233 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
234 case "$ac_flag" in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
235 no) ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
236 -D_FILE_OFFSET_BITS=*) ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
237 -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
238 -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
239 -D?* | -I?*)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
240 AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
241 *)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
242 AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
243 esac
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
244 done
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
245 AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
246 AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
247 AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
248 ac_cv_sys_file_offset_bits,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
249 [Number of bits in a file offset, on hosts where this is settable.]
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
250 [case "$host_os" in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
251 # HP-UX 10.20 and later
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
252 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
253 ac_cv_sys_file_offset_bits=64 ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
254 esac])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
255 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
256 ac_cv_sys_largefile_source,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
257 [Define to make fseeko etc. visible, on some hosts.],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
258 [case "$host_os" in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
259 # HP-UX 10.20 and later
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
260 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
261 ac_cv_sys_largefile_source=1 ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
262 esac])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
263 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
264 ac_cv_sys_large_files,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
265 [Define for large files, on AIX-style hosts.],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
266 [case "$host_os" in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
267 # AIX 4.2 and later
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
268 aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
269 ac_cv_sys_large_files=1 ;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
270 esac])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
271 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
272 ])
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
273
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
274
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
275 # serial 1
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
276
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
277 AC_DEFUN([AM_C_PROTOTYPES],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
278 [AC_REQUIRE([AM_PROG_CC_STDC])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
279 AC_REQUIRE([AC_PROG_CPP])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
280 AC_MSG_CHECKING([for function prototypes])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
281 if test "$am_cv_prog_cc_stdc" != no; then
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
282 AC_MSG_RESULT(yes)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
283 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
284 U= ANSI2KNR=
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
285 else
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
286 AC_MSG_RESULT(no)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
287 U=_ ANSI2KNR=./ansi2knr
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
288 # Ensure some checks needed by ansi2knr itself.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
289 AC_HEADER_STDC
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
290 AC_CHECK_HEADERS(string.h)
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
291 fi
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
292 AC_SUBST(U)dnl
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
293 AC_SUBST(ANSI2KNR)dnl
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
294 ])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
295
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
296
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
297 # serial 1
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
298
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
299 # @defmac AC_PROG_CC_STDC
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
300 # @maindex PROG_CC_STDC
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
301 # @ovindex CC
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
302 # If the C compiler in not in ANSI C mode by default, try to add an option
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
303 # to output variable @code{CC} to make it so. This macro tries various
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
304 # options that select ANSI C on some system or another. It considers the
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
305 # compiler to be in ANSI C mode if it handles function prototypes correctly.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
306 #
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
307 # If you use this macro, you should check after calling it whether the C
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
308 # compiler has been set to accept ANSI C; if not, the shell variable
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
309 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
310 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
311 # program @code{ansi2knr}, which comes with Ghostscript.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
312 # @end defmac
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
313
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
314 AC_DEFUN([AM_PROG_CC_STDC],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
315 [AC_REQUIRE([AC_PROG_CC])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
316 AC_BEFORE([$0], [AC_C_INLINE])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
317 AC_BEFORE([$0], [AC_C_CONST])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
318 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
319 dnl a magic option to avoid problems with ANSI preprocessor commands
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
320 dnl like #elif.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
321 dnl FIXME: can't do this because then AC_AIX won't work due to a
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
322 dnl circular dependency.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
323 dnl AC_BEFORE([$0], [AC_PROG_CPP])
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
324 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
325 AC_CACHE_VAL(am_cv_prog_cc_stdc,
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
326 [am_cv_prog_cc_stdc=no
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
327 ac_save_CC="$CC"
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
328 # Don't try gcc -ansi; that turns off useful extensions and
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
329 # breaks some systems' header files.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
330 # AIX -qlanglvl=ansi
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
331 # Ultrix and OSF/1 -std1
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
332 # HP-UX -Aa -D_HPUX_SOURCE
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
333 # SVR4 -Xc -D__EXTENSIONS__
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
334 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
335 do
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
336 CC="$ac_save_CC $ac_arg"
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
337 AC_TRY_COMPILE(
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
338 [#include <stdarg.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
339 #include <stdio.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
340 #include <sys/types.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
341 #include <sys/stat.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
342 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
343 struct buf { int x; };
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
344 FILE * (*rcsopen) (struct buf *, struct stat *, int);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
345 static char *e (p, i)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
346 char **p;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
347 int i;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
348 {
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
349 return p[i];
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
350 }
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
351 static char *f (char * (*g) (char **, int), char **p, ...)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
352 {
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
353 char *s;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
354 va_list v;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
355 va_start (v,p);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
356 s = g (p, va_arg (v,int));
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
357 va_end (v);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
358 return s;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
359 }
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
360 int test (int i, double x);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
361 struct s1 {int (*f) (int a);};
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
362 struct s2 {int (*f) (double a);};
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
363 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
364 int argc;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
365 char **argv;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
366 ], [
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
367 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
368 ],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
369 [am_cv_prog_cc_stdc="$ac_arg"; break])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
370 done
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
371 CC="$ac_save_CC"
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
372 ])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
373 if test -z "$am_cv_prog_cc_stdc"; then
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
374 AC_MSG_RESULT([none needed])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
375 else
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
376 AC_MSG_RESULT($am_cv_prog_cc_stdc)
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
377 fi
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
378 case "x$am_cv_prog_cc_stdc" in
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
379 x|xno) ;;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
380 *) CC="$CC $am_cv_prog_cc_stdc" ;;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
381 esac
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
382 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
383
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
384 # Add --enable-maintainer-mode option to configure.
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
385 # From Jim Meyering
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
386
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
387 # serial 1
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
388
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
389 AC_DEFUN([AM_MAINTAINER_MODE],
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
390 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
391 dnl maintainer-mode is disabled by default
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
392 AC_ARG_ENABLE(maintainer-mode,
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
393 [ --enable-maintainer-mode enable make rules and dependencies not useful
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
394 (and sometimes confusing) to the casual installer],
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
395 USE_MAINTAINER_MODE=$enableval,
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
396 USE_MAINTAINER_MODE=no)
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
397 AC_MSG_RESULT($USE_MAINTAINER_MODE)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
398 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
399 MAINT=$MAINTAINER_MODE_TRUE
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
400 AC_SUBST(MAINT)dnl
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
401 ]
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
402 )
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
403
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
404 # Define a conditional.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
405
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
406 AC_DEFUN([AM_CONDITIONAL],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
407 [AC_SUBST($1_TRUE)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
408 AC_SUBST($1_FALSE)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
409 if $2; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
410 $1_TRUE=
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
411 $1_FALSE='#'
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
412 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
413 $1_TRUE='#'
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
414 $1_FALSE=
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
415 fi])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
416
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
417 # Configure paths for GLIB
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
418 # Owen Taylor 97-11-3
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
419
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
420 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
421 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
422 dnl gthread is specified in MODULES, pass to glib-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
423 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
424 AC_DEFUN(AM_PATH_GLIB,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
425 [dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
426 dnl Get the cflags and libraries from the glib-config script
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
427 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
428 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
429 glib_config_prefix="$withval", glib_config_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
430 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
431 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
432 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
433 , enable_glibtest=yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
434
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
435 if test x$glib_config_exec_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
436 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
437 if test x${GLIB_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
438 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
439 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
440 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
441 if test x$glib_config_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
442 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
443 if test x${GLIB_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
444 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
445 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
446 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
447
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
448 for module in . $4
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
449 do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
450 case "$module" in
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
451 gmodule)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
452 glib_config_args="$glib_config_args gmodule"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
453 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
454 gthread)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
455 glib_config_args="$glib_config_args gthread"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
456 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
457 esac
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
458 done
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
459
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
460 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
461 min_glib_version=ifelse([$1], ,0.99.7,$1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
462 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
463 no_glib=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
464 if test "$GLIB_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
465 no_glib=yes
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
466 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
467 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
468 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
469 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
470 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
471 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
472 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
473 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
474 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
475 if test "x$enable_glibtest" = "xyes" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
476 ac_save_CFLAGS="$CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
477 ac_save_LIBS="$LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
478 CFLAGS="$CFLAGS $GLIB_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
479 LIBS="$GLIB_LIBS $LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
480 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
481 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
482 dnl checks the results of glib-config to some extent
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
483 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
484 rm -f conf.glibtest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
485 AC_TRY_RUN([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
486 #include <glib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
487 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
488 #include <stdlib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
489
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
490 int
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
491 main ()
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
492 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
493 int major, minor, micro;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
494 char *tmp_version;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
495
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
496 system ("touch conf.glibtest");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
497
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
498 /* HP/UX 9 (%@#!) writes to sscanf strings */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
499 tmp_version = g_strdup("$min_glib_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
500 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
501 printf("%s, bad version string\n", "$min_glib_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
502 exit(1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
503 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
504
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
505 if ((glib_major_version != $glib_config_major_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
506 (glib_minor_version != $glib_config_minor_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
507 (glib_micro_version != $glib_config_micro_version))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
508 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
509 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
510 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
511 glib_major_version, glib_minor_version, glib_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
512 printf ("*** was found! If glib-config was correct, then it is best\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
513 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
514 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
515 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
516 printf("*** required on your system.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
517 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
518 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
519 printf("*** before re-running configure\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
520 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
521 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
522 (glib_minor_version != GLIB_MINOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
523 (glib_micro_version != GLIB_MICRO_VERSION))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
524 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
525 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
526 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
527 printf("*** library (version %d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
528 glib_major_version, glib_minor_version, glib_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
529 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
530 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
531 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
532 if ((glib_major_version > major) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
533 ((glib_major_version == major) && (glib_minor_version > minor)) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
534 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
535 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
536 return 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
537 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
538 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
539 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
540 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
541 glib_major_version, glib_minor_version, glib_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
542 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
543 major, minor, micro);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
544 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
545 printf("***\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
546 printf("*** If you have already installed a sufficiently new version, this error\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
547 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
548 printf("*** being found. The easiest way to fix this is to remove the old version\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
549 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
550 printf("*** correct copy of glib-config. (In this case, you will have to\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
551 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
552 printf("*** so that the correct libraries are found at run-time))\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
553 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
554 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
555 return 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
556 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
557 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
558 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
559 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
560 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
561 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
562 if test "x$no_glib" = x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
563 AC_MSG_RESULT(yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
564 ifelse([$2], , :, [$2])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
565 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
566 AC_MSG_RESULT(no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
567 if test "$GLIB_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
568 echo "*** The glib-config script installed by GLIB could not be found"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
569 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
570 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
571 echo "*** full path to glib-config."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
572 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
573 if test -f conf.glibtest ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
574 :
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
575 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
576 echo "*** Could not run GLIB test program, checking why..."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
577 CFLAGS="$CFLAGS $GLIB_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
578 LIBS="$LIBS $GLIB_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
579 AC_TRY_LINK([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
580 #include <glib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
581 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
582 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
583 [ echo "*** The test program compiled, but did not run. This usually means"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
584 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
585 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
586 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
587 echo "*** to the installed location Also, make sure you have run ldconfig if that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
588 echo "*** is required on your system"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
589 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
590 echo "*** If you have an old version installed, it is best to remove it, although"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
591 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
592 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
593 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
594 echo "*** came with the system with the command"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
595 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
596 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
597 [ echo "*** The test program failed to compile or link. See the file config.log for the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
598 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
599 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
600 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
601 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
602 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
603 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
604 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
605 GLIB_CFLAGS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
606 GLIB_LIBS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
607 ifelse([$3], , :, [$3])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
608 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
609 AC_SUBST(GLIB_CFLAGS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
610 AC_SUBST(GLIB_LIBS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
611 rm -f conf.glibtest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
612 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
613
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
614
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
615 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
616 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
617 dnl also defines GSTUFF_PKG_ERRORS on error
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
618 AC_DEFUN(PKG_CHECK_MODULES, [
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
619 succeeded=no
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
620
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
621 if test -z "$PKG_CONFIG"; then
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
622 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
623 fi
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
624
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
625 if test "$PKG_CONFIG" = "no" ; then
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
626 echo "*** The pkg-config script could not be found. Make sure it is"
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
627 echo "*** in your path, or set the PKG_CONFIG environment variable"
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
628 echo "*** to the full path to pkg-config."
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
629 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
630 else
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
631 PKG_CONFIG_MIN_VERSION=0.9.0
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
632 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
633 AC_MSG_CHECKING(for $2)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
634
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
635 if $PKG_CONFIG --exists "$2" ; then
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
636 AC_MSG_RESULT(yes)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
637 succeeded=yes
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
638
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
639 AC_MSG_CHECKING($1_CFLAGS)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
640 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
641 AC_MSG_RESULT($$1_CFLAGS)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
642
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
643 AC_MSG_CHECKING($1_LIBS)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
644 $1_LIBS=`$PKG_CONFIG --libs "$2"`
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
645 AC_MSG_RESULT($$1_LIBS)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
646 else
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
647 $1_CFLAGS=""
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
648 $1_LIBS=""
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
649 ## If we have a custom action on failure, don't print errors, but
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
650 ## do set a variable so people can do so.
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
651 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
652 ifelse([$4], ,echo $$1_PKG_ERRORS,)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
653 fi
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
654
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
655 AC_SUBST($1_CFLAGS)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
656 AC_SUBST($1_LIBS)
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
657 else
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
658 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
659 echo "*** See http://www.freedesktop.org/software/pkgconfig"
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
660 fi
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
661 fi
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
662
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
663 if test $succeeded = yes; then
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
664 ifelse([$3], , :, [$3])
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
665 else
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
666 ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
667 fi
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
668 ])
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
669
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
670
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
671
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
672
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
673 # serial 1
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
674
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
675 AC_DEFUN([AM_WITH_DMALLOC],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
676 [AC_MSG_CHECKING(if malloc debugging is wanted)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
677 AC_ARG_WITH(dmalloc,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
678 [ --with-dmalloc use dmalloc, as in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
679 ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
680 [if test "$withval" = yes; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
681 AC_MSG_RESULT(yes)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
682 AC_DEFINE(WITH_DMALLOC,1,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
683 [Define if using the dmalloc debugging malloc package])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
684 LIBS="$LIBS -ldmalloc"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
685 LDFLAGS="$LDFLAGS -g"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
686 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
687 AC_MSG_RESULT(no)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
688 fi], [AC_MSG_RESULT(no)])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
689 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
690
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
691 # Configure paths for GTK+
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
692 # Owen Taylor 97-11-3
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
693
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
694 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
695 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
696 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
697 AC_DEFUN(AM_PATH_GTK,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
698 [dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
699 dnl Get the cflags and libraries from the gtk-config script
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
700 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
701 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
702 gtk_config_prefix="$withval", gtk_config_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
703 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
704 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
705 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
706 , enable_gtktest=yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
707
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
708 for module in . $4
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
709 do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
710 case "$module" in
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
711 gthread)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
712 gtk_config_args="$gtk_config_args gthread"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
713 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
714 esac
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
715 done
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
716
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
717 if test x$gtk_config_exec_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
718 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
719 if test x${GTK_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
720 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
721 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
722 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
723 if test x$gtk_config_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
724 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
725 if test x${GTK_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
726 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
727 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
728 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
729
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
730 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
731 min_gtk_version=ifelse([$1], ,0.99.7,$1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
732 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
733 no_gtk=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
734 if test "$GTK_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
735 no_gtk=yes
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
736 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
737 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
738 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
739 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
740 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
741 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
742 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
743 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
744 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
745 if test "x$enable_gtktest" = "xyes" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
746 ac_save_CFLAGS="$CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
747 ac_save_LIBS="$LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
748 CFLAGS="$CFLAGS $GTK_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
749 LIBS="$GTK_LIBS $LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
750 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
751 dnl Now check if the installed GTK is sufficiently new. (Also sanity
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
752 dnl checks the results of gtk-config to some extent
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
753 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
754 rm -f conf.gtktest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
755 AC_TRY_RUN([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
756 #include <gtk/gtk.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
757 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
758 #include <stdlib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
759
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
760 int
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
761 main ()
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
762 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
763 int major, minor, micro;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
764 char *tmp_version;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
765
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
766 system ("touch conf.gtktest");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
767
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
768 /* HP/UX 9 (%@#!) writes to sscanf strings */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
769 tmp_version = g_strdup("$min_gtk_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
770 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
771 printf("%s, bad version string\n", "$min_gtk_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
772 exit(1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
773 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
774
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
775 if ((gtk_major_version != $gtk_config_major_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
776 (gtk_minor_version != $gtk_config_minor_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
777 (gtk_micro_version != $gtk_config_micro_version))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
778 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
779 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
780 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
781 gtk_major_version, gtk_minor_version, gtk_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
782 printf ("*** was found! If gtk-config was correct, then it is best\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
783 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
784 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
785 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
786 printf("*** required on your system.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
787 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
788 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
789 printf("*** before re-running configure\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
790 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
791 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
792 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
793 (gtk_minor_version != GTK_MINOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
794 (gtk_micro_version != GTK_MICRO_VERSION))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
795 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
796 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
797 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
798 printf("*** library (version %d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
799 gtk_major_version, gtk_minor_version, gtk_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
800 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
801 #endif /* defined (GTK_MAJOR_VERSION) ... */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
802 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
803 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
804 if ((gtk_major_version > major) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
805 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
806 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
807 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
808 return 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
809 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
810 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
811 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
812 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
813 gtk_major_version, gtk_minor_version, gtk_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
814 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
815 major, minor, micro);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
816 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
817 printf("***\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
818 printf("*** If you have already installed a sufficiently new version, this error\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
819 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
820 printf("*** being found. The easiest way to fix this is to remove the old version\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
821 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
822 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
823 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
824 printf("*** so that the correct libraries are found at run-time))\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
825 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
826 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
827 return 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
828 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
829 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
830 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
831 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
832 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
833 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
834 if test "x$no_gtk" = x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
835 AC_MSG_RESULT(yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
836 ifelse([$2], , :, [$2])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
837 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
838 AC_MSG_RESULT(no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
839 if test "$GTK_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
840 echo "*** The gtk-config script installed by GTK could not be found"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
841 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
842 echo "*** your path, or set the GTK_CONFIG environment variable to the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
843 echo "*** full path to gtk-config."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
844 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
845 if test -f conf.gtktest ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
846 :
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
847 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
848 echo "*** Could not run GTK test program, checking why..."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
849 CFLAGS="$CFLAGS $GTK_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
850 LIBS="$LIBS $GTK_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
851 AC_TRY_LINK([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
852 #include <gtk/gtk.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
853 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
854 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
855 [ echo "*** The test program compiled, but did not run. This usually means"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
856 echo "*** that the run-time linker is not finding GTK or finding the wrong"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
857 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
858 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
859 echo "*** to the installed location Also, make sure you have run ldconfig if that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
860 echo "*** is required on your system"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
861 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
862 echo "*** If you have an old version installed, it is best to remove it, although"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
863 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
864 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
865 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
866 echo "*** came with the system with the command"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
867 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
868 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
869 [ echo "*** The test program failed to compile or link. See the file config.log for the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
870 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
871 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
872 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
873 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
874 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
875 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
876 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
877 GTK_CFLAGS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
878 GTK_LIBS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
879 ifelse([$3], , :, [$3])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
880 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
881 AC_SUBST(GTK_CFLAGS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
882 AC_SUBST(GTK_LIBS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
883 rm -f conf.gtktest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
884 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
885
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
886 # gettext.m4 serial 17 (gettext-0.11.5)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
887 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
888 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
889 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
890 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
891 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
892 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
893 dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
894 dnl This file can can be used in projects which are not available under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
895 dnl the GNU General Public License or the GNU Library General Public
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
896 dnl License but which still want to provide support for the GNU gettext
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
897 dnl functionality.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
898 dnl Please note that the actual code of the GNU gettext library is covered
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
899 dnl by the GNU Library General Public License, and the rest of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
900 dnl gettext package package is covered by the GNU General Public License.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
901 dnl They are *not* in the public domain.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
902
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
903 dnl Authors:
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
904 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
905 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
906
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
907 dnl Macro to add for using GNU gettext.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
908
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
909 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
910 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
911 dnl default (if it is not specified or empty) is 'no-libtool'.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
912 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
913 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
914 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
915 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
916 dnl depending on --{enable,disable}-{shared,static} and on the presence of
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
917 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
918 dnl $(top_builddir)/intl/libintl.a will be created.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
919 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
920 dnl implementations (in libc or libintl) without the ngettext() function
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
921 dnl will be ignored. If NEEDSYMBOL is specified and is
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
922 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
923 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
924 dnl INTLDIR is used to find the intl libraries. If empty,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
925 dnl the value `$(top_builddir)/intl/' is used.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
926 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
927 dnl The result of the configuration is one of three cases:
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
928 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
929 dnl and used.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
930 dnl Catalog format: GNU --> install in $(datadir)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
931 dnl Catalog extension: .mo after installation, .gmo in source tree
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
932 dnl 2) GNU gettext has been found in the system's C library.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
933 dnl Catalog format: GNU --> install in $(datadir)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
934 dnl Catalog extension: .mo after installation, .gmo in source tree
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
935 dnl 3) No internationalization, always use English msgid.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
936 dnl Catalog format: none
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
937 dnl Catalog extension: none
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
938 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
939 dnl The use of .gmo is historical (it was needed to avoid overwriting the
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
940 dnl GNU format catalogs when building on a platform with an X/Open gettext),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
941 dnl but we keep it in order not to force irrelevant filename changes on the
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
942 dnl maintainers.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
943 dnl
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
944 AC_DEFUN([AM_GNU_GETTEXT],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
945 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
946 dnl Argument checking.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
947 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
948 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
949 ])])])])])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
950 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
951 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
952 ])])])])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
953 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
954 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
955
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
956 AC_REQUIRE([AM_PO_SUBDIRS])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
957 ifelse(gt_included_intl, yes, [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
958 AC_REQUIRE([AM_INTL_SUBDIR])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
959 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
960
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
961 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
962 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
963 AC_REQUIRE([AC_LIB_RPATH])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
964
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
965 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
966 dnl Ideally we would do this search only after the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
967 dnl if test "$USE_NLS" = "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
968 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
969 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
970 dnl the configure script would need to contain the same shell code
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
971 dnl again, outside any 'if'. There are two solutions:
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
972 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
973 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
974 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
975 dnl documented, we avoid it.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
976 ifelse(gt_included_intl, yes, , [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
977 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
978 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
979
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
980 AC_MSG_CHECKING([whether NLS is requested])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
981 dnl Default is enabled NLS
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
982 AC_ARG_ENABLE(nls,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
983 [ --disable-nls do not use Native Language Support],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
984 USE_NLS=$enableval, USE_NLS=yes)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
985 AC_MSG_RESULT($USE_NLS)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
986 AC_SUBST(USE_NLS)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
987
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
988 ifelse(gt_included_intl, yes, [
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
989 BUILD_INCLUDED_LIBINTL=no
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
990 USE_INCLUDED_LIBINTL=no
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
991 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
992 LIBINTL=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
993 LTLIBINTL=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
994 POSUB=
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
995
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
996 dnl If we use NLS figure out what method
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
997 if test "$USE_NLS" = "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
998 gt_use_preinstalled_gnugettext=no
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
999 ifelse(gt_included_intl, yes, [
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1000 AC_MSG_CHECKING([whether included gettext is requested])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1001 AC_ARG_WITH(included-gettext,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1002 [ --with-included-gettext use the GNU gettext library included here],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1003 nls_cv_force_use_gnu_gettext=$withval,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1004 nls_cv_force_use_gnu_gettext=no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1005 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1006
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1007 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1008 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1009 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1010 dnl User does not insist on using GNU NLS library. Figure out what
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1011 dnl to use. If GNU gettext is available we use this. Else we have
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1012 dnl to fall back to GNU NLS library.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1013
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1014 dnl Add a version number to the cache macros.
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1015 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1016 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1017 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1018
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1019 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1020 [AC_TRY_LINK([#include <libintl.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1021 ]ifelse([$2], [need-formatstring-macros],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1022 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1023 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1024 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1025 changequote(,)dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1026 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1027 changequote([,])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1028 ], [])[extern int _nl_msg_cat_cntr;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1029 extern int *_nl_domain_bindings;],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1030 [bindtextdomain ("", "");
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1031 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1032 gt_cv_func_gnugettext_libc=yes,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1033 gt_cv_func_gnugettext_libc=no)])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1034
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1035 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1036 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1037 ifelse(gt_included_intl, yes, , [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1038 AM_ICONV_LINK
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1039 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1040 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1041 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1042 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1043 dnl even if libiconv doesn't exist.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1044 AC_LIB_LINKFLAGS_BODY([intl])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1045 AC_CACHE_CHECK([for GNU gettext in libintl],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1046 gt_cv_func_gnugettext_libintl,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1047 [gt_save_CPPFLAGS="$CPPFLAGS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1048 CPPFLAGS="$CPPFLAGS $INCINTL"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1049 gt_save_LIBS="$LIBS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1050 LIBS="$LIBS $LIBINTL"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1051 dnl Now see whether libintl exists and does not depend on libiconv.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1052 AC_TRY_LINK([#include <libintl.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1053 ]ifelse([$2], [need-formatstring-macros],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1054 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1055 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1056 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1057 changequote(,)dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1058 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1059 changequote([,])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1060 ], [])[extern int _nl_msg_cat_cntr;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1061 extern
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1062 #ifdef __cplusplus
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1063 "C"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1064 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1065 const char *_nl_expand_alias ();],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1066 [bindtextdomain ("", "");
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1067 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1068 gt_cv_func_gnugettext_libintl=yes,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1069 gt_cv_func_gnugettext_libintl=no)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1070 dnl Now see whether libintl exists and depends on libiconv.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1071 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1072 LIBS="$LIBS $LIBICONV"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1073 AC_TRY_LINK([#include <libintl.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1074 ]ifelse([$2], [need-formatstring-macros],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1075 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1076 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1077 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1078 changequote(,)dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1079 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1080 changequote([,])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1081 ], [])[extern int _nl_msg_cat_cntr;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1082 extern
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1083 #ifdef __cplusplus
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1084 "C"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1085 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1086 const char *_nl_expand_alias ();],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1087 [bindtextdomain ("", "");
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1088 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1089 [LIBINTL="$LIBINTL $LIBICONV"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1090 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1091 gt_cv_func_gnugettext_libintl=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1092 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1093 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1094 CPPFLAGS="$gt_save_CPPFLAGS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1095 LIBS="$gt_save_LIBS"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1096 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1097
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1098 dnl If an already present or preinstalled GNU gettext() is found,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1099 dnl use it. But if this macro is used in GNU gettext, and GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1100 dnl gettext is already preinstalled in libintl, we update this
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1101 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1102 if test "$gt_cv_func_gnugettext_libc" = "yes" \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1103 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1104 && test "$PACKAGE" != gettext; }; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1105 gt_use_preinstalled_gnugettext=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1106 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1107 dnl Reset the values set by searching for libintl.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1108 LIBINTL=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1109 LTLIBINTL=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1110 INCINTL=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1111 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1112
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1113 ifelse(gt_included_intl, yes, [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1114 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1115 dnl GNU gettext is not found in the C library.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1116 dnl Fall back on included GNU gettext library.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1117 nls_cv_use_gnu_gettext=yes
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1118 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1119 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1120
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1121 if test "$nls_cv_use_gnu_gettext" = "yes"; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1122 dnl Mark actions used to generate GNU NLS library.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1123 INTLOBJS="\$(GETTOBJS)"
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1124 BUILD_INCLUDED_LIBINTL=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1125 USE_INCLUDED_LIBINTL=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1126 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1127 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1128 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1129 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1130
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1131 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1132 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1133 dnl Mark actions to use GNU gettext tools.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1134 CATOBJEXT=.gmo
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1135 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1136 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1137
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1138 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1139 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1140 AC_DEFINE(ENABLE_NLS, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1141 [Define to 1 if translation of program messages to the user's native language
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1142 is requested.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1143 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1144 USE_NLS=no
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1145 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1146 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1147
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1148 if test "$USE_NLS" = "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1149
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1150 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1151 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1152 AC_MSG_CHECKING([how to link with libintl])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1153 AC_MSG_RESULT([$LIBINTL])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1154 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1155 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1156
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1157 dnl For backward compatibility. Some packages may be using this.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1158 AC_DEFINE(HAVE_GETTEXT, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1159 [Define if the GNU gettext() function is already present or preinstalled.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1160 AC_DEFINE(HAVE_DCGETTEXT, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1161 [Define if the GNU dcgettext() function is already present or preinstalled.])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1162 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1163
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1164 dnl We need to process the po/ directory.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1165 POSUB=po
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1166 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1167
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1168 ifelse(gt_included_intl, yes, [
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1169 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1170 dnl to 'yes' because some of the testsuite requires it.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1171 if test "$PACKAGE" = gettext; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1172 BUILD_INCLUDED_LIBINTL=yes
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1173 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1174
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1175 dnl Make all variables we use known to autoconf.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1176 AC_SUBST(BUILD_INCLUDED_LIBINTL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1177 AC_SUBST(USE_INCLUDED_LIBINTL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1178 AC_SUBST(CATOBJEXT)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1179 AC_SUBST(INTLOBJS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1180
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1181 dnl For backward compatibility. Some configure.ins may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1182 nls_cv_header_intl=
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1183 nls_cv_header_libgt=
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1184
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1185 dnl For backward compatibility. Some Makefiles may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1186 DATADIRNAME=share
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1187 AC_SUBST(DATADIRNAME)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1188
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1189 dnl For backward compatibility. Some Makefiles may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1190 INSTOBJEXT=.mo
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1191 AC_SUBST(INSTOBJEXT)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1192
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1193 dnl For backward compatibility. Some Makefiles may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1194 GENCAT=gencat
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1195 AC_SUBST(GENCAT)
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1196
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1197 dnl Enable libtool support if the surrounding package wishes it.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1198 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1199 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1200 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1201
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1202 dnl For backward compatibility. Some Makefiles may be using this.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1203 INTLLIBS="$LIBINTL"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1204 AC_SUBST(INTLLIBS)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1205
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1206 dnl Make all documented variables known to autoconf.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1207 AC_SUBST(LIBINTL)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1208 AC_SUBST(LTLIBINTL)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1209 AC_SUBST(POSUB)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1210 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1211
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1212
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1213 dnl Checks for all prerequisites of the po subdirectory,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1214 dnl except for USE_NLS.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1215 AC_DEFUN([AM_PO_SUBDIRS],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1216 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1217 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1218 AC_REQUIRE([AC_PROG_INSTALL])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1219 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1220
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1221 dnl Perform the following tests also if --disable-nls has been given,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1222 dnl because they are needed for "make dist" to work.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1223
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1224 dnl Search for GNU msgfmt in the PATH.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1225 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1226 dnl The second test excludes FreeBSD msgfmt.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1227 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1228 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1229 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1230 :)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1231 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1232
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1233 dnl Search for GNU xgettext 0.11 or newer in the PATH.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1234 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1235 dnl The second test excludes FreeBSD xgettext.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1236 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1237 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1238 (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1239 :)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1240 dnl Remove leftover from FreeBSD xgettext call.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1241 rm -f messages.po
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1242
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1243 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1244 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1245 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1246
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1247 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1248 dnl Test whether we really found GNU msgfmt.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1249 if test "$GMSGFMT" != ":"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1250 dnl If it is no GNU msgfmt we define it as : so that the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1251 dnl Makefiles still can work.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1252 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1253 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1254 : ;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1255 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1256 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1257 AC_MSG_RESULT(
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1258 [found $GMSGFMT program is not GNU msgfmt; ignore it])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1259 GMSGFMT=":"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1260 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1261 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1262
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1263 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1264 dnl Test whether we really found GNU xgettext.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1265 if test "$XGETTEXT" != ":"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1266 dnl If it is no GNU xgettext we define it as : so that the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1267 dnl Makefiles still can work.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1268 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1269 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1270 : ;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1271 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1272 AC_MSG_RESULT(
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1273 [found xgettext program is not GNU xgettext; ignore it])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1274 XGETTEXT=":"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1275 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1276 dnl Remove leftover from FreeBSD xgettext call.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1277 rm -f messages.po
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1278 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1279
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1280 AC_OUTPUT_COMMANDS([
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1281 for ac_file in $CONFIG_FILES; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1282 # Support "outfile[:infile[:infile...]]"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1283 case "$ac_file" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1284 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1285 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1286 # PO directories have a Makefile.in generated from Makefile.in.in.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1287 case "$ac_file" in */Makefile.in)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1288 # Adjust a relative srcdir.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1289 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1290 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1291 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1292 # In autoconf-2.13 it is called $ac_given_srcdir.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1293 # In autoconf-2.50 it is called $srcdir.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1294 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1295 case "$ac_given_srcdir" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1296 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1297 /*) top_srcdir="$ac_given_srcdir" ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1298 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1299 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1300 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1301 rm -f "$ac_dir/POTFILES"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1302 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1303 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1304 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1305 # on $ac_dir but don't depend on user-specified configuration
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1306 # parameters.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1307 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1308 # The LINGUAS file contains the set of available languages.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1309 if test -n "$ALL_LINGUAS"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1310 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1311 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1312 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1313 # Hide the ALL_LINGUAS assigment from automake.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1314 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1315 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1316 case "$ac_given_srcdir" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1317 .) srcdirpre= ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1318 *) srcdirpre='$(srcdir)/' ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1319 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1320 POFILES=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1321 GMOFILES=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1322 UPDATEPOFILES=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1323 DUMMYPOFILES=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1324 for lang in $ALL_LINGUAS; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1325 POFILES="$POFILES $srcdirpre$lang.po"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1326 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1327 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1328 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1329 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1330 # CATALOGS depends on both $ac_dir and the user's LINGUAS
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1331 # environment variable.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1332 INST_LINGUAS=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1333 if test -n "$ALL_LINGUAS"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1334 for presentlang in $ALL_LINGUAS; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1335 useit=no
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1336 if test "%UNSET%" != "$LINGUAS"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1337 desiredlanguages="$LINGUAS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1338 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1339 desiredlanguages="$ALL_LINGUAS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1340 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1341 for desiredlang in $desiredlanguages; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1342 # Use the presentlang catalog if desiredlang is
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1343 # a. equal to presentlang, or
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1344 # b. a variant of presentlang (because in this case,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1345 # presentlang can be used as a fallback for messages
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1346 # which are not translated in the desiredlang catalog).
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1347 case "$desiredlang" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1348 "$presentlang"*) useit=yes;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1349 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1350 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1351 if test $useit = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1352 INST_LINGUAS="$INST_LINGUAS $presentlang"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1353 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1354 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1355 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1356 CATALOGS=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1357 if test -n "$INST_LINGUAS"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1358 for lang in $INST_LINGUAS; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1359 CATALOGS="$CATALOGS $lang.gmo"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1360 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1361 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1362 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1363 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1364 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1365 if test -f "$f"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1366 case "$f" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1367 *.orig | *.bak | *~) ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1368 *) cat "$f" >> "$ac_dir/Makefile" ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1369 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1370 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1371 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1372 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1373 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1374 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1375 done],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1376 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1377 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1378 # from automake.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1379 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1380 # Capture the value of LINGUAS because we need it to compute CATALOGS.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1381 LINGUAS="${LINGUAS-%UNSET%}"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1382 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1383 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1384
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1385
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1386 dnl Checks for all prerequisites of the intl subdirectory,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1387 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1388 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1389 AC_DEFUN([AM_INTL_SUBDIR],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1390 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1391 AC_REQUIRE([AC_PROG_INSTALL])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1392 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1393 AC_REQUIRE([AC_PROG_CC])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1394 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1395 AC_REQUIRE([AC_PROG_RANLIB])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1396 AC_REQUIRE([AC_ISC_POSIX])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1397 AC_REQUIRE([AC_HEADER_STDC])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1398 AC_REQUIRE([AC_C_CONST])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1399 AC_REQUIRE([AC_C_INLINE])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1400 AC_REQUIRE([AC_TYPE_OFF_T])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1401 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1402 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1403 AC_REQUIRE([AC_FUNC_MMAP])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1404 AC_REQUIRE([jm_GLIBC21])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1405 AC_REQUIRE([gt_INTDIV0])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1406 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1407 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1408 AC_REQUIRE([gt_INTTYPES_PRI])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1409
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1410 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1411 stdlib.h string.h unistd.h sys/param.h])
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1412 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1413 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1414 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1415
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1416 AM_ICONV
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1417 AM_LANGINFO_CODESET
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1418 if test $ac_cv_header_locale_h = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1419 AM_LC_MESSAGES
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1420 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1421
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1422 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1423 dnl because plural.y uses bison specific features. It requires at least
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1424 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1425 dnl compile.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1426 dnl bison is only needed for the maintainer (who touches plural.y). But in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1427 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1428 dnl the rule in general Makefile. Now, some people carelessly touch the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1429 dnl files or have a broken "make" program, hence the plural.c rule will
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1430 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1431 dnl present or too old.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1432 AC_CHECK_PROGS([INTLBISON], [bison])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1433 if test -z "$INTLBISON"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1434 ac_verc_fail=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1435 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1436 dnl Found it, now check the version.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1437 AC_MSG_CHECKING([version of bison])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1438 changequote(<<,>>)dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1439 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1440 case $ac_prog_version in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1441 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1442 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1443 changequote([,])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1444 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1445 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1446 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1447 AC_MSG_RESULT([$ac_prog_version])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1448 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1449 if test $ac_verc_fail = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1450 INTLBISON=:
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1451 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1452 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1453
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1454
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1455 AC_DEFUN([AM_MKINSTALLDIRS],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1456 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1457 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1458 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1459 dnl Try to locate is.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1460 MKINSTALLDIRS=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1461 if test -n "$ac_aux_dir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1462 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1463 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1464 if test -z "$MKINSTALLDIRS"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1465 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1466 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1467 AC_SUBST(MKINSTALLDIRS)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1468 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1469
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1470
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1471 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1472 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1473
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1474 # lib-link.m4 serial 3 (gettext-0.11.3)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1475 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1476 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1477 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1478 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1479 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1480 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1481
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1482 dnl From Bruno Haible.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1483
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1484 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1485 dnl the libraries corresponding to explicit and implicit dependencies.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1486 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1487 dnl augments the CPPFLAGS variable.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1488 AC_DEFUN([AC_LIB_LINKFLAGS],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1489 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1490 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1491 AC_REQUIRE([AC_LIB_RPATH])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1492 define([Name],[translit([$1],[./-], [___])])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1493 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1494 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1495 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1496 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1497 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1498 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1499 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1500 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1501 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1502 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1503 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1504 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1505 AC_SUBST([LIB]NAME)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1506 AC_SUBST([LTLIB]NAME)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1507 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1508 dnl results of this search when this library appears as a dependency.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1509 HAVE_LIB[]NAME=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1510 undefine([Name])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1511 undefine([NAME])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1512 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1513
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1514 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1515 dnl searches for libname and the libraries corresponding to explicit and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1516 dnl implicit dependencies, together with the specified include files and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1517 dnl the ability to compile and link the specified testcode. If found, it
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1518 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1519 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1520 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1521 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1522 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1523 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1524 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1525 AC_REQUIRE([AC_LIB_RPATH])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1526 define([Name],[translit([$1],[./-], [___])])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1527 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1528 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1529
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1530 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1531 dnl accordingly.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1532 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1533
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1534 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1535 dnl because if the user has installed lib[]Name and not disabled its use
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1536 dnl via --without-lib[]Name-prefix, he wants to use it.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1537 ac_save_CPPFLAGS="$CPPFLAGS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1538 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1539
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1540 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1541 ac_save_LIBS="$LIBS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1542 LIBS="$LIBS $LIB[]NAME"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1543 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1544 LIBS="$ac_save_LIBS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1545 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1546 if test "$ac_cv_lib[]Name" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1547 HAVE_LIB[]NAME=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1548 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1549 AC_MSG_CHECKING([how to link with lib[]$1])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1550 AC_MSG_RESULT([$LIB[]NAME])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1551 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1552 HAVE_LIB[]NAME=no
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1553 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1554 dnl $INC[]NAME either.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1555 CPPFLAGS="$ac_save_CPPFLAGS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1556 LIB[]NAME=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1557 LTLIB[]NAME=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1558 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1559 AC_SUBST([HAVE_LIB]NAME)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1560 AC_SUBST([LIB]NAME)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1561 AC_SUBST([LTLIB]NAME)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1562 undefine([Name])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1563 undefine([NAME])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1564 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1565
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1566 dnl Determine the platform dependent parameters needed to use rpath:
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1567 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1568 dnl hardcode_direct, hardcode_minus_L,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1569 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1570 AC_DEFUN([AC_LIB_RPATH],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1571 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1572 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1573 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1574 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1575 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1576 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1577 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1578 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1579 . ./conftest.sh
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1580 rm -f ./conftest.sh
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1581 acl_cv_rpath=done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1582 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1583 wl="$acl_cv_wl"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1584 libext="$acl_cv_libext"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1585 shlibext="$acl_cv_shlibext"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1586 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1587 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1588 hardcode_direct="$acl_cv_hardcode_direct"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1589 hardcode_minus_L="$acl_cv_hardcode_minus_L"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1590 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1591 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1592 dnl Determine whether the user wants rpath handling at all.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1593 AC_ARG_ENABLE(rpath,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1594 [ --disable-rpath do not hardcode runtime library paths],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1595 :, enable_rpath=yes)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1596 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1597
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1598 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1599 dnl the libraries corresponding to explicit and implicit dependencies.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1600 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1601 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1602 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1603 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1604 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1605 dnl By default, look in $includedir and $libdir.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1606 use_additional=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1607 AC_LIB_WITH_FINAL_PREFIX([
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1608 eval additional_includedir=\"$includedir\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1609 eval additional_libdir=\"$libdir\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1610 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1611 AC_ARG_WITH([lib$1-prefix],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1612 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1613 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1614 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1615 if test "X$withval" = "Xno"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1616 use_additional=no
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1617 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1618 if test "X$withval" = "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1619 AC_LIB_WITH_FINAL_PREFIX([
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1620 eval additional_includedir=\"$includedir\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1621 eval additional_libdir=\"$libdir\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1622 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1623 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1624 additional_includedir="$withval/include"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1625 additional_libdir="$withval/lib"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1626 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1627 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1628 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1629 dnl Search the library and its dependencies in $additional_libdir and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1630 dnl $LDFLAGS. Using breadth-first-seach.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1631 LIB[]NAME=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1632 LTLIB[]NAME=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1633 INC[]NAME=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1634 rpathdirs=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1635 ltrpathdirs=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1636 names_already_handled=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1637 names_next_round='$1 $2'
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1638 while test -n "$names_next_round"; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1639 names_this_round="$names_next_round"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1640 names_next_round=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1641 for name in $names_this_round; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1642 already_handled=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1643 for n in $names_already_handled; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1644 if test "$n" = "$name"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1645 already_handled=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1646 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1647 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1648 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1649 if test -z "$already_handled"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1650 names_already_handled="$names_already_handled $name"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1651 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1652 dnl or AC_LIB_HAVE_LINKFLAGS call.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1653 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1654 eval value=\"\$HAVE_LIB$uppername\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1655 if test -n "$value"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1656 if test "$value" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1657 eval value=\"\$LIB$uppername\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1658 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1659 eval value=\"\$LTLIB$uppername\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1660 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1661 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1662 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1663 dnl that this library doesn't exist. So just drop it.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1664 :
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1665 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1666 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1667 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1668 dnl and the already constructed $LIBNAME/$LTLIBNAME.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1669 found_dir=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1670 found_la=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1671 found_so=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1672 found_a=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1673 if test $use_additional = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1674 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1675 found_dir="$additional_libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1676 found_so="$additional_libdir/lib$name.$shlibext"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1677 if test -f "$additional_libdir/lib$name.la"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1678 found_la="$additional_libdir/lib$name.la"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1679 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1680 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1681 if test -f "$additional_libdir/lib$name.$libext"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1682 found_dir="$additional_libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1683 found_a="$additional_libdir/lib$name.$libext"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1684 if test -f "$additional_libdir/lib$name.la"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1685 found_la="$additional_libdir/lib$name.la"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1686 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1687 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1688 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1689 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1690 if test "X$found_dir" = "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1691 for x in $LDFLAGS $LTLIB[]NAME; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1692 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1693 case "$x" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1694 -L*)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1695 dir=`echo "X$x" | sed -e 's/^X-L//'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1696 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1697 found_dir="$dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1698 found_so="$dir/lib$name.$shlibext"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1699 if test -f "$dir/lib$name.la"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1700 found_la="$dir/lib$name.la"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1701 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1702 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1703 if test -f "$dir/lib$name.$libext"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1704 found_dir="$dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1705 found_a="$dir/lib$name.$libext"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1706 if test -f "$dir/lib$name.la"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1707 found_la="$dir/lib$name.la"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1708 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1709 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1710 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1711 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1712 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1713 if test "X$found_dir" != "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1714 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1715 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1716 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1717 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1718 if test "X$found_dir" != "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1719 dnl Found the library.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1720 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1721 if test "X$found_so" != "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1722 dnl Linking with a shared library. We attempt to hardcode its
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1723 dnl directory into the executable's runpath, unless it's the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1724 dnl standard /usr/lib.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1725 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1726 dnl No hardcoding is needed.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1727 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1728 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1729 dnl Use an explicit option to hardcode DIR into the resulting
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1730 dnl binary.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1731 dnl Potentially add DIR to ltrpathdirs.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1732 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1733 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1734 for x in $ltrpathdirs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1735 if test "X$x" = "X$found_dir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1736 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1737 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1738 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1739 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1740 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1741 ltrpathdirs="$ltrpathdirs $found_dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1742 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1743 dnl The hardcoding into $LIBNAME is system dependent.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1744 if test "$hardcode_direct" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1745 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1746 dnl resulting binary.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1747 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1748 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1749 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1750 dnl Use an explicit option to hardcode DIR into the resulting
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1751 dnl binary.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1752 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1753 dnl Potentially add DIR to rpathdirs.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1754 dnl The rpathdirs will be appended to $LIBNAME at the end.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1755 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1756 for x in $rpathdirs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1757 if test "X$x" = "X$found_dir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1758 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1759 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1760 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1761 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1762 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1763 rpathdirs="$rpathdirs $found_dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1764 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1765 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1766 dnl Rely on "-L$found_dir".
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1767 dnl But don't add it if it's already contained in the LDFLAGS
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1768 dnl or the already constructed $LIBNAME
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1769 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1770 for x in $LDFLAGS $LIB[]NAME; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1771 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1772 if test "X$x" = "X-L$found_dir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1773 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1774 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1775 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1776 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1777 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1778 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1779 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1780 if test "$hardcode_minus_L" != no; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1781 dnl FIXME: Not sure whether we should use
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1782 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1783 dnl here.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1784 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1785 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1786 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1787 dnl here, because this doesn't fit in flags passed to the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1788 dnl compiler. So give up. No hardcoding. This affects only
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1789 dnl very old systems.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1790 dnl FIXME: Not sure whether we should use
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1791 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1792 dnl here.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1793 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1794 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1795 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1796 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1797 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1798 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1799 if test "X$found_a" != "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1800 dnl Linking with a static library.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1801 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1802 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1803 dnl We shouldn't come here, but anyway it's good to have a
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1804 dnl fallback.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1805 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1806 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1807 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1808 dnl Assume the include files are nearby.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1809 additional_includedir=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1810 case "$found_dir" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1811 */lib | */lib/)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1812 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1813 additional_includedir="$basedir/include"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1814 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1815 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1816 if test "X$additional_includedir" != "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1817 dnl Potentially add $additional_includedir to $INCNAME.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1818 dnl But don't add it
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1819 dnl 1. if it's the standard /usr/include,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1820 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1821 dnl 3. if it's already present in $CPPFLAGS or the already
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1822 dnl constructed $INCNAME,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1823 dnl 4. if it doesn't exist as a directory.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1824 if test "X$additional_includedir" != "X/usr/include"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1825 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1826 if test "X$additional_includedir" = "X/usr/local/include"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1827 if test -n "$GCC"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1828 case $host_os in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1829 linux*) haveit=yes;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1830 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1831 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1832 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1833 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1834 for x in $CPPFLAGS $INC[]NAME; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1835 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1836 if test "X$x" = "X-I$additional_includedir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1837 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1838 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1839 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1840 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1841 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1842 if test -d "$additional_includedir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1843 dnl Really add $additional_includedir to $INCNAME.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1844 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1845 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1846 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1847 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1848 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1849 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1850 dnl Look for dependencies.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1851 if test -n "$found_la"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1852 dnl Read the .la file. It defines the variables
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1853 dnl dlname, library_names, old_library, dependency_libs, current,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1854 dnl age, revision, installed, dlopen, dlpreopen, libdir.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1855 save_libdir="$libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1856 case "$found_la" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1857 */* | *\\*) . "$found_la" ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1858 *) . "./$found_la" ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1859 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1860 libdir="$save_libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1861 dnl We use only dependency_libs.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1862 for dep in $dependency_libs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1863 case "$dep" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1864 -L*)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1865 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1866 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1867 dnl But don't add it
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1868 dnl 1. if it's the standard /usr/lib,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1869 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1870 dnl 3. if it's already present in $LDFLAGS or the already
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1871 dnl constructed $LIBNAME,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1872 dnl 4. if it doesn't exist as a directory.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1873 if test "X$additional_libdir" != "X/usr/lib"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1874 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1875 if test "X$additional_libdir" = "X/usr/local/lib"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1876 if test -n "$GCC"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1877 case $host_os in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1878 linux*) haveit=yes;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1879 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1880 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1881 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1882 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1883 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1884 for x in $LDFLAGS $LIB[]NAME; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1885 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1886 if test "X$x" = "X-L$additional_libdir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1887 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1888 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1889 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1890 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1891 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1892 if test -d "$additional_libdir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1893 dnl Really add $additional_libdir to $LIBNAME.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1894 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1895 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1896 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1897 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1898 for x in $LDFLAGS $LTLIB[]NAME; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1899 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1900 if test "X$x" = "X-L$additional_libdir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1901 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1902 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1903 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1904 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1905 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1906 if test -d "$additional_libdir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1907 dnl Really add $additional_libdir to $LTLIBNAME.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1908 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1909 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1910 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1911 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1912 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1913 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1914 -R*)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1915 dir=`echo "X$dep" | sed -e 's/^X-R//'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1916 if test "$enable_rpath" != no; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1917 dnl Potentially add DIR to rpathdirs.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1918 dnl The rpathdirs will be appended to $LIBNAME at the end.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1919 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1920 for x in $rpathdirs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1921 if test "X$x" = "X$dir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1922 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1923 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1924 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1925 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1926 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1927 rpathdirs="$rpathdirs $dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1928 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1929 dnl Potentially add DIR to ltrpathdirs.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1930 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1931 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1932 for x in $ltrpathdirs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1933 if test "X$x" = "X$dir"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1934 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1935 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1936 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1937 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1938 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1939 ltrpathdirs="$ltrpathdirs $dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1940 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1941 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1942 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1943 -l*)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1944 dnl Handle this in the next round.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1945 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1946 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1947 *.la)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1948 dnl Handle this in the next round. Throw away the .la's
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1949 dnl directory; it is already contained in a preceding -L
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1950 dnl option.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1951 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1952 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1953 *)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1954 dnl Most likely an immediate library name.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1955 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1956 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1957 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1958 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1959 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1960 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1961 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1962 dnl Didn't find the library; assume it is in the system directories
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1963 dnl known to the linker and runtime loader. (All the system
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1964 dnl directories known to the linker should also be known to the
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1965 dnl runtime loader, otherwise the system is severely misconfigured.)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1966 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1967 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1968 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1969 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1970 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1971 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1972 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1973 if test "X$rpathdirs" != "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1974 if test -n "$hardcode_libdir_separator"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1975 dnl Weird platform: only the last -rpath option counts, the user must
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1976 dnl pass all path elements in one option. We can arrange that for a
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1977 dnl single library, but not when more than one $LIBNAMEs are used.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1978 alldirs=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1979 for found_dir in $rpathdirs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1980 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1981 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1982 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1983 acl_save_libdir="$libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1984 libdir="$alldirs"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1985 eval flag=\"$hardcode_libdir_flag_spec\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1986 libdir="$acl_save_libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1987 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1988 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1989 dnl The -rpath options are cumulative.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1990 for found_dir in $rpathdirs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1991 acl_save_libdir="$libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1992 libdir="$found_dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1993 eval flag=\"$hardcode_libdir_flag_spec\"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1994 libdir="$acl_save_libdir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1995 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1996 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1997 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1998 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1999 if test "X$ltrpathdirs" != "X"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2000 dnl When using libtool, the option that works for both libraries and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2001 dnl executables is -R. The -R options are cumulative.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2002 for found_dir in $ltrpathdirs; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2003 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2004 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2005 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2006 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2007
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2008 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2009 dnl unless already present in VAR.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2010 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2011 dnl contains two or three consecutive elements that belong together.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2012 AC_DEFUN([AC_LIB_APPENDTOVAR],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2013 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2014 for element in [$2]; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2015 haveit=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2016 for x in $[$1]; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2017 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2018 if test "X$x" = "X$element"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2019 haveit=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2020 break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2021 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2022 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2023 if test -z "$haveit"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2024 [$1]="${[$1]}${[$1]:+ }$element"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2025 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2026 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2027 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2028
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2029 # lib-prefix.m4 serial 1 (gettext-0.11)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2030 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2031 dnl This file is free software, distributed under the terms of the GNU
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2032 dnl General Public License. As a special exception to the GNU General
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2033 dnl Public License, this file may be distributed as part of a program
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2034 dnl that contains a configuration script generated by Autoconf, under
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2035 dnl the same distribution terms as the rest of that program.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2036
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2037 dnl From Bruno Haible.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2038
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2039 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2040 dnl to access previously installed libraries. The basic assumption is that
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2041 dnl a user will want packages to use other packages he previously installed
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2042 dnl with the same --prefix option.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2043 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2044 dnl libraries, but is otherwise very convenient.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2045 AC_DEFUN([AC_LIB_PREFIX],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2046 [
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2047 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2048 AC_REQUIRE([AC_PROG_CC])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2049 AC_REQUIRE([AC_CANONICAL_HOST])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2050 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2051 dnl By default, look in $includedir and $libdir.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2052 use_additional=yes
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2053 AC_LIB_WITH_FINAL_PREFIX([
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2054 eval additional_includedir=\"$includedir\"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2055 eval additional_libdir=\"$libdir\"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2056 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2057 AC_ARG_WITH([lib-prefix],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2058 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2059 --without-lib-prefix don't search for libraries in includedir and libdir],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2060 [
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2061 if test "X$withval" = "Xno"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2062 use_additional=no
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2063 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2064 if test "X$withval" = "X"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2065 AC_LIB_WITH_FINAL_PREFIX([
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2066 eval additional_includedir=\"$includedir\"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2067 eval additional_libdir=\"$libdir\"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2068 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2069 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2070 additional_includedir="$withval/include"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2071 additional_libdir="$withval/lib"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2072 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2073 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2074 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2075 if test $use_additional = yes; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2076 dnl Potentially add $additional_includedir to $CPPFLAGS.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2077 dnl But don't add it
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2078 dnl 1. if it's the standard /usr/include,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2079 dnl 2. if it's already present in $CPPFLAGS,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2080 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2081 dnl 4. if it doesn't exist as a directory.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2082 if test "X$additional_includedir" != "X/usr/include"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2083 haveit=
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2084 for x in $CPPFLAGS; do
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2085 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2086 if test "X$x" = "X-I$additional_includedir"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2087 haveit=yes
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2088 break
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2089 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2090 done
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2091 if test -z "$haveit"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2092 if test "X$additional_includedir" = "X/usr/local/include"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2093 if test -n "$GCC"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2094 case $host_os in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2095 linux*) haveit=yes;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2096 esac
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2097 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2098 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2099 if test -z "$haveit"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2100 if test -d "$additional_includedir"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2101 dnl Really add $additional_includedir to $CPPFLAGS.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2102 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2103 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2104 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2105 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2106 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2107 dnl Potentially add $additional_libdir to $LDFLAGS.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2108 dnl But don't add it
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2109 dnl 1. if it's the standard /usr/lib,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2110 dnl 2. if it's already present in $LDFLAGS,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2111 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2112 dnl 4. if it doesn't exist as a directory.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2113 if test "X$additional_libdir" != "X/usr/lib"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2114 haveit=
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2115 for x in $LDFLAGS; do
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2116 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2117 if test "X$x" = "X-L$additional_libdir"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2118 haveit=yes
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2119 break
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2120 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2121 done
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2122 if test -z "$haveit"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2123 if test "X$additional_libdir" = "X/usr/local/lib"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2124 if test -n "$GCC"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2125 case $host_os in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2126 linux*) haveit=yes;;
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2127 esac
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2128 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2129 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2130 if test -z "$haveit"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2131 if test -d "$additional_libdir"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2132 dnl Really add $additional_libdir to $LDFLAGS.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2133 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2134 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2135 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2136 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2137 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2138 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2139 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2140
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2141 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2142 dnl acl_final_exec_prefix, containing the values to which $prefix and
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2143 dnl $exec_prefix will expand at the end of the configure script.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2144 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2145 [
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2146 dnl Unfortunately, prefix and exec_prefix get only finally determined
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2147 dnl at the end of configure.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2148 if test "X$prefix" = "XNONE"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2149 acl_final_prefix="$ac_default_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2150 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2151 acl_final_prefix="$prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2152 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2153 if test "X$exec_prefix" = "XNONE"; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2154 acl_final_exec_prefix='${prefix}'
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2155 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2156 acl_final_exec_prefix="$exec_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2157 fi
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2158 acl_save_prefix="$prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2159 prefix="$acl_final_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2160 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2161 prefix="$acl_save_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2162 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2163
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2164 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2165 dnl variables prefix and exec_prefix bound to the values they will have
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2166 dnl at the end of the configure script.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2167 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2168 [
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2169 acl_save_prefix="$prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2170 prefix="$acl_final_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2171 acl_save_exec_prefix="$exec_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2172 exec_prefix="$acl_final_exec_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2173 $1
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2174 exec_prefix="$acl_save_exec_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2175 prefix="$acl_save_prefix"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2176 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
2177
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2178 # lib-ld.m4 serial 1 (gettext-0.11)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2179 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2180 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2181 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2182 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2183 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2184 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2185
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2186 dnl Subroutines of libtool.m4,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2187 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2188 dnl with libtool.m4.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2189
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2190 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2191 AC_DEFUN([AC_LIB_PROG_LD_GNU],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2192 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2193 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2194 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2195 acl_cv_prog_gnu_ld=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2196 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2197 acl_cv_prog_gnu_ld=no
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2198 fi])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2199 with_gnu_ld=$acl_cv_prog_gnu_ld
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2200 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2201
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2202 dnl From libtool-1.4. Sets the variable LD.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2203 AC_DEFUN([AC_LIB_PROG_LD],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2204 [AC_ARG_WITH(gnu-ld,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2205 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2206 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2207 AC_REQUIRE([AC_PROG_CC])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2208 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2209 ac_prog=ld
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2210 if test "$GCC" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2211 # Check if gcc -print-prog-name=ld gives a path.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2212 AC_MSG_CHECKING([for ld used by GCC])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2213 case $host in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2214 *-*-mingw*)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2215 # gcc leaves a trailing carriage return which upsets mingw
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2216 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2217 *)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2218 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2219 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2220 case $ac_prog in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2221 # Accept absolute paths.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2222 [[\\/]* | [A-Za-z]:[\\/]*)]
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2223 [re_direlt='/[^/][^/]*/\.\./']
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2224 # Canonicalize the path of ld
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2225 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2226 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2227 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2228 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2229 test -z "$LD" && LD="$ac_prog"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2230 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2231 "")
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2232 # If it fails, then pretend we aren't using GCC.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2233 ac_prog=ld
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2234 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2235 *)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2236 # If it is relative, then search for the first ld in PATH.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2237 with_gnu_ld=unknown
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2238 ;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2239 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2240 elif test "$with_gnu_ld" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2241 AC_MSG_CHECKING([for GNU ld])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2242 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2243 AC_MSG_CHECKING([for non-GNU ld])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2244 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2245 AC_CACHE_VAL(acl_cv_path_LD,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2246 [if test -z "$LD"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2247 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2248 for ac_dir in $PATH; do
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2249 test -z "$ac_dir" && ac_dir=.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2250 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2251 acl_cv_path_LD="$ac_dir/$ac_prog"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2252 # Check to see if the program is GNU ld. I'd rather use --version,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2253 # but apparently some GNU ld's only accept -v.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2254 # Break only if it was the GNU/non-GNU ld that we prefer.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2255 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2256 test "$with_gnu_ld" != no && break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2257 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2258 test "$with_gnu_ld" != yes && break
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2259 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2260 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2261 done
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2262 IFS="$ac_save_ifs"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2263 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2264 acl_cv_path_LD="$LD" # Let the user override the test with a path.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2265 fi])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2266 LD="$acl_cv_path_LD"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2267 if test -n "$LD"; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2268 AC_MSG_RESULT($LD)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2269 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2270 AC_MSG_RESULT(no)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2271 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2272 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2273 AC_LIB_PROG_LD_GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2274 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2275
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2276 # iconv.m4 serial AM4 (gettext-0.11.3)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2277 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2278 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2279 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2280 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2281 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2282 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2283
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2284 dnl From Bruno Haible.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2285
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2286 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2287 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2288 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2289 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2290 AC_REQUIRE([AC_LIB_RPATH])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2291
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2292 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2293 dnl accordingly.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2294 AC_LIB_LINKFLAGS_BODY([iconv])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2295 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2296
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2297 AC_DEFUN([AM_ICONV_LINK],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2298 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2299 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2300 dnl those with the standalone portable GNU libiconv installed).
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2301
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2302 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2303 dnl accordingly.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2304 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2305
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2306 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2307 dnl because if the user has installed libiconv and not disabled its use
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2308 dnl via --without-libiconv-prefix, he wants to use it. The first
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2309 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2310 am_save_CPPFLAGS="$CPPFLAGS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2311 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2312
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2313 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2314 am_cv_func_iconv="no, consider installing GNU libiconv"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2315 am_cv_lib_iconv=no
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2316 AC_TRY_LINK([#include <stdlib.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2317 #include <iconv.h>],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2318 [iconv_t cd = iconv_open("","");
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2319 iconv(cd,NULL,NULL,NULL,NULL);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2320 iconv_close(cd);],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2321 am_cv_func_iconv=yes)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2322 if test "$am_cv_func_iconv" != yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2323 am_save_LIBS="$LIBS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2324 LIBS="$LIBS $LIBICONV"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2325 AC_TRY_LINK([#include <stdlib.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2326 #include <iconv.h>],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2327 [iconv_t cd = iconv_open("","");
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2328 iconv(cd,NULL,NULL,NULL,NULL);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2329 iconv_close(cd);],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2330 am_cv_lib_iconv=yes
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2331 am_cv_func_iconv=yes)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2332 LIBS="$am_save_LIBS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2333 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2334 ])
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2335 if test "$am_cv_func_iconv" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2336 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2337 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2338 if test "$am_cv_lib_iconv" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2339 AC_MSG_CHECKING([how to link with libiconv])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2340 AC_MSG_RESULT([$LIBICONV])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2341 else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2342 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2343 dnl either.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2344 CPPFLAGS="$am_save_CPPFLAGS"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2345 LIBICONV=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2346 LTLIBICONV=
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2347 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2348 AC_SUBST(LIBICONV)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2349 AC_SUBST(LTLIBICONV)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2350 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2351
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2352 AC_DEFUN([AM_ICONV],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2353 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2354 AM_ICONV_LINK
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2355 if test "$am_cv_func_iconv" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2356 AC_MSG_CHECKING([for iconv declaration])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2357 AC_CACHE_VAL(am_cv_proto_iconv, [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2358 AC_TRY_COMPILE([
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2359 #include <stdlib.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2360 #include <iconv.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2361 extern
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2362 #ifdef __cplusplus
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2363 "C"
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2364 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2365 #if defined(__STDC__) || defined(__cplusplus)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2366 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2367 #else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2368 size_t iconv();
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2369 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2370 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2371 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2372 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2373 AC_MSG_RESULT([$]{ac_t:-
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2374 }[$]am_cv_proto_iconv)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2375 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2376 [Define as const if the declaration of iconv() needs const.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2377 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2378 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2379
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2380 # progtest.m4 serial 2 (gettext-0.10.40)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2381 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2382 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2383 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2384 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2385 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2386 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2387 dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2388 dnl This file can can be used in projects which are not available under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2389 dnl the GNU General Public License or the GNU Library General Public
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2390 dnl License but which still want to provide support for the GNU gettext
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2391 dnl functionality.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2392 dnl Please note that the actual code of the GNU gettext library is covered
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2393 dnl by the GNU Library General Public License, and the rest of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2394 dnl gettext package package is covered by the GNU General Public License.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2395 dnl They are *not* in the public domain.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2396
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2397 dnl Authors:
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2398 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2399
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2400 # Search path for a program which passes the given test.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2401
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2402 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2403 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2404 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2405 [# Extract the first word of "$2", so it can be a program name with args.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2406 set dummy $2; ac_word=[$]2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2407 AC_MSG_CHECKING([for $ac_word])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2408 AC_CACHE_VAL(ac_cv_path_$1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2409 [case "[$]$1" in
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2410 /*)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2411 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2412 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2413 *)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2414 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2415 for ac_dir in ifelse([$5], , $PATH, [$5]); do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2416 test -z "$ac_dir" && ac_dir=.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2417 if test -f $ac_dir/$ac_word; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2418 if [$3]; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2419 ac_cv_path_$1="$ac_dir/$ac_word"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2420 break
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2421 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2422 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2423 done
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2424 IFS="$ac_save_ifs"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2425 dnl If no 4th arg is given, leave the cache variable unset,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2426 dnl so AC_PATH_PROGS will keep looking.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2427 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2428 ])dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2429 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2430 esac])dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2431 $1="$ac_cv_path_$1"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2432 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2433 AC_MSG_RESULT([$]$1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2434 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2435 AC_MSG_RESULT(no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2436 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2437 AC_SUBST($1)dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2438 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2439
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2440 # isc-posix.m4 serial 2 (gettext-0.11.2)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2441 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2442 dnl This file is free software, distributed under the terms of the GNU
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2443 dnl General Public License. As a special exception to the GNU General
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2444 dnl Public License, this file may be distributed as part of a program
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2445 dnl that contains a configuration script generated by Autoconf, under
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2446 dnl the same distribution terms as the rest of that program.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2447
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2448 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2449
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2450 # This test replaces the one in autoconf.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2451 # Currently this macro should have the same name as the autoconf macro
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2452 # because gettext's gettext.m4 (distributed in the automake package)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2453 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2454 # give these diagnostics:
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2455 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2456 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2457
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2458 undefine([AC_ISC_POSIX])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2459
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2460 AC_DEFUN([AC_ISC_POSIX],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2461 [
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2462 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2463 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2464 ]
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2465 )
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
2466
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2467 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2468 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2469 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2470 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2471 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2472 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2473 dnl the same distribution terms as the rest of that program.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2474
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2475 # Test for the GNU C Library, version 2.1 or newer.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2476 # From Bruno Haible.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2477
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2478 AC_DEFUN([jm_GLIBC21],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2479 [
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2480 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2481 ac_cv_gnu_library_2_1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2482 [AC_EGREP_CPP([Lucky GNU user],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2483 [
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2484 #include <features.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2485 #ifdef __GNU_LIBRARY__
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2486 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2487 Lucky GNU user
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2488 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2489 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2490 ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2491 ac_cv_gnu_library_2_1=yes,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2492 ac_cv_gnu_library_2_1=no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2493 ]
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2494 )
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2495 AC_SUBST(GLIBC21)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2496 GLIBC21="$ac_cv_gnu_library_2_1"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2497 ]
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2498 )
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2499
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2500 # intdiv0.m4 serial 1 (gettext-0.11.3)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2501 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2502 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2503 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2504 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2505 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2506 dnl the same distribution terms as the rest of that program.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2507
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2508 dnl From Bruno Haible.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2509
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2510 AC_DEFUN([gt_INTDIV0],
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2511 [
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2512 AC_REQUIRE([AC_PROG_CC])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2513 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2514
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2515 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2516 gt_cv_int_divbyzero_sigfpe,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2517 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2518 AC_TRY_RUN([
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2519 #include <stdlib.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2520 #include <signal.h>
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2521
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2522 static void
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2523 #ifdef __cplusplus
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2524 sigfpe_handler (int sig)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2525 #else
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2526 sigfpe_handler (sig) int sig;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2527 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2528 {
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2529 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2530 exit (sig != SIGFPE);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2531 }
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2532
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2533 int x = 1;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2534 int y = 0;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2535 int z;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2536 int nan;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2537
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2538 int main ()
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2539 {
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2540 signal (SIGFPE, sigfpe_handler);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2541 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2542 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2543 signal (SIGTRAP, sigfpe_handler);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2544 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2545 /* Linux/SPARC yields signal SIGILL. */
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2546 #if defined (__sparc__) && defined (__linux__)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2547 signal (SIGILL, sigfpe_handler);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2548 #endif
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2549
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2550 z = x / y;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2551 nan = y / y;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2552 exit (1);
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2553 }
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2554 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2555 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2556 # Guess based on the CPU.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2557 case "$host_cpu" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2558 alpha* | i[34567]86 | m68k | s390*)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2559 gt_cv_int_divbyzero_sigfpe="guessing yes";;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2560 *)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2561 gt_cv_int_divbyzero_sigfpe="guessing no";;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2562 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2563 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2564 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2565 case "$gt_cv_int_divbyzero_sigfpe" in
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2566 *yes) value=1;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2567 *) value=0;;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2568 esac
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2569 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2570 [Define if integer division by zero raises signal SIGFPE.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2571 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2572
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2573 # uintmax_t.m4 serial 6 (gettext-0.11)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2574 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2575 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2576 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2577 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2578 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2579 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2580
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2581 dnl From Paul Eggert.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2582
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2583 AC_PREREQ(2.13)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2584
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2585 # Define uintmax_t to `unsigned long' or `unsigned long long'
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2586 # if <inttypes.h> does not exist.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2587
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2588 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2589 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2590 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2591 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2592 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2593 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2594 test $ac_cv_type_unsigned_long_long = yes \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2595 && ac_type='unsigned long long' \
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2596 || ac_type='unsigned long'
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2597 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2598 [Define to unsigned long or unsigned long long
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2599 if <inttypes.h> and <stdint.h> don't define.])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2600 fi
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2601 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2602
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2603 # inttypes_h.m4 serial 4 (gettext-0.11.4)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2604 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2605 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2606 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2607 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2608 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2609 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2610
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2611 dnl From Paul Eggert.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2612
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2613 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2614 # doesn't clash with <sys/types.h>, and declares uintmax_t.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2615
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2616 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2617 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2618 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2619 [AC_TRY_COMPILE(
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2620 [#include <sys/types.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2621 #include <inttypes.h>],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2622 [uintmax_t i = (uintmax_t) -1;],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2623 jm_ac_cv_header_inttypes_h=yes,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2624 jm_ac_cv_header_inttypes_h=no)])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2625 if test $jm_ac_cv_header_inttypes_h = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2626 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2627 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2628 and declares uintmax_t. ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2629 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2630 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2631
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2632 # stdint_h.m4 serial 2 (gettext-0.11.4)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2633 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2634 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2635 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2636 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2637 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2638 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2639
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2640 dnl From Paul Eggert.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2641
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2642 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2643 # doesn't clash with <sys/types.h>, and declares uintmax_t.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2644
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2645 AC_DEFUN([jm_AC_HEADER_STDINT_H],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2646 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2647 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2648 [AC_TRY_COMPILE(
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2649 [#include <sys/types.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2650 #include <stdint.h>],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2651 [uintmax_t i = (uintmax_t) -1;],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2652 jm_ac_cv_header_stdint_h=yes,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2653 jm_ac_cv_header_stdint_h=no)])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2654 if test $jm_ac_cv_header_stdint_h = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2655 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2656 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2657 and declares uintmax_t. ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2658 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2659 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2660
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2661 # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2662 dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2663 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2664 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2665 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2666 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2667 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2668
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2669 dnl From Paul Eggert.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2670
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2671 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2672 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2673 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2674 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2675 [unsigned long long ullmax = (unsigned long long) -1;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2676 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2677 ac_cv_type_unsigned_long_long=yes,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2678 ac_cv_type_unsigned_long_long=no)])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2679 if test $ac_cv_type_unsigned_long_long = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2680 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2681 [Define if you have the unsigned long long type.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2682 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2683 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2684
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2685 # inttypes.m4 serial 1 (gettext-0.11.4)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2686 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2687 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2688 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2689 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2690 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2691 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2692
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2693 dnl From Paul Eggert.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2694
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2695 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2696 # <sys/types.h>.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2697
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2698 AC_DEFUN([gt_HEADER_INTTYPES_H],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2699 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2700 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2701 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2702 AC_TRY_COMPILE(
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2703 [#include <sys/types.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2704 #include <inttypes.h>],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2705 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2706 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2707 if test $gt_cv_header_inttypes_h = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2708 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2709 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2710 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2711 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2712
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2713 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2714 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2715 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2716 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2717 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2718 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2719 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2720
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2721 dnl From Bruno Haible.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2722
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2723 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2724 # macros to non-string values. This is the case on AIX 4.3.3.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2725
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2726 AC_DEFUN([gt_INTTYPES_PRI],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2727 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2728 AC_REQUIRE([gt_HEADER_INTTYPES_H])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2729 if test $gt_cv_header_inttypes_h = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2730 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2731 gt_cv_inttypes_pri_broken,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2732 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2733 AC_TRY_COMPILE([#include <inttypes.h>
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2734 #ifdef PRId32
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2735 char *p = PRId32;
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2736 #endif
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2737 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2738 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2739 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2740 if test "$gt_cv_inttypes_pri_broken" = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2741 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2742 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2743 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2744 ])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2745
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2746 # codeset.m4 serial AM1 (gettext-0.10.40)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2747 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2748 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2749 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2750 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2751 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2752 dnl the same distribution terms as the rest of that program.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2753
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2754 dnl From Bruno Haible.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2755
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2756 AC_DEFUN([AM_LANGINFO_CODESET],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2757 [
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2758 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2759 [AC_TRY_LINK([#include <langinfo.h>],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2760 [char* cs = nl_langinfo(CODESET);],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2761 am_cv_langinfo_codeset=yes,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2762 am_cv_langinfo_codeset=no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2763 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2764 if test $am_cv_langinfo_codeset = yes; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2765 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2766 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2767 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2768 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2769
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2770 # lcmessage.m4 serial 3 (gettext-0.11.3)
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2771 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2772 dnl This file is free software, distributed under the terms of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2773 dnl General Public License. As a special exception to the GNU General
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2774 dnl Public License, this file may be distributed as part of a program
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2775 dnl that contains a configuration script generated by Autoconf, under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2776 dnl the same distribution terms as the rest of that program.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2777 dnl
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2778 dnl This file can can be used in projects which are not available under
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2779 dnl the GNU General Public License or the GNU Library General Public
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2780 dnl License but which still want to provide support for the GNU gettext
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2781 dnl functionality.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2782 dnl Please note that the actual code of the GNU gettext library is covered
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2783 dnl by the GNU Library General Public License, and the rest of the GNU
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2784 dnl gettext package package is covered by the GNU General Public License.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2785 dnl They are *not* in the public domain.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2786
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2787 dnl Authors:
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2788 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2789
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2790 # Check whether LC_MESSAGES is available in <locale.h>.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2791
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2792 AC_DEFUN([AM_LC_MESSAGES],
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2793 [
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2794 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2795 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2796 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2797 if test $am_cv_val_LC_MESSAGES = yes; then
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2798 AC_DEFINE(HAVE_LC_MESSAGES, 1,
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2799 [Define if your <locale.h> file defines LC_MESSAGES.])
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2800 fi
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
2801 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2802