mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 02:53:02 +01:00
Merge pull request #7 from jin-eld/update-build-system
Update build system
This commit is contained in:
commit
c78d8bc854
11
.travis.yml
11
.travis.yml
@ -28,14 +28,13 @@ before_script:
|
||||
|
||||
- git clone https://github.com/irungentoo/ProjectTox-Core.git toxcore
|
||||
- cd toxcore
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
- make toxcore -j2
|
||||
- cd ../..
|
||||
- autoreconf -i
|
||||
- ./configure
|
||||
- make -j2
|
||||
- sudo make install
|
||||
script:
|
||||
- autoreconf -i
|
||||
- ./configure --with-libtoxcore-headers=$TRAVIS_BUILD_DIR/toxcore/core --with-libtoxcore-libs=$TRAVIS_BUILD_DIR/toxcore/build/core
|
||||
- ./configure
|
||||
- make -j2
|
||||
notifications:
|
||||
email: false
|
||||
|
137
configure.ac
137
configure.ac
@ -20,6 +20,10 @@ LIBTOXCORE_SEARCH_LIBS=
|
||||
LIBSODIUM_SEARCH_HEADERS=
|
||||
LIBSODIUM_SEARCH_LIBS=
|
||||
|
||||
LIBTOXCORE_FOUND="no"
|
||||
NCURSES_FOUND="no"
|
||||
NCURSES_WIDECHAR_SUPPORT="no"
|
||||
|
||||
AC_ARG_WITH(dependency-search,
|
||||
AC_HELP_STRING([--with-dependency-search=DIR],
|
||||
[search for dependencies in DIR, i.e. look for libraries in
|
||||
@ -38,7 +42,7 @@ fi
|
||||
|
||||
AC_ARG_WITH(libtoxcore-headers,
|
||||
AC_HELP_STRING([--with-libtoxcore-headers=DIR],
|
||||
[search for libtoxcore header files in DIR]),
|
||||
[search for libtoxcore header files in DIR/tox]),
|
||||
[
|
||||
LIBTOXCORE_SEARCH_HEADERS="$withval"
|
||||
AC_MSG_NOTICE([Will search for libtoxcore header files in $withval])
|
||||
@ -108,17 +112,19 @@ AC_CHECK_FUNCS(
|
||||
# pkg-config based tests
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
NCURSES_WIDECHAR_SUPPORT="yes"
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
if test "$WIN32" != "xyes"; then
|
||||
PKG_CHECK_MODULES([NCURSES], [ncursesw],
|
||||
[],
|
||||
[
|
||||
NCURSES_FOUND="yes"
|
||||
NCURSES_WIDECHAR_SUPPORT="yes"
|
||||
],
|
||||
[
|
||||
NCURSES_WIDECHAR_SUPPORT="no"
|
||||
PKG_CHECK_MODULES([NCURSES], [ncurses],
|
||||
[],
|
||||
[
|
||||
AC_MSG_ERROR([required library ncursesw was not found on your system: $NCURSES_PKG_ERRORS])
|
||||
AC_MSG_WARN([$NCURSES_PKG_ERRORS])
|
||||
])
|
||||
])
|
||||
fi
|
||||
@ -126,8 +132,77 @@ else
|
||||
AC_MSG_WARN([pkg-config was not found on your sytem])
|
||||
fi
|
||||
|
||||
if (test "x$NCURSES_FOUND" = "xno") && (test "$WIN32" != "xyes"); then
|
||||
AC_PATH_PROG([CURSES_CONFIG], [ncursesw5-config], [no])
|
||||
if test "x$CURSES_CONFIG" != "xno"; then
|
||||
AC_MSG_CHECKING(ncurses cflags)
|
||||
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
||||
AC_MSG_RESULT($NCURSES_CFLAGS)
|
||||
|
||||
if (test -z "$PKG_CONFIG") || (test "x$WIN32" = "xyes"); then
|
||||
AC_MSG_CHECKING(ncurses libraries)
|
||||
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
||||
AC_MSG_RESULT($NCURSES_LIBS)
|
||||
|
||||
AC_SUBST(NCURSES_CFLAGS)
|
||||
AC_SUBST(NCURSES_LIBS)
|
||||
NCURSES_FOUND="yes"
|
||||
NCURSES_WIDECHAR_SUPPORT="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (test "x$NCURSES_FOUND" = "xno") && (test "$WIN32" != "xyes"); then
|
||||
AC_PATH_PROG([CURSES_CONFIG], [ncursesw5.4-config], [no])
|
||||
if test "x$CURSES_CONFIG" != "xno"; then
|
||||
AC_MSG_CHECKING(ncurses cflags)
|
||||
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
||||
AC_MSG_RESULT($NCURSES_CFLAGS)
|
||||
|
||||
AC_MSG_CHECKING(ncurses libraries)
|
||||
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
||||
AC_MSG_RESULT($NCURSES_LIBS)
|
||||
|
||||
AC_SUBST(NCURSES_CFLAGS)
|
||||
AC_SUBST(NCURSES_LIBS)
|
||||
NCURSES_FOUND="yes"
|
||||
NCURSES_WIDECHAR_SUPPORT="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (test "x$NCURSES_FOUND" = "xno") && (test "$WIN32" != "xyes"); then
|
||||
AC_PATH_PROG([CURSES_CONFIG], [ncurses5-config], [no])
|
||||
if test "x$CURSES_CONFIG" != "xno"; then
|
||||
AC_MSG_CHECKING(ncurses cflags)
|
||||
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
||||
AC_MSG_RESULT($NCURSES_CFLAGS)
|
||||
|
||||
AC_MSG_CHECKING(ncurses libraries)
|
||||
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
||||
AC_MSG_RESULT($NCURSES_LIBS)
|
||||
|
||||
AC_SUBST(NCURSES_CFLAGS)
|
||||
AC_SUBST(NCURSES_LIBS)
|
||||
NCURSES_FOUND="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (test "x$NCURSES_FOUND" = "xno") && (test "$WIN32" != "xyes"); then
|
||||
AC_PATH_PROG([CURSES_CONFIG], [ncurses5.4-config], [no])
|
||||
if test "x$CURSES_CONFIG" != "xno"; then
|
||||
AC_MSG_CHECKING(ncurses cflags)
|
||||
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
||||
AC_MSG_RESULT($NCURSES_CFLAGS)
|
||||
|
||||
AC_MSG_CHECKING(ncurses libraries)
|
||||
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
||||
AC_MSG_RESULT($NCURSES_LIBS)
|
||||
|
||||
AC_SUBST(NCURSES_CFLAGS)
|
||||
AC_SUBST(NCURSES_LIBS)
|
||||
NCURSES_FOUND="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$NCURSES_FOUND" = "xno"; then
|
||||
AC_CHECK_HEADER([curses.h],
|
||||
[],
|
||||
[
|
||||
@ -156,11 +231,15 @@ if (test -z "$PKG_CONFIG") || (test "x$WIN32" = "xyes"); then
|
||||
)
|
||||
else
|
||||
AC_CHECK_LIB([ncursesw], [get_wch],
|
||||
[],
|
||||
[
|
||||
NCURSES_WIDECHAR_SUPPORT="yes"
|
||||
],
|
||||
[
|
||||
unset ac_cv_lib_ncursesw_get_wch
|
||||
AC_CHECK_LIB([ncursesw], [get_wch],
|
||||
[],
|
||||
[
|
||||
NCURSES_WIDECHAR_SUPPORT="yes"
|
||||
],
|
||||
[
|
||||
NCURSES_WIDECHAR_SUPPORT="no"
|
||||
AC_CHECK_LIB([ncurses], [clear],
|
||||
@ -188,34 +267,17 @@ if (test -z "$PKG_CONFIG") || (test "x$WIN32" = "xyes"); then
|
||||
fi
|
||||
fi
|
||||
|
||||
# sodium is included by Tox headers so we kind of need to know where it is
|
||||
LIBSODIUM_CFLAGS=
|
||||
CFLAGS_SAVE="$CFLAGS"
|
||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||
if test -n "$LIBSODIUM_SEARCH_HEADERS"; then
|
||||
CFLAGS="$CFLAGS -I$LIBSODIUM_SEARCH_HEADERS"
|
||||
CPPFLAGS="$CFLAGS -I$LIBSODIUM_SEARCH_HEADERS"
|
||||
AC_CHECK_HEADER(sodium.h,
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
PKG_CHECK_MODULES(LIBTOXCORE, [libtoxcore],
|
||||
[
|
||||
LIBSODIUM_CFLAGS="-I$LIBSODIUM_SEARCH_HEADERS"
|
||||
LIBTOXCORE_FOUND="yes"
|
||||
],
|
||||
[
|
||||
AC_MSG_ERROR([header files for required library libsodium was not found in requested location $LIBSODIUM_SEARCH_HEADERS])
|
||||
]
|
||||
)
|
||||
else
|
||||
AC_CHECK_HEADER(sodium.h,
|
||||
[],
|
||||
[
|
||||
AC_MSG_ERROR([header files for required library libsodium was not found on your system, please check http://download.libsodium.org/libsodium/releases/])
|
||||
]
|
||||
)
|
||||
AC_MSG_WARN([required library libsodium was not found in requested location $LIBSODIUM_SEARCH_LIBS])
|
||||
])
|
||||
fi
|
||||
CFLAGS="$CFLAGS_SAVE"
|
||||
CPPFLAGS="$CPPFLAGS_SAVE"
|
||||
AC_SUBST(LIBSODIUM_CFLAGS)
|
||||
|
||||
|
||||
if test "x$LIBTOXCORE_FOUND" = "xno"; then
|
||||
LIBSODIUM_LIBS=
|
||||
LIBSODIUM_LDFLAGS=
|
||||
LDFLAGS_SAVE="$LDFLAGS"
|
||||
@ -250,9 +312,9 @@ CFLAGS_SAVE="$CFLAGS"
|
||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||
|
||||
if test -n "$LIBTOXCORE_SEARCH_HEADERS"; then
|
||||
CFLAGS="$CFLAGS -I$LIBTOXCORE_SEARCH_HEADERS $LIBSODIUM_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -I$LIBTOXCORE_SEARCH_HEADERS $LIBSODIUM_CFLAGS"
|
||||
AC_CHECK_HEADER([tox.h],
|
||||
CFLAGS="$CFLAGS -I$LIBTOXCORE_SEARCH_HEADERS"
|
||||
CPPFLAGS="$CPPFLAGS -I$LIBTOXCORE_SEARCH_HEADERS"
|
||||
AC_CHECK_HEADER([tox/tox.h],
|
||||
[
|
||||
LIBTOXCORE_CFLAGS="-I$LIBTOXCORE_SEARCH_HEADERS"
|
||||
],
|
||||
@ -261,13 +323,11 @@ if test -n "$LIBTOXCORE_SEARCH_HEADERS"; then
|
||||
]
|
||||
)
|
||||
else
|
||||
CFLAGS="$CFLAGS $LIBSODIUM_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $LIBSODIUM_CFLAGS"
|
||||
AC_CHECK_HEADER([tox.h],
|
||||
AC_CHECK_HEADER([tox/tox.h],
|
||||
[],
|
||||
[
|
||||
AC_MSG_ERROR([headers for the toxcore library were not found on your system])
|
||||
]
|
||||
],
|
||||
)
|
||||
fi
|
||||
CFLAGS="$CFLAGS_SAVE"
|
||||
@ -300,8 +360,7 @@ fi
|
||||
LDFLAGS="$LDFLAGS_SAVE"
|
||||
AC_SUBST(LIBTOXCORE_LIBS)
|
||||
AC_SUBST(LIBTOXCORE_LDFLAGS)
|
||||
|
||||
|
||||
fi
|
||||
|
||||
TOXIC_VERSION="$PACKAGE_VERSION"
|
||||
AC_PATH_PROG([GIT], [git], [no])
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <stdint.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "tox.h"
|
||||
#include <tox/tox.h>
|
||||
|
||||
#include "friendlist.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include "tox.h"
|
||||
#include <tox/tox.h>
|
||||
|
||||
#include "configdir.h"
|
||||
#include "toxic_windows.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <wctype.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "tox.h"
|
||||
#include <tox/tox.h>
|
||||
|
||||
#define MAX_WINDOWS_NUM 32
|
||||
#define MAX_FRIENDS_NUM 100
|
||||
|
Loading…
Reference in New Issue
Block a user