ryanmjacobs/c

freebsd support

dcou opened this issue · 3 comments

dcou commented

I got your script working on freebsd with multiple parameters using this as my first line

#!/usr/bin/env -S c "-I/usr/local/include/ -g -L/usr/local/lib/mysql/ -lmysqlclient --"

might be worth mentioning in the readme

Interesting... does this apply for even simple scripts? Or only for scripts that link in external libraries, e.g. mysqlclient?

#!/usr/bin/c

#include <stdio.h>

int main(void) {
    printf("hello world\n");
    return 0;
}
dcou commented

Yes even for simple scripts, on FreeBSD 11, it has to be

#!/usr/bin/env c

#include <stdio.h>

int main(void) {
    printf("hello world\n");
    return 0;
}

my other more complex example is required when using env with multiple arguments

@ryanmjacobs You could add a CI FreeBSD test using https://github.com/vmactions/freebsd-vm