refactor: hectic C: perfavor
This commit is contained in:
@@ -22,6 +22,7 @@ stdenv.mkDerivation {
|
||||
cp target/libhectic.a $out/lib/
|
||||
cp target/hectic.so $out/lib/
|
||||
cp hectic.h $out/include/
|
||||
ln $out/lib/hectic.so $out/lib/libhectic.so
|
||||
|
||||
# Create hectic-config script
|
||||
cat > $out/bin/hectic-config <<EOF
|
||||
@@ -31,6 +32,7 @@ stdenv.mkDerivation {
|
||||
echo "Usage: hectic-config [--cflags] [--libs] [--static]"
|
||||
echo " --cflags Print the compiler flags"
|
||||
echo " --libs Print the linker flags (dynamic library by default)"
|
||||
echo " --libdir Print the lib directory"
|
||||
echo " --static When used with --libs, use static linking"
|
||||
echo " --help Display this help message"
|
||||
exit \$1
|
||||
@@ -53,6 +55,9 @@ stdenv.mkDerivation {
|
||||
--cflags)
|
||||
echo "-I$out/include"
|
||||
;;
|
||||
--libdir)
|
||||
echo "-I$out/lib"
|
||||
;;
|
||||
--libs)
|
||||
if [ \$static -eq 1 ]; then
|
||||
echo "-L$out/lib -static -lhectic"
|
||||
|
||||
@@ -4,14 +4,15 @@ EXTENSION = hel
|
||||
|
||||
DATA = $(wildcard *.sql)
|
||||
|
||||
HECTIC_CONFIG = hectic-config
|
||||
PG_CONFIG = pg_config
|
||||
|
||||
HECTIC_CONFIG = hectic-config
|
||||
PG_CFLAGS += $(shell $(HECTIC_CONFIG) --cflags)
|
||||
PG_LDFLAGS += -Wl,-rpath,$(shell $(HECTIC_CONFIG) --libdir)
|
||||
SHLIB_LINK += $(shell $(HECTIC_CONFIG) --libs)
|
||||
|
||||
CFLAGS += $(shell $(HECTIC_CONFIG) --cflags)
|
||||
LIBS += $(shell $(HECTIC_CONFIG) --libs)
|
||||
|
||||
SHLIB_LINK := $(LIBS)
|
||||
PG_CFLAGS += -fsanitize=address
|
||||
PG_LDFLAGS += -fsanitize=address
|
||||
|
||||
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
||||
include $(PGXS)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <fmgr.h>
|
||||
#include <utils/builtins.h>
|
||||
#include <utils/json.h>
|
||||
#include <hectic.h>
|
||||
#include "hectic.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef PG_MODULE_MAGIC
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user