diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 108 |
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 @@ | |||
1 | AC_INIT(src/main.cc) | ||
2 | AC_PREREQ(2.52) | ||
3 | AM_INIT_AUTOMAKE(fbpager,0.1.5,no-define) | ||
4 | |||
5 | |||
6 | AC_LANG_CPLUSPLUS | ||
7 | |||
8 | dnl Locate required external software | ||
9 | AC_PROG_CC | ||
10 | AC_PROG_CXX | ||
11 | AC_PROG_INSTALL | ||
12 | AM_PROG_LIBTOOL | ||
13 | |||
14 | |||
15 | dnl Check for system header files | ||
16 | AC_HEADER_STDC | ||
17 | AC_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 | |||
19 | AC_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 | |||
25 | AC_HEADER_TIME | ||
26 | dnl Determine the return type of signal handlers | ||
27 | AC_TYPE_SIGNAL | ||
28 | |||
29 | AC_CHECK_FUNCS(sigaction strcasestr) | ||
30 | |||
31 | dnl Check for X headers and libraries | ||
32 | AC_PATH_X | ||
33 | AC_PATH_XTRA | ||
34 | |||
35 | test x$no_x = "xyes" && AC_MSG_ERROR([fbpager requires the X Window System libraries and headers.]) | ||
36 | |||
37 | test x$x_includes = "x" && x_includes="/usr/include" | ||
38 | test x$x_libraries = "x" && x_libraries="/usr/lib" | ||
39 | |||
40 | CFLAGS="$CFLAGS $X_CFLAGS" | ||
41 | CXXFLAGS="$CXXFLAGS $X_CFLAGS" | ||
42 | LIBS="$LIBS $X_LIBS" | ||
43 | LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS" | ||
44 | |||
45 | dnl Check for required functions in -lX11 | ||
46 | AC_CHECK_LIB(X11, XOpenDisplay, | ||
47 | LIBS="$LIBS -lX11", | ||
48 | AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.]) | ||
49 | ) | ||
50 | |||
51 | LIBS="$LIBS $X_EXTRA_LIBS" | ||
52 | |||
53 | Xext_lib="" | ||
54 | |||
55 | |||
56 | dnl Check whether to include debugging code | ||
57 | DEBUG="" | ||
58 | AC_MSG_CHECKING([whether to include verbose debugging code]) | ||
59 | AC_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 | ) | ||
69 | AC_SUBST(DEBUG) | ||
70 | CXXFLAGS="$CXXFLAGS $DEBUG" | ||
71 | |||
72 | AC_MSG_CHECKING([whether to have Xrender (transparent) support]) | ||
73 | AC_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 | |||
90 | dnl Print results | ||
91 | AC_MSG_RESULT([]) | ||
92 | AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.]) | ||
93 | AC_MSG_RESULT([]) | ||
94 | AC_MSG_RESULT([Using '$prefix' for installation.]) | ||
95 | AC_MSG_RESULT([Using '$CXX' for C++ compiler.]) | ||
96 | AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.]) | ||
97 | AC_MSG_RESULT([Building with '$LIBS' for linker flags.]) | ||
98 | AC_MSG_RESULT([]) | ||
99 | |||
100 | dnl Output files | ||
101 | AM_CONFIG_HEADER(config.h) | ||
102 | |||
103 | AC_OUTPUT( | ||
104 | Makefile | ||
105 | version.h | ||
106 | src/Makefile | ||
107 | src/FbTk/Makefile | ||
108 | ) | ||