Skip to content

Commit

Permalink
add -I/usr/local/include to CFLAGS and -L/usr/local/lib to LDFLAGS by…
Browse files Browse the repository at this point in the history
… default unless disabled by using --disable-extra-paths with configure
  • Loading branch information
vergoh committed Mar 11, 2018
1 parent 1601521 commit fffc15d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 0 additions & 6 deletions INSTALL_BSD
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ Compiling the binaries
options for the cgi are in the beginning of the file. Additional examples
for using the json output are also available in the same directory.

Some BSD users may need to provide correct CFLAGS and LDFLAGS paths to the
configure script if the image output is wanted but the location of libgd2
isn't automatically detected. For example (using bash as shell):

CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure

For executing the optional test suite, see the appendix at the end of this
file.

Expand Down
12 changes: 12 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ enable_maintainer_mode
enable_dependency_tracking
enable_image_output
enable_werror
enable_extra_paths
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1389,6 +1390,8 @@ Optional Features:
--enable-werror add -Werror to CFLAGS
--disable-extra-paths do not add extra paths to CFLAGS and LDFLAGS
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
Expand Down Expand Up @@ -4097,6 +4100,15 @@ fi



# Check whether --enable-extra-paths was given.
if test "${enable_extra_paths+set}" = set; then :
enableval=$enable_extra_paths;
else

CFLAGS="$CFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi


# Checks for libraries.

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ AC_ARG_ENABLE([werror], [
AS_HELP_STRING([--enable-werror], [add -Werror to CFLAGS])], [CFLAG_EXTRAS="-Werror"])
AC_SUBST([CFLAG_EXTRAS])

AC_ARG_ENABLE([extra-paths], [
AS_HELP_STRING([--disable-extra-paths], [do not add extra paths to CFLAGS and LDFLAGS])], [], [
CFLAGS="$CFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib"])

# Checks for libraries.
AC_CHECK_LIB([m], [pow], [], [AC_MSG_ERROR([could not find required math library])])
AC_CHECK_LIB([sqlite3], [sqlite3_prepare_v2], [], [AC_MSG_ERROR([could not find required sqlite3 library])])
Expand Down

0 comments on commit fffc15d

Please sign in to comment.