Tue Aug 31 21:41:59 PDT 2004
- Previous message: [Slony1-commit] By cbbrowne: Indicate need to run "set drop table" queries on all nodes,
- Next message: [Slony1-commit] By darcyb: New Directory
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message: ----------- First round of makefile cleanups, also expand ./configure to build debug code Modified Files: -------------- slony1-engine: Makefile.global.in (r1.15 -> r1.16) configure.ac (r1.31 -> r1.32) slony1-engine/src/slon: Makefile (r1.20 -> r1.21) slony1-engine/doc/concept: Makefile (r1.5 -> r1.6) Added Files: ----------- slony1-engine/config: compiler.m4 (r1.1) docs.m4 (r1.1) general.m4 (r1.1) -------------- next part -------------- Index: Makefile.global.in =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/Makefile.global.in,v retrieving revision 1.15 retrieving revision 1.16 diff -LMakefile.global.in -LMakefile.global.in -u -w -r1.15 -r1.16 --- Makefile.global.in +++ Makefile.global.in @@ -9,35 +9,48 @@ # $Id$ # ---------- +#location subsitutions + pgincludedir = @PGINCLUDEDIR@ pgincludeserverdir = @PGINCLUDESERVERDIR@ pglibdir = @PGLIBDIR@ pgpkglibdir = @PGPKGLIBDIR@ pgsharedir = @PGSHAREDIR@ pgbindir = @PGBINDIR@ +distdir= @SLONYPATH@/@PACKAGE_NAME at -@PACKAGE_VERSION@ + host_os = @HOST_OS@ PORTNAME = @PORTNAME@ - PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE = @PACKAGE@ -subdir=$(slony_subdir) -distdir=@SLONYPATH@/@PACKAGE_NAME at -@PACKAGE_VERSION@ - -override CPPFLAGS := -I$(top_builddir) -I${pgincludedir} -I${pgincludeserverdir} $(CPPFLAGS) -LDFLAGS = -L${pglibdir} -L${pgpkglibdir} -lpq - -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -PTHREAD_CC = @PTHREAD_CC@ - +#build tools CC = @CC@ +PTHREAD_CC= @PTHREAD_CC@ YACC = @YACC@ -YFLAGS = @YFLAGS@ FLEX = @LEX@ +GROFF= @GROFF@ +PS2PDF= @PS2PDF@ +DJPEG= @DJPEG@ +PNMTOPS= @PNMTOPS@ + +#build tool flags +CFLAGS= @CFLAGS@ +PTHREAD_CFLAGS= @PTHREAD_CFLAGS@ +YFLAGS= @YFLAGS@ FLEXFLAGS = @LEXFLAGS@ $(LFLAGS) +#libs +PTHREAD_LIBS= @PTHREAD_LIBS@ + + +subdir=$(slony_subdir) + +override CPPFLAGS := -I$(top_builddir) -I${pgincludedir} -I${pgincludeserverdir} $(CPPFLAGS) +LDFLAGS = -L${pglibdir} -L${pgpkglibdir} -lpq + +CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations # Installation. Index: configure.ac =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/configure.ac,v retrieving revision 1.31 retrieving revision 1.32 diff -Lconfigure.ac -Lconfigure.ac -u -w -r1.31 -r1.32 --- configure.ac +++ configure.ac @@ -89,6 +89,7 @@ # ---- # Locate PostgreSQL paths # ---- + AC_ARG_WITH(pgconfigdir, [ --with-pgconfigdir=<dir> Location of the PostgreSQL pg_config program. ]) AC_ARG_WITH(pgbindir, [ --with-pgbindir=<dir> Location of the PostgreSQL postmaster. ]) AC_ARG_WITH(pgincludedir, [ --with-pgincludedir=<dir> Location of the PostgreSQL headers. ]) @@ -111,10 +112,21 @@ AC_SUBST(PGPKGLIBDIR, $PG_PKGLIBDIR) AC_SUBST(PGSHAREDIR, $PG_SHAREDIR) AC_SUBST(PGBINDIR, $PG_BINDIR) -AC_SUBST(SLONYPATH, $SLONYPATH) +AC_SUBST(SLONYPATH) AC_SUBST(HOST_OS,$host_os) AC_SUBST(PORTNAME,$template) +# ---- +# Tools for building docs +# --- +#SLON_DOCS() + +AC_SUBST(GROFF) +AC_SUBST(PS2PDF) +AC_SUBST(DJPEG) +AC_SUBST(PNMTOPS) + + AC_CONFIG_FILES([ Makefile.global GNUmakefile ]) --- /dev/null +++ config/docs.m4 @@ -0,0 +1,18 @@ +dnl Checking for documentation tools. +dnl + +AC_DEFUN([SLON_DOCS], [ +AC_LANG_SAVE +AC_PATH_PROG(GROFF,groff) +if test "x$GROFF" != x; then + GROFF="$GROFF -U -t -p -ms -mpspic" +fi + +AC_PATH_PROG(PS2PDF, ps2pdf) +AC_PATH_PROG(DJPEG, djpeg) +AC_PATH_PROG(PNMTOPS, pnmtops) + +AC_LANG_RESTORE + +]) + --- /dev/null +++ config/compiler.m4 @@ -0,0 +1,40 @@ +PGAC_ARG_BOOL(enable, debug, no, + [ --enable-debug build with debugging symbols (-g)]) +AC_SUBST(enable_debug) + +AC_DEFUN([PGAC_PROG_CC_NO_STRICT_ALIASING], +[AC_CACHE_CHECK([how to turn off strict aliasing in $CC], + pgac_cv_prog_cc_no_strict_aliasing, +[pgac_save_CFLAGS=$CFLAGS +if test "$GCC" = yes; then + pgac_try="-fno-strict-aliasing" +else + # Maybe fill in later... + pgac_try= +fi + +for pgac_flag in $pgac_try; do + CFLAGS="$pgac_save_CFLAGS $pgac_flag" + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [pgac_cv_prog_cc_no_strict_aliasing=$pgac_try +break]) +done + +CFLAGS=$pgac_save_CFLAGS +]) +if test x"$pgac_cv_prog_cc_no_strict_aliasing" != x""; then + CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing" +fi])# PGAC_PROG_CC_NO_STRICT_ALIASING + +PGAC_PROG_CC_NO_STRICT_ALIASING +if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then + CFLAGS="$CFLAGS -g" +fi +AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) + +if test "$GCC" = yes; then +AC_TRY_COMPILE([], [@%:@ifdef __FAST_MATH__ +choke me +@%:@endif], [], [AC_MSG_ERROR([do not put -ffast-math in CFLAGS])]) +fi + --- /dev/null +++ config/general.m4 @@ -0,0 +1,135 @@ +# $PostgreSQL: pgsql-server/config/general.m4,v 1.3 2003/11/29 19:51:17 pgsql Exp $ + +# This file defines new macros to process configure command line +# arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE. +# The flaw in these is particularly that they only differentiate +# between "given" and "not given" and do not provide enough help to +# process arguments that only accept "yes/no", that require an +# argument (other than "yes/no"), etc. +# +# The point of this implementation is to reduce code size and +# redundancy in configure.in and to improve robustness and consistency +# in the option evaluation code. + + +# Convert type and name to shell variable name (e.g., "enable_long_strings") +m4_define([pgac_arg_to_variable], + [$1[]_[]patsubst($2, -, _)]) + + +# PGAC_ARG(TYPE, NAME, HELP-STRING, +# [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG], +# [ACTION-IF-OMITTED]) +# ---------------------------------------------------------- +# This is the base layer. TYPE is either "with" or "enable", depending +# on what you like. NAME is the rest of the option name, HELP-STRING +# as usual. ACTION-IF-YES is executed if the option is given without +# and argument (or "yes", which is the same); similar for ACTION-IF-NO. + +AC_DEFUN([PGAC_ARG], +[ +m4_case([$1], + +enable, [ +AC_ARG_ENABLE([$2], [$3], [ + case [$]enableval in + yes) + m4_default([$4], :) + ;; + no) + m4_default([$5], :) + ;; + *) + $6 + ;; + esac +], +[$7])[]dnl AC_ARG_ENABLE +], + +with, [ +AC_ARG_WITH([$2], [$3], [ + case [$]withval in + yes) + m4_default([$4], :) + ;; + no) + m4_default([$5], :) + ;; + *) + $6 + ;; + esac +], +[$7])[]dnl AC_ARG_WITH +], + +[m4_fatal([first argument of $0 must be 'enable' or 'with', not '$1'])] +) +])# PGAC_ARG + + +# PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING, +# [ACTION-IF-YES], [ACTION-IF-NO]) +# ----------------------------------------------- +# Accept a boolean option, that is, one that only takes yes or no. +# ("no" is equivalent to "disable" or "without"). DEFAULT is what +# should be done if the option is omitted; it should be "yes" or "no". +# (Consequently, one of ACTION-IF-YES and ACTION-IF-NO will always +# execute.) + +AC_DEFUN([PGAC_ARG_BOOL], +[PGAC_ARG([$1], [$2], [$4], [$5], [$6], + [AC_MSG_ERROR([no argument expected for --$1-$2 option])], + [m4_case([$3], + yes, [pgac_arg_to_variable([$1], [$2])=yes +$5], + no, [pgac_arg_to_variable([$1], [$2])=no +$6], + [m4_fatal([third argument of $0 must be 'yes' or 'no', not '$3'])])])[]dnl +])# PGAC_ARG_BOOL + + +# PGAC_ARG_REQ(TYPE, NAME, HELP-STRING, [ACTION-IF-GIVEN], [ACTION-IF-NOT-GIVEN]) +# ------------------------------------------------------------------------------- +# This option will require an argument; "yes" or "no" will not be +# accepted. + +AC_DEFUN([PGAC_ARG_REQ], +[PGAC_ARG([$1], [$2], [$3], + [AC_MSG_ERROR([argument required for --$1-$2 option])], + [AC_MSG_ERROR([argument required for --$1-$2 option])], + [$4], + [$5])])# PGAC_ARG_REQ + + +# PGAC_ARG_OPTARG(TYPE, NAME, HELP-STRING, [DEFAULT-ACTION], [ARG-ACTION] +# [ACTION-ENABLED], [ACTION-DISABLED]) +# ----------------------------------------------------------------------- +# This will create an option that behaves as follows: If omitted, or +# called with "no", then set the enable_variable to "no" and do +# nothing else. If called with "yes", then execute DEFAULT-ACTION. If +# called with argument, set enable_variable to "yes" and execute +# ARG-ACTION. Additionally, execute ACTION-ENABLED if we ended up with +# "yes" either way, else ACTION-DISABLED. +# +# The intent is to allow enabling a feature, and optionally pass an +# additional piece of information. + +AC_DEFUN([PGAC_ARG_OPTARG], +[PGAC_ARG([$1], [$2], [$3], [$4], [], + [pgac_arg_to_variable([$1], [$2])=yes +$5], + [pgac_arg_to_variable([$1], [$2])=no]) +dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED. +m4_ifval([$6[]$7], +[ +if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then + m4_default([$6], :) +m4_ifval([$7], +[else + $7 +])[]dnl +fi +])[]dnl +])# PGAC_ARG_OPTARG Index: Makefile =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/Makefile,v retrieving revision 1.20 retrieving revision 1.21 diff -Lsrc/slon/Makefile -Lsrc/slon/Makefile -u -w -r1.20 -r1.21 --- src/slon/Makefile +++ src/slon/Makefile @@ -17,8 +17,8 @@ CFLAGS += -D_POSIX_PTHREAD_SEMANTICS endif -override CFLAGS += -g $(PTHREAD_CFLAGS) -I$(slony_top_builddir) -I$(pgincludedir) -override LDFLAGS += -g $(PTHREAD_CFLAGS) $(rpath) $(PTHREAD_LIBS) -L$(pglibdir) -lpq +override CFLAGS += $(PTHREAD_CFLAGS) -I$(slony_top_builddir) -I$(pgincludedir) +override LDFLAGS += $(PTHREAD_CFLAGS) $(rpath) $(PTHREAD_LIBS) -L$(pglibdir) -lpq PROG = slon Index: Makefile =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/doc/concept/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -Ldoc/concept/Makefile -Ldoc/concept/Makefile -u -w -r1.5 -r1.6 --- doc/concept/Makefile +++ doc/concept/Makefile @@ -38,7 +38,7 @@ DISTFILES = Makefile $(wildcard *.pic) Slon_900x720.jpg Slony-I-concept.nr -all: all-ps all-pdf +all: all-ps all-pdf all-txt all-ps: $(PS)
- Previous message: [Slony1-commit] By cbbrowne: Indicate need to run "set drop table" queries on all nodes,
- Next message: [Slony1-commit] By darcyb: New Directory
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list