EXTRA_CLEAN = cubeparse.c cubeparse.h cubescan.c y.tab.c y.tab.h
+SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS
PGXS = $(shell pg_config --pgxs)
* interface functions to dictionary
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
+#include "postgres.h"
+
#include <ctype.h>
-#include "postgres.h"
-#include "fmgr.h"
-#include "utils/array.h"
#include "catalog/pg_type.h"
#include "executor/spi.h"
+#include "fmgr.h"
+#include "utils/array.h"
+#include "utils/memutils.h"
#include "dict.h"
#include "common.h"
static int
comparedict(const void *a, const void *b)
{
- return ((DictInfo *) a)->dict_id - ((DictInfo *) b)->dict_id;
+ if ( ((DictInfo *) a)->dict_id == ((DictInfo *) b)->dict_id )
+ return 0;
+ return ( ((DictInfo *) a)->dict_id < ((DictInfo *) b)->dict_id ) ? -1 : 1;
}
DictInfo *
* example of dictionary
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "postgres.h"
#include "dict.h"
* ISpell interface
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
#include "postgres.h"
+#include <ctype.h>
+
#include "dict.h"
#include "common.h"
#include "ispell/spell.h"
* http://snowball.tartarus.org/
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <stdlib.h>
-#include <string.h>
-
#include "postgres.h"
#include "dict.h"
* ISpell interface
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-
#include "postgres.h"
+#include <ctype.h>
+
#include "dict.h"
#include "common.h"
* Simple config parser
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
#include "postgres.h"
+#include <ctype.h>
+
#include "dict.h"
#include "common.h"
* simple but fast map from str to Oid
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "postgres.h"
+
#include "snmap.h"
#include "common.h"
* interface functions to tscfg
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
+#include "postgres.h"
+
#include <ctype.h>
#include <locale.h>
-#include "postgres.h"
-#include "fmgr.h"
-#include "utils/array.h"
#include "catalog/pg_type.h"
#include "executor/spi.h"
+#include "fmgr.h"
+#include "utils/array.h"
+#include "utils/memutils.h"
#include "ts_cfg.h"
#include "dict.h"
static int
comparecfg(const void *a, const void *b)
{
- return ((TSCfgInfo *) a)->id - ((TSCfgInfo *) b)->id;
+ if ( ((TSCfgInfo *) a)->id == ((TSCfgInfo *) b)->id )
+ return 0;
+ return ( ((TSCfgInfo *) a)->id < ((TSCfgInfo *) b)->id ) ? -1 : 1;
}
TSCfgInfo *
* interface functions to parser
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
+#include "postgres.h"
+
#include <ctype.h>
-#include "postgres.h"
-#include "fmgr.h"
-#include "utils/array.h"
#include "catalog/pg_type.h"
#include "executor/spi.h"
+#include "fmgr.h"
#include "funcapi.h"
+#include "utils/array.h"
+#include "utils/memutils.h"
#include "wparser.h"
#include "ts_cfg.h"
static int
compareprs(const void *a, const void *b)
{
- return ((WParserInfo *) a)->prs_id - ((WParserInfo *) b)->prs_id;
+ if ( ((WParserInfo *) a)->prs_id == ((WParserInfo *) b)->prs_id )
+ return 0;
+ return ( ((WParserInfo *) a)->prs_id < ((WParserInfo *) b)->prs_id ) ? -1 : 1;
}
WParserInfo *
* default word parser
* Teodor Sigaev <teodor@sigaev.ru>
*/
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "postgres.h"
+
#include "utils/builtins.h"
#include "dict.h"
main nodes optimizer port postmaster regex rewrite \
storage tcop utils $(top_builddir)/src/timezone
-OBJS := $(DIRS:%=%/SUBSYS.o)
+SUBSYSOBJS := $(DIRS:%=%/SUBSYS.o)
+
+OBJS := $(SUBSYSOBJS) $(top_builddir)/src/port/libpgport_srv.a
+
+# We put libpgport into OBJS, so remove it from LIBS
+LIBS := $(patsubst -lpgport, , $(LIBS))
ifeq ($(PORTNAME), qnx4)
# This file crashes qnx4's wlink and is therefore not in
# bootstrap/SUBSYS.o on that platform. (Wotta hack ... is it still
# necessary?) [ Yes, until the Watcom compiler goes open source it's
# effectively unsupported ]
-OBJS+= bootstrap/bootstrap.o
+OBJS += bootstrap/bootstrap.o
endif
-# Use server version of port library
-LIBS := $(patsubst -lpgport,-lpgport_srv, $(LIBS))
-
##########################################################################
all: submake-libpgport postgres $(POSTGRES_IMP)
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(LIBS)
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack,4194304 -o $@$(X) $@.exp $(OBJS) $(LIBS)
rm -f $@.exp $@.base
postgres.def: $(OBJS)
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(WIN32RES) $(LIBS)
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(WIN32RES) $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack=4194304 -o $@$(X) $@.exp $(OBJS) $(WIN32RES) $(LIBS)
rm -f $@.exp $@.base
postgres.def: $(OBJS)
- $(DLLTOOL) --export-all --output-def $@ $^ $(top_builddir)/src/port/libpgport.a
+ $(DLLTOOL) --export-all --output-def $@ $^
libpostgres.a: postgres.def
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
endif # aix
# Parallel make trickery
-$(OBJS): $(DIRS:%=%-recursive) ;
+$(SUBSYSOBJS): $(DIRS:%=%-recursive) ;
.PHONY: $(DIRS:%=%-recursive)
# Update the commonly used headers before building the subdirectories
* $PostgreSQL$
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "c.h"
#include "getopt_long.h"
+#ifndef HAVE_INT_OPTRESET
+int optreset;
+#endif
+
#define BADCH '?'
#define BADARG ':'
#define EMSG ""
+
int
getopt_long(int argc, char *const argv[],
const char *optstring,