more autotools adjustments
This commit is contained in:
parent
2dda6d6156
commit
bd29e01afe
220
Makefile
220
Makefile
@ -1,220 +0,0 @@
|
||||
# Makefile for procps. Chuck Blake.
|
||||
# Portions of this are highly dependent upon features specific to GNU make
|
||||
|
||||
export PREFIX = #proc# prefix for program names
|
||||
|
||||
export DESTDIR = /
|
||||
export MANDIR = /usr/man
|
||||
export MAN1DIR = $(DESTDIR)$(MANDIR)/man1
|
||||
export MAN5DIR = $(DESTDIR)$(MANDIR)/man5
|
||||
export MAN8DIR = $(DESTDIR)$(MANDIR)/man8
|
||||
export BINDIR = $(DESTDIR)/bin
|
||||
export SBINDIR = $(DESTDIR)/sbin
|
||||
export XBINDIR = $(DESTDIR)/usr/X11R6/bin
|
||||
export USRBINDIR = $(DESTDIR)/usr/bin
|
||||
export PROCDIR = $(DESTDIR)/usr/bin# /usr/proc/bin for Solaris devotees
|
||||
export APPLNK = $(DESTDIR)/etc/X11/applnk/Utilities
|
||||
export OWNERGROUP = --owner 0 --group 0
|
||||
export INSTALLBIN = install --mode a=rx --strip
|
||||
export INSTALLSCT = install --mode a=rx
|
||||
export INSTALLMAN = install --mode a=r
|
||||
|
||||
BPROG = kill # -> BINDIR
|
||||
UPROG = oldps uptime tload free w top vmstat watch skill snice # -> USRBINDIR
|
||||
PPROG = pgrep pkill# -> PROCDIR
|
||||
SPROG = sysctl
|
||||
MAN1 = oldps.1 uptime.1 tload.1 free.1 w.1 top.1 watch.1 skill.1 kill.1 snice.1 pgrep.1 pkill.1
|
||||
MAN5 = sysctl.conf.5
|
||||
MAN8 = vmstat.8 sysctl.8
|
||||
DESKTOP = top.desktop
|
||||
XSCPT = XConsole # -> XBINDIR
|
||||
|
||||
SUBDIRS = ps # sub-packages to build/install
|
||||
|
||||
# easy to command-line override
|
||||
export INCDIRS = -I/usr/include/ncurses -I/usr/X11R6/include
|
||||
|
||||
export CC = gcc #-ggdb # this gets compiling and linking :-)
|
||||
export OPT = -O2
|
||||
export CFLAGS = -D_GNU_SOURCE $(OPT) -I$(shell pwd) $(INCDIRS) -W -Wall -Wstrict-prototypes -Wshadow -Wcast-align -Wmissing-prototypes
|
||||
|
||||
export SHARED = 1# build/install both a static and ELF shared library
|
||||
export SHLIBDIR = $(DESTDIR)/lib# where to install the shared library
|
||||
|
||||
export LDFLAGS = -Wl,-warn-common #-s recommended for ELF systems
|
||||
#LDFLAGS = -qmagic -s# recommended for a.out systems
|
||||
#LDFLAGS = -Xlinker -qmagic -s# older a.out systems may need this
|
||||
#LDFLAGS = -N -s# still older a.out systems use this
|
||||
|
||||
#BFD_CAPABLE = -DBFD_CAPABLE
|
||||
#AOUT_CAPABLE = #-DAOUT_CAPABLE
|
||||
#ELF_CAPABLE = #-DELF_CAPABLE
|
||||
|
||||
#LIBBFD = -lbfd -liberty
|
||||
LIBCURSES = -lncurses# watch is the only thing that needs this
|
||||
#LIBCURSES = -lcurses -ltermcap# BSD Curses requires termcap
|
||||
LIBTERMCAP = -lncurses# provides perfectly good termcap support
|
||||
#LIBTERMCAP = -ltermcap
|
||||
EXTRALIBS = # -lshadow
|
||||
|
||||
W_SHOWFROM = -DW_SHOWFROM# show remote host users are logged in from.
|
||||
|
||||
#----------------------------------------------------#
|
||||
# End of user-configurable portion of the Makefile. #
|
||||
# You should not need to modify anything below this. #
|
||||
#----------------------------------------------------#
|
||||
BUILD = $(BPROG) $(UPROG) $(PPROG) $(SPROG) $(SUBDIRS) $(DESKTOP)
|
||||
|
||||
# BUILD LIBRARIES + PROGRAMS
|
||||
all: $(BUILD)
|
||||
|
||||
# INSTALL PROGRAMS + DOCS
|
||||
install: $(patsubst %,install_%,$(BUILD) $(XSCPT) $(MAN1) $(MAN5) $(MAN8))
|
||||
ifeq ($(SHARED),1)
|
||||
install $(OWNERGROUP) --mode a=rx $(LIB_TGT) $(SHLIBDIR)
|
||||
endif
|
||||
|
||||
# INSTALL LIBRARIES + HEADERS (OPTIONAL)
|
||||
libinstall:
|
||||
$(MAKE) -C proc install $(LIBPROCPASS)
|
||||
|
||||
clean:
|
||||
$(RM) -f $(OBJ) $(BPROG) $(UPROG) $(PPROG) $(SPROG)
|
||||
for i in proc $(SUBDIRS); do $(MAKE) -C $$i clean; done
|
||||
|
||||
distclean: clean
|
||||
for i in proc $(SUBDIRS); do $(MAKE) -C $$i clean; done
|
||||
$(RM) -f $(OBJ) $(BPROG) $(UPROG) $(SPROG) \
|
||||
proc/.depend
|
||||
|
||||
|
||||
#-----------------------------------------------------#
|
||||
# End of user-callable make targets. #
|
||||
# You should not need to read anything below this. #
|
||||
#-----------------------------------------------------#
|
||||
|
||||
.PHONY: all install libinstall clean distclean
|
||||
.PHONY: $(patsubst %,install_%, $(BPROG) $(UPROG) $(SPROG))
|
||||
.PHONY: proc ps
|
||||
.PHONY: $(patsubst %,build_%, proc ps)
|
||||
.PHONY: $(patsubst %,install_%, proc ps)
|
||||
|
||||
VERSION = $(shell awk '/^%define major_version/ { print $$3 }' < procps.spec)
|
||||
SUBVERSION = $(shell awk '/^%define minor_version/ { print $$3 }' < procps.spec)
|
||||
MINORVERSION = $(shell awk '/^%define revision/ { print $$3 }' < procps.spec)
|
||||
|
||||
# Note: LIBVERSION may be less than $(VERSION).$(SUBVERSION).$(MINORVERSION)
|
||||
# LIBVERSION is only set to current $(VERSION).$(SUBVERSION).$(MINORVERSION)
|
||||
# when an incompatible change is made in libproc.
|
||||
LIBVERSION = 2.0.7
|
||||
ifdef MINORVERSION
|
||||
LIBPROCPASS = SHARED=$(SHARED) SHLIBDIR=$(SHLIBDIR) VERSION=$(VERSION) SUBVERSION=$(SUBVERSION) MINORVERSION=$(MINORVERSION) LIBVERSION=$(LIBVERSION)
|
||||
else
|
||||
LIBPROCPASS = SHARED=$(SHARED) SHLIBDIR=$(SHLIBDIR) VERSION=$(VERSION) SUBVERSION=$(SUBVERSION) LIBVERSION=$(LIBVERSION)
|
||||
endif
|
||||
|
||||
# libproc setup
|
||||
|
||||
ifeq ($(SHARED),1)
|
||||
LIB_TGT = proc/libproc.so.$(LIBVERSION)
|
||||
else
|
||||
LIB_TGT = proc/libproc.a
|
||||
endif
|
||||
|
||||
$(LIB_TGT): $(wildcard proc/*.[ch])
|
||||
$(MAKE) -C proc `basename $(LIB_TGT)` $(LIBPROCPASS)
|
||||
|
||||
# component package setup -- the pattern should be obvious: A build rule and
|
||||
# unified executable+documentation install rule. (An extra makefile rule is
|
||||
# needed for those packages which use Imake.)
|
||||
|
||||
ps: build_ps
|
||||
build_ps: ; $(MAKE) -C ps
|
||||
install_ps: ps ; $(MAKE) -C ps install
|
||||
|
||||
# executable dependencies
|
||||
oldps kill skill snice top w uptime tload free vmstat utmp : $(LIB_TGT)
|
||||
|
||||
# static pattern build/link rules:
|
||||
|
||||
%.o : %.c
|
||||
$(strip $(CC) $(CFLAGS) -c $^)
|
||||
|
||||
oldps w uptime tload free vmstat utmp pgrep: % : %.o
|
||||
$(strip $(CC) $(LDFLAGS) -o $@ $< $(LIB_TGT) $(EXTRALIBS))
|
||||
|
||||
|
||||
# special instances of link rules (need extra libraries/objects)
|
||||
|
||||
top: % : %.o
|
||||
$(strip $(CC) $(LDFLAGS) -o $@ $^ $(LIB_TGT) $(LIBTERMCAP) $(EXTRALIBS))
|
||||
|
||||
watch: % : %.o
|
||||
$(strip $(CC) $(SLDFLAGS) -o $@ $< $(LIBCURSES) $(EXTRALIBS))
|
||||
|
||||
|
||||
# special instances of compile rules (need extra defines)
|
||||
w.o: w.c
|
||||
$(strip $(CC) $(CFLAGS) $(W_SHOWFROM) -c $<)
|
||||
|
||||
top.o: top.c
|
||||
$(strip $(CC) $(CFLAGS) -fwritable-strings -c $<)
|
||||
|
||||
skill.o: skill.c
|
||||
$(strip $(CC) $(CFLAGS) -DSYSV -c $<)
|
||||
|
||||
snice: skill
|
||||
ln -f skill snice
|
||||
|
||||
kill: skill
|
||||
ln -f skill kill
|
||||
|
||||
pkill: pgrep
|
||||
ln -f pgrep pkill
|
||||
|
||||
# static pattern installation rules
|
||||
|
||||
$(patsubst %,install_%,$(BPROG)): install_%: %
|
||||
$(INSTALLBIN) $< $(BINDIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(SPROG)): install_%: %
|
||||
$(INSTALLBIN) $< $(SBINDIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(UPROG)): install_%: %
|
||||
$(INSTALLBIN) $< $(USRBINDIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(PPROG)): install_%: %
|
||||
$(INSTALLBIN) $< $(PROCDIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(XSCPT)): install_%: %
|
||||
$(INSTALLSCT) $< $(XBINDIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(MAN1)) : install_%: %
|
||||
$(INSTALLMAN) $< $(MAN1DIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(MAN5)) : install_%: %
|
||||
$(INSTALLMAN) $< $(MAN5DIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(MAN8)) : install_%: %
|
||||
$(INSTALLMAN) $< $(MAN8DIR)/$(PREFIX)$<
|
||||
$(patsubst %,install_%,$(DESKTOP)) : install_%: %
|
||||
$(INSTALLSCT $< $(APPLNK)/$(PREFIX)$<
|
||||
|
||||
# special case install rules
|
||||
install_snice: snice install_skill
|
||||
cd $(USRBINDIR) && ln -f skill snice
|
||||
install_kill: snice install_skill
|
||||
cd $(USRBINDIR) && ln -f skill kill
|
||||
install_pkill: pgrep install_pgrep
|
||||
cd $(USRBINDIR) && ln -f pgrep pkill
|
||||
|
||||
# Find all the source and object files in this directory
|
||||
|
||||
SRC = $(sort $(wildcard *.c))
|
||||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
CVSTAG = ps_$(VERSION)_$(SUBVERSION)_$(MINORVERSION)
|
||||
FILEVERSION = $(VERSION).$(SUBVERSION).$(MINORVERSION)
|
||||
dist: archive
|
||||
archive:
|
||||
@cvs -Q tag -F $(CVSTAG)
|
||||
@rm -rf /tmp/procps
|
||||
@cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) procps || echo GRRRrrrrr -- ignore [export aborted]
|
||||
@mv /tmp/procps /tmp/procps-$(FILEVERSION)
|
||||
@cd /tmp; tar czSpf procps-$(FILEVERSION).tar.gz procps-$(FILEVERSION)
|
||||
@cd /tmp; cp procps-$(FILEVERSION)/procps.lsm procps-$(FILEVERSION).lsm
|
||||
@rm -rf /tmp/procps-$(FILEVERSION)
|
||||
@echo "The final archive is /tmp/procps-$(FILEVERSION).tar.gz"
|
510
aclocal.m4
vendored
Normal file
510
aclocal.m4
vendored
Normal file
@ -0,0 +1,510 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# serial 40 AC_PROG_LIBTOOL
|
||||
AC_DEFUN(AC_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
||||
|
||||
# Save cache, so that ltconfig can load it
|
||||
AC_CACHE_SAVE
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
||||
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Reload cache, that may have been modified by ltconfig
|
||||
AC_CACHE_LOAD
|
||||
|
||||
# This can be used to rebuild libtool when needed
|
||||
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)dnl
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LIBTOOL_SETUP,
|
||||
[AC_PREREQ(2.13)dnl
|
||||
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_LD])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
|
||||
# Check for any special flags to pass to ltconfig.
|
||||
libtool_flags="--cache-file=$cache_file"
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
case "$host" in
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
case "`/usr/bin/file conftest.o`" in
|
||||
*32-bit*)
|
||||
LD="${LD-ld} -32"
|
||||
;;
|
||||
*N32*)
|
||||
LD="${LD-ld} -n32"
|
||||
;;
|
||||
*64-bit*)
|
||||
LD="${LD-ld} -64"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
*-*-sco3.2v5*)
|
||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
||||
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
||||
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
||||
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
;;
|
||||
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[*-*-cygwin* | *-*-mingw*)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
])
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
||||
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
||||
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(shared,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_SHARED(no)])
|
||||
|
||||
# AC_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
||||
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(static,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_STATIC(no)])
|
||||
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
||||
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
||||
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(fast-install,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
||||
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_FAST_INSTALL(no)])
|
||||
|
||||
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AC_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
changequote(,)dnl
|
||||
[\\/]* | [A-Za-z]:[\\/]*)
|
||||
re_direlt='/[^/][^/]*/\.\./'
|
||||
changequote([,])dnl
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$ac_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_SUBST(LD)
|
||||
AC_PROG_LD_GNU
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
ac_cv_prog_gnu_ld=yes
|
||||
else
|
||||
ac_cv_prog_gnu_ld=no
|
||||
fi])
|
||||
])
|
||||
|
||||
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AC_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[if test -n "$NM"; then
|
||||
# Let the user override the test.
|
||||
ac_cv_path_NM="$NM"
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
break
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
break
|
||||
else
|
||||
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
||||
continue # so that we can try to find one that supports BSD flags
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
fi])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
AC_SUBST(NM)
|
||||
])
|
||||
|
||||
# AC_CHECK_LIBM - check for math library
|
||||
AC_DEFUN(AC_CHECK_LIBM,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
LIBM=
|
||||
case "$host" in
|
||||
*-*-beos* | *-*-cygwin*)
|
||||
# These system don't have libm
|
||||
;;
|
||||
*-ncr-sysv4.3*)
|
||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
||||
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(m, main, LIBM="-lm")
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl convenience library, adds --enable-ltdl-convenience to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
case "$enable_ltdl_convenience" in
|
||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
||||
"") enable_ltdl_convenience=yes
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl installable library, and adds --enable-ltdl-install to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_CHECK_LIB(ltdl, main,
|
||||
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
||||
[if test x"$enable_ltdl_install" = xno; then
|
||||
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
||||
else
|
||||
enable_ltdl_install=yes
|
||||
fi
|
||||
])
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
|
||||
else
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
INCLTDL=
|
||||
fi
|
||||
])
|
||||
|
||||
dnl old names
|
||||
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
||||
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
|
||||
dnl This is just to silence aclocal about the macro not being used
|
||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
||||
|
140
config.h.in
Normal file
140
config.h.in
Normal file
@ -0,0 +1,140 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
#undef GETPGRP_VOID
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#undef HAVE_ST_RDEV
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <mkdev.h>. */
|
||||
#undef MAJOR_IN_MKDEV
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
|
||||
#undef MAJOR_IN_SYSMACROS
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the regcomp function. */
|
||||
#undef HAVE_REGCOMP
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#undef HAVE_SELECT
|
||||
|
||||
/* Define if you have the strcspn function. */
|
||||
#undef HAVE_STRCSPN
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strspn function. */
|
||||
#undef HAVE_STRSPN
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#undef HAVE_STRSTR
|
||||
|
||||
/* Define if you have the strtod function. */
|
||||
#undef HAVE_STRTOD
|
||||
|
||||
/* Define if you have the strtol function. */
|
||||
#undef HAVE_STRTOL
|
||||
|
||||
/* Define if you have the strtoul function. */
|
||||
#undef HAVE_STRTOUL
|
||||
|
||||
/* Define if you have the uname function. */
|
||||
#undef HAVE_UNAME
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the c library (-lc). */
|
||||
#undef HAVE_LIBC
|
||||
|
||||
/* Define if you have the efence library (-lefence). */
|
||||
#undef HAVE_LIBEFENCE
|
||||
|
||||
/* Define if you have the proc library (-lproc). */
|
||||
#undef HAVE_LIBPROC
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
51
configure.in
Normal file
51
configure.in
Normal file
@ -0,0 +1,51 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(free.c)
|
||||
|
||||
dnl sets package name and version
|
||||
AM_INIT_AUTOMAKE(procps,3.0)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl Replace `main' with a function in -lc:
|
||||
AC_CHECK_LIB(c, main)
|
||||
dnl Replace `main' with a function in -lefence:
|
||||
AC_CHECK_LIB(efence, main)
|
||||
dnl Replace `main' with a function in -lproc:
|
||||
#AC_CHECK_LIB(proc, main)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_UID_T
|
||||
AC_C_INLINE
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_STRUCT_ST_RDEV
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_GETPGRP
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_HEADER_MAJOR
|
||||
AC_FUNC_MMAP
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_STRFTIME
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(gettimeofday regcomp select strcspn strdup strerror strspn strstr strtod strtol strtoul uname)
|
||||
|
||||
AC_SUBST(NCURSES_LIB)
|
||||
AC_CHECK_LIB(ncurses, initscr,NCURSES_LIB="-lncurses",AC_MSG_ERROR(Need ncurses to compile this program))
|
||||
|
||||
|
||||
AC_OUTPUT(Makefile ps/Makefile proc/Makefile)
|
@ -1,98 +0,0 @@
|
||||
# Auto-adaptive C library Makefile adapted for libproc, Chuck Blake.
|
||||
# Assumptions are basically that all the .c files in the CWD are modules
|
||||
# for the library and that all .h files are the interface to the library.
|
||||
|
||||
# PROJECT SPECIFIC MACROS
|
||||
NAME = proc
|
||||
|
||||
# INSTALLATION OPTIONS
|
||||
TOPDIR = /usr
|
||||
HDRDIR = $(TOPDIR)/include/$(NAME)# where to put .h files
|
||||
LIBDIR = $(TOPDIR)/lib# where to put library files
|
||||
SHLIBDIR = /lib# where to put shared library files
|
||||
HDROWN = $(OWNERGROUP) # owner of header files
|
||||
LIBOWN = $(OWNERGROUP) # owner of library files
|
||||
INSTALL = install
|
||||
|
||||
# ----------------------------------------------------------------#
|
||||
# The rest is the auto-magic section -- highly GNU make dependent #
|
||||
# You should never need to edit this. #
|
||||
# ----------------------------------------------------------------#
|
||||
|
||||
VC_SUF = ,v
|
||||
VC_PFX = RCS/
|
||||
RCSFILES = $(patsubst $(VC_PFX)%$(VC_SUF),%,$(wildcard $(VC_PFX)*$(VC_SUF)))
|
||||
|
||||
# We take the union of RCS files and other files in CWD so that new files do
|
||||
# not need to alter this makefile. 'sort' removes duplicates. This allows the
|
||||
# convenience of compiling and testing new files before the initial check-in.
|
||||
|
||||
SRC = $(sort $(wildcard *.c) $(filter %.c,$(RCSFILES)))
|
||||
HDR = $(sort $(wildcard *.h) $(filter %.h,$(RCSFILES)))
|
||||
|
||||
OBJ = $(SRC:.c=.o)
|
||||
SONAME = lib$(NAME).so.$(LIBVERSION)
|
||||
|
||||
ifeq ($(SHARED),1)
|
||||
CFLAGS += -fpic
|
||||
all: lib$(NAME).a $(SONAME)
|
||||
else
|
||||
all: lib$(NAME).a
|
||||
endif
|
||||
|
||||
lib$(NAME).a: $(OBJ)
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
$(SONAME): $(OBJ)
|
||||
gcc -shared -Wl,-soname,$(SONAME) -o $@ $^ -lc
|
||||
ln -sf $(SONAME) lib$(NAME).so
|
||||
|
||||
# AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT
|
||||
|
||||
.depend:
|
||||
$(strip $(CC) $(CFLAGS) -MM -MG $(SRC) > .depend)
|
||||
-include .depend
|
||||
|
||||
# INSTALLATION
|
||||
|
||||
install: all
|
||||
if ! [ -d $(HDRDIR) ] ; then mkdir $(HDRDIR) ; fi
|
||||
$(INSTALL) $(HDROWN) $(HDR) $(TOPDIR)/include/$(NAME)
|
||||
$(INSTALL) $(LIBOWN) lib$(NAME).a $(LIBDIR)
|
||||
ifeq ($(SHARED),1)
|
||||
$(INSTALL) $(LIBOWN) $(SONAME) $(SHLIBDIR)
|
||||
cd $(SHLIBDIR) && ln -sf $(SONAME) lib$(NAME).so
|
||||
ldconfig
|
||||
endif
|
||||
|
||||
# VARIOUS SHORT CUT TARGETS
|
||||
.PHONY: all install dep clean distclean checkout checkclean
|
||||
|
||||
dep: .depend
|
||||
|
||||
clean:
|
||||
$(RM) lib$(NAME).* *.o DEADJOE
|
||||
|
||||
distclean: clean
|
||||
$(RM) .depend *~
|
||||
|
||||
checkout:
|
||||
$(CO) $(RCSFILES)
|
||||
|
||||
checkclean:
|
||||
$(RM) $(RCSFILES)
|
||||
|
||||
# CUSTOM c -> o rule so that command-line has minimal whitespace
|
||||
|
||||
%.o : %.c
|
||||
$(strip $(CC) $(CFLAGS) -c $<)
|
||||
|
||||
# PROJECT SPECIFIC DEPENDENCIES/BUILD RULES
|
||||
|
||||
|
||||
version.o: version.c version.h
|
||||
ifdef MINORVERSION
|
||||
$(strip $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\" -c version.c)
|
||||
else
|
||||
$(strip $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -c version.c)
|
||||
endif
|
35
ps/Makefile
35
ps/Makefile
@ -1,35 +0,0 @@
|
||||
all: ps
|
||||
|
||||
ps: escape.o global.o help.o select.o sortformat.o output.o parser.o display.o
|
||||
$(CC) -o ps escape.o global.o help.o select.o sortformat.o output.o parser.o display.o -L../proc -lproc
|
||||
|
||||
# This just adds the stacktrace code
|
||||
debug: escape.o global.o help.o select.o sortformat.o output.o parser.o display.o stacktrace.o
|
||||
$(CC) -o ps escape.o global.o help.o select.o sortformat.o output.o parser.o display.o stacktrace.o -L../proc -lproc -lefence
|
||||
|
||||
sortformat.o: sortformat.c common.h
|
||||
|
||||
global.o: global.c common.h
|
||||
|
||||
escape.o: escape.c
|
||||
|
||||
help.o: help.c
|
||||
|
||||
select.o: select.c common.h
|
||||
|
||||
output.o: output.c common.h
|
||||
|
||||
parser.o: parser.c common.h
|
||||
|
||||
display.o: display.c common.h
|
||||
|
||||
stacktrace.o: stacktrace.c
|
||||
|
||||
|
||||
install: ps
|
||||
install $(OWNERGROUP) --mode a=rx --strip ps $(BINDIR)/ps
|
||||
install $(OWNERGROUP) --mode a=r ps.1 $(MAN1DIR)/ps.1
|
||||
-rm -f $(DESTDIR)/var/catman/cat1/ps.1.gz $(DESTDIR)/var/man/cat1/ps.1.gz
|
||||
|
||||
clean:
|
||||
rm -f *.o DEADJOE *~ core ps gmon.out
|
Loading…
Reference in New Issue
Block a user