mirror of https://github.com/fadden/nulib2.git
87 lines
2.2 KiB
Plaintext
87 lines
2.2 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
AC_INIT(Main.c)
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
dnl Checks for programs.
|
|
AC_CANONICAL_HOST
|
|
AC_PROG_CC
|
|
AC_PROG_INSTALL
|
|
|
|
dnl Checks for libraries.
|
|
dnl Replace `main' with a function in -lr:
|
|
dnl AC_CHECK_LIB(r, main)
|
|
|
|
dnl Checks for header files.
|
|
AC_HEADER_DIRENT
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h stdlib.h strings.h sys/stat.h \
|
|
sys/time.h sys/types.h unistd.h)
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
AC_C_CONST
|
|
AC_TYPE_MODE_T
|
|
AC_TYPE_OFF_T
|
|
AC_TYPE_SIZE_T
|
|
AC_STRUCT_TM
|
|
AC_CHECK_TYPE(uchar, unsigned char)
|
|
AC_CHECK_TYPE(ushort, unsigned short)
|
|
AC_CHECK_TYPE(uint, unsigned int)
|
|
AC_CHECK_TYPE(ulong, unsigned long)
|
|
|
|
dnl Checks for library functions.
|
|
dnl AC_FUNC_SETVBUF_REVERSED
|
|
AC_FUNC_UTIME_NULL
|
|
AC_CHECK_FUNCS(memmove mkdir strtoul strcasecmp strncasecmp strerror)
|
|
|
|
dnl BeOS doesn't like /usr/local/include, and gets feisty about it. If libdir
|
|
dnl and includedir are set to defaults, replace them with BeOS values. This
|
|
dnl might be going a little too far...
|
|
if test "$host_os" = "beos"; then
|
|
if test "$prefix" = "NONE" -a \
|
|
"$includedir" = '${prefix}/include' -a \
|
|
"$libdir" = '${exec_prefix}/lib' -a \
|
|
"$bindir" = '${exec_prefix}/bin' -a \
|
|
"$mandir" = '${prefix}/man'
|
|
then
|
|
echo replacing install locations with BeOS values
|
|
prefix=/boot
|
|
includedir='${prefix}/develop/headers'
|
|
libdir='${exec_prefix}/home/config/lib'
|
|
bindir='${exec_prefix}/home/config/bin'
|
|
mandir='/tmp'
|
|
AC_SUBST(prefix)
|
|
AC_SUBST(includedir)
|
|
AC_SUBST(libdir)
|
|
AC_SUBST(bindir)
|
|
AC_SUBST(mandir)
|
|
fi
|
|
fi
|
|
|
|
|
|
dnl Figure out what the build and link flags should be
|
|
if test "$host_cpu" = "powerpc" -a "$host_os" = "beos"; then
|
|
dnl BeOS/PPC with Metrowerks compiler
|
|
CC=cc
|
|
GCC=
|
|
CFLAGS='-proc 603 -opt full'
|
|
echo "forcing CC to \"$CC\" and CFLAGS to \"$CFLAGS\""
|
|
fi
|
|
|
|
dnl if we're using gcc, include gcc-specific warning flags
|
|
dnl (
|
|
if test -z "$GCC"; then
|
|
BUILD_FLAGS='$(OPT)'
|
|
else
|
|
BUILD_FLAGS='$(OPT) $(GCC_FLAGS)'
|
|
fi
|
|
|
|
AC_SUBST(BUILD_FLAGS)
|
|
|
|
DMALLOC=
|
|
AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc: do dmalloc stuff], \
|
|
[ echo "--- enabling dmalloc";
|
|
DMALLOC="-L/usr/local/lib -ldmalloc"; AC_DEFINE(USE_DMALLOC) ])
|
|
AC_SUBST(DMALLOC)
|
|
|
|
AC_OUTPUT(Makefile)
|