aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in108
1 files changed, 108 insertions, 0 deletions
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..c6c1ea2
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,108 @@
1AC_INIT(src/main.cc)
2AC_PREREQ(2.52)
3AM_INIT_AUTOMAKE(fbpager,0.1.5,no-define)
4
5
6AC_LANG_CPLUSPLUS
7
8dnl Locate required external software
9AC_PROG_CC
10AC_PROG_CXX
11AC_PROG_INSTALL
12AM_PROG_LIBTOOL
13
14
15dnl Check for system header files
16AC_HEADER_STDC
17AC_CHECK_HEADERS(fcntl.h signal.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h)
18
19AC_CHECK_HEADERS(sstream, ,
20 [ AC_CHECK_HEADERS(strstream,,
21 [AC_MSG_ERROR([Your libstdc++ doesn't have the sstream or strstream classes])]
22 )]
23)
24
25AC_HEADER_TIME
26dnl Determine the return type of signal handlers
27AC_TYPE_SIGNAL
28
29AC_CHECK_FUNCS(sigaction strcasestr)
30
31dnl Check for X headers and libraries
32AC_PATH_X
33AC_PATH_XTRA
34
35test x$no_x = "xyes" && AC_MSG_ERROR([fbpager requires the X Window System libraries and headers.])
36
37test x$x_includes = "x" && x_includes="/usr/include"
38test x$x_libraries = "x" && x_libraries="/usr/lib"
39
40CFLAGS="$CFLAGS $X_CFLAGS"
41CXXFLAGS="$CXXFLAGS $X_CFLAGS"
42LIBS="$LIBS $X_LIBS"
43LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
44
45dnl Check for required functions in -lX11
46AC_CHECK_LIB(X11, XOpenDisplay,
47 LIBS="$LIBS -lX11",
48 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
49)
50
51LIBS="$LIBS $X_EXTRA_LIBS"
52
53Xext_lib=""
54
55
56dnl Check whether to include debugging code
57DEBUG=""
58AC_MSG_CHECKING([whether to include verbose debugging code])
59AC_ARG_ENABLE(debug,
60 [ --enable-debug include verbose debugging code [default=no]],
61 if test x$enableval = "xyes"; then
62 AC_MSG_RESULT([yes])
63 DEBUG="-DDEBUG -fno-inline"
64 else
65 AC_MSG_RESULT([no])
66 fi,
67 AC_MSG_RESULT([no])
68)
69AC_SUBST(DEBUG)
70CXXFLAGS="$CXXFLAGS $DEBUG"
71
72AC_MSG_CHECKING([whether to have Xrender (transparent) support])
73AC_ARG_ENABLE(
74 xrender,
75[ --enable-xrender Xrender (transparent) support [default=yes]],
76 if test x$enableval = "xyes"; then
77 AC_MSG_RESULT([yes])
78 AC_CHECK_LIB(Xrender, XRenderCreatePicture,
79 AC_DEFINE(HAVE_XRENDER, 1, "Xrender support")
80 LIBS="$LIBS -lXrender")
81 else
82 AC_MSG_RESULT([no])
83 fi,
84 AC_MSG_RESULT([yes])
85 AC_CHECK_LIB(Xrender, XRenderCreatePicture,
86 AC_DEFINE(HAVE_XRENDER, 1, "Xrender support")
87 LIBS="$LIBS -lXrender")
88)
89
90dnl Print results
91AC_MSG_RESULT([])
92AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
93AC_MSG_RESULT([])
94AC_MSG_RESULT([Using '$prefix' for installation.])
95AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
96AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
97AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
98AC_MSG_RESULT([])
99
100dnl Output files
101AM_CONFIG_HEADER(config.h)
102
103AC_OUTPUT(
104Makefile
105version.h
106src/Makefile
107src/FbTk/Makefile
108)