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 # Check whether we are doing a native build
AM_CONDITIONAL(NATIVE_BUILD, test "${cross_compiling}" = "no") 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, AC_CHECK_HEADERS(inttypes.h,
[STDINT_HEADER="<inttypes.h>"], [STDINT_HEADER="<inttypes.h>"],
[AC_CHECK_HEADERS(sys/inttypes.h, [AC_CHECK_HEADERS(sys/inttypes.h,
@ -484,48 +502,51 @@ AC_PATH_X
if test -n "${x_includes}"; then x_cflags="-I${x_includes}"; fi if test -n "${x_includes}"; then x_cflags="-I${x_includes}"; fi
if test -n "${x_libraries}"; then x_libs="-I${x_libraries}"; fi if test -n "${x_libraries}"; then x_libs="-I${x_libraries}"; fi
AC_CHECK_LIB(X11, XOpenDisplay, ac_cv_my_have_x11=no
[ac_cv_my_have_x11=yes AS_IF([test "x$with_x11" != xno],
X_CFLAGS="${x_cflags}" [AC_CHECK_LIB(X11, XOpenDisplay,
X_LIBS="${x_libs} -lX11"], [ac_cv_my_have_x11=yes
[ac_cv_my_have_x11=no], X_CFLAGS="${x_cflags}"
[[${x_libs}]]) X_LIBS="${x_libs} -lX11"],
[ac_cv_my_have_x11=no],
[[${x_libs}]])])
AM_CONDITIONAL(HAVE_X11, test "${ac_cv_my_have_x11}" = "yes") AM_CONDITIONAL(HAVE_X11, test "${ac_cv_my_have_x11}" = "yes")
AC_SUBST(X_CFLAGS) AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS) AC_SUBST(X_LIBS)
if test "${cross_compiling}" = "no"; then ac_cv_my_have_xt=no
AC_CHECK_LIB(Xt, XtFree, AS_IF([test "x$with_xt" != xno],
[ac_cv_my_have_xt=yes [AC_CHECK_LIB(Xt, XtFree,
AC_CHECK_LIB(Xmu, XmuDrawLogo, if test "${cross_compiling}" = "no"; then
[XT_CFLAGS="${x_cflags}" [ac_cv_my_have_xt=yes
XT_LIBS="${x_libs} -lXmu -lXt -lSM -lICE -lXext -lX11"], AC_CHECK_LIB(Xmu, XmuDrawLogo,
[XT_CFLAGS="${x_cflags}" [XT_CFLAGS="${x_cflags}"
XT_LIBS="${x_libs} -lXt -lSM -lICE -lXext -lX11"], XT_LIBS="${x_libs} -lXmu -lXt -lSM -lICE -lXext -lX11"],
[[-lXt -lSM -lICE -lXext -lX11 ${x_libs}]])], [XT_CFLAGS="${x_cflags}"
[ac_cv_my_have_xt=no], XT_LIBS="${x_libs} -lXt -lSM -lICE -lXext -lX11"],
[[-lSM -lICE -lXext -lX11 ${x_libs}]]) [[-lXt -lSM -lICE -lXext -lX11 ${x_libs}]])],
else [ac_cv_my_have_xt=no],
ac_cv_my_have_xt=no [[-lSM -lICE -lXext -lX11 ${x_libs}]])
fi fi])
AM_CONDITIONAL(HAVE_XT, test "${ac_cv_my_have_xt}" = "yes") AM_CONDITIONAL(HAVE_XT, test "${ac_cv_my_have_xt}" = "yes")
AC_SUBST(XT_CFLAGS) AC_SUBST(XT_CFLAGS)
AC_SUBST(XT_LIBS) AC_SUBST(XT_LIBS)
if test "${cross_compiling}" = "no"; then ac_cv_my_have_xaw=no
AC_CHECK_LIB(Xaw, XawTextSearch, AS_IF([test "x$with_xaw" != xno],
[ac_cv_my_have_xaw=yes [if test "${cross_compiling}" = "no"; then
XAW_CFLAGS="${x_cflags}" AC_CHECK_LIB(Xaw, XawTextSearch,
XAW_LIBS="${x_libs} -lXaw ${XT_LIBS}"], [ac_cv_my_have_xaw=yes
[ac_cv_my_have_xaw=no], XAW_CFLAGS="${x_cflags}"
[[${XT_LIBS}]]) XAW_LIBS="${x_libs} -lXaw ${XT_LIBS}"],
else [ac_cv_my_have_xaw=no],
ac_cv_my_have_xaw="no (cross-compiling)" [[${XT_LIBS}]])
fi fi])
AM_CONDITIONAL(HAVE_XAW, test "${ac_cv_my_have_xaw}" = "yes") AM_CONDITIONAL(HAVE_XAW, test "${ac_cv_my_have_xaw}" = "yes")
AC_SUBST(XAW_CFLAGS) AC_SUBST(XAW_CFLAGS)
AC_SUBST(XAW_LIBS) AC_SUBST(XAW_LIBS)
ac_cv_my_have_motif=no
if test "${cross_compiling}" = "no"; then if test "${cross_compiling}" = "no"; then
AC_CHECK_LIB(Xm, XmStringConcat, AC_CHECK_LIB(Xm, XmStringConcat,
[ac_cv_my_have_motif=yes [ac_cv_my_have_motif=yes
@ -533,8 +554,6 @@ if test "${cross_compiling}" = "no"; then
MOTIF_LIBS="${x_libs} -lXm ${XT_LIBS}"], MOTIF_LIBS="${x_libs} -lXm ${XT_LIBS}"],
[ac_cv_my_have_motif=no], [ac_cv_my_have_motif=no],
[[${XT_LIBS}]]) [[${XT_LIBS}]])
else
ac_cv_my_have_motif="no (cross-compiling)"
fi fi
AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes") AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes")
AC_SUBST(MOTIF_CFLAGS) AC_SUBST(MOTIF_CFLAGS)