File: configure.in

package info (click to toggle)
gvidm 0.8-15
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 420 kB
  • sloc: cpp: 1,049; sh: 153; python: 104; makefile: 64
file content (86 lines) | stat: -rw-r--r-- 2,031 bytes parent folder | download
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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(gvid.cc)
AC_CONFIG_HEADER(config.h)    

define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl

AC_LANG_CPLUSPLUS

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL

dnl Checks for X.
AC_PATH_XTRA
LIBS="$LIBS $X_LIBS"
dnl X_CFLAGS needs to go in CPPFLAGS so that AC_CHECK_HEADERS works
CPPFLAGS="$CPPFLAGS $X_CFLAGS"

dnl Checks for libraries.
AC_CHECK_LIB(X11, XOpenDisplay)
AC_CHECK_LIB(Xext, main)
AC_CHECK_LIB(Xinerama, XineramaQueryScreens)
lfoobar=""
AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode,,[lfoobar="${lfoobar}a"])
AC_CHECK_LIB(Xrandr, XRRSetScreenConfigAndRate,,[lfoobar="${lfoobar}b"])
if test "$lfoobar" = "ab"; then
	AC_ERROR([neither XVidMode nor XRandR support found.])
fi

AC_ARG_WITH(gtk1, 
	AS_HELP_STRING([--with-gtk1],[use GTK 1.x (default is GTK2)]),
	with_gtk1="$withval",
	with_gtk1=no
)
AS_IF([test "$with_gtk1" = "no"],[
	PKG_CHECK_MODULES([GTK],[gtk+-2.0],,[with_gtk1=yes])
])
if test "$with_gtk1" = "yes" ; then
	AC_MSG_CHECKING([for GTK 1.x])
	GTK_LIBS=`gtk-config --libs`
	if test $? = 0 ; then 
		GTK_CFLAGS=`gtk-config --cflags`
		AC_MSG_RESULT(yes)
	else
		AC_MSG_RESULT(no)
		AC_MSG_ERROR([cannot find GTK])
	fi
fi
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)


dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h getopt.h ios iostream sstream)
AC_CHECK_HEADERS(xf86Parser.h)

dnl Checks for typedefs, structures, and compiler characteristics.
dnl AC_C_CONST
AC_CHECK_TYPES([uintptr_t])

AC_CHECK_DECLS([std::fixed, std::left],,,[#ifdef HAVE_IOS
#include <ios>
#else
#include <iostream>
#endif])

dnl Checks for library functions.
AC_CHECK_FUNCS(getopt_long)

dnl enable warnings and dependancies if using gcc
if test "$GXX" = "yes"; then
	CXXFLAGS="$CXXFLAGS -Wall -MMD"

	AC_MSG_CHECKING(if $CXX accepts -MP)
	if $CXX -MP 2>&1 | grep -q -- -MP ; then
		AC_MSG_RESULT(no)
	else
		AC_MSG_RESULT(yes)
		CXXFLAGS="$CXXFLAGS -MP"
	fi
fi

AC_OUTPUT(Makefile,[echo timestamp > stamp-h])