Skip to content

Commit

Permalink
Add new autoconf macro for adding brew directories to flags
Browse files Browse the repository at this point in the history
  • Loading branch information
d-torrance committed Nov 15, 2024
1 parent 262ef0c commit 147d6ee
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions M2/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,19 @@ AC_SUBST(SIZEOF_INT_P,$ac_cv_sizeof_int_p)
AC_CHECK_SIZEOF([long])
AC_SUBST(SIZEOF_LONG,$ac_cv_sizeof_long)

dnl Check for Homebrew packages

AC_CHECK_PROGS([BREW], [brew], [false])

dnl BREW_ADD_FLAG([FORMULA], [DIR], [FLAG], [PREFIX])
dnl adds PREFIX$(brew --prefix FORMULA)/DIR (if it exists) to FLAG
AC_DEFUN([BREW_ADD_FLAG],
[AS_IF([test "x$BREW" = xbrew -a -d $($BREW --prefix $1)/$2],
[$3="$$3 $4$($BREW --prefix $1)/$2"], [echo foo])])

BREW_ADD_FLAG([], [lib], [LDFLAGS], [-L])
BREW_ADD_FLAG([], [include], [CPPFLAGS], [-I])

AC_CHECK_HEADERS(sys/ioctl.h termios.h sys/mman.h sys/socket.h netdb.h netinet/in.h arpa/inet.h sys/time.h time.h sys/wait.h sys/resource.h io.h linux/personality.h stddef.h elf.h execinfo.h syscall.h math.h pthread.h assert.h alloca.h malloc.h dlfcn.h)
AC_CHECK_HEADERS(winsock2.h) dnl used with ws2_32.dll under mingw64
dnl winsock2.h should be included before including windows.h
Expand Down

0 comments on commit 147d6ee

Please sign in to comment.