Add ./configure --with flags for X11

--with-x11
--with-xt
--with-xaw

All disabled by default, since the code has probably bitrotted.
This commit is contained in:
Lassi Kortela 2023-02-13 15:43:46 +02:00
parent 4011143b81
commit 0648b5d060
1 changed files with 51 additions and 32 deletions

View File

@ -26,6 +26,24 @@ AC_TYPE_SIZE_T
# Check whether we are doing a native build
AM_CONDITIONAL(NATIVE_BUILD, test "${cross_compiling}" = "no")
AC_ARG_WITH([x11],
[AS_HELP_STRING([--with-x11],
[enable support for libx11])],
[],
[with_x11=no])
AC_ARG_WITH([xt],
[AS_HELP_STRING([--with-xt],
[enable support for libxt])],
[],
[with_xt=no])
AC_ARG_WITH([xaw],
[AS_HELP_STRING([--with-xaw],
[enable support for libxaw])],
[],
[with_xaw=no])
AC_CHECK_HEADERS(inttypes.h,
[STDINT_HEADER="<inttypes.h>"],
[AC_CHECK_HEADERS(sys/inttypes.h,
@ -484,18 +502,22 @@ AC_PATH_X
if test -n "${x_includes}"; then x_cflags="-I${x_includes}"; fi
if test -n "${x_libraries}"; then x_libs="-I${x_libraries}"; fi
AC_CHECK_LIB(X11, XOpenDisplay,
ac_cv_my_have_x11=no
AS_IF([test "x$with_x11" != xno],
[AC_CHECK_LIB(X11, XOpenDisplay,
[ac_cv_my_have_x11=yes
X_CFLAGS="${x_cflags}"
X_LIBS="${x_libs} -lX11"],
[ac_cv_my_have_x11=no],
[[${x_libs}]])
[[${x_libs}]])])
AM_CONDITIONAL(HAVE_X11, test "${ac_cv_my_have_x11}" = "yes")
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
ac_cv_my_have_xt=no
AS_IF([test "x$with_xt" != xno],
[AC_CHECK_LIB(Xt, XtFree,
if test "${cross_compiling}" = "no"; then
AC_CHECK_LIB(Xt, XtFree,
[ac_cv_my_have_xt=yes
AC_CHECK_LIB(Xmu, XmuDrawLogo,
[XT_CFLAGS="${x_cflags}"
@ -505,27 +527,26 @@ if test "${cross_compiling}" = "no"; then
[[-lXt -lSM -lICE -lXext -lX11 ${x_libs}]])],
[ac_cv_my_have_xt=no],
[[-lSM -lICE -lXext -lX11 ${x_libs}]])
else
ac_cv_my_have_xt=no
fi
fi])
AM_CONDITIONAL(HAVE_XT, test "${ac_cv_my_have_xt}" = "yes")
AC_SUBST(XT_CFLAGS)
AC_SUBST(XT_LIBS)
if test "${cross_compiling}" = "no"; then
ac_cv_my_have_xaw=no
AS_IF([test "x$with_xaw" != xno],
[if test "${cross_compiling}" = "no"; then
AC_CHECK_LIB(Xaw, XawTextSearch,
[ac_cv_my_have_xaw=yes
XAW_CFLAGS="${x_cflags}"
XAW_LIBS="${x_libs} -lXaw ${XT_LIBS}"],
[ac_cv_my_have_xaw=no],
[[${XT_LIBS}]])
else
ac_cv_my_have_xaw="no (cross-compiling)"
fi
fi])
AM_CONDITIONAL(HAVE_XAW, test "${ac_cv_my_have_xaw}" = "yes")
AC_SUBST(XAW_CFLAGS)
AC_SUBST(XAW_LIBS)
ac_cv_my_have_motif=no
if test "${cross_compiling}" = "no"; then
AC_CHECK_LIB(Xm, XmStringConcat,
[ac_cv_my_have_motif=yes
@ -533,8 +554,6 @@ if test "${cross_compiling}" = "no"; then
MOTIF_LIBS="${x_libs} -lXm ${XT_LIBS}"],
[ac_cv_my_have_motif=no],
[[${XT_LIBS}]])
else
ac_cv_my_have_motif="no (cross-compiling)"
fi
AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes")
AC_SUBST(MOTIF_CFLAGS)