summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-31 01:47:53 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-31 01:47:53 +0300
commit4530a341c65ac12e50075fb3e3d6166cd2e1fe3b (patch)
tree9739fdefed4477751bee9fc07b1fbfeac1e3d1b5
parentf592e589f9b5e38e1fe9e6d0fd5d2adc62326bb7 (diff)
downloadmanaverse-4530a341c65ac12e50075fb3e3d6166cd2e1fe3b.tar.gz
manaverse-4530a341c65ac12e50075fb3e3d6166cd2e1fe3b.tar.bz2
manaverse-4530a341c65ac12e50075fb3e3d6166cd2e1fe3b.tar.xz
manaverse-4530a341c65ac12e50075fb3e3d6166cd2e1fe3b.zip
Add USE_X11 define into make file.
-rwxr-xr-xconfigure.ac7
-rw-r--r--src/Makefile.am9
2 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 7aad4ed33..fd715eb59 100755
--- a/configure.ac
+++ b/configure.ac
@@ -276,6 +276,7 @@ AC_CHECK_LIB(png, png_write_info, ,
AC_MSG_ERROR([ *** Unable to find png library]))
+use_x11=no
# === Check for X11 (check borrowed from Wormux) ========================
# Deactivated on purpose under OSX (in case X11 SDK is installed)
if test "x$OSX" != "xyes" ; then
@@ -289,11 +290,15 @@ if test "x$OSX" != "xyes" ; then
if test x${check_x11} = xyes ; then
AC_CHECK_LIB(X11, XOpenDisplay,
[ LIBS="$LIBS -lX11"
- AC_DEFINE(USE_X11, 1, [Define to use X11 copy'n'paste]) ],
+ AC_DEFINE(USE_X11, 1, [Define to use X11 copy'n'paste])
+ use_x11=yes
+ ],
[])
fi
fi
+AM_CONDITIONAL(USE_X11, test x$use_x11 = xyes)
+
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h])
diff --git a/src/Makefile.am b/src/Makefile.am
index e70aaf2fa..e45202c22 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,6 +18,11 @@ manaplus_CXXFLAGS += -Werror
dyecmd_CXXFLAGS += -Werror
endif
+if USE_X11
+manaplus_CXXFLAGS += -DUSE_X11
+dyecmd_CXXFLAGS += -DUSE_X11
+endif
+
if ENABLE_ASSERTS
manaplus_CXXFLAGS += -DENABLE_ASSERTS
dyecmd_CXXFLAGS += -DENABLE_ASSERTS
@@ -1804,6 +1809,10 @@ manaplustests_CXXFLAGS += -DENABLE_ASSERTS
manaplustests_LDFLAGS = -rdynamic
endif
+if USE_X11
+manaplustests_CXXFLAGS += -DUSE_X11
+endif
+
manaplustests_SOURCES = ${manaplus_SOURCES} \
enums/enums_unittest.cc \
utils/checkutils_unittest.cc \