File: configure.in

package info (click to toggle)
idesk 0.7.5-6
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 1,416 kB
  • ctags: 769
  • sloc: cpp: 4,211; sh: 2,917; makefile: 78
file content (187 lines) | stat: -rw-r--r-- 4,886 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
dnl Initialize autoconf and automake
AC_INIT(src/Main.cpp)
VERSION=0.7.5
PACKAGE=idesk
dnl Output files
AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE($PACKAGE,"$VERSION")

dnl Determine default prefix
if test "x$prefix" = "xNONE"; then
  prefix="/usr/local"
fi
if test "x$exec_prefix" = "xNONE"; then
 exec_prefix=$prefix
fi

dnl Check for various flavors of UNIX(r)
dnl AC_AIX
AC_ISC_POSIX
AC_LANG_CPLUSPLUS
 
dnl Locate required external software
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AM_PROG_CC_STDC
AC_PROG_MAKE_SET

dnl Check for system header files
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h unistd.h dirent.h stdlib.h sys/time.h time.h sys/wait.h) 

AC_CHECK_HEADERS(sstream, ,
        [ AC_CHECK_HEADERS(strstream,,
            [AC_MSG_ERROR([Your libstdc++ doesn't have the sstream, fstream or strstream classes])]
        )]
)


AC_CHECK_HEADERS(cassert cctype cerrno cmath cstdarg cstdio cstdlib cstring ctime)

AC_HEADER_TIME

dnl Check for X headers and libraries
AC_PATH_X([X11], [X11/Xlib.h], [XOpenDisplay(NULL)])
AC_PATH_XTRA

test x$no_x = "xyes" && AC_MSG_ERROR([Idesk requires the X Window System libraries and headers.])

test x$x_includes = "x" && x_includes="/usr/include"
test x$x_libraries = "x" && x_libraries="/usr/lib"

CFLAGS="$CFLAGS $X_CFLAGS"
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
LIBS="$LIBS $X_LIBS"
LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"

dnl Check for required functions in -lX11
AC_CHECK_LIB(X11, XOpenDisplay, LIBS="$LIBS -lX11",[
  echo "ERROR:  You need libX11 to build Idesk.  Verify that you have libX11.a or";
  echo "        libX11.so installed and that it is located in the X libraries";
  AC_MSG_ERROR([Fatal:  libX11 not found.])])

LIBS="$LIBS $X_EXTRA_LIBS"

dnl Check for XShape extension support and proper library files.
SHAPE=""
AC_MSG_CHECKING([whether to build support for the XShape extension])
AC_ARG_ENABLE(
  shape, [  --enable-shape          enable support of the XShape extension [default=yes]])

: ${enableval="yes"}
if test x$enableval = "xyes"; then
  AC_MSG_RESULT([yes])
  AC_CHECK_LIB(Xext, XShapeCombineShape,
    AC_MSG_CHECKING([for X11/extensions/shape.h])
    AC_TRY_LINK(
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
, long foo = ShapeSet,
      AC_MSG_RESULT([yes])
      SHAPE="-DSHAPE"; Xext_lib="-lXext",
      AC_MSG_RESULT([no])
    )
  )
else
  AC_MSG_RESULT([no])
fi
AC_SUBST(SHAPE)
CXXFLAGS="$CXXFLAGS $SHAPE"
LIBS="$LIBS $Xext_lib"

dnl Imlib2 detection

AC_PATH_GENERIC(imlib2, , [
    AC_SUBST(IMLIB_LIBS)
   AC_SUBST(IMLIB_CXXFLAGS) ],
  AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in the path?
               You need Imlib2 to build Idesk.  Verify that you have Imlib2-dev))

dnl the above doesn't work for some reason :/
IMLIB_LIBS=`imlib2-config --libs`
IMLIB_CFLAGS=`imlib2-config --cflags`
AC_SUBST(IMLIB_LIBS)
AC_SUBST(IMLIB_CXXFLAGS)

CXXFLAGS="$CXXFLAGS $IMLIB_CXXFLAGS"
LIBS="$LIBS $IMLIB_LIBS"


dnl Check for libsn Startup Notificacion options
STARTUP=""
AC_MSG_CHECKING([whether to include Startup Notification ])
AC_ARG_ENABLE(
  libsn, [  --enable-libsn        include code for LIBSN [default=no]])

if test -n "$enable_libsn"; then
                    PKG_CHECK_MODULES(LIBSN, libstartup-notification-1.0 >= 0.5)
      		    AC_MSG_RESULT([yes])
                    STARTUP="-DHAVE_STARTUP_NOTIFICATION -DSN_API_NOT_YET_FROZEN=1",
else
  AC_MSG_RESULT([no])
fi

AM_CONDITIONAL(HAVE_STARTUP_NOTIFICATION, test x$LIBSN = xtrue)
AC_SUBST(STARTUP)
AC_SUBST(LIBSN_CFLAGS)
AC_SUBST(LIBSN_LIBS)
CXXFLAGS="$CXXFLAGS $LIBSN_CFLAGS $STARTUP"
LIBS="$LIBS $LIBSN_LIBS"


AC_MSG_CHECKING([whether to have Xft support])
AM_PATH_XFT(yes,
	XFT=true,
	XFT=false
)

if test "x$XFT" = "xtrue" ; then
	AC_TRY_LINK([
			#include <X11/Xft/Xft.h>
		], [ XftFontClose(0, 0); return 1; ], 
	[
		
		AC_DEFINE(USE_XFT, 1, "antialias support")
	    AC_MSG_CHECKING([Xft UTF-8 support])
   	     AC_TRY_LINK([
			#include <X11/Xft/Xft.h>
		], [ XftDrawStringUtf8(0, 0, 0, 0, 0, 0, 0); return 0; ],
		AC_DEFINE(HAVE_XFT_UTF8_STRING, 1, "Xft UTF8 support")
		AC_MSG_RESULT(yes),
		AC_MSG_RESULT(no)
		)
	],
	[	AC_MSG_RESULT([Could not link with Xft. Install Xft if you want support for it.])
		XFT=false
	])
fi

AM_CONDITIONAL(XFT, test x$XFT = xtrue)

dnl Determine the return type of signal handlers
AC_TYPE_SIGNAL

dnl Determine if maintainer portions of the Makefiles should be included.
dnl AM_MAINTAINER_MODE

dnl default prefix
DEFAULT_PREFIX="$prefix"
AC_SUBST(DEFAULT_PREFIX)

dnl Print results
AC_MSG_RESULT([])
AC_MSG_RESULT([	$PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([])
AC_MSG_RESULT([Using '$prefix' for installation.])
AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
AC_MSG_RESULT([])


AC_OUTPUT(Makefile
src/Makefile
)