source: trunk/third/tex/xdvi/gsftopk/Configure @ 12209

Revision 12209, 8.3 KB checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12208, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
1#! /bin/sh
2#
3# If these # comments don't work, trim them.
4#
5# (If you are trying to port this package to a machine without sh,
6# I would suggest you have a look at the prototypical config_p.h file
7# and edit it to reflect your system. Some packages may include samples
8# of config.h for certain machines, so you might look for one of those.)
9#
10# Yes, you may rip this off to use in other distribution packages. This
11# script belongs to the public domain and cannot be copyrighted.
12#
13# (Note: this Configure script was generated automatically. Rather than
14# working with this copy of Configure, you may wish to get metaconfig.
15# The dist-3.0 package (which contains metaconfig) was posted in
16# comp.sources.misc so you may fetch it yourself from your nearest
17# archive site. Check with Archie if you don't know where that can be.)
18#
19
20# Generated on Tue May 10 14:30:48 PDT 1994 [metaconfig 3.0 PL26]
21#
22# Hacked by hand by Paul Vojta, ignoring an earlier paragraph.  Removed
23# all the questions, and added an argument to specify the C compiler.
24
25# Modifications to this script are Copyright (c) 1994 Paul Vojta.
26#
27# Redistribution and use in source and binary forms, with or without
28# modification, are permitted provided that the following conditions
29# are met:
30# 1. Redistributions of source code must retain the above copyright
31#    notice, this list of conditions and the following disclaimer.
32# 2. Redistributions in binary form must reproduce the above copyright
33#    notice, this list of conditions and the following disclaimer in the
34#    documentation and/or other materials provided with the distribution.
35#
36# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
37# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
40# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46# SUCH DAMAGE.
47
48if test ! -t 0; then
49        echo "You must run Configure from make."
50        exit 1
51fi
52
53: On HP-UX, large Configure scripts may exercise a bug in /bin/sh
54if test -f /hp-ux -a -f /bin/ksh; then
55        if (PATH=.; alias -x) >/dev/null 2>&1; then
56                : already under /bin/ksh
57        else
58                cat <<'EOM'
59(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
60EOM
61                exec /bin/ksh $0 "$@"
62        fi
63else
64        : Warn them if they use ksh on other systems
65        (PATH=.; alias -x) >/dev/null 2>&1 && \
66                cat <<'EOM'
67(I see you are using the Korn shell.  Some ksh's blow up on Configure,
68especially on exotic machines.  If yours does, try the Bourne shell instead.)
69EOM
70fi
71
72: Check for arguments
73if test $# -eq 0; then
74        echo "You must specify an argument saying what C compiler you're using."
75        exit 1
76fi
77
78echo "Sanity check first..."
79cat <<EOF >cfg_test.c
80#include <stdio.h>
81main() {puts("Hello world");}
82EOF
83if $* -o cfg_test cfg_test.c; then
84        : blank line
85else
86        echo ""
87        echo "This is not gonna work.  I'm sorry, but you'll have to edit"
88        echo "config.h by hand."
89        cp config_p.h config.h
90        exit 1
91fi
92
93echo "Checking for stdlib.h"
94cat <<EOF >config.h
95/*
96 * This file was generated automatically by the Configure script.
97 * Run Configure again to make any necessary changes, or copy
98 * config_p.h to config.h and then start editing.
99 */
100
101/* Include <stdlib.h>, if it exists. */
102EOF
103cat <<EOF >cfg_test.c
104#include <stdlib.h>
105#include <stdio.h>
106main() {puts("Hello world");}
107EOF
108if $* -c cfg_test.c >/dev/null 2>&1; then
109        stdlib='yes'
110        echo "#include <stdlib.h>" >>config.h
111else
112        stdlib='no'
113        echo "/* #include <stdlib.h> */" >>config.h
114fi
115
116echo "Checking for stdarg.h"
117cat <<EOF >>config.h
118
119/* Always include this one. */
120#include <stdio.h>
121
122/* Define I_STDARG if there's a stdarg.h. */
123EOF
124cat <<EOF >cfg_test.c
125#include "config.h"
126#include <stdarg.h>
127main() {puts("Hello world");}
128EOF
129if $* -c cfg_test.c >/dev/null 2>&1; then
130        echo "#define I_STDARG" >>config.h
131else
132        echo "#undef I_STDARG" >>config.h
133fi
134
135echo "Checking for string.h vs. strings.h"
136cat <<EOF >>config.h
137
138/* Include either <string.h> or <strings.h> here. */
139EOF
140
141cat <<EOF >cfg_test.c
142#include "config.h"
143#include <string.h>
144main() {puts("Hello world");}
145EOF
146if $* -c cfg_test.c >/dev/null 2>&1; then
147        string='string'
148else
149        string='strings'
150fi
151echo "#include <$string.h>" >>config.h
152
153cat <<EOF >>config.h
154
155/* Include <memory.h>, if appropriate.  Note that it may have been left
156   out even though it exists.  We do this because of conflicts on many
157   systems.  But if it works, then it works. */
158EOF
159memory='no'
160if test "$stdlib $string" = "no string"; then
161        echo "Checking for memory.h"
162        cat <<EOF >cfg_test.c
163#include "config.h"
164#include <memory.h>
165main() {puts("Hello world");}
166EOF
167        if $* -c cfg_test.c >/dev/null 2>&1; then
168                memory='yes'
169        fi
170fi
171if test $memory = 'yes'; then
172        echo "#include <memory.h>" >>config.h
173else
174        echo "/* #include <memory.h> */" >>config.h
175fi
176
177cat <<EOF >>config.h
178
179/* Include <unistd.h> if it exists. */
180EOF
181echo "Checking for unistd.h"
182cat <<EOF >cfg_test.c
183#include "config.h"
184#include <unistd.h>
185main() {puts("Hello world");}
186EOF
187if $* -c cfg_test.c >/dev/null 2>&1; then
188        echo "#include <unistd.h>" >>config.h
189else
190        echo "/* #include <unistd.h> */" >>config.h
191fi
192
193echo "Checking for vfork()"
194cat <<EOF >cfg_test.c
195#include "config.h"
196main() {(void) vfork();}
197EOF
198if $* -o cfg_test cfg_test.c >/dev/null 2>&1; then
199        vfork='yes'
200else
201        vfork='no'
202fi
203
204vforkinc='no'
205if test $vfork = 'yes'; then
206        echo "Checking for vfork.h"
207        cat <<EOF >cfg_test.c
208#include "config.h"
209#include <vfork.h>
210main() {puts("Hello world");}
211EOF
212        if $* -c cfg_test.c >/dev/null 2>&1; then
213                vforkinc='yes'
214        fi
215fi
216
217cat <<EOF >>config.h
218
219/* If the system has vfork(), then it may require us to include vfork.h */
220EOF
221if test $vforkinc = yes; then
222        echo "#include <vfork.h>" >>config.h
223else
224        echo "/* #include <vfork.h> */" >>config.h
225fi
226
227cat <<EOF >>config.h
228
229/* Define this if POSIX <dirent.h> instead of old <sys/dir.h>. */
230EOF
231echo "Checking for dirent.h vs. sys/dir.h"
232cat <<EOF >cfg_test.c
233#include "config.h"
234#include <dirent.h>
235main() {puts("Hello world");}
236EOF
237if $* -c cfg_test.c >/dev/null 2>&1; then
238        echo "#define POSIX_DIRENT" >>config.h
239else
240        echo "/* #define POSIX_DIRENT */" >>config.h
241fi
242
243echo "Checking for bzero()"
244cat <<EOF >>config.h
245
246/* If the system has bzero(), use it; otherwise hope they have memset() */
247EOF
248cat <<EOF >cfg_test.c
249#include "config.h"
250main() {int i; bzero(&i, 1);}
251EOF
252if $* -o cfg_test cfg_test.c >/dev/null 2>&1; then
253        echo "/* #define bzero(s, n)    memset((s), 0, (n)) */" >>config.h
254else
255        echo "#define bzero(s, n)       memset((s), 0, (n))" >>config.h
256fi
257
258echo "Checking for memcmp()"
259cat <<EOF >>config.h
260
261/* If the system has memcmp(), use it; otherwise hope they have bcmp() */
262EOF
263cat <<EOF >cfg_test.c
264#include "config.h"
265main() {char c; memcmp(&c, &c, 1);}
266EOF
267if $* -o cfg_test cfg_test.c >/dev/null 2>&1; then
268        echo "/* #define memcmp bcmp */" >>config.h
269else
270        echo "#define memcmp    bcmp" >>config.h
271fi
272
273echo "Checking for memcpy()"
274cat <<EOF >>config.h
275
276/* If the system has memcpy(), use it; otherwise hope they have bcopy() */
277EOF
278cat <<EOF >cfg_test.c
279#include "config.h"
280main() {char c; memcpy(&c, &c, 1);}
281EOF
282if $* -o cfg_test cfg_test.c >/dev/null 2>&1; then
283        echo "/* #define memcpy(d, s, n)        bcopy(s, d, n) */" >>config.h
284else
285        echo "#define memcpy(d, s, n)   bcopy(s, d, n)" >>config.h
286fi
287
288echo "Checking for strchr()"
289cat <<EOF >>config.h
290
291/* If the system has strchr(), use it; otherwise hope they have index() */
292/* Likewise for strrchr() and rindex() */
293EOF
294cat <<EOF >cfg_test.c
295#include "config.h"
296main() {char c; (void) strchr("foo", 'b');}
297EOF
298if $* -o cfg_test cfg_test.c >/dev/null 2>&1; then
299        echo "/* #define strchr index */" >>config.h
300        echo "/* #define strrchr        rindex */" >>config.h
301else
302        echo "#define strchr    index" >>config.h
303        echo "#define strrchr   rindex" >>config.h
304fi
305
306cat <<EOF >>config.h
307
308/* Use vfork() if it's available; otherwise, fork() */
309EOF
310if test $vfork = 'yes'; then
311        echo "/* #define vfork  fork */" >>config.h
312else
313        echo "#define vfork     fork" >>config.h
314fi
315
316rm -f cfg_test.c cfg_test.o cfg_test
317echo "Done."
318exit 0
Note: See TracBrowser for help on using the repository browser.