From 2f14a4df61cf416420a54c252e72458ef8d06ba0 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Mon, 16 Jun 2025 19:37:35 -0400 Subject: [PATCH] Adding shared capability --- .gitignore | 1 + app/Makefile | 2 +- lib/Makefile | 19 +++++++++++++++---- lib/unipos.c | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d79af10..e8c61db 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ data-sender/ data-sorter/ data-sorter2/ *.swp +shared/ lib/numver.h diff --git a/app/Makefile b/app/Makefile index 18a8a15..8dcd227 100644 --- a/app/Makefile +++ b/app/Makefile @@ -40,7 +40,7 @@ SRC= \ CC = gcc LD = gcc -g CFLAGS = -I ../lib -Wall $(OPTIME) -LIBMAIL = ../lib/libmail.a +LIBMAIL = ../lib/libmail.a ../shared/libposql.so.1 LIBS = $(LIBMAIL) \ -luuid \ -lpq \ diff --git a/lib/Makefile b/lib/Makefile index edf6072..598d980 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -4,7 +4,6 @@ debug : toremake @ $(MAKE) \ $(PAR) \ - DATABASE=$(DATABASE) \ OPTIME="-g -DMODEDEBUG" \ objs @ echo "library compiled in '$@' mode, now ready" @@ -14,7 +13,19 @@ prod : toremake @ echo "library compiled in '$@' mode, now ready" clean : - - rm -fr *.o *.a *.tar.gz + - rm -fr *.so.* *.o *.a *.tar.gz + +#-------------------------------------------------------------------- +#database definition +shared : libposql + mv -f libposql.so.1.0 ../shared + ln -nsf libposql.so.1.0 ../shared/libposql.so.1 + +libposql: unipos.o + $(CC) -shared -Wl,-soname,$@.so.1 -o $@.so.1.0 unipos.o + +unipos.o: unipos.h + $(CC) $(CFLAGS) -c -fPIC -o $@ unipos.c #-------------------------------------------------------------------- #Equivalences @@ -24,11 +35,11 @@ OBJS= \ lvleml.o \ gesspf.o gestcp.o geseml.o \ devlog.o devsoc.o devsql.o \ - unidns.o unieml.o unipos.o \ + unidns.o unieml.o \ unipar.o uniprc.o unisig.o unitls.o \ subafn.o subrou.o -objs : $(OBJS) +objs : $(OBJS) shared @ ar -cr $(LIBMAIL) $(OBJS) #-------------------------------------------------------------------- diff --git a/lib/unipos.c b/lib/unipos.c index 84dd4aa..be4e9db 100644 --- a/lib/unipos.c +++ b/lib/unipos.c @@ -23,7 +23,7 @@ static void notavail() { char *cmt="Postgresql Database access is NOT implemented (config?)"; -(void) rou_alert(0,"%s",cmt); +(void) fprintf(stderr,"%s\n",cmt); } #endif /* -- 2.47.3