* Added autoconf checks for -lgdbm, X11, Xaw and Motif.

git-svn-id: svn://svn.zoy.org/elk/trunk@100 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2003-09-06 11:15:57 +00:00
parent 6000fb66f3
commit 57766216c8
5 changed files with 98 additions and 31 deletions

View File

@ -12,7 +12,6 @@ AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AM_CONDITIONAL(HAVE_CXX, test -n "$CXX")
AC_PROG_LIBTOOL
AC_STDC_HEADERS
@ -21,6 +20,16 @@ AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_HEADERS(stdint.h inttypes.h sys/_inttypes.h)
if test "${ac_cv_header_stdint_h}" = "yes"; then
STDINT_HEADER="stdint.h"
elif test "${ac_cv_header_inttypes_h}" = "yes"; then
STDINT_HEADER="inttypes.h"
elif test "${ac_cv_header_sys__inttypes_h}" = "yes"; then
STDINT_HEADER="sys/_inttypes.h"
else
AC_MSG_ERROR([cannot find C99 integer headers])
fi
AC_SUBST(STDINT_HEADER)
# $system should contain the name of this file. It may be used by some
# of the build scripts to do things that are specific to one single
@ -345,19 +354,20 @@ AC_DEFINE(OBJ_DIR, "/usr/lib/elk", [FIXME HARD])
#define FIND_AOUT defined(USE_LD) || defined(CAN_DUMP) || defined(INIT_OBJECTS)
AC_DEFINE(FIND_AOUT, 1, [FIXME HARD])
dnl
dnl Check for available libraries
dnl
ac_cv_have_gdbm=no
AC_CHECK_LIB(gdbm, gdbm_open, ac_cv_have_gdbm=yes)
AM_CONDITIONAL(HAVE_GDBM, test "${ac_cv_have_gdbm}" = "yes")
dnl
dnl Check for available compiler features
dnl
CFLAGS_save="${CFLAGS}"
LDFLAGS_save="${LDFLAGS}"
AC_CACHE_CHECK([__attribute__ ((noreturn)) support with function pointers],
if test -n "${CXX}"; then
ac_cv_my_have_cxx=yes
else
ac_cv_my_have_cxx=no
fi
AM_CONDITIONAL(HAVE_CXX, test "${ac_cv_my_have_cxx}" = "yes")
AC_CACHE_CHECK([__attribute__ ((noreturn)) support],
[ac_cv_c_attribute_noreturn],
[ac_cv_c_attribute_noreturn=no
CFLAGS="${CFLAGS_save} -Werror"
@ -385,27 +395,51 @@ if test "x${ac_cv_c_Wsign_compare}" != "xno"; then
CFLAGS_save="-Wsign-compare ${CFLAGS_save}"
fi
dnl
dnl Check for available headers and libraries
dnl
CFLAGS="${CFLAGS_save}"
INCLUDES="${INCLUDES} -I\$(top_srcdir)/include"
LDFLAGS="${LDFLAGS_save}"
X_CFLAGS="-I/usr/X11R6/include"
X_LIBS="-L/usr/X11R6/lib -lX11"
ac_cv_my_have_gdbm=no
AC_CHECK_LIB(gdbm, gdbm_open, ac_cv_my_have_gdbm=yes)
AM_CONDITIONAL(HAVE_GDBM, test "${ac_cv_my_have_gdbm}" = "yes")
XAW_CFLAGS="-I/usr/X11R6/include"
XAW_LIBS="-L/usr/X11R6/lib -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11"
AC_PATH_X
XM_CFLAGS="-I/usr/X11R6/include -I/usr/include/Xm"
XM_LIBS="-L/usr/X11R6/lib -lXm -lXmu -lXt -lSM -lICE -lXext -lX11"
dnl Export variables
AC_SUBST(INCLUDES)
AC_CHECK_LIB(X11, XOpenDisplay, [
ac_cv_my_have_x11=yes
X_CFLAGS="-I${x_includes}"
X_LIBS="-lX11 -L${x_libraries}"
], [ac_cv_my_have_x11=no],
[[-lXt -L${x_libraries}]])
AM_CONDITIONAL(HAVE_X11, test "${ac_cv_my_have_x11}" = "yes")
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
AC_CHECK_LIB(Xaw, XawTextSearch, [
ac_cv_my_have_xaw=yes
XAW_CFLAGS="-I${x_includes}"
XAW_LIBS="-L${x_libraries} -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11"
], [ac_cv_my_have_xaw=no],
[[-lXmu -lXt -lSM -lICE -lXext -lX11 -L${x_libraries}]])
AM_CONDITIONAL(HAVE_XAW, test "${ac_cv_my_have_xaw}" = "yes")
AC_SUBST(XAW_CFLAGS)
AC_SUBST(XAW_LIBS)
AC_SUBST(XM_CFLAGS)
AC_SUBST(XM_LIBS)
AC_CHECK_LIB(Xm, XmStringConcat, [
ac_cv_my_have_motif=yes
MOTIF_CFLAGS="-I${x_includes} -I/usr/include/Xm"
MOTIF_LIBS="-L${x_libraries} -lXm -lXmu -lXt -lSM -lICE -lXext -lX11"
], [ac_cv_my_have_motif=no],
[[-lXmu -lXt -lSM -lICE -lXext -lX11 -L${x_libraries}]])
AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes")
AC_SUBST(MOTIF_CFLAGS)
AC_SUBST(MOTIF_LIBS)
dnl Export variables
INCLUDES="${INCLUDES} -I\$(top_srcdir)/include"
AC_SUBST(INCLUDES)
AC_OUTPUT([
Makefile
@ -434,7 +468,20 @@ AC_OUTPUT([
lib/xwidgets/xaw/Makefile
lib/xwidgets/motif/Makefile
scm/Makefile
scm/slib.scm
src/Makefile
scm/slib.scm
include/site.h
])
cat << EOF
Configuration summary
---------------------
C++ support: ${ac_cv_my_have_cxx}
libgdbm support: ${ac_cv_my_have_xaw}
X11 support: ${ac_cv_my_have_x11}
Xaw support: ${ac_cv_my_have_xaw}
Motif support: ${ac_cv_my_have_motif}
EOF

View File

@ -4,7 +4,11 @@ include Include.am
EXTRA_DIST = MISSING
pkglib_LTLIBRARIES = xlib.la
pkglib_LTLIBRARIES = $(xlib_la)
if HAVE_X11
xlib_la = xlib.la
endif
xlib_la_SOURCES = $(SOURCES_XLIB)
xlib_la_CFLAGS = @X_CFLAGS@

View File

@ -6,7 +6,15 @@ NULL =
EXTRA_DIST = MISSING mkwidget.scm
pkglib_LTLIBRARIES = xaw-xt.la motif-xt.la
pkglib_LTLIBRARIES = $(xaw_xt_la) $(motif_xt_la)
if HAVE_XAW
xaw_xt_la = xaw-xt.la
endif
if HAVE_MOTIF
motif_xt_la = motif-xt.la
endif
xaw_xt_la_SOURCES = $(SOURCES_XT)
xaw_xt_la_CFLAGS = -I$(srcdir)/../xlib @XAW_CFLAGS@
@ -14,9 +22,9 @@ xaw_xt_la_LDFLAGS = -module -avoid-version
xaw_xt_la_LIBADD = $(top_builddir)/src/libelk.la @XAW_LIBS@
motif_xt_la_SOURCES = $(SOURCES_XT)
motif_xt_la_CFLAGS = -I$(srcdir)/../xlib @XM_CFLAGS@
motif_xt_la_CFLAGS = -I$(srcdir)/../xlib @MOTIF_CFLAGS@
motif_xt_la_LDFLAGS = -module -avoid-version
motif_xt_la_LIBADD = $(top_builddir)/src/libelk.la @XM_LIBS@
motif_xt_la_LIBADD = $(top_builddir)/src/libelk.la @MOTIF_LIBS@
extensions_HEADERS = xt.h
extensionsdir = $(pkgincludedir)/extensions

View File

@ -2,13 +2,17 @@ NULL =
EXTRA_DIST = $(SOURCES_D)
pkglib_LTLIBRARIES = motif-widgets.la
pkglib_LTLIBRARIES = $(motif_widgets_la)
if HAVE_MOTIF
motif_widgets_la = motif-widgets.la
endif
nodist_motif_widgets_la_SOURCES = $(SOURCES_C)
motif_widgets_la_SOURCES = init.c
motif_widgets_la_CFLAGS = -I$(srcdir)/../../xlib @XM_CFLAGS@
motif_widgets_la_CFLAGS = -I$(srcdir)/../../xlib @MOTIF_CFLAGS@
motif_widgets_la_LDFLAGS = -module -avoid-version -u XmIsMotifWMRunning
motif_widgets_la_LIBADD = $(top_builddir)/src/libelk.la @XM_LIBS@
motif_widgets_la_LIBADD = $(top_builddir)/src/libelk.la @MOTIF_LIBS@
.d.c:
$(top_builddir)/src/elk -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ motif

View File

@ -2,7 +2,11 @@ NULL =
EXTRA_DIST = $(SOURCES_D)
pkglib_LTLIBRARIES = xaw-widgets.la
pkglib_LTLIBRARIES = $(xaw_widgets_la)
if HAVE_MOTIF
xaw_widgets_la = xaw-widgets.la
endif
nodist_xaw_widgets_la_SOURCES = $(SOURCES_C)
xaw_widgets_la_SOURCES = init.c