annotate aclocal.m4 @ 118:ed3c66c2aced

Updated Polish translation by GNOME PL Team <translators@gnome.pl>
author chyla
date Mon, 10 Mar 2003 19:08:47 +0000
parents 6df043359b41
children 5c952c5cb438
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
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
158
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
159 # serial 1
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
160
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
161 AC_DEFUN([AM_C_PROTOTYPES],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
162 [AC_REQUIRE([AM_PROG_CC_STDC])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
163 AC_REQUIRE([AC_PROG_CPP])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
164 AC_MSG_CHECKING([for function prototypes])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
165 if test "$am_cv_prog_cc_stdc" != no; then
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
166 AC_MSG_RESULT(yes)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
167 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
168 U= ANSI2KNR=
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
169 else
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
170 AC_MSG_RESULT(no)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
171 U=_ ANSI2KNR=./ansi2knr
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
172 # Ensure some checks needed by ansi2knr itself.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
173 AC_HEADER_STDC
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
174 AC_CHECK_HEADERS(string.h)
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
175 fi
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
176 AC_SUBST(U)dnl
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
177 AC_SUBST(ANSI2KNR)dnl
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
178 ])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
179
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
180
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
181 # serial 1
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
182
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
183 # @defmac AC_PROG_CC_STDC
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
184 # @maindex PROG_CC_STDC
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
185 # @ovindex CC
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
186 # 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
187 # to output variable @code{CC} to make it so. This macro tries various
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
188 # options that select ANSI C on some system or another. It considers the
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
189 # compiler to be in ANSI C mode if it handles function prototypes correctly.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
190 #
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
191 # If you use this macro, you should check after calling it whether the C
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
192 # compiler has been set to accept ANSI C; if not, the shell variable
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
193 # @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
194 # 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
195 # program @code{ansi2knr}, which comes with Ghostscript.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
196 # @end defmac
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
197
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
198 AC_DEFUN([AM_PROG_CC_STDC],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
199 [AC_REQUIRE([AC_PROG_CC])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
200 AC_BEFORE([$0], [AC_C_INLINE])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
201 AC_BEFORE([$0], [AC_C_CONST])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
202 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
203 dnl a magic option to avoid problems with ANSI preprocessor commands
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
204 dnl like #elif.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
205 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
206 dnl circular dependency.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
207 dnl AC_BEFORE([$0], [AC_PROG_CPP])
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
208 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
209 AC_CACHE_VAL(am_cv_prog_cc_stdc,
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
210 [am_cv_prog_cc_stdc=no
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
211 ac_save_CC="$CC"
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
212 # Don't try gcc -ansi; that turns off useful extensions and
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
213 # breaks some systems' header files.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
214 # AIX -qlanglvl=ansi
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
215 # Ultrix and OSF/1 -std1
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
216 # HP-UX -Aa -D_HPUX_SOURCE
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
217 # SVR4 -Xc -D__EXTENSIONS__
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
218 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
219 do
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
220 CC="$ac_save_CC $ac_arg"
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
221 AC_TRY_COMPILE(
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
222 [#include <stdarg.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
223 #include <stdio.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
224 #include <sys/types.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
225 #include <sys/stat.h>
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
226 /* 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
227 struct buf { int x; };
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
228 FILE * (*rcsopen) (struct buf *, struct stat *, int);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
229 static char *e (p, i)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
230 char **p;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
231 int i;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
232 {
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
233 return p[i];
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
234 }
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
235 static char *f (char * (*g) (char **, int), char **p, ...)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
236 {
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
237 char *s;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
238 va_list v;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
239 va_start (v,p);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
240 s = g (p, va_arg (v,int));
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
241 va_end (v);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
242 return s;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
243 }
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
244 int test (int i, double x);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
245 struct s1 {int (*f) (int a);};
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
246 struct s2 {int (*f) (double a);};
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
247 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
248 int argc;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
249 char **argv;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
250 ], [
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
251 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
252 ],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
253 [am_cv_prog_cc_stdc="$ac_arg"; break])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
254 done
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
255 CC="$ac_save_CC"
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
256 ])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
257 if test -z "$am_cv_prog_cc_stdc"; then
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
258 AC_MSG_RESULT([none needed])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
259 else
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
260 AC_MSG_RESULT($am_cv_prog_cc_stdc)
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
261 fi
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
262 case "x$am_cv_prog_cc_stdc" in
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
263 x|xno) ;;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
264 *) CC="$CC $am_cv_prog_cc_stdc" ;;
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
265 esac
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
266 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
267
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
268 # Add --enable-maintainer-mode option to configure.
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
269 # From Jim Meyering
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
270
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
271 # serial 1
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
272
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
273 AC_DEFUN([AM_MAINTAINER_MODE],
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
274 [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
275 dnl maintainer-mode is disabled by default
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
276 AC_ARG_ENABLE(maintainer-mode,
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
277 [ --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
278 (and sometimes confusing) to the casual installer],
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
279 USE_MAINTAINER_MODE=$enableval,
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
280 USE_MAINTAINER_MODE=no)
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
281 AC_MSG_RESULT($USE_MAINTAINER_MODE)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
282 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
283 MAINT=$MAINTAINER_MODE_TRUE
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
284 AC_SUBST(MAINT)dnl
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
285 ]
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
286 )
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
287
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
288 # Define a conditional.
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
289
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
290 AC_DEFUN([AM_CONDITIONAL],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
291 [AC_SUBST($1_TRUE)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
292 AC_SUBST($1_FALSE)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
293 if $2; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
294 $1_TRUE=
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
295 $1_FALSE='#'
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
296 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
297 $1_TRUE='#'
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
298 $1_FALSE=
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
299 fi])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
300
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
301
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
302 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
303 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
304 dnl also defines GSTUFF_PKG_ERRORS on error
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
305 AC_DEFUN(PKG_CHECK_MODULES, [
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
306 succeeded=no
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
307
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
308 if test -z "$PKG_CONFIG"; then
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
309 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
310 fi
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
311
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
312 if test "$PKG_CONFIG" = "no" ; then
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
313 echo "*** The pkg-config script could not be found. Make sure it is"
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
314 echo "*** in your path, or set the PKG_CONFIG environment variable"
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
315 echo "*** to the full path to pkg-config."
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
316 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
317 else
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
318 PKG_CONFIG_MIN_VERSION=0.9.0
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
319 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
320 AC_MSG_CHECKING(for $2)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
321
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
322 if $PKG_CONFIG --exists "$2" ; then
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
323 AC_MSG_RESULT(yes)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
324 succeeded=yes
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
325
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
326 AC_MSG_CHECKING($1_CFLAGS)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
327 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
328 AC_MSG_RESULT($$1_CFLAGS)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
329
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
330 AC_MSG_CHECKING($1_LIBS)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
331 $1_LIBS=`$PKG_CONFIG --libs "$2"`
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
332 AC_MSG_RESULT($$1_LIBS)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
333 else
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
334 $1_CFLAGS=""
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
335 $1_LIBS=""
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
336 ## If we have a custom action on failure, don't print errors, but
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
337 ## do set a variable so people can do so.
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
338 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
339 ifelse([$4], ,echo $$1_PKG_ERRORS,)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
340 fi
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
341
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
342 AC_SUBST($1_CFLAGS)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
343 AC_SUBST($1_LIBS)
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
344 else
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
345 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
346 echo "*** See http://www.freedesktop.org/software/pkgconfig"
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
347 fi
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
348 fi
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
349
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
350 if test $succeeded = yes; then
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
351 ifelse([$3], , :, [$3])
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
352 else
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
353 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])
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
354 fi
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
355 ])
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
356
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
357
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
358
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
359 # Configure paths for GLIB
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
360 # Owen Taylor 97-11-3
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
361
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
362 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
363 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
364 dnl gthread is specified in MODULES, pass to glib-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
365 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
366 AC_DEFUN(AM_PATH_GLIB,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
367 [dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
368 dnl Get the cflags and libraries from the glib-config script
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
369 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
370 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
371 glib_config_prefix="$withval", glib_config_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
372 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
373 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
374 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
375 , enable_glibtest=yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
376
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
377 if test x$glib_config_exec_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
378 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
379 if test x${GLIB_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
380 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
381 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
382 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
383 if test x$glib_config_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
384 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
385 if test x${GLIB_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
386 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
387 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
388 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
389
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
390 for module in . $4
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
391 do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
392 case "$module" in
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
393 gmodule)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
394 glib_config_args="$glib_config_args gmodule"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
395 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
396 gthread)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
397 glib_config_args="$glib_config_args gthread"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
398 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
399 esac
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
400 done
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
401
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
402 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
403 min_glib_version=ifelse([$1], ,0.99.7,$1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
404 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
405 no_glib=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
406 if test "$GLIB_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
407 no_glib=yes
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
408 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
409 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
410 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
411 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
412 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
413 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
414 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
415 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
416 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
417 if test "x$enable_glibtest" = "xyes" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
418 ac_save_CFLAGS="$CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
419 ac_save_LIBS="$LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
420 CFLAGS="$CFLAGS $GLIB_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
421 LIBS="$GLIB_LIBS $LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
422 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
423 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
424 dnl checks the results of glib-config to some extent
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
425 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
426 rm -f conf.glibtest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
427 AC_TRY_RUN([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
428 #include <glib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
429 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
430 #include <stdlib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
431
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
432 int
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
433 main ()
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
434 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
435 int major, minor, micro;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
436 char *tmp_version;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
437
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
438 system ("touch conf.glibtest");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
439
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
440 /* HP/UX 9 (%@#!) writes to sscanf strings */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
441 tmp_version = g_strdup("$min_glib_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
442 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
443 printf("%s, bad version string\n", "$min_glib_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
444 exit(1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
445 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
446
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
447 if ((glib_major_version != $glib_config_major_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
448 (glib_minor_version != $glib_config_minor_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
449 (glib_micro_version != $glib_config_micro_version))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
450 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
451 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
452 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
453 glib_major_version, glib_minor_version, glib_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
454 printf ("*** was found! If glib-config was correct, then it is best\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
455 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
456 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
457 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
458 printf("*** required on your system.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
459 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
460 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
461 printf("*** before re-running configure\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
462 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
463 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
464 (glib_minor_version != GLIB_MINOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
465 (glib_micro_version != GLIB_MICRO_VERSION))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
466 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
467 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
468 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
469 printf("*** library (version %d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
470 glib_major_version, glib_minor_version, glib_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
471 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
472 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
473 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
474 if ((glib_major_version > major) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
475 ((glib_major_version == major) && (glib_minor_version > minor)) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
476 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
477 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
478 return 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
479 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
480 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
481 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
482 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
483 glib_major_version, glib_minor_version, glib_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
484 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
485 major, minor, micro);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
486 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
487 printf("***\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
488 printf("*** If you have already installed a sufficiently new version, this error\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
489 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
490 printf("*** being found. The easiest way to fix this is to remove the old version\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
491 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
492 printf("*** correct copy of glib-config. (In this case, you will have to\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
493 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
494 printf("*** so that the correct libraries are found at run-time))\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
495 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
496 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
497 return 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
498 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
499 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
500 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
501 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
502 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
503 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
504 if test "x$no_glib" = x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
505 AC_MSG_RESULT(yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
506 ifelse([$2], , :, [$2])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
507 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
508 AC_MSG_RESULT(no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
509 if test "$GLIB_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
510 echo "*** The glib-config script installed by GLIB could not be found"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
511 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
512 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
513 echo "*** full path to glib-config."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
514 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
515 if test -f conf.glibtest ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
516 :
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
517 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
518 echo "*** Could not run GLIB test program, checking why..."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
519 CFLAGS="$CFLAGS $GLIB_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
520 LIBS="$LIBS $GLIB_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
521 AC_TRY_LINK([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
522 #include <glib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
523 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
524 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
525 [ echo "*** The test program compiled, but did not run. This usually means"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
526 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
527 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
528 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
529 echo "*** to the installed location Also, make sure you have run ldconfig if that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
530 echo "*** is required on your system"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
531 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
532 echo "*** If you have an old version installed, it is best to remove it, although"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
533 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
534 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
535 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
536 echo "*** came with the system with the command"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
537 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
538 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
539 [ echo "*** The test program failed to compile or link. See the file config.log for the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
540 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
541 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
542 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
543 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
544 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
545 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
546 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
547 GLIB_CFLAGS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
548 GLIB_LIBS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
549 ifelse([$3], , :, [$3])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
550 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
551 AC_SUBST(GLIB_CFLAGS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
552 AC_SUBST(GLIB_LIBS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
553 rm -f conf.glibtest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
554 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
555
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 16
diff changeset
556
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
557 # serial 1
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
558
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
559 AC_DEFUN([AM_WITH_DMALLOC],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
560 [AC_MSG_CHECKING(if malloc debugging is wanted)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
561 AC_ARG_WITH(dmalloc,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
562 [ --with-dmalloc use dmalloc, as in
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
563 ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
564 [if test "$withval" = yes; then
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
565 AC_MSG_RESULT(yes)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
566 AC_DEFINE(WITH_DMALLOC,1,
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
567 [Define if using the dmalloc debugging malloc package])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
568 LIBS="$LIBS -ldmalloc"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
569 LDFLAGS="$LDFLAGS -g"
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
570 else
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
571 AC_MSG_RESULT(no)
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
572 fi], [AC_MSG_RESULT(no)])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
573 ])
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
574
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
575 # Configure paths for GTK+
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
576 # Owen Taylor 97-11-3
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
577
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
578 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
579 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
580 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
581 AC_DEFUN(AM_PATH_GTK,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
582 [dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
583 dnl Get the cflags and libraries from the gtk-config script
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
584 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
585 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
586 gtk_config_prefix="$withval", gtk_config_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
587 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
588 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
589 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
590 , enable_gtktest=yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
591
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
592 for module in . $4
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
593 do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
594 case "$module" in
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
595 gthread)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
596 gtk_config_args="$gtk_config_args gthread"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
597 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
598 esac
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
599 done
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
600
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
601 if test x$gtk_config_exec_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
602 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
603 if test x${GTK_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
604 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
605 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
606 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
607 if test x$gtk_config_prefix != x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
608 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
609 if test x${GTK_CONFIG+set} != xset ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
610 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
611 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
612 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
613
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
614 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
615 min_gtk_version=ifelse([$1], ,0.99.7,$1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
616 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
617 no_gtk=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
618 if test "$GTK_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
619 no_gtk=yes
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
620 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
621 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
622 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
623 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
624 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
625 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
626 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
627 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
628 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
629 if test "x$enable_gtktest" = "xyes" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
630 ac_save_CFLAGS="$CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
631 ac_save_LIBS="$LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
632 CFLAGS="$CFLAGS $GTK_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
633 LIBS="$GTK_LIBS $LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
634 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
635 dnl Now check if the installed GTK is sufficiently new. (Also sanity
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
636 dnl checks the results of gtk-config to some extent
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
637 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
638 rm -f conf.gtktest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
639 AC_TRY_RUN([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
640 #include <gtk/gtk.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
641 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
642 #include <stdlib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
643
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
644 int
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
645 main ()
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
646 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
647 int major, minor, micro;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
648 char *tmp_version;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
649
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
650 system ("touch conf.gtktest");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
651
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
652 /* HP/UX 9 (%@#!) writes to sscanf strings */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
653 tmp_version = g_strdup("$min_gtk_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
654 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
655 printf("%s, bad version string\n", "$min_gtk_version");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
656 exit(1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
657 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
658
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
659 if ((gtk_major_version != $gtk_config_major_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
660 (gtk_minor_version != $gtk_config_minor_version) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
661 (gtk_micro_version != $gtk_config_micro_version))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
662 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
663 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
664 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
665 gtk_major_version, gtk_minor_version, gtk_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
666 printf ("*** was found! If gtk-config was correct, then it is best\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
667 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
668 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
669 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
670 printf("*** required on your system.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
671 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
672 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
673 printf("*** before re-running configure\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
674 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
675 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
676 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
677 (gtk_minor_version != GTK_MINOR_VERSION) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
678 (gtk_micro_version != GTK_MICRO_VERSION))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
679 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
680 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
681 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
682 printf("*** library (version %d.%d.%d)\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
683 gtk_major_version, gtk_minor_version, gtk_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
684 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
685 #endif /* defined (GTK_MAJOR_VERSION) ... */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
686 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
687 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
688 if ((gtk_major_version > major) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
689 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
690 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
691 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
692 return 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
693 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
694 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
695 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
696 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
697 gtk_major_version, gtk_minor_version, gtk_micro_version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
698 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
699 major, minor, micro);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
700 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
701 printf("***\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
702 printf("*** If you have already installed a sufficiently new version, this error\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
703 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
704 printf("*** being found. The easiest way to fix this is to remove the old version\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
705 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
706 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
707 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
708 printf("*** so that the correct libraries are found at run-time))\n");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
709 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
710 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
711 return 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
712 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
713 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
714 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
715 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
716 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
717 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
718 if test "x$no_gtk" = x ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
719 AC_MSG_RESULT(yes)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
720 ifelse([$2], , :, [$2])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
721 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
722 AC_MSG_RESULT(no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
723 if test "$GTK_CONFIG" = "no" ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
724 echo "*** The gtk-config script installed by GTK could not be found"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
725 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
726 echo "*** your path, or set the GTK_CONFIG environment variable to the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
727 echo "*** full path to gtk-config."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
728 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
729 if test -f conf.gtktest ; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
730 :
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
731 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
732 echo "*** Could not run GTK test program, checking why..."
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
733 CFLAGS="$CFLAGS $GTK_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
734 LIBS="$LIBS $GTK_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
735 AC_TRY_LINK([
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
736 #include <gtk/gtk.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
737 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
738 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
739 [ echo "*** The test program compiled, but did not run. This usually means"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
740 echo "*** that the run-time linker is not finding GTK or finding the wrong"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
741 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
742 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
743 echo "*** to the installed location Also, make sure you have run ldconfig if that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
744 echo "*** is required on your system"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
745 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
746 echo "*** If you have an old version installed, it is best to remove it, although"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
747 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
748 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
749 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
750 echo "*** came with the system with the command"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
751 echo "***"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
752 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
753 [ echo "*** The test program failed to compile or link. See the file config.log for the"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
754 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
755 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
756 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
757 CFLAGS="$ac_save_CFLAGS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
758 LIBS="$ac_save_LIBS"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
759 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
760 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
761 GTK_CFLAGS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
762 GTK_LIBS=""
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
763 ifelse([$3], , :, [$3])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
764 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
765 AC_SUBST(GTK_CFLAGS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
766 AC_SUBST(GTK_LIBS)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
767 rm -f conf.gtktest
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
768 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
769
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
770 # Macro to add for using GNU gettext.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
771 # Ulrich Drepper <drepper@cygnus.com>, 1995.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
772 #
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
773 # This file can be copied and used freely without restrictions. It can
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
774 # be used in projects which are not available under the GNU General Public
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
775 # License or the GNU Library General Public License but which still want
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
776 # to provide support for the GNU gettext functionality.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
777 # Please note that the actual code of the GNU gettext library is covered
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
778 # by the GNU Library General Public License, and the rest of the GNU
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
779 # gettext package package is covered by the GNU General Public License.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
780 # They are *not* in the public domain.
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
781
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
782 # serial 10
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
783
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
784 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
785 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
786 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
787 dnl depending on --{enable,disable}-{shared,static} and on the presence of
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
788 dnl AM-DISABLE-SHARED). Otherwise, a static library
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
789 dnl $(top_builddir)/intl/libintl.a will be created.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
790 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
791 dnl implementations (in libc or libintl) without the ngettext() function
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
792 dnl will be ignored.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
793 dnl LIBDIR is used to find the intl libraries. If empty,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
794 dnl the value `$(top_builddir)/intl/' is used.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
795 dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
796 dnl The result of the configuration is one of three cases:
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
797 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
798 dnl and used.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
799 dnl Catalog format: GNU --> install in $(datadir)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
800 dnl Catalog extension: .mo after installation, .gmo in source tree
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
801 dnl 2) GNU gettext has been found in the system's C library.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
802 dnl Catalog format: GNU --> install in $(datadir)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
803 dnl Catalog extension: .mo after installation, .gmo in source tree
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
804 dnl 3) No internationalization, always use English msgid.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
805 dnl Catalog format: none
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
806 dnl Catalog extension: none
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
807 dnl The use of .gmo is historical (it was needed to avoid overwriting the
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
808 dnl GNU format catalogs when building on a platform with an X/Open gettext),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
809 dnl but we keep it in order not to force irrelevant filename changes on the
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
810 dnl maintainers.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
811 dnl
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
812 AC_DEFUN([AM_WITH_NLS],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
813 [AC_MSG_CHECKING([whether NLS is requested])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
814 dnl Default is enabled NLS
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
815 AC_ARG_ENABLE(nls,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
816 [ --disable-nls do not use Native Language Support],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
817 USE_NLS=$enableval, USE_NLS=yes)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
818 AC_MSG_RESULT($USE_NLS)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
819 AC_SUBST(USE_NLS)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
820
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
821 BUILD_INCLUDED_LIBINTL=no
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
822 USE_INCLUDED_LIBINTL=no
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
823 INTLLIBS=
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
824
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
825 dnl If we use NLS figure out what method
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
826 if test "$USE_NLS" = "yes"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
827 AC_DEFINE(ENABLE_NLS, 1,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
828 [Define to 1 if translation of program messages to the user's native language
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
829 is requested.])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
830 AC_MSG_CHECKING([whether included gettext is requested])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
831 AC_ARG_WITH(included-gettext,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
832 [ --with-included-gettext use the GNU gettext library included here],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
833 nls_cv_force_use_gnu_gettext=$withval,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
834 nls_cv_force_use_gnu_gettext=no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
835 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
836
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
837 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
838 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
839 dnl User does not insist on using GNU NLS library. Figure out what
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
840 dnl to use. If GNU gettext is available we use this. Else we have
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
841 dnl to fall back to GNU NLS library.
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
842 CATOBJEXT=NONE
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
843
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
844 dnl Add a version number to the cache macros.
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
845 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
846 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
847
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
848 AC_CHECK_HEADER(libintl.h,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
849 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
850 [AC_TRY_LINK([#include <libintl.h>
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
851 extern int _nl_msg_cat_cntr;],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
852 [bindtextdomain ("", "");
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
853 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
854 gt_cv_func_gnugettext_libc=yes,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
855 gt_cv_func_gnugettext_libc=no)])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
856
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
857 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
858 AC_CACHE_CHECK([for GNU gettext in libintl],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
859 gt_cv_func_gnugettext_libintl,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
860 [gt_save_LIBS="$LIBS"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
861 LIBS="$LIBS -lintl $LIBICONV"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
862 AC_TRY_LINK([#include <libintl.h>
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
863 extern int _nl_msg_cat_cntr;],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
864 [bindtextdomain ("", "");
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
865 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
866 gt_cv_func_gnugettext_libintl=yes,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
867 gt_cv_func_gnugettext_libintl=no)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
868 LIBS="$gt_save_LIBS"])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
869 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
870
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
871 dnl If an already present or preinstalled GNU gettext() is found,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
872 dnl use it. But if this macro is used in GNU gettext, and GNU
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
873 dnl gettext is already preinstalled in libintl, we update this
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
874 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
875 if test "$gt_cv_func_gnugettext_libc" = "yes" \
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
876 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
877 && test "$PACKAGE" != gettext; }; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
878 AC_DEFINE(HAVE_GETTEXT, 1,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
879 [Define if the GNU gettext() function is already present or preinstalled.])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
880
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
881 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
882 dnl If iconv() is in a separate libiconv library, then anyone
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
883 dnl linking with libintl{.a,.so} also needs to link with
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
884 dnl libiconv.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
885 INTLLIBS="-lintl $LIBICONV"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
886 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
887
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
888 gt_save_LIBS="$LIBS"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
889 LIBS="$LIBS $INTLLIBS"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
890 AC_CHECK_FUNCS(dcgettext)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
891 LIBS="$gt_save_LIBS"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
892
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
893 dnl Search for GNU msgfmt in the PATH.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
894 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
895 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
896 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
897
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
898 dnl Search for GNU xgettext in the PATH.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
899 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
900 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
901
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
902 CATOBJEXT=.gmo
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
903 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
904 ])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
905
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
906 if test "$CATOBJEXT" = "NONE"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
907 dnl GNU gettext is not found in the C library.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
908 dnl Fall back on GNU gettext library.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
909 nls_cv_use_gnu_gettext=yes
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
910 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
911 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
912
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
913 if test "$nls_cv_use_gnu_gettext" = "yes"; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
914 dnl Mark actions used to generate GNU NLS library.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
915 INTLOBJS="\$(GETTOBJS)"
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
916 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
917 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
918 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
919 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
920 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
921 AC_SUBST(MSGFMT)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
922 BUILD_INCLUDED_LIBINTL=yes
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
923 USE_INCLUDED_LIBINTL=yes
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
924 CATOBJEXT=.gmo
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
925 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
926 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
927 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
928
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
929 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
930 dnl Test whether we really found GNU msgfmt.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
931 if test "$GMSGFMT" != ":"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
932 dnl If it is no GNU msgfmt we define it as : so that the
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
933 dnl Makefiles still can work.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
934 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
935 : ;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
936 else
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
937 AC_MSG_RESULT(
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
938 [found msgfmt program is not GNU msgfmt; ignore it])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
939 GMSGFMT=":"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
940 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
941 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
942
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
943 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
944 dnl Test whether we really found GNU xgettext.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
945 if test "$XGETTEXT" != ":"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
946 dnl If it is no GNU xgettext we define it as : so that the
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
947 dnl Makefiles still can work.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
948 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
949 : ;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
950 else
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
951 AC_MSG_RESULT(
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
952 [found xgettext program is not GNU xgettext; ignore it])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
953 XGETTEXT=":"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
954 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
955 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
956
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
957 dnl We need to process the po/ directory.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
958 POSUB=po
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
959 fi
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
960 AC_OUTPUT_COMMANDS(
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
961 [for ac_file in $CONFIG_FILES; do
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
962 # Support "outfile[:infile[:infile...]]"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
963 case "$ac_file" in
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
964 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
965 esac
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
966 # PO directories have a Makefile.in generated from Makefile.in.in.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
967 case "$ac_file" in */Makefile.in)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
968 # Adjust a relative srcdir.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
969 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
970 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
971 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
972 # In autoconf-2.13 it is called $ac_given_srcdir.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
973 # In autoconf-2.50 it is called $srcdir.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
974 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
975 case "$ac_given_srcdir" in
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
976 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
977 /*) top_srcdir="$ac_given_srcdir" ;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
978 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
979 esac
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
980 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
981 rm -f "$ac_dir/POTFILES"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
982 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
983 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
984 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
985 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
986 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
987 ;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
988 esac
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
989 done])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
990
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
991
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
992 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
993 dnl to 'yes' because some of the testsuite requires it.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
994 if test "$PACKAGE" = gettext; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
995 BUILD_INCLUDED_LIBINTL=yes
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
996 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
997
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
998 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
999 dnl because plural.y uses bison specific features. It requires at least
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1000 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1001 dnl compile.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1002 dnl bison is only needed for the maintainer (who touches plural.y). But in
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1003 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1004 dnl the rule in general Makefile. Now, some people carelessly touch the
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1005 dnl files or have a broken "make" program, hence the plural.c rule will
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1006 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1007 dnl present or too old.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1008 AC_CHECK_PROGS([INTLBISON], [bison])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1009 if test -z "$INTLBISON"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1010 ac_verc_fail=yes
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1011 else
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1012 dnl Found it, now check the version.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1013 AC_MSG_CHECKING([version of bison])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1014 changequote(<<,>>)dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1015 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1016 case $ac_prog_version in
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1017 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1018 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1019 changequote([,])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1020 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1021 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1022 esac
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1023 AC_MSG_RESULT([$ac_prog_version])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1024 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1025 if test $ac_verc_fail = yes; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1026 INTLBISON=:
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1027 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1028
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1029 dnl These rules are solely for the distribution goal. While doing this
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1030 dnl we only have to keep exactly one list of the available catalogs
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1031 dnl in configure.in.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1032 for lang in $ALL_LINGUAS; do
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1033 GMOFILES="$GMOFILES $lang.gmo"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1034 POFILES="$POFILES $lang.po"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1035 done
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1036
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1037 dnl Make all variables we use known to autoconf.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1038 AC_SUBST(BUILD_INCLUDED_LIBINTL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1039 AC_SUBST(USE_INCLUDED_LIBINTL)
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1040 AC_SUBST(CATALOGS)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1041 AC_SUBST(CATOBJEXT)
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1042 AC_SUBST(GMOFILES)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1043 AC_SUBST(INTLLIBS)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1044 AC_SUBST(INTLOBJS)
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1045 AC_SUBST(POFILES)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1046 AC_SUBST(POSUB)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1047
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1048 dnl For backward compatibility. Some configure.ins may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1049 nls_cv_header_intl=
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1050 nls_cv_header_libgt=
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1051
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1052 dnl For backward compatibility. Some Makefiles may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1053 DATADIRNAME=share
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1054 AC_SUBST(DATADIRNAME)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1055
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1056 dnl For backward compatibility. Some Makefiles may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1057 INSTOBJEXT=.mo
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1058 AC_SUBST(INSTOBJEXT)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1059
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1060 dnl For backward compatibility. Some Makefiles may be using this.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1061 GENCAT=gencat
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1062 AC_SUBST(GENCAT)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1063 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1064
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1065 dnl Usage: Just like AM_WITH_NLS, which see.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1066 AC_DEFUN([AM_GNU_GETTEXT],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1067 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1068 AC_REQUIRE([AC_PROG_CC])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1069 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1070 AC_REQUIRE([AC_PROG_RANLIB])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1071 AC_REQUIRE([AC_ISC_POSIX])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1072 AC_REQUIRE([AC_HEADER_STDC])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1073 AC_REQUIRE([AC_C_CONST])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1074 AC_REQUIRE([AC_C_INLINE])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1075 AC_REQUIRE([AC_TYPE_OFF_T])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1076 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1077 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1078 AC_REQUIRE([AC_FUNC_MMAP])dnl
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1079 AC_REQUIRE([jm_GLIBC21])dnl
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1080
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1081 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1082 stdlib.h string.h unistd.h sys/param.h])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1083 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1084 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1085 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1086
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1087 AM_ICONV
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1088 AM_LANGINFO_CODESET
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1089 AM_LC_MESSAGES
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1090 AM_WITH_NLS([$1],[$2],[$3])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1091
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1092 if test "x$CATOBJEXT" != "x"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1093 if test "x$ALL_LINGUAS" = "x"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1094 LINGUAS=
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1095 else
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1096 AC_MSG_CHECKING(for catalogs to be installed)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1097 NEW_LINGUAS=
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1098 for presentlang in $ALL_LINGUAS; do
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1099 useit=no
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1100 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1101 # Use the presentlang catalog if desiredlang is
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1102 # a. equal to presentlang, or
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1103 # b. a variant of presentlang (because in this case,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1104 # presentlang can be used as a fallback for messages
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1105 # which are not translated in the desiredlang catalog).
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1106 case "$desiredlang" in
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1107 "$presentlang"*) useit=yes;;
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1108 esac
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1109 done
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1110 if test $useit = yes; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1111 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1112 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1113 done
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1114 LINGUAS=$NEW_LINGUAS
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1115 AC_MSG_RESULT($LINGUAS)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1116 fi
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1117
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1118 dnl Construct list of names of catalog files to be constructed.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1119 if test -n "$LINGUAS"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1120 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1121 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1122 fi
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1123
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1124 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1125 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1126 dnl Try to locate is.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1127 MKINSTALLDIRS=
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1128 if test -n "$ac_aux_dir"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1129 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1130 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1131 if test -z "$MKINSTALLDIRS"; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1132 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1133 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1134 AC_SUBST(MKINSTALLDIRS)
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1135
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1136 dnl Enable libtool support if the surrounding package wishes it.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1137 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1138 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1139 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1140
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1141 # Search path for a program which passes the given test.
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1142 # Ulrich Drepper <drepper@cygnus.com>, 1996.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1143 #
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1144 # This file can be copied and used freely without restrictions. It can
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1145 # be used in projects which are not available under the GNU General Public
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1146 # License or the GNU Library General Public License but which still want
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1147 # to provide support for the GNU gettext functionality.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1148 # Please note that the actual code of the GNU gettext library is covered
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1149 # by the GNU Library General Public License, and the rest of the GNU
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1150 # gettext package package is covered by the GNU General Public License.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1151 # They are *not* in the public domain.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1152
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1153 # serial 2
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1154
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1155 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1156 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1157 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1158 [# Extract the first word of "$2", so it can be a program name with args.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1159 set dummy $2; ac_word=[$]2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1160 AC_MSG_CHECKING([for $ac_word])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1161 AC_CACHE_VAL(ac_cv_path_$1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1162 [case "[$]$1" in
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1163 /*)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1164 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1165 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1166 *)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1167 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1168 for ac_dir in ifelse([$5], , $PATH, [$5]); do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1169 test -z "$ac_dir" && ac_dir=.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1170 if test -f $ac_dir/$ac_word; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1171 if [$3]; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1172 ac_cv_path_$1="$ac_dir/$ac_word"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1173 break
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1174 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1175 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1176 done
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1177 IFS="$ac_save_ifs"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1178 dnl If no 4th arg is given, leave the cache variable unset,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1179 dnl so AC_PATH_PROGS will keep looking.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1180 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1181 ])dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1182 ;;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1183 esac])dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1184 $1="$ac_cv_path_$1"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1185 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1186 AC_MSG_RESULT([$]$1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1187 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1188 AC_MSG_RESULT(no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1189 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1190 AC_SUBST($1)dnl
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1191 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1192
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1193 #serial 1
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1194 # This test replaces the one in autoconf.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1195 # Currently this macro should have the same name as the autoconf macro
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1196 # because gettext's gettext.m4 (distributed in the automake package)
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1197 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1198 # give these diagnostics:
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1199 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1200 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1201
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1202 undefine([AC_ISC_POSIX])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1203
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1204 AC_DEFUN([AC_ISC_POSIX],
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1205 [
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1206 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1207 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1208 ]
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1209 )
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 7
diff changeset
1210
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1211 #serial 2
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1212
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1213 # Test for the GNU C Library, version 2.1 or newer.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1214 # From Bruno Haible.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1215
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1216 AC_DEFUN([jm_GLIBC21],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1217 [
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1218 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1219 ac_cv_gnu_library_2_1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1220 [AC_EGREP_CPP([Lucky GNU user],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1221 [
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1222 #include <features.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1223 #ifdef __GNU_LIBRARY__
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1224 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1225 Lucky GNU user
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1226 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1227 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1228 ],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1229 ac_cv_gnu_library_2_1=yes,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1230 ac_cv_gnu_library_2_1=no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1231 ]
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1232 )
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1233 AC_SUBST(GLIBC21)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1234 GLIBC21="$ac_cv_gnu_library_2_1"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1235 ]
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1236 )
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1237
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1238 #serial AM2
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1239
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1240 dnl From Bruno Haible.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1241
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1242 AC_DEFUN([AM_ICONV],
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1243 [
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1244 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1245 dnl those with the standalone portable GNU libiconv installed).
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1246
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1247 AC_ARG_WITH([libiconv-prefix],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1248 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1249 for dir in `echo "$withval" | tr : ' '`; do
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1250 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1251 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1252 done
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1253 ])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1254
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1255 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1256 am_cv_func_iconv="no, consider installing GNU libiconv"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1257 am_cv_lib_iconv=no
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1258 AC_TRY_LINK([#include <stdlib.h>
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1259 #include <iconv.h>],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1260 [iconv_t cd = iconv_open("","");
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1261 iconv(cd,NULL,NULL,NULL,NULL);
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1262 iconv_close(cd);],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1263 am_cv_func_iconv=yes)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1264 if test "$am_cv_func_iconv" != yes; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1265 am_save_LIBS="$LIBS"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1266 LIBS="$LIBS -liconv"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1267 AC_TRY_LINK([#include <stdlib.h>
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1268 #include <iconv.h>],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1269 [iconv_t cd = iconv_open("","");
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1270 iconv(cd,NULL,NULL,NULL,NULL);
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1271 iconv_close(cd);],
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1272 am_cv_lib_iconv=yes
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1273 am_cv_func_iconv=yes)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1274 LIBS="$am_save_LIBS"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1275 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1276 ])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1277 if test "$am_cv_func_iconv" = yes; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1278 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1279 AC_MSG_CHECKING([for iconv declaration])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1280 AC_CACHE_VAL(am_cv_proto_iconv, [
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1281 AC_TRY_COMPILE([
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1282 #include <stdlib.h>
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1283 #include <iconv.h>
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1284 extern
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1285 #ifdef __cplusplus
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1286 "C"
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1287 #endif
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1288 #if defined(__STDC__) || defined(__cplusplus)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1289 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1290 #else
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1291 size_t iconv();
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1292 #endif
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1293 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1294 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);"])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1295 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1296 AC_MSG_RESULT([$]{ac_t:-
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1297 }[$]am_cv_proto_iconv)
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1298 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1299 [Define as const if the declaration of iconv() needs const.])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1300 fi
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1301 LIBICONV=
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1302 if test "$am_cv_lib_iconv" = yes; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1303 LIBICONV="-liconv"
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1304 fi
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1305 AC_SUBST(LIBICONV)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1306 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1307
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1308 #serial AM1
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1309
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1310 dnl From Bruno Haible.
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1311
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1312 AC_DEFUN([AM_LANGINFO_CODESET],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1313 [
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1314 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1315 [AC_TRY_LINK([#include <langinfo.h>],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1316 [char* cs = nl_langinfo(CODESET);],
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1317 am_cv_langinfo_codeset=yes,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1318 am_cv_langinfo_codeset=no)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1319 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1320 if test $am_cv_langinfo_codeset = yes; then
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1321 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1322 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1323 fi
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1324 ])
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1325
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1326 # Check whether LC_MESSAGES is available in <locale.h>.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1327 # Ulrich Drepper <drepper@cygnus.com>, 1995.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1328 #
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1329 # This file can be copied and used freely without restrictions. It can
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1330 # be used in projects which are not available under the GNU General Public
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1331 # License or the GNU Library General Public License but which still want
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1332 # to provide support for the GNU gettext functionality.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1333 # Please note that the actual code of the GNU gettext library is covered
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1334 # by the GNU Library General Public License, and the rest of the GNU
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1335 # gettext package package is covered by the GNU General Public License.
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1336 # They are *not* in the public domain.
7
5551ab2301fe * Fixed a DND crash
masneyb
parents: 1
diff changeset
1337
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1338 # serial 2
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1339
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1340 AC_DEFUN([AM_LC_MESSAGES],
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1341 [if test $ac_cv_header_locale_h = yes; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1342 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1343 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1344 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1345 if test $am_cv_val_LC_MESSAGES = yes; then
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1346 AC_DEFINE(HAVE_LC_MESSAGES, 1,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1347 [Define if your <locale.h> file defines LC_MESSAGES.])
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1348 fi
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
1349 fi])
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1350