configure.ac 1.2 KB
Newer Older
N
nocjj 已提交
1 2 3 4 5 6 7 8 9 10 11 12
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([vmtop], [1.0], [virt@openeuler.org])
AC_CONFIG_SRCDIR([src/vmtop.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AM_INIT_AUTOMAKE([subdir-objects])
13
CC="$CC -std=gnu11"
N
nocjj 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

# Checks for libraries.
AC_CHECK_LIB(ncurses, initscr, [], [echo "missing ncurses support!";exit -1])
NCURSES_LIBS="-lncurses"
AC_SUBST([NCURSES_LIBS])

# Checks for header files.
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset realpath strstr strtoul])

30 31 32 33 34 35 36 37 38 39 40 41
# AC_ARGS_ENABLES
AC_ARG_ENABLE([debug],
  [AS_HELP_STRING([--enable-debug], [debug program(default is disable)])],
  [CFLAGS="-g -O0"],
  [CFLAGS="-g -O2"]
)

AC_ARG_ENABLE([secure-build],
  [AS_HELP_STRING([--enable-secure-build], [build project with secure flags])],
  [CFLAGS="${CFLAGS} -Wl,-z,relro,-z,now -fPIE -fPIC -pie -Werror -Wall -ftrapv -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2"],[]
)

N
nocjj 已提交
42 43 44
AC_CONFIG_FILES([Makefile
                 src/Makefile])
AC_OUTPUT