Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit563673e

Browse files
committed
Add make install-strip target.
1 parentb210b16 commit563673e

File tree

6 files changed

+163
-9
lines changed

6 files changed

+163
-9
lines changed

‎config/programs.m4

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.8 2002/03/29 17:32:54 petere Exp $
1+
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.9 2002/04/10 16:45:24 petere Exp $
22

33

44
# PGAC_PATH_FLEX
@@ -144,3 +144,28 @@ dnl FIXME: We should probably check for version >=0.10.36.
144144
AC_DEFINE_UNQUOTED(LOCALEDIR,["$exp_localedir"],
145145
[location of locale files])
146146
])# PGAC_CHECK_GETTEXT
147+
148+
149+
150+
# PGAC_CHECK_STRIP
151+
# ----------------
152+
# Check for a 'strip' program, and figure out if that program can
153+
# strip libraries.
154+
155+
AC_DEFUN([PGAC_CHECK_STRIP],
156+
[
157+
AC_CHECK_TOOL(STRIP,strip,:)
158+
159+
AC_MSG_CHECKING([whether it is possible to strip libraries])
160+
if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
161+
STRIP_STATIC_LIB="$STRIP -x"
162+
STRIP_SHARED_LIB="$STRIP --strip-unneeded"
163+
AC_MSG_RESULT(yes)
164+
else
165+
STRIP_STATIC_LIB=:
166+
STRIP_SHARED_LIB=:
167+
AC_MSG_RESULT(no)
168+
fi
169+
AC_SUBST(STRIP_STATIC_LIB)
170+
AC_SUBST(STRIP_SHARED_LIB)
171+
])# PGAC_CHECK_STRIP

‎configure

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4668,6 +4668,104 @@ echo "${ECHO_T}no" >&6
46684668
fi
46694669
46704670
4671+
iftest -n"$ac_tool_prefix";then
4672+
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4673+
set dummy${ac_tool_prefix}strip; ac_word=$2
4674+
echo"$as_me:$LINENO: checking for$ac_word">&5
4675+
echo$ECHO_N"checking for$ac_word...$ECHO_C">&6
4676+
iftest"${ac_cv_prog_STRIP+set}" =set;then
4677+
echo$ECHO_N"(cached)$ECHO_C">&6
4678+
else
4679+
iftest -n"$STRIP";then
4680+
ac_cv_prog_STRIP="$STRIP"# Let the user override the test.
4681+
else
4682+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4683+
foras_dirin$PATH
4684+
do
4685+
IFS=$as_save_IFS
4686+
test -z"$as_dir"&& as_dir=.
4687+
forac_exec_extin''$ac_executable_extensions;do
4688+
if$as_executable_p"$as_dir/$ac_word$ac_exec_ext";then
4689+
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4690+
echo"$as_me:$LINENO: found$as_dir/$ac_word$ac_exec_ext">&5
4691+
break 2
4692+
fi
4693+
done
4694+
done
4695+
4696+
fi
4697+
fi
4698+
STRIP=$ac_cv_prog_STRIP
4699+
iftest -n"$STRIP";then
4700+
echo"$as_me:$LINENO: result:$STRIP">&5
4701+
echo"${ECHO_T}$STRIP">&6
4702+
else
4703+
echo"$as_me:$LINENO: result: no">&5
4704+
echo"${ECHO_T}no">&6
4705+
fi
4706+
4707+
fi
4708+
iftest -z"$ac_cv_prog_STRIP";then
4709+
ac_ct_STRIP=$STRIP
4710+
# Extract the first word of "strip", so it can be a program name with args.
4711+
set dummy strip; ac_word=$2
4712+
echo"$as_me:$LINENO: checking for$ac_word">&5
4713+
echo$ECHO_N"checking for$ac_word...$ECHO_C">&6
4714+
iftest"${ac_cv_prog_ac_ct_STRIP+set}" =set;then
4715+
echo$ECHO_N"(cached)$ECHO_C">&6
4716+
else
4717+
iftest -n"$ac_ct_STRIP";then
4718+
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP"# Let the user override the test.
4719+
else
4720+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4721+
foras_dirin$PATH
4722+
do
4723+
IFS=$as_save_IFS
4724+
test -z"$as_dir"&& as_dir=.
4725+
forac_exec_extin''$ac_executable_extensions;do
4726+
if$as_executable_p"$as_dir/$ac_word$ac_exec_ext";then
4727+
ac_cv_prog_ac_ct_STRIP="strip"
4728+
echo"$as_me:$LINENO: found$as_dir/$ac_word$ac_exec_ext">&5
4729+
break 2
4730+
fi
4731+
done
4732+
done
4733+
4734+
test -z"$ac_cv_prog_ac_ct_STRIP"&& ac_cv_prog_ac_ct_STRIP=":"
4735+
fi
4736+
fi
4737+
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
4738+
iftest -n"$ac_ct_STRIP";then
4739+
echo"$as_me:$LINENO: result:$ac_ct_STRIP">&5
4740+
echo"${ECHO_T}$ac_ct_STRIP">&6
4741+
else
4742+
echo"$as_me:$LINENO: result: no">&5
4743+
echo"${ECHO_T}no">&6
4744+
fi
4745+
4746+
STRIP=$ac_ct_STRIP
4747+
else
4748+
STRIP="$ac_cv_prog_STRIP"
4749+
fi
4750+
4751+
4752+
echo"$as_me:$LINENO: checking whether it is possible to strip libraries">&5
4753+
echo$ECHO_N"checking whether it is possible to strip libraries...$ECHO_C">&6
4754+
iftest x"$STRIP"!= x""&&"$STRIP" -V2>&1| grep"GNU strip">/dev/null;then
4755+
STRIP_STATIC_LIB="$STRIP -x"
4756+
STRIP_SHARED_LIB="$STRIP --strip-unneeded"
4757+
echo"$as_me:$LINENO: result: yes">&5
4758+
echo"${ECHO_T}yes">&6
4759+
else
4760+
STRIP_STATIC_LIB=:
4761+
STRIP_SHARED_LIB=:
4762+
echo"$as_me:$LINENO: result: no">&5
4763+
echo"${ECHO_T}no">&6
4764+
fi
4765+
4766+
4767+
4768+
46714769
forac_progin'bison -y'
46724770
do
46734771
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -16740,6 +16838,10 @@ s,@RANLIB@,$RANLIB,;t t
1674016838
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
1674116839
s,@LORDER@,$LORDER,;t t
1674216840
s,@TAR@,$TAR,;t t
16841+
s,@STRIP@,$STRIP,;t t
16842+
s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
16843+
s,@STRIP_STATIC_LIB@,$STRIP_STATIC_LIB,;t t
16844+
s,@STRIP_SHARED_LIB@,$STRIP_SHARED_LIB,;t t
1674316845
s,@YACC@,$YACC,;t t
1674416846
s,@YFLAGS@,$YFLAGS,;t t
1674516847
s,@WISH@,$WISH,;t t

‎configure.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.175 2002/04/03 05:39:27 petere Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.176 2002/04/10 16:45:24 petere Exp $
33

44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -640,6 +640,7 @@ esac
640640
AC_PROG_RANLIB
641641
AC_CHECK_PROGS(LORDER, lorder)
642642
AC_PATH_PROG(TAR, tar)
643+
PGAC_CHECK_STRIP
643644

644645
AC_CHECK_PROGS(YACC, ['bison -y'])
645646
if test -z "$YACC"; then

‎doc/src/sgml/installation.sgml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.75 2002/04/03 05:39:28 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.76 2002/04/10 16:45:25 petere Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -983,6 +983,19 @@ All of PostgreSQL is successfully made. Ready to install.
983983
be granted.
984984
</para>
985985

986+
<para>
987+
You can use <literal>gmake install-strip</literal> instead of
988+
<literal>gmake install</literal> to strip the executable files and
989+
libraries as they are installed. This will save some space. If
990+
you built with debugging support, stripping will effectively
991+
remove the debugging support, so it should only be done if
992+
debugging is no longer needed. <literal>install-strip</literal>
993+
tries to do a reasonable job saving space, but it does not have
994+
perfect knowledge of how to strip every unneeded byte from an
995+
executable file, so if you want to save all the disk space you
996+
possibly can, you will have to do manual work.
997+
</para>
998+
986999
<para>
9871000
If you built the Perl or Python interfaces and you were not the
9881001
root user when you executed the above command then that part of

‎src/Makefile.global.in

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.144 2002/03/29 17:32:54 petere Exp $
2+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.145 2002/04/10 16:45:25 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -18,7 +18,7 @@
1818
#
1919
# Meta configuration
2020

21-
.PHONY: all install installdirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check
21+
.PHONY: all installinstall-stripinstalldirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check
2222
.SILENT: installdirs
2323

2424
# make `all' the default target
@@ -228,16 +228,21 @@ BZIP2= bzip2
228228

229229
INSTALL=$(SHELL)$(top_srcdir)/config/install-sh -c
230230

231-
INSTALL_PROGRAM=$(INSTALL)
231+
INSTALL_PROGRAM=$(INSTALL_PROGRAM_ENV)$(INSTALL)$(INSTALL_STRIP_FLAG)
232232
INSTALL_SCRIPT=$(INSTALL) -m 755
233233
INSTALL_DATA=$(INSTALL) -m 644
234-
INSTALL_SHLIB=$(INSTALL)$(INSTALL_SHLIB_OPTS)
234+
INSTALL_STLIB=$(INSTALL_STLIB_ENV)$(INSTALL_DATA)$(INSTALL_STRIP_FLAG)
235+
INSTALL_SHLIB=$(INSTALL_SHLIB_ENV)$(INSTALL)$(INSTALL_SHLIB_OPTS)$(INSTALL_STRIP_FLAG)
235236
# Override in Makefile.port if necessary
236237
INSTALL_SHLIB_OPTS = -m 755
237238

238239
mkinstalldirs=$(SHELL)$(top_srcdir)/config/mkinstalldirs
239240
missing=$(SHELL)$(top_srcdir)/config/missing
240241

242+
STRIP= @STRIP@
243+
STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
244+
STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
245+
241246
# Documentation
242247

243248
JADE= @JADE@
@@ -384,6 +389,14 @@ $(top_builddir)/config.status: $(top_srcdir)/configure
384389
cd$(top_builddir)&& ./config.status --recheck
385390

386391

392+
install-strip:
393+
@$(MAKE) INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'"\
394+
INSTALL_STLIB_ENV="STRIPPROG='$(STRIP_STATIC_LIB)'"\
395+
INSTALL_SHLIB_ENV="STRIPPROG='$(STRIP_SHARED_LIB)'"\
396+
INSTALL_STRIP_FLAG=-s\
397+
install
398+
399+
387400
##########################################################################
388401
#
389402
# Automatic dependency generation

‎src/Makefile.shlib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.56 2001/11/11 19:20:53 momjian Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.57 2002/04/10 16:45:25 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -357,7 +357,7 @@ endif # enable_shared
357357
install-lib: install-lib-static install-lib-shared
358358

359359
install-lib-static: lib$(NAME).a
360-
$(INSTALL_DATA) $< $(DESTDIR)$(libdir)/lib$(NAME).a
360+
$(INSTALL_STLIB) $< $(DESTDIR)$(libdir)/lib$(NAME).a
361361

362362
ifeq ($(enable_shared), yes)
363363
install-lib-shared: $(shlib)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp