Static port with mysqlclient

Pascal Christen pascal at pascalchristen.ch
Fri May 10 15:22:36 UTC 2019


Hi

I'm trying to build a static c program with a port. How do I achieve that?

Let's say, thats my code:

#include <mysql.h>
#include <stdio.h>
int main()
{
   printf("Hello, World!");
   printf("MySQL client version: %s\n", mysql_get_client_info());
   return 0;
}

Let's say, that's my Makefile:
CC=gcc
LIBS = `mysql_config --libs`
CFLAGS = `mysql_config --cflags` -Wall

compile:
	$(CC) -static -o blabla test.c $(LIBS) $(CFLAGS)

which produces that:
# make
gcc8 -static -o blabla test.c `mysql_config --libs` `mysql_config --cflags` -Wall
# ./blabla 
Hello, World!MySQL client version: 10.1.39-MariaDB


And how do I wrap around a FreeBSD port, which builds with correct mysql-Version?

Thanks for helping me out!








More information about the freebsd-ports mailing list