Skip to content

Commit

Permalink
lirc: Improve non-Linux portability.
Browse files Browse the repository at this point in the history
* netinet/in.h is needed for sockaddr_in on BSD
* Makefile changes to properly link on BSD

With these changes, everything now compiles fine
on FreeBSD with gmake.
  • Loading branch information
InterLinked1 committed Nov 25, 2023
1 parent 9c2e8e2 commit c9b0923
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ library: irc.o
@echo "== Linking $@"
$(CC) -shared -fPIC -o $(LIBNAME).so $^ -lssl -lcrypto

libinstall:
libinstall: library
$(INSTALL) -m 755 $(LIBNAME).so "/usr/lib"
mkdir -p /usr/include/lirc
$(INSTALL) -m 755 *.h "/usr/include/lirc/"
Expand All @@ -28,7 +28,7 @@ client : client.o
$(CC) $(CFLAGS) -o $(EXE) $< -lirc

%.o : %.c
$(CC) $(CFLAGS) -c $^
$(CC) $(CFLAGS) -fPIC -c $^

clean :
$(RM) *.i *.o $(EXE)
Expand Down
1 change: 1 addition & 0 deletions irc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <poll.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> /* use sockaddr_in */
#include <netdb.h>
#include <arpa/inet.h>

Expand Down

0 comments on commit c9b0923

Please sign in to comment.