1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Makefiles & autoconf.

This commit is contained in:
Alasdair Kergon 2001-09-21 12:37:43 +00:00
parent b5ab48be2a
commit 795ca3e5b8
8 changed files with 2718 additions and 23 deletions

26
Makefile.in Normal file
View File

@ -0,0 +1,26 @@
#
# Copyright (C) 2001 Sistina Software
#
# This LVM library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This LVM library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this LVM library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
SUBDIRS = man lib tools
include make.tmpl

2325
configure vendored Executable file

File diff suppressed because it is too large Load Diff

137
configure.in Normal file
View File

@ -0,0 +1,137 @@
################################################################################
##
## Copyright 1999-2000 Sistina Software, Inc.
##
## This is free software released under the GNU General Public License.
## There is no warranty for this software. See the file COPYING for
## details.
##
## See the file CONTRIBUTORS for a list of contributors.
##
## This file is maintained by:
## AJ Lewis <lewis@sistina.com>
##
## File name: configure.in
##
## Description: Input file for autoconf. Generates the configure script
## that tries to keep everything nice and portable. It also
## simplifies distribution package building considerably.
################################################################################
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lib/dev-mgr/dev-manager.h)
dnl setup the directory where autoconf has auxilary files
AC_CONFIG_AUX_DIR(autoconf)
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_RDEV
AC_HEADER_TIME
dnl -- prefix is /usr by default, the exec_prefix default is setup later
AC_PREFIX_DEFAULT(/usr)
dnl -- setup the ownership of the files
AC_ARG_WITH(user,
[ --with-user=USER Set the owner of installed files ],
[ OWNER="$withval" ],
[ OWNER="root" ])
dnl -- setup the group ownership of the files
AC_ARG_WITH(group,
[ --with-group=GROUP Set the group owner of installed files ],
[ GROUP="$withval" ],
[ GROUP="root" ])
dnl -- Where the linux src tree is
AC_ARG_WITH(kernel_dir,
[ --with-kernel_dir=DIR linux kernel source in DIR [/usr/src/linux]],
[ kernel_dir="$withval" ],
[ kernel_dir=/usr/src/linux ])
AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=)
dnl Enables staticly linked tools
AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to the liblvm library
statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no)
dnl Disable readline
AC_ARG_ENABLE(readline, [ --disable-readline Disable readline support], \
READLINE=$enableval, READLINE=yes)
dnl Mess with default exec_prefix
if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
then exec_prefix="";
fi;
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(mkdir rmdir uname)
dnl check for termcap (Shamelessly copied from parted 1.4.17)
if test x$READLINE = xyes; then
AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, ,
AC_MSG_ERROR(
termcap could not be found which is required for the
--enable-readline option (which is enabled by default). Either disable readline
support with --disable-readline or download and install termcap from:
ftp.gnu.org/gnu/termcap
Note: if you are using precompiled packages you will also need the development
package as well (which may be called termcap-devel or something similar).
Note: (n)curses also seems to work as a substitute for termcap. This was
not found either - but you could try installing that as well.
)
exit
)
fi
dnl Check for readline (Shamelessly copied from parted 1.4.17)
if test x$READLINE = xyes; then
AC_CHECK_LIB(readline, readline, ,
AC_MSG_ERROR(
GNU Readline could not be found which is required for the
--enable-readline option (which is enabled by default). Either disable readline
support with --disable-readline or download and install readline from:
ftp.gnu.org/gnu/readline
Note: if you are using precompiled packages you will also need the development
package as well (which may be called readline-devel or something similar).
)
exit
)
fi
AC_SUBST(JOBS)
AC_SUBST(STATIC_LINK)
AC_SUBST(READLINE)
AC_SUBST(kernel_dir)
AC_SUBST(OWNER)
AC_SUBST(GROUP)
dnl First and last lines should not contain files to generate in order to
dnl keep utility scripts running properly
AC_OUTPUT( \
Makefile \
make.tmpl \
lib/Makefile \
man/Makefile \
tools/Makefile \
)

View File

@ -1,23 +0,0 @@
CFLAGS = -I.
SRC= \
config/config.c \
dev-mgr/dev-manager.c \
dev-mgr/hash.c \
log/log.c \
mm/pool.c \
mm/dbg_malloc.c
OBJ=${SRC:.c=.o}
TARGET=liblvm.a
all: ${TARGET}
liblvm.a: $(OBJ)
rm -f $@
ar r $@ $(OBJ)
ranlib $@
clean:
rm -f ${OBJ} ${TARGET}

39
lib/Makefile.in Normal file
View File

@ -0,0 +1,39 @@
#
# Copyright (C) 2001 Sistina Software
#
# This LVM library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This LVM library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this LVM library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
SOURCES=\
config/config.c \
dev-mgr/dev-manager.c \
dev-mgr/hash.c \
log/log.c \
mm/pool.c \
mm/dbg_malloc.c
TARGETS=liblvm.a
include ../make.tmpl
liblvm.a: $(OBJECTS)
$(RM) $@
$(AR) r $@ $(OBJECTS)
$(RANLIB) $@

110
make.tmpl.in Normal file
View File

@ -0,0 +1,110 @@
# @configure_input@
#
# Copyright (C) 2001 Sistina Software
#
# This LVM library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This LVM library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this LVM library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
SHELL = /bin/sh
@SET_MAKE@
CC = @CC@
RANLIB = @RANLIB@
SHELL = /bin/sh
INSTALL = @INSTALL@
LN_S = @LN_S@
# Setup directory variables
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
staticlibdir = ${prefix}/lib
libdir = @libdir@
sbindir = @sbindir@
infodir = @infodir@
mandir = @mandir@
# setup misc variables
# define the ownership variables for the binaries and man pages
OWNER=@OWNER@
GROUP=@GROUP@
# The number of jobs to run, if blank, defaults to the make standard
ifndef MAKEFLAGS
MAKEFLAGS = @JOBS@
endif
SUFFIXES=
SUFFIXES=.c .d .o
CFLAGS+=-g -Wall -DDEBUG_MEM -DBOUNDS_CHECK -DDEBUG
INCLUDES+=-I. -I$(top_srcdir)/lib
ifeq ("@READLINE@", "yes")
CFLAGS += -DREADLINE_SUPPORT
EXTRA_LIBS += -lreadline
endif
OBJECTS=$(SOURCES:%.c=%.o)
SUBDIRS.install := $(SUBDIRS:=.install)
SUBDIRS.clean := $(SUBDIRS:=.clean)
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
.PHONY: all install distclean clean
.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
all: $(SUBDIRS) $(TARGETS)
install: all $(SUBDIRS.install)
$(SUBDIRS):
$(MAKE) -C $@
$(SUBDIRS.install):
$(MAKE) -C $(@:.install=) install
$(SUBDIRS.clean):
$(MAKE) -C $(@:.clean=) clean
$(SUBDIRS.distclean):
$(MAKE) -C $(@:.distclean=) distclean
%.o: %.c
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
%.d: %.c
set -e; FILE=`echo $@ | sed 's/\\//\\\\\\//g'`; \
$(CC) -MM $(INCLUDES) $< \
| sed "s/\($$FILE\)\.o[ :]*/\1.o $$FILE : /g" > $@; \
[ -s $@ ] || $(RM) $@
clean: $(SUBDIRS.clean)
$(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
distclean: $(SUBDIRS.distclean)
$(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
$(RM) config.cache config.log config.status
$(RM) Makefile make.tmpl
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifdef SOURCES
-include $(SOURCES:.c=.d)
endif
endif
endif

35
man/Makefile.in Normal file
View File

@ -0,0 +1,35 @@
#
# Copyright (C) 2001 Sistina Software
#
# This LVM library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This LVM library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this LVM library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
MANUALS=$(wildcard *.8)
MAN8DIR=${mandir}/man8
include ../make.tmpl
install:
@echo "*** Installing $(ALL_MANUALS) in $(DESTDIR)$(MAN8DIR) ***"
@for f in $(MANUALS); \
do \
$(RM) $(DESTDIR)$(MAN8DIR)/$$f; \
@INSTALL@ -D -o $(OWNER) -g $(GROUP) -m 444 $$f $(DESTDIR)$(MAN8DIR)/$$f; \
done

46
tools/Makefile.in Normal file
View File

@ -0,0 +1,46 @@
#
# Copyright (C) 2001 Sistina Software
#
# This LVM library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This LVM library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this LVM library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
SOURCES=\
lvm.c\
pvdisplay.c
TARGETS=\
lvm
include ../make.tmpl
lvm: $(OBJECTS)
$(CC) -o lvm $(OBJECTS) -L$(top_srcdir)/lib -llvm $(EXTRA_LIBS)
install:
$(INSTALL) -c -d $(sbindir);
$(INSTALL) -c -o $(OWNER) -g $(GROUP) -m 555 -s lvm $(sbindir)/lvm
( cd $(sbindir); \
for v in ${SOURCES:.c=}; do \
if [ "x$$v" != "xlvm" ]; then \
$(LN_S) -f lvm $$v; \
fi \
done; \
)