1 dnl configure.in.x11 --
2 dnl
3 dnl autoconf rules to find X11 includes and libraries
4 dnl
5 dnl Copyright (c) 2000-2002 The Regents of the University of California.
6 dnl All rights reserved.
7 dnl
8 dnl Redistribution and use in source and binary forms, with or without
9 dnl modification, are permitted provided that the following conditions are met:
10 dnl
11 dnl A. Redistributions of source code must retain the above copyright notice,
12 dnl this list of conditions and the following disclaimer.
13 dnl B. Redistributions in binary form must reproduce the above copyright
14 dnl notice, this list of conditions and the following disclaimer in the
15 dnl documentation and/or other materials provided with the distribution.
16 dnl C. Neither the names of the copyright holders nor the names of its
17 dnl contributors may be used to endorse or promote products derived from
18 dnl this software without specific prior written permission.
19 dnl
20 dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
21 dnl IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 dnl THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
24 dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 dnl POSSIBILITY OF SUCH DAMAGE.
31 dnl
32 dnl $Header: /usr/mash/src/repository/conf/configure.in.x11,v 1.3 2004/11/12 00:44:30 aswan Exp $
33
34 xlibdirs="\
35 /usr/openwin/lib \
36 /usr/X11R6/lib \
37 /usr/lib/X11R6 \
38 /usr/X11R5/lib \
39 /usr/lib/X11R5 \
40 /usr/X11R4/lib \
41 /usr/lib/X11R4 \
42 /usr/local/lib \
43 /usr/X386/lib \
44 /usr/X11/lib \
45 /usr/unsupported/lib \
46 /import/X11R4/usr/lib"
47
48 xincdirs="\
49 /usr/openwin/include \
50 /usr/X11R6/include \
51 /usr/include/X11R6 \
52 /usr/X11R5/include \
53 /usr/include/X11R5 \
54 /usr/X11R4/include \
55 /usr/include/X11R4 \
56 /usr/local/include \
57 /usr/X386/include \
58 /usr/X11/include \
59 /usr/lpp/X11/include \
60 /usr/unsupported/include \
61 /import/X11R4/include"
62
63 V_LIB_X11=""
64 V_INCLUDE_X11=""
65
66 if test "$macosx" != "yes" ; then
67 echo "checking for X11 header files"
68 if test "$x_includes" = NONE ; then
69 AC_TEST_CPP([#include <X11/Intrinsic.h>],x_includes="",x_includes=NONE)
70 if test "$x_includes" = NONE ; then
71 for i in $xincdirs ; do
72 if test -r $i/X11/Intrinsic.h; then
73 x_includes=$i
74 break
75 fi
76 done
77 if test "$x_includes" = NONE ; then
78 echo "can't find X includes"
79 exit 1
80 fi
81 fi
82 fi
83 if test -n "$x_includes" ; then
84 V_INCLUDE_X11=-I$x_includes
85 fi
86
87 echo "checking for X11 library archive"
88 if test "$x_libraries" = NONE ; then
89 AC_CHECK_LIB(X11, XOpenDisplay, x_libraries="", x_libraries=NONE)
90 if test "$x_libraries" = NONE ; then
91 for i in $xlibdirs ; do
92 if test -r $i/libX11.a -o -r $i/libX11.so; then
93 x_libraries=$i
94 break
95 fi
96 done
97 if test "$x_libraries" = NONE ; then
98 echo "can't find X library"
99 exit 1
100 fi
101 fi
102 fi
103
104 V_LIB_X11=-lX11
105
106 if test -n "$V_SHM" ; then
107 if test -z "$x_libraries" ; then
108 AC_CHECK_LIB(Xext, XShmAttach, V_Xext="-lXext", V_Xext=NONE, -lX11)
109 else
110 echo "checking for libXext.a"
111 if test -f $x_libraries/libXext.a -o -f $x_libraries/libXext.so; then
112 V_Xext="-lXext"
113 else
114 echo "warning: compiling without -lXext"
115 fi
116 fi
117 if test "$V_Xext" = NONE ; then
118 echo "warning: compiling without -lXext"
119 else
120 V_LIB_X11="$V_Xext $V_LIB_X11"
121 fi
122 fi
123
124 if test -n "$x_libraries" ; then
125 V_LIB_X11="-L$x_libraries $V_LIB_X11"
126 if test $solaris ; then
127 V_LIB_X11="-R$x_libraries $V_LIB_X11"
128 fi
129 fi
130 fi
131
132 AC_SUBST(V_LIB_X11)
133 AC_SUBST(V_INCLUDE_X11)
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.