Skip to content

Commit

Permalink
Do not hardcode PKG_CONFIG_PATH in config.m4
Browse files Browse the repository at this point in the history
Lookup whether libmapi include,libdir are found in configure
  • Loading branch information
jkerihuel committed Aug 11, 2014
1 parent 67b86a5 commit 22ec492
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions php/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ PHP_MAPI_H="php_mapi.h mapi_exception.h mapi_profile_db.h mapi_profile.h mapi_se
PHP_MAPI_SRC="mapi.c mapi_exception.c mapi_profile_db.c mapi_profile.c mapi_session.c mapi_mailbox.c mapi_folder.c mapi_message.c mapi_contact.c mapi_task.c mapi_appointment.c mapi_attachment.c mapi_table.c mapi_message_table.c mapi_folder_table.c mapi_attachment_table.c php_mapi_constants.c "
dnl remove php_mapi_constants.c when it is genration is included in the build

if test "$PHP_MAPI" = "yes"; then
AC_DEFINE(HAVE_MAPI, 1, [Whether you have LibMapi ])
PHP_NEW_EXTENSION(openchange, $PHP_MAPI_SRC, $ext_shared)
fi
AC_DEFINE(HAVE_MAPI, 1, [Whether you have LibMapi ])
PHP_NEW_EXTENSION(openchange, $PHP_MAPI_SRC, $ext_shared)

LIBMAPI_INCLINE=`pkg-config --cflags libmapi`
LIBMAPI_LIBLINE=`pkg-config --libs libmapi`

PHP_ARG_WITH(pkgconfig-path, path to libmapi pkgconfig directory,
[ --with-pkgconfig-path Path to libmapi pkgconfig directory], /usr/local/samba/lib/pkgconfig)
if test x"$LIBMAPI_INCLINE" = x""; then
AC_MSG_ERROR([libmapi not found])
fi

LIBMAPI_INCLINE=`PKG_CONFIG_PATH=/opt/samba4/lib/pkgconfig pkg-config --cflags libmapi`
LIBMAPI_LIBLINE=`PKG_CONFIG_PATH=/opt/samba4/lib/pkgconfig pkg-config --libs libmapi`
if test x"$LIBMAPI_LIBLINE" = x""; then
AC_MSG_ERROR([libmapi not found])
fi

LDFLAGS="$LDFLAGS $LIBMAPI_LIBLINE"
INCLUDES="$INCLUDES $LIBMAPI_INCLINE -I$PHP_OPENCHANGE_PATH -I$PHP_OPENCHANGE_PATH/utils"
Expand Down

0 comments on commit 22ec492

Please sign in to comment.