Use GNU Autotools instead of CMake
[nomnom.git] / configure.ac
blob267c05385866b0f7a97f3a7a026188d0b252c14d
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.68])
6 m4_include([m4/version.m4])
8 AC_INIT([nomnom], [_NOMNOM_VERSION],
9   [http://sourceforge.net/apps/trac/nomnom], [],
10   [http://nomnom.sourceforge.net/])
12 AC_CONFIG_SRCDIR([src/main.cpp])
13 AC_CONFIG_HEADERS([config.h])
14 AC_CONFIG_AUX_DIR([config.aux])
15 AC_CONFIG_MACRO_DIR([m4])
16 AC_CANONICAL_SYSTEM
17 AC_GNU_SOURCE
19 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...])
20 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...])
22 AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2 dist-xz])
23 AM_SILENT_RULES([yes])
25 # Checks for programs.
26 AC_PROG_CXX
27 AC_PROG_CC
29 # Checks for libraries.
30 PKG_CHECK_MODULES([QtScript], [QtScript >= 4.6.0])
31 PKG_CHECK_MODULES([QtCore],   [QtCore >= 4.6.0])
32 PKG_CHECK_MODULES([QtGui],    [QtGui >= 4.6.0])
34 # Checks for Qt programs.
36 LRELEASE=`$PKG_CONFIG --variable=lrelease_location QtCore 2>/dev/null`
37 MOC=`$PKG_CONFIG --variable=moc_location QtCore 2>/dev/null`
38 RCC=`$PKG_CONFIG --variable=rcc_location QtCore 2>/dev/null`
39 UIC=`$PKG_CONFIG --variable=uic_location QtCore 2>/dev/null`
41 AS_IF([test -z "$MOC"], [
42   AC_MSG_ERROR([QtCore.pc: moc_location not found, is qt installed?])])
44 AS_IF([test -z "$UIC"], [
45   AC_MSG_ERROR([QtCore.pc: uic_location not found, is qt installed?])])
47 # debian: QtCore.pc (4.6.3): rcc_location undefined in QtCore.pc
48 # rcc: required. You can set RCC_PATH to point to a directory with lrelease.
49 AS_IF([test -z "$RCC"], [
50   AC_PATH_PROGS([RCC], [rcc rcc-qt4], [], [$RCC_PATH$PATH_SEPARATOR$PATH])
51   AS_IF([test -z "$RCC"], [AC_MSG_ERROR([rcc not found, is qt installed?])])
54 # debian: QtCore.pc (4.6.3): lrelease_location undefined in QtCore.pc
55 # lrelease: optional: translations will not be installed.
56 # You can set LRELEASE_PATH to point to a directory with lrelease.
57 AS_IF([test -z "$LRELEASE"], [
58   AC_PATH_PROGS([LRELEASE], [lrelease lrelease-qt4], [],
59     [$LRELEASE_PATH$PATH_SEPARATOR$PATH])
60   AS_IF([test -z "$LRELEASE"], [
61     AC_MSG_NOTICE([lrelease not found, translations will not be built])])
63 AM_CONDITIONAL([HAVE_LRELEASE], [test -n "$LRELEASE"])
65 AC_SUBST([LRELEASE])
66 AC_SUBST([MOC])
67 AC_SUBST([RCC])
68 AC_SUBST([UIC])
70 # Checks for header files.
72 # Checks for typedefs, structures, and compiler characteristics.
73 AC_HEADER_STDBOOL
74 AC_TYPE_SIZE_T
76 # Checks for library functions.
77 AC_FUNC_ERROR_AT_LINE
79 # Version.
80 VN=`$srcdir/gen-ver.sh $srcdir`
81 AC_DEFINE_UNQUOTED([VN],["$VN"], [We have version number from gen-ver.sh])
83 # --with-manual
84 AC_ARG_WITH([manual],
85   [AS_HELP_STRING([--with-manual],
86     [Install manual page(s) @<:@default=yes@:>@])],
87   [],
88   [with_manual=yes])
89 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
91 AC_CONFIG_FILES([
92   Makefile
93   doc/Makefile
94   doc/man1/Makefile
95   tr/Makefile
96   src/Makefile
97   nomnom.desktop
100 AC_OUTPUT
102 AC_MSG_NOTICE([
103  nomnom version: ${VERSION} (${VN})
104  host setup:     ${host}
105  prefix:         ${prefix}
106  install manual: ${with_manual}
108  lrelease:       ${LRELEASE}
109  moc:            ${MOC}
110  rcc:            ${RCC}
111  uic:            ${UIC}])
113 # vim: set ts=2 sw=2 tw=72 expandtab: