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

Commit6de89c9

Browse files
committed
Moved the intricacies of the perl interface build into its own makefile
that now functions as a wrapper around the MakeMaker stuff. It mighteven behave sensically when we have separate build dirs. Same for plperl,which of course still doesn't work very well. Made sure that plperlrespects the choice of --libdir.Added --with-python to automatically build and install the Python interface.Works similarly to the Perl5 stuff.Moved the burden of the distclean targets lower down into the source tree.Eventually, each make file should have its own.Added automatic remaking of makefiles and configure. Currently only for thetop-level because of a bug(?) in Autoconf. Use GNU `missing' to work aroundmissing autoconf and aclocal. Start factoring out macros into their ownconfig/*.m4 files to increase readability and organization.
1 parent2ae20ef commit6de89c9

22 files changed

+1408
-714
lines changed

‎GNUmakefile.in

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# PostgreSQL top level makefile
33
#
4-
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.2 2000/06/07 23:09:18 petere Exp $
4+
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.3 2000/06/10 18:01:34 petere Exp $
55
#
66

77
srcdir = @srcdir@
@@ -23,8 +23,24 @@ clean:
2323
$(MAKE) -C src clean
2424

2525
distclean:
26-
$(MAKE) -C src distclean
26+
-$(MAKE) -C src distclean
2727
-rm -f config.cache config.log config.status GNUmakefile
2828

2929

3030
.PHONY: all install clean distclean
31+
32+
33+
AUTOCONF = @AUTOCONF@
34+
ACLOCAL = @ACLOCAL@
35+
36+
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
37+
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
38+
39+
$(top_builddir)/config.status: $(top_srcdir)/configure
40+
cd $(top_builddir) && ./config.status --recheck
41+
42+
$(top_srcdir)/configure: $(top_srcdir)/configure.in $(top_srcdir)/aclocal.m4
43+
cd $(top_srcdir) && $(AUTOCONF)
44+
45+
$(top_srcdir)/aclocal.m4: $(wildcard $(top_srcdir)/config/*.m4)
46+
cd $(top_srcdir) && $(ACLOCAL) -I config

‎Makefile

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
1-
# The Postgres make files exploit features of GNU make that other makes
2-
# do not have. Because it is a common mistake for users to try to build
3-
# Postgres with a different make, we have this make file that does nothing
4-
# but tell the user to use GNU make.
1+
# The PostgreSQL make files exploit features of GNU make that other
2+
# makes do not have. Because it is a common mistake for users to try
3+
# to build Postgres with a different make, we have this make file
4+
# that, as a service, will look for a GNU make and invoke it, or show
5+
# an error message if none could be found.
56

6-
# If the user were using GNU make now, this file would not get used because
7-
# GNU make uses a make file named "GNUmakefile" in preference to "Makefile"
8-
# if it exists. Postgres is shipped with a "GNUmakefile".
7+
# If the user were using GNU make now, this file would not get used
8+
# because GNU make uses a make file named "GNUmakefile" in preference
9+
# to "Makefile" if it exists. PostgreSQL is shipped with a
10+
# "GNUmakefile". If the user hasn't run the configure script yet, the
11+
# GNUmakefile won't exist yet, so we catch that case as well.
912

10-
allinstallcleandepdependdistclean:
11-
@echo"You must use GNU make to use Postgres. It may be installed"
12-
@echo"on your system with the name 'gmake'."
13-
@echo
14-
@echo"NOTE: If you are sure that you are using GNU make and you are"
15-
@echo" still getting this message, you may simply need to run"
16-
@echo" the configure program."
13+
14+
allinstallcleandepdependdistcleanmaintainer-clean:
15+
@if! [-f GNUmakefile ];then\
16+
echo"You need to run the\`configure' program fist. See the file";\
17+
echo"\`INSTALL' for installation instructions.";\
18+
false;\
19+
fi
20+
@IFS=':';\
21+
fordirin$$PATH;do \
22+
forprogin gmake gnumake make;do \
23+
if [-f$$dir/$$prog ]&& ($$dir/$$prog --version| grep GNU>/dev/null2>&1 );then \
24+
GMAKE=$$dir/$$prog;\
25+
break 2;\
26+
fi;\
27+
done;\
28+
done;\
29+
\
30+
if [ x"$${GMAKE+set}"= xset ];then \
31+
echo"Using GNU make found at$${GMAKE}";\
32+
$${GMAKE};\
33+
else\
34+
echo"You must use GNU make to build PostgreSQL.";\
35+
false;\
36+
fi

‎aclocal.m4

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
dnl aclocal.m4 generated automatically by aclocal 1.4
2+
3+
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4+
dnl This file is free software; the Free Software Foundation
5+
dnl gives unlimited permission to copy and/or distribute it,
6+
dnl with or without modifications, as long as this notice is preserved.
7+
8+
dnl This program is distributed in the hope that it will be useful,
9+
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10+
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11+
dnl PARTICULAR PURPOSE.
12+
13+
#
14+
# Autoconf macros for configuring the build of Python extension modules
15+
#
16+
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.1 2000/06/10 18:01:34 petere Exp $
17+
#
18+
19+
# PGAC_PROG_PYTHON
20+
# ----------------
21+
# Look for Python and set the output variable `PYTHON'
22+
# to `python' if found, empty otherwise.
23+
AC_DEFUN([PGAC_PROG_PYTHON],
24+
[AC_CHECK_PROG(PYTHON,python,python)])
25+
26+
27+
# PGAC_PATH_PYTHONDIR
28+
# -------------------
29+
# Finds the names of various install dirs and helper files
30+
# necessary to build a Python extension module.
31+
#
32+
# It would be nice if we could check whether the current setup allows
33+
# the build of the shared module. Future project.
34+
AC_DEFUN([PGAC_PATH_PYTHONDIR],
35+
[AC_REQUIRE([PGAC_PROG_PYTHON])
36+
[if test "${PYTHON+set}" = set ; then
37+
python_version=`${PYTHON} -c "import sys; print sys.version[:3]"`
38+
python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
39+
python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
40+
python_configdir="${python_execprefix}/lib/python${python_version}/config"
41+
python_moduledir="${python_prefix}/lib/python${python_version}"
42+
python_extmakefile="${python_configdir}/Makefile.pre.in"]
43+
44+
AC_MSG_CHECKING(forPythonextensionmakefile)
45+
if test -f "${python_extmakefile}" ; then
46+
AC_MSG_RESULT(found)
47+
else
48+
AC_MSG_RESULT(no)
49+
AC_MSG_ERROR(
50+
[The Python extension makefile was expected at \`${python_extmakefile}\'
51+
but does not exist. This means the Python module cannot be built automatically.])
52+
fi
53+
54+
AC_SUBST(python_version)
55+
AC_SUBST(python_prefix)
56+
AC_SUBST(python_execprefix)
57+
AC_SUBST(python_configdir)
58+
AC_SUBST(python_moduledir)
59+
AC_SUBST(python_extmakefile)
60+
else
61+
AC_MSG_ERROR([Python not found])
62+
fi])# PGAC_PATH_PYTHONDIR
63+
64+
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
65+
dnl The program must properly implement --version.
66+
AC_DEFUN(AM_MISSING_PROG,
67+
[AC_MSG_CHECKING(forworking$2)
68+
# Run test in a subshell; some versions of sh will print an error if
69+
# an executable is not found, even if stderr is redirected.
70+
# Redirect stdin to placate older versions of autoconf. Sigh.
71+
if ($2 --version) < /dev/null > /dev/null 2>&1; then
72+
$1=$2
73+
AC_MSG_RESULT(found)
74+
else
75+
$1="$3/missing$2"
76+
AC_MSG_RESULT(missing)
77+
fi
78+
AC_SUBST($1)])
79+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp