Add configure options --enable-symlink-build and --enable-symlink-install

These options allow e2fsprogs to be built using symlinks instead of
hard links, and to be installed using symlinks instead of hard links,
respectively.

Addresses-Sourceforge-Bug: #1436294

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
bitmap-optimize
Theodore Ts'o 2010-05-17 19:21:42 -04:00
parent 822c10e84e
commit 5aa6c3f61c
13 changed files with 138 additions and 71 deletions

View File

@ -59,6 +59,8 @@ ALL_LDFLAGS = $(LDFLAGS) @LDFLAG_DYNAMIC@
LDFLAGS_STATIC = $(LDFLAGS) @LDFLAG_STATIC@
BUILD_CFLAGS = @BUILD_CFLAGS@
BUILD_LDFLAGS = @BUILD_LDFLAGS@
LINK_BUILD_FLAGS = @LINK_BUILD_FLAGS@
LINK_INSTALL_FLAGS = @LINK_INSTALL_FLAGS@
RM = @RM@
LN = @LN@
LN_S = @LN_S@
@ -176,7 +178,8 @@ MANMODE= 444
# Autoconf magic...
#
DEP_LIB_MAKEFILES = $(top_srcdir)/lib/Makefile.elf-lib \
DEP_LIB_MAKEFILES = $(top_srcdir)/lib/Makefile.library \
$(top_srcdir)/lib/Makefile.elf-lib \
$(top_srcdir)/lib/Makefile.bsd-lib $(top_srcdir)/lib/Makefile.darwin-lib \
$(top_srcdir)/lib/Makefile.solaris-lib $(top_srcdir)/lib/Makefile.checker \
$(top_srcdir)/lib/Makefile.profile

50
configure vendored
View File

@ -700,6 +700,8 @@ ELF_CMT
HTREE_CMT
Q
E
LINK_BUILD_FLAGS
LINK_INSTALL_FLAGS
MAINTAINER_CMT
LINUX_INCLUDE
EGREP
@ -780,6 +782,8 @@ with_ccopts
with_ldopts
with_root_prefix
enable_maintainer_mode
enable_symlink_install
enable_symlink_build
enable_verbose_makecmds
enable_compression
enable_htree
@ -1429,7 +1433,9 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-maintainer-mode enable makefile rules useful for maintainers
--enable-verbose-makecmds enable verbose make command output
--enable-symlink-install use symlinks when installing instead of hard links
--enable-symlink-build use symlinks while building instead of hard links
--enable-verbose-makecmds enable verbose make command output
--enable-compression enable EXPERIMENTAL compression support
--enable-htree enable EXPERIMENTAL htree directory support
--enable-elf-shlibs select ELF shared libraries
@ -4575,6 +4581,48 @@ $as_echo "Disabling maintainer mode by default" >&6; }
fi
# Check whether --enable-symlink-install was given.
if test "${enable_symlink_install+set}" = set; then :
enableval=$enable_symlink_install; if test "$enableval" = "no"
then
LINK_INSTALL_FLAGS=-f
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for install" >&5
$as_echo "Disabling symlinks for install" >&6; }
else
LINK_INSTALL_FLAGS=-sf
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling symlinks for install" >&5
$as_echo "Enabling symlinks for install" >&6; }
fi
else
LINK_INSTALL_FLAGS=-f
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for install" >&5
$as_echo "Disabling symlinks for install" >&6; }
fi
# Check whether --enable-symlink-build was given.
if test "${enable_symlink_build+set}" = set; then :
enableval=$enable_symlink_build; if test "$enableval" = "no"
then
LINK_BUILD_FLAGS=
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for build" >&5
$as_echo "Disabling symlinks for build" >&6; }
else
LINK_BUILD_FLAGS=-s
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling symlinks for build" >&5
$as_echo "Enabling symlinks for build" >&6; }
fi
else
LINK_BUILD_FLAGS=
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for build" >&5
$as_echo "Disabling symlinks for build" >&6; }
fi
# Check whether --enable-verbose-makecmds was given.
if test "${enable_verbose_makecmds+set}" = set; then :
enableval=$enable_verbose_makecmds; if test "$enableval" = "no"

View File

@ -154,10 +154,46 @@ AC_MSG_RESULT([Disabling maintainer mode by default])
)
AC_SUBST(MAINTAINER_CMT)
dnl
dnl handle --enable-symlink-install
dnl
AC_ARG_ENABLE([symlink-install],
[ --enable-symlink-install use symlinks when installing instead of hard links],
if test "$enableval" = "no"
then
LINK_INSTALL_FLAGS=-f
AC_MSG_RESULT([Disabling symlinks for install])
else
LINK_INSTALL_FLAGS=-sf
AC_MSG_RESULT([Enabling symlinks for install])
fi
,
LINK_INSTALL_FLAGS=-f
AC_MSG_RESULT([Disabling symlinks for install])
)
AC_SUBST(LINK_INSTALL_FLAGS)
dnl
dnl handle --enable-symlink-build
dnl
AC_ARG_ENABLE([symlink-build],
[ --enable-symlink-build use symlinks while building instead of hard links],
if test "$enableval" = "no"
then
LINK_BUILD_FLAGS=
AC_MSG_RESULT([Disabling symlinks for build])
else
LINK_BUILD_FLAGS=-s
AC_MSG_RESULT([Enabling symlinks for build])
fi
,
LINK_BUILD_FLAGS=
AC_MSG_RESULT([Disabling symlinks for build])
)
AC_SUBST(LINK_BUILD_FLAGS)
dnl
dnl handle --enable-verbose-makecmds
dnl
AC_ARG_ENABLE([verbose-makecmds],
[ --enable-verbose-makecmds enable verbose make command output],
[ --enable-verbose-makecmds enable verbose make command output],
if test "$enableval" = "no"
then
AC_MSG_RESULT([Disabling verbose make commands])

View File

@ -201,18 +201,11 @@ install: $(PROGS) $(MANPAGES) $(FMANPAGES) installdirs
echo " INSTALL $(root_sbindir)/$$i"; \
$(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
done
$(E) " LINK $(root_sbindir)/fsck.ext2"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
$(DESTDIR)$(root_sbindir)/fsck.ext2
$(E) " LINK $(root_sbindir)/fsck.ext3"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
$(DESTDIR)$(root_sbindir)/fsck.ext3
$(E) " LINK $(root_sbindir)/fsck.ext4"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
$(DESTDIR)$(root_sbindir)/fsck.ext4
$(E) " LINK $(root_sbindir)/fsck.ext4dev"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
$(DESTDIR)$(root_sbindir)/fsck.ext4dev
$(Q) for i in ext2 ext3 ext4 ext4dev; do \
echo " LINK $(root_sbindir)/fsck.$$i"; \
(cd $(DESTDIR)$(root_sbindir); \
$(LN) $(LINK_INSTALL_FLAGS) e2fsck fsck.$$i); \
done
$(Q) for i in $(MANPAGES); do \
for j in $(COMPRESS_EXT); do \
$(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
@ -227,18 +220,11 @@ install: $(PROGS) $(MANPAGES) $(FMANPAGES) installdirs
echo " INSTALL_DATA $(man5dir)/$$i"; \
$(INSTALL_DATA) $$i $(DESTDIR)$(man5dir)/$$i; \
done
$(E) " LINK $(man8dir)/fsck.ext2.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
$(DESTDIR)$(man8dir)/fsck.ext2.8
$(E) " LINK $(man8dir)/fsck.ext3.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
$(DESTDIR)$(man8dir)/fsck.ext3.8
$(E) " LINK $(man8dir)/fsck.ext4.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
$(DESTDIR)$(man8dir)/fsck.ext4.8
$(E) " LINK $(man8dir)/fsck.ext4.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
$(DESTDIR)$(man8dir)/fsck.ext4dev.8
$(Q) for i in ext2 ext3 ext4 ext4dev; do \
echo " LINK $(man8dir)/fsck.$$i.8"; \
(cd $(DESTDIR)$(man8dir); \
$(LN) $(LINK_INSTALL_FLAGS) e2fsck.8 fsck.$$i.8); \
done
install-strip: install
$(Q) for i in $(PROGS); do \

View File

@ -25,7 +25,8 @@ $(BSD_LIB): $(OBJS)
(cd pic; ld -Bshareable -o $(BSD_LIB) $(OBJS))
$(MV) pic/$(BSD_LIB) .
$(RM) -f ../$(BSD_LIB)
$(LN) $(BSD_LIB) ../$(BSD_LIB)
(cd ..; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$(BSD_LIB) $(BSD_LIB))
install-shlibs install:: $(BSD_LIB)
@echo " INSTALL_PROGRAM $(BSDLIB_INSTALL_DIR)/$(BSD_LIB)"

View File

@ -13,4 +13,5 @@ $(LIBRARY)_chk.a: $(OBJS)
$(Q) (cd checker; $(ARGEN) $@ $(OBJS))
-$(Q) $(RANLIB) $@
$(Q) $(RM) -f ../$@
$(Q) $(LN) $@ ../$@
$(Q) (cd .. ; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$@ $@)

View File

@ -27,8 +27,9 @@ $(BSD_LIB): $(OBJS)
-flat_namespace -undefined warning -o $(BSD_LIB) $(OBJS))
$(Q) $(MV) pic/$(BSD_LIB) .
$(Q) $(RM) -f ../$(BSD_LIB)
$(Q) $(LN) $(BSD_LIB) ../$(BSD_LIB)
$(Q) $(LN) ../$(BSD_LIB) ../$(BSDLIB_IMAGE).dylib
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$(BSD_LIB) $(BSD_LIB))
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(BSD_LIB) $(BSDLIB_IMAGE).dylib)
install-shlibs install:: $(BSD_LIB)
$(E) " INSTALL_PROGRAM $(BSDLIB_INSTALL_DIR)/$(BSD_LIB)"

View File

@ -28,9 +28,10 @@ $(ELF_LIB): $(OBJS)
-Wl,-soname,$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS))
$(Q) $(MV) elfshared/$(ELF_LIB) .
$(Q) $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
$(Q) $(LN) $(ELF_LIB) ../$(ELF_LIB)
$(Q) $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so
$(Q) $(LN) ../$(ELF_LIB) ../$(ELF_SONAME)
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$(ELF_LIB) $(ELF_LIB))
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_IMAGE).so)
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_SONAME))
installdirs-elf-lib::
$(E) " MKINSTALLDIRS $(ELF_INSTALL_DIR) $(libdir)"

View File

@ -19,6 +19,7 @@ $(LIBRARY).a: $(OBJS)
$(Q) $(ARGEN) $@ $(OBJS)
-@$(RANLIB) $@
$(Q) $(RM) -f ../$@
$(Q) $(LN) $@ ../$@
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$@ $@)
$(LIB)/$(LIBRARY).a: $(LIBRARY).a

View File

@ -14,7 +14,8 @@ $(LIBRARY)_p.a: $(OBJS)
$(Q) (cd profiled; $(ARUPD) ../$@ $(OBJS))
-$(Q) $(RANLIB) $@
$(Q) $(RM) -f ../$@
$(Q) $(LN) $@ ../$@
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$@ $@)
install:: $(LIBRARY)_p.a installdirs
$(E) " INSTALL_DATA $(libdir)/$(LIBRARY)_p.a"

View File

@ -28,9 +28,10 @@ $(ELF_LIB): $(OBJS)
-Wl,-h,$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS))
$(Q) $(MV) elfshared/$(ELF_LIB) .
$(Q) $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
$(Q) $(LN) $(ELF_LIB) ../$(ELF_LIB)
$(Q) $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so
$(Q) $(LN) ../$(ELF_LIB) ../$(ELF_SONAME)
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$(ELF_LIB) $(ELF_LIB))
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_IMAGE).so)
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_SONAME))
installdirs-elf-lib::
$(MKINSTALLDIRS) $(DESTDIR)$(ELF_INSTALL_DIR) \

View File

@ -150,9 +150,11 @@ install:: all installdirs
$(Q) $(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3.gz \
$(DESTDIR)$(man3dir)/uuid_generate_time.3.gz
$(E) " LINK $(man3dir)/uuid_generate_random.3"
$(Q) $(LN) -f $(DESTDIR)$(man3dir)/uuid_generate.3 $(DESTDIR)$(man3dir)/uuid_generate_random.3
$(Q) (cd $(DESTDIR)$(man3dir); \
$(LN) $(LINK_INSTALL_FLAGS) uuid_generate.3 uuid_generate_random.3)
$(E) " LINK $(man3dir)/uuid_generate_time.3"
$(Q) $(LN) -f $(DESTDIR)$(man3dir)/uuid_generate.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3
$(Q) (cd $(DESTDIR)$(man3dir); \
$(LN) $(LINK_INSTALL_FLAGS) uuid_generate.3 uuid_generate_time.3)
$(E) " INSTALL_DATA $(libdir)/pkgconfig/uuid.pc"
$(Q) $(INSTALL_DATA) uuid.pc $(DESTDIR)$(libdir)/pkgconfig/uuid.pc

View File

@ -403,25 +403,17 @@ install: all $(SMANPAGES) $(UMANPAGES) installdirs
echo " INSTALL $(sbindir)/$$i"; \
$(INSTALL_PROGRAM) $$i $(DESTDIR)$(sbindir)/$$i; \
done
$(E) " LINK $(root_sbindir)/mkfs.ext2"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
$(DESTDIR)$(root_sbindir)/mkfs.ext2
$(E) " LINK $(root_sbindir)/mkfs.ext3"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
$(DESTDIR)$(root_sbindir)/mkfs.ext3
$(E) " LINK $(root_sbindir)/mkfs.ext4"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
$(DESTDIR)$(root_sbindir)/mkfs.ext4
$(E) " LINK $(root_sbindir)/mkfs.ext4dev"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
$(DESTDIR)$(root_sbindir)/mkfs.ext4dev
$(E) " LINK $(root_sbindir)/e2label"
$(Q) $(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
$(DESTDIR)$(root_sbindir)/e2label
$(Q) for i in ext2 ext3 ext4 ext4dev; do \
echo " LINK $(root_sbindir)/mkfs.$$i"; \
(cd $(DESTDIR)$(root_sbindir); \
$(LN) $(LINK_INSTALL_FLAGS) mke2fs mkfs.$$i); \
done
$(Q) (cd $(DESTDIR)$(root_sbindir); \
$(LN) $(LINK_INSTALL_FLAGS) tune2fs e2label)
$(Q) if test -n "$(FINDFS_LINK)"; then \
echo " LINK $(root_sbindir)/findfs"; \
$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
$(DESTDIR)$(root_sbindir)/$(FINDFS_LINK); \
echo " LINK $(root_sbindir)/findfs"; \
(cd $(DESTDIR)$(root_sbindir); \
$(LN) $(LINK_INSTALL_FLAGS) tune2fs $(FINDFS_LINK)); \
fi
$(Q) for i in $(UPROGS); do \
echo " INSTALL $(bindir)/$$i"; \
@ -440,18 +432,11 @@ install: all $(SMANPAGES) $(UMANPAGES) installdirs
done
$(Q) $(RM) -f $(DESTDIR)$(man8dir)/mkfs.ext2.8.gz \
$(DESTDIR)$(man8dir)/mkfs.ext3.8.gz
$(E) " LINK mkfs.ext2.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
$(DESTDIR)$(man8dir)/mkfs.ext2.8
$(E) " LINK mkfs.ext3.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
$(DESTDIR)$(man8dir)/mkfs.ext3.8
$(E) " LINK mkfs.ext4.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
$(DESTDIR)$(man8dir)/mkfs.ext4.8
$(E) " LINK mkfs.ext4dev.8"
$(Q) $(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
$(DESTDIR)$(man8dir)/mkfs.ext4dev.8
$(Q) for i in ext2 ext3 ext4 ext4dev; do \
echo " LINK mkfs.$$i.8"; \
(cd $(DESTDIR)$(man8dir); \
$(LN) $(LINK_INSTALL_FLAGS) mke2fs.8 mkfs.$$i.8); \
done
$(Q) for i in $(UMANPAGES); do \
for j in $(COMPRESS_EXT); do \
$(RM) -f $(DESTDIR)$(man1dir)/$$i.$$j; \