1) check for alloca.h in configure.in

2) use more portable dependency scheme

CVS patchset: 2023
CVS date: 1998/03/04 16:52:19
This commit is contained in:
ewt 1998-03-04 16:52:19 +00:00
parent 820afde7fa
commit 619bdbe02e
2 changed files with 36 additions and 12 deletions

View File

@ -1,51 +1,56 @@
srcdir = @srcdir@
VPATH = $(srcdir)
top_srcdir = @top_srcdir@
VPATH = @srcdir
LIBOBJECTS = popt.o
WARNINGS = -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
SOURCES = $(addprefix $(srcdir)/,$(subst .o,.c,$(LIBOBJECTS)))
LIBPOPT = libpopt.a
RANLIB=@RANLIB@
INSTALL=@INSTALL@
INSTALL_PREOGRAM=@INSTALL_PREOGRAM@
INSTALL_DATA=@INSTALL_DATA@
prefix=@prefix@
LIBS=$(prefix)/lib
INCLUDE=$(prefix)/include
# -----------------------------------------------------------------------
CFLAGS = @CFLAGS@ @DEFS@ $(WARNINGS) $(OPTS)
CFLAGS = @CFLAGS@ @DEFS@ $(OPTS)
ifeq ($(RANLIB),)
RANLIB=ranlib
endif
ifeq (.depend,$(wildcard .depend))
ifeq (.depend,$(wildcard .depend-done))
TARGET=allprogs
else
TARGET=depend allprogs
TARGET=@TARGET@
endif
$(LIBPOPT): $(LIBPOPT)($(LIBOBJECTS))
$(RANLIB) $@
distclean: clean
rm -f Makefile config.h config.cache config.status config.log
rm -f Makefile .depend-done
clean:
rm -f *.a *.o *~ $(PROGS) test.out tagtable.c
squeaky: clean
squeaky: distclean
rm -f .depend
depend:
$(CPP) $(CFLAGS) -M $(SOURCES) > .depend
topdir_path=`( cd $(top_srcdir) && pwd )` ; \
$(CPP) $(CFLAGS) -MM $(SOURCES) | \
sed s+$$topdir_path+$(top_srcdir)+g > .depend
install:
mkdir -p $(PREFIX)/$(INCLUDE)
mkdir -p $(PREFIX)/$(LIBS)
install -m 644 popt.h $(PREFIX)/$(INCLUDE)/popt.h
install -m 644 $(LIBPOPT) $(PREFIX)/$(LIBS)/$(LIBPOPT)
$INSTALL_DATA) -m 644 popt.h $(PREFIX)/$(INCLUDE)/popt.h
$INSTALL_DATA) -m 644 $(LIBPOPT) $(PREFIX)/$(LIBS)/$(LIBPOPT)
ifeq (.depend,$(wildcard .depend))
include .depend

View File

@ -2,8 +2,27 @@ AC_INIT(popt.h)
AC_PROG_CC
AC_GCC_TRADITIONAL
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_HEADER(unistd.h)
dnl
dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
dnl requires gcc). If it's not, don't rebuild dependencies -- use what was
dnl shipped with RPM.
dnl
if test X"$GCC" = Xyes ; then
TARGET="depend allprogs"
else
TARGET="everything"
#
# let the Makefile know that we're done with `depend', since we don't
# have gcc we're not going to rebuild our dependencies at all.
#
echo > .depend-done
fi
AC_SUBST(TARGET)
AC_CHECK_HEADERS(unistd.h alloca.h)
AC_CHECK_FUNCS(mmap)
AC_CHECK_FUNCS(strerror)