# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) AC_CONFIG_SRCDIR([base.cc]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL # Check withs AC_ARG_WITH(curl, [ --with-curl enable stuff]) if test "$with_curl" == "yes" then AC_MSG_NOTICE([You enabled stuff. Good for you.]) elif test "$with_curl" != "" then AC_MSG_NOTICE([Your specific kind of stuff is $with_curl]) CFLAGS="$CFLAGS -I$with_curl/include" LDFLAGS="$LDFLAGS -L$with_curl/lib" else AC_MSG_NOTICE([No curl for you.]) fi # Checks for libraries. has_curl=1 has_json=1 has_pcre=1 # FIXME: Replace `main' with a function in `-lcurl': AC_CHECK_LIB([curl], [main], [], [has_curl=0]) #AC_CHECK_LIB([curl], [main]) # FIXME: Replace `main' with a function in `-ljson': AC_CHECK_LIB([json], [main], [], [has_json=0]) # FIXME: Replace `main' with a function in `-lpcre': AC_CHECK_LIB([pcre], [main], [], [has_pcre=0]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_CHECK_FUNCS([select strstr]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_SUBDIRS([server]) AC_OUTPUT if test $has_curl == 0 then AC_MSG_NOTICE([libcurl is missing.]) else AC_MSG_NOTICE([libcurl is present.]) fi if test $has_json == 0 then AC_MSG_NOTICE([json-c is missing.]) else AC_MSG_NOTICE([json-c is present.]) fi if test $has_pcre == 0 then AC_MSG_NOTICE([pcre is missing.]) else AC_MSG_NOTICE([pcre is present.]) fi