diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-03-11 21:43:04 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-07-02 19:03:10 -0300 |
commit | 2f7992eaefb19f23c127e15624ba38208c03439b (patch) | |
tree | 061d365af23a69f1b942d7087bf6173cda57c57a | |
parent | 19e3f51f9758e2708fb4abfa364b346591089bcd (diff) |
Update build for sane defaults.
Check for existing system functions.
Don't add test program sources with main functions to libraries.
Build test programs.
-rw-r--r-- | Makefile.am | 59 | ||||
-rw-r--r-- | configure.ac | 36 |
2 files changed, 69 insertions, 26 deletions
diff --git a/Makefile.am b/Makefile.am index f698010..7da5d92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,11 +19,9 @@ # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -XEDITDIR = ${libdir}/X11/xedit -xedit_lispdir = ${XEDITDIR}/lisp - bin_PROGRAMS = xedit noinst_LIBRARIES = liblisp.a libre.a libmp.a +noinst_PROGRAMS = lisp/lsp lisp/re/tests # # libmp.a @@ -40,8 +38,7 @@ libmp_a_SOURCES = \ # liblisp.a # -liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(xedit_lispdir)\" $(XEDIT_CFLAGS) -liblisp_a_LIBADD = libmp.a +liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(LISPDIR)\" $(PKGDEPS_CFLAGS) liblisp_a_SOURCES = \ lisp/bytecode.c \ lisp/bytecode.h \ @@ -60,7 +57,6 @@ liblisp_a_SOURCES = \ lisp/io.h \ lisp/lisp.c \ lisp/lisp.h \ - lisp/lsp.c \ lisp/math.c \ lisp/math.h \ lisp/package.c \ @@ -87,6 +83,10 @@ liblisp_a_SOURCES = \ lisp/xedit.c \ lisp/xedit.h +if NEED_UNSETENV +liblisp_a_SOURCES += lisp/env.c +endif + # # libre.a # @@ -97,15 +97,14 @@ libre_a_SOURCES = \ lisp/re/rec.c \ lisp/re/re.h \ lisp/re/reo.c \ - lisp/re/rep.h \ - lisp/re/tests.c + lisp/re/rep.h # # xedit # -xedit_CFLAGS = $(XEDIT_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE -DXEDIT -xedit_LDADD = libre.a liblisp.a libmp.a $(XEDIT_LIBS) -lm +xedit_CFLAGS = $(PKGDEPS_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE -DXEDIT +xedit_LDADD = -L. -lre -llisp -lmp $(PKGDEPS_LIBS) -lm xedit_SOURCES = \ commands.c \ @@ -113,13 +112,19 @@ xedit_SOURCES = \ ispell.c \ lisp.c \ options.c \ - realpath.c \ - strcasecmp.c \ util.c \ xedit.c \ xedit.h -if XAW_USE_XPRINT +if NEED_REALPATH +xedit_SOURCES += realpath.c +endif + +if NEED_STRCASECMP +xedit_SOURCES += strcasecmp.c +endif + +if USE_XPRINT xedit_CFLAGS += -DINCLUDE_XPRINT_SUPPORT xedit_SOURCES += \ @@ -130,13 +135,33 @@ xedit_SOURCES += \ print.h endif +# lisp/lsp +lisp_lsp_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"@LISPDIR@\" -D_BSD_SOURCE +lisp_lsp_LDADD = -L. -llisp -lre -lmp -lm +lisp_lsp_SOURCES = \ + lisp/lsp.c + +if NEED_REALPATH +lisp_lsp_SOURCES += realpath.c +endif + +if NEED_STRCASECMP +lisp_lsp_SOURCES += strcasecmp.c +endif + +# re/tests +lisp_re_tests_CFLAGS = -I$(top_srcdir)/lisp/re -D_BSD_SOURCE +lisp_re_tests_LDADD = -L. -lre +lisp_re_tests_SOURCES = lisp/re/tests.c + + # App default files (*.ad) APPDEFAULTFILES = \ Xedit-color \ Xedit -if XAW_USE_XPRINT +if USE_XPRINT Xedit.ad: cp $(top_srcdir)/Xedit-xprint.ad Xedit.ad else @@ -154,13 +179,13 @@ appdefault_DATA = $(APPDEFAULTFILES) CLEANFILES = $(APPDEFAULTFILES) Xedit.ad -# Note that xedit_lispdir is defined above -dist_xedit_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \ +lispdir = $(LISPDIR) +dist_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \ ${srcdir}/lisp/modules/xedit.lsp \ ${srcdir}/lisp/modules/syntax.lsp \ ${srcdir}/lisp/modules/indent.lsp -progmodesdir = $(xedit_lispdir)/progmodes +progmodesdir = $(LISPDIR)/progmodes dist_progmodes_DATA = ${srcdir}/lisp/modules/progmodes/c.lsp \ ${srcdir}/lisp/modules/progmodes/html.lsp \ ${srcdir}/lisp/modules/progmodes/imake.lsp \ diff --git a/configure.ac b/configure.ac index c421a79..2672a87 100644 --- a/configure.ac +++ b/configure.ac @@ -29,20 +29,38 @@ AM_MAINTAINER_MODE AM_CONFIG_HEADER(config.h) AC_PROG_CC +AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_RANLIB +PKG_PROG_PKG_CONFIG -# Checks for pkg-config packages -XAW_CHECK_XPRINT_SUPPORT(XEDIT) -if test "x$xaw_use_xprint" = "xyes" ; then - PKG_CHECK_MODULES(XPRINT_UTIL, xprintutil xp) - - XEDIT_CFLAGS="$XEDIT_CFLAGS $XPRINT_UTIL_CFLAGS" - XEDIT_LIBS="$XEDIT_LIBS $XPRINT_UTIL_LIBS" +AC_ARG_ENABLE(xprint, + AS_HELP_STRING([--enable-xprint], + [Compile with xprint support (default: disabled)]), + [enable_xprint=$enableval], [enable_xprint=no]) +AM_CONDITIONAL(USE_XPRINT, test x$enable_xprint = xyes) +if test x$enable_xprint = xyes; then + PKG_CHECK_MODULES(PKGDEPS, xprintutil xp xaw8) +else + PKG_CHECK_MODULES(PKGDEPS, xaw7) fi -AC_SUBST(XEDIT_CFLAGS) -AC_SUBST(XEDIT_LIBS) +AC_ARG_WITH(lispdir, AS_HELP_STRING([--with-lispdir=PATH], + [Directory to install lisp files (default: $libdir/X11/xedit/lisp)]), + [ lispdir="$withval"], + [ lispdir=${libdir}/X11/xedit/lisp ]) +LISPDIR=$lispdir +AC_SUBST(LISPDIR) + +AC_CHECK_FUNC(realpath, [], [have_realpath=yes]) +AM_CONDITIONAL(NEED_REALPATH, test x$have_realpath = xyes) +AC_CHECK_FUNC(strcasecmp, [], [have_strcasecmp=yes]) +AM_CONDITIONAL(NEED_STRCASECMP, test x$have_strcasecmp = xyes) +AC_CHECK_FUNC(unsetenv, [], [have_unsetenv=yes]) +AM_CONDITIONAL(NEED_UNSETENV, test x$have_unsetenv = xyes) + +AC_SUBST(PKGDEPS_CFLAGS) +AC_SUBST(PKGDEPS_LIBS) PKG_CHECK_MODULES(APPDEFS, xt) appdefaultdir=$(pkg-config --variable=appdefaultdir xt) |