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
|
dnl Link to easy tutorial on using autoconf/automake.
dnl ftp://ftp.ugcs.caltech.edu/pub/elef/autotools/toolsmanual.html
dnl Process this file with autoconf to produce a configure script.
AC_INIT(linuxtrade.c)
RPM_RELEASE=1
AC_SUBST(RPM_RELEASE)
AM_INIT_AUTOMAKE(linuxtrade, 3.65)
AM_CONFIG_HEADER(config.h)
AC_PREFIX_DEFAULT(/usr)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
dnl Add -Wall if gcc
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -Wall -Wno-format-y2k"
fi
dnl Checks for libraries.
dnl Replace `main' with a function in -lncurses:
AC_CHECK_LIB(ncurses, initscr)
AC_CHECK_LIB(panel, new_panel)
AC_CHECK_LIB(m, floor)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_LIB(c_r, pthread_create)
AC_CHECK_LIB(glib, g_tree_new)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h stdint.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TM
dnl Checks for library functions.
# AC_FUNC_SETVBUF_REVERSED
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(putenv socket strdup lrint)
dnl Normally, we link this statically for faster execution and binary
dnl portability. However, static linking is broken on MacOS X (or at
dnl least I don't know what pixie dust is needed to get it to work).
dnl
dnl If you aim to distribute binaries for your distro, then please insure
dnl that you distribute binaries for both glibc 2.2.x and glibc 2.3.
dnl The easiest way to achieve this is to distribute binaries statically
dnl linked against glibc 2.2.x. Its also possible to create static
dnl binaries using glibc 2.3, but this could be risky. A dynamic binary
dnl created using glibc 2.3 *will not* run on a glibc 2.2.x system;
dnl please avoid distributing these unless you provide both sets of
dnl binaries. I wish to avoid forcing still-mainstream users to upgrade
dnl their libraries in order to run my program.
AM_CONDITIONAL(STATIC, test `uname` != Darwin)
dnl Figure out what libs we need to link with libcurl programs
CURL_LIBS=`curl-config --libs`
AC_SUBST(CURL_LIBS)
CURL_CFLAGS=`curl-config --cflags`
CFLAGS="$CFLAGS $CURL_CFLAGS"
AC_OUTPUT(Makefile linuxtrade.spec linuxtrade.1 index.html register.html)
|