Handle platforms where X11 headers do not typedef XPointer.

This commit is contained in:
Mark Hessling
2001-10-16 11:14:03 +00:00
parent fd6fd22f2e
commit 24e415ca06
5 changed files with 74 additions and 7 deletions

24
aclocal.m4 vendored
View File

@@ -401,3 +401,27 @@ else
AC_MSG_RESULT($mh_cv_max_signals)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl Determine if supplied types have been typedefed
dnl ---------------------------------------------------------------------------
AC_DEFUN([MH_CHECK_X_TYPEDEF],
[
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SYS_DEFS $MH_XINC_DIR"
for td in $1 ; do
AC_MSG_CHECKING(if $td is typedefed:)
AC_TRY_COMPILE(
[#include "X11/Xlib.h"],
[$td fred],
[mh_td=yes],
[mh_td=no]
)
if test "$mh_td" = yes ; then
TD_upper=`echo $td | tr a-z A-Z`
AC_DEFINE_UNQUOTED(${TD_upper}_TYPEDEFED, 1)
fi
AC_MSG_RESULT($mh_td)
done
CPPFLAGS="$save_CPPFLAGS"
])dnl

View File

@@ -131,3 +131,5 @@
/* Define if you want to build XCurses with processes */
#undef USE_PROCESSES
/* Define XPointer is typedefed in X11/Xlib.h */
#undef XPOINTER_TYPEDEFED

50
configure vendored
View File

@@ -2342,6 +2342,42 @@ done
CPPFLAGS="$save_CPPFLAGS"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SYS_DEFS $MH_XINC_DIR"
for td in XPointer ; do
echo $ac_n "checking if $td is typedefed:""... $ac_c" 1>&6
echo "configure:2350: checking if $td is typedefed:" >&5
cat > conftest.$ac_ext <<EOF
#line 2352 "configure"
#include "confdefs.h"
#include "X11/Xlib.h"
int main() {
$td fred
; return 0; }
EOF
if { (eval echo configure:2359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
mh_td=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
mh_td=no
fi
rm -f conftest*
if test "$mh_td" = yes ; then
TD_upper=`echo $td | tr a-z A-Z`
cat >> confdefs.h <<EOF
#define ${TD_upper}_TYPEDEFED 1
EOF
fi
echo "$ac_t""$mh_td" 1>&6
done
CPPFLAGS="$save_CPPFLAGS"
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
enableval="$enable_debug"
@@ -2502,10 +2538,10 @@ esac
if test "$DYN_COMP" = ""; then
echo $ac_n "checking compiler flags for a dynamic object""... $ac_c" 1>&6
echo "configure:2506: checking compiler flags for a dynamic object" >&5
echo "configure:2542: checking compiler flags for a dynamic object" >&5
cat > conftest.$ac_ext <<EOF
#line 2509 "configure"
#line 2545 "configure"
int a=0
EOF
@@ -2517,7 +2553,7 @@ EOF
CFLAGS="-c $a"
mh_compile='${CC-cc} -c $CFLAGS conftest.$ac_ext > conftest.tmp 2>&1'
if { (eval echo configure:2521: \"$mh_compile\") 1>&5; (eval $mh_compile) 2>&5; }; then
if { (eval echo configure:2557: \"$mh_compile\") 1>&5; (eval $mh_compile) 2>&5; }; then
DYN_COMP=""
else
slash="\\"
@@ -2634,21 +2670,21 @@ case "$target" in
mh_compile='${CC-cc} -c $DYN_COMP conftest.$ac_ext 1>&5'
cat > conftest.$ac_ext <<EOF
#line 2638 "configure"
#line 2674 "configure"
int foo()
{
return(0);
}
EOF
if { (eval echo configure:2644: \"$mh_compile\") 1>&5; (eval $mh_compile) 2>&5; } && test -s conftest.o; then
if { (eval echo configure:2680: \"$mh_compile\") 1>&5; (eval $mh_compile) 2>&5; } && test -s conftest.o; then
mh_dyn_link='ld -shared -o conftest.rxlib conftest.o -lc 1>&5'
if { (eval echo configure:2646: \"$mh_dyn_link\") 1>&5; (eval $mh_dyn_link) 2>&5; } && test -s conftest.rxlib; then
if { (eval echo configure:2682: \"$mh_dyn_link\") 1>&5; (eval $mh_dyn_link) 2>&5; } && test -s conftest.rxlib; then
LD_RXLIB1="ld -shared"
RXLIBPRE="lib"
RXLIBPST=".so"
else
mh_dyn_link='ld -G -o conftest.rxlib conftest.o 1>&5'
if { (eval echo configure:2652: \"$mh_dyn_link\") 1>&5; (eval $mh_dyn_link) 2>&5; } && test -s conftest.rxlib; then
if { (eval echo configure:2688: \"$mh_dyn_link\") 1>&5; (eval $mh_dyn_link) 2>&5; } && test -s conftest.rxlib; then
LD_RXLIB1="ld -G"
RXLIBPRE="lib"
RXLIBPST=".so"

View File

@@ -102,6 +102,7 @@ MH_CHECK_X_LIB
MH_CHECK_X_HEADERS(DECkeysym.h Sunkeysym.h)
MH_CHECK_X_KEYDEFS(XK_KP_Delete XK_KP_Insert XK_KP_End XK_KP_Down XK_KP_Next \
XK_KP_Left XK_KP_Right XK_KP_Home XK_KP_Up XK_KP_Prior XK_KP_Begin)
MH_CHECK_X_TYPEDEF(XPointer)
dnl --------------- allow --enable-debug to compile in debug mode --------
AC_ARG_ENABLE(debug,

View File

@@ -51,6 +51,10 @@
# include <sys/shm.h>
#endif
#if !defined(XPOINTER_TYPEDEFED)
typedef char * XPointer;
#endif
/*
* #includes specific to running XCurses with threads
*/