2019-01-19 17:26:41 +01:00
|
|
|
AC_PREREQ([2.60])
|
2019-04-18 12:25:23 +02:00
|
|
|
AC_INIT([pkgtool], [0.4], [goliath@infraroot.at], pkgtool)
|
2019-01-19 17:26:41 +01:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AM_INIT_AUTOMAKE([foreign dist-xz subdir-objects])
|
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CC_C99
|
2019-02-04 15:21:19 +01:00
|
|
|
AC_PROG_RANLIB
|
2019-01-19 17:26:41 +01:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
m4_ifndef([PKG_PROG_PKG_CONFIG],
|
|
|
|
[m4_fatal([Could not locate the pkg-config autoconf
|
|
|
|
macros. These are usually located in /usr/share/aclocal/pkg.m4.
|
|
|
|
If your macros are in a different location, try setting the
|
|
|
|
environment variable AL_OPTS="-I/other/macro/dir" before running
|
|
|
|
./autogen.sh or autoreconf again. Make sure pkg-config is installed.])])
|
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
|
|
|
UL_WARN_ADD([-Wall])
|
|
|
|
UL_WARN_ADD([-Wextra])
|
|
|
|
UL_WARN_ADD([-Wunused])
|
|
|
|
UL_WARN_ADD([-Wmissing-prototypes])
|
|
|
|
UL_WARN_ADD([-Wmissing-declarations])
|
|
|
|
UL_WARN_ADD([-Wwrite-strings])
|
|
|
|
UL_WARN_ADD([-Wjump-misses-init])
|
|
|
|
UL_WARN_ADD([-Wuninitialized])
|
|
|
|
UL_WARN_ADD([-Winit-self])
|
|
|
|
UL_WARN_ADD([-Wlogical-op])
|
|
|
|
UL_WARN_ADD([-Wunused-but-set-parameter])
|
|
|
|
UL_WARN_ADD([-Wunused-but-set-variable])
|
|
|
|
UL_WARN_ADD([-Wunused-parameter])
|
|
|
|
UL_WARN_ADD([-Wunused-result])
|
|
|
|
UL_WARN_ADD([-Wunused-variable])
|
|
|
|
UL_WARN_ADD([-Wduplicated-cond])
|
|
|
|
UL_WARN_ADD([-Wduplicated-branches])
|
|
|
|
UL_WARN_ADD([-Wrestrict])
|
|
|
|
UL_WARN_ADD([-Wnull-dereference])
|
|
|
|
UL_WARN_ADD([-pedantic])
|
|
|
|
|
|
|
|
AC_SUBST([WARN_CFLAGS])
|
|
|
|
|
2019-04-28 16:36:10 +02:00
|
|
|
##### configuration options #####
|
|
|
|
|
|
|
|
AC_DEFINE([REPODIR], ["./"], [Default package repository directory])
|
|
|
|
AC_DEFINE([INSTALLROOT], ["./"], [Default package installation root])
|
|
|
|
|
|
|
|
AC_ARG_WITH([repo-dir],
|
|
|
|
[AS_HELP_STRING([--with-repo-dir],
|
|
|
|
[Set the default package repository directory])],
|
|
|
|
[AC_DEFINE_UNQUOTED([REPODIR], "$withval")])
|
|
|
|
|
|
|
|
AC_ARG_WITH([install-root],
|
|
|
|
[AS_HELP_STRING([--with-install-root],
|
|
|
|
[Set the default package installation directory])],
|
|
|
|
[AC_DEFINE_UNQUOTED([INSTALLROOT], "$withval")])
|
|
|
|
|
2019-01-19 17:26:41 +01:00
|
|
|
##### search for dependencies #####
|
|
|
|
|
|
|
|
have_zlib="no"
|
|
|
|
have_lzma="no"
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(ZLIB, [zlib], [have_zlib="yes"], [])
|
|
|
|
PKG_CHECK_MODULES(XZ, [liblzma >= 5.0.0], [have_lzma="yes"], [])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([WITH_ZLIB], [test "x$have_zlib" == "xyes"])
|
|
|
|
AM_CONDITIONAL([WITH_LZMA], [test "x$have_lzma" == "xyes"])
|
|
|
|
|
|
|
|
##### generate output #####
|
|
|
|
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
|
|
|
AC_OUTPUT([Makefile])
|