mirror of
https://github.com/fadden/nulib2.git
synced 2024-09-27 00:54:57 +00:00
119 lines
3.7 KiB
Plaintext
119 lines
3.7 KiB
Plaintext
dnl Nulib2
|
|
dnl Copyright (C) 2000-2002 by Andy McFadden, All Rights Reserved.
|
|
dnl This is free software; you can redistribute it and/or modify it under the
|
|
dnl terms of the GNU General Public License, see the file COPYING.
|
|
dnl
|
|
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 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)
|
|
|
|
LIBS=""
|
|
|
|
dnl
|
|
dnl Check for libz and libbz2. We want to link against them in case
|
|
dnl NufxLib has them enabled. If they're not enabled, we don't want to
|
|
dnl link against them if they're shared libraries, because it'll create
|
|
dnl an unnecessary shared lib dependency. Won't matter unless you try
|
|
dnl to copy the binary to another machine.
|
|
dnl
|
|
dnl So, we try to link against the libraries unless they're explicitly
|
|
dnl disabled by the person building them. Not ideal, but it'll work.
|
|
dnl Of course, if nufxlib is built as a shared library, the dependencies
|
|
dnl will be handled correctly without having to use -l here.
|
|
dnl
|
|
AC_ARG_ENABLE(deflate,
|
|
[ --disable-deflate don't link against libz],
|
|
[ ], [ enable_deflate=yes ])
|
|
if test $enable_deflate = "yes"; then
|
|
dnl Check for zlib. Make sure it comes with zlib.h.
|
|
AC_CHECK_LIB(z, deflate,
|
|
AC_CHECK_HEADER(zlib.h, LIBS="$LIBS -lz"))
|
|
fi
|
|
|
|
AC_ARG_ENABLE(bzip2,
|
|
[ --enable-bzip2 do link against libbz2],
|
|
[ ], [ enable_bzip2=no ])
|
|
if test $enable_bzip2 = "yes"; then
|
|
dnl Check for libbz2. Make sure it comes with bzlib.h.
|
|
AC_CHECK_LIB(bz2, BZ2_bzCompress,
|
|
AC_CHECK_HEADER(bzlib.h, LIBS="$LIBS -lbz2"))
|
|
fi
|
|
|
|
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)
|
|
|
|
AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc do dmalloc stuff], \
|
|
[ echo "--- enabling dmalloc";
|
|
LIBS="$LIBS -L/usr/local/lib -ldmalloc"; AC_DEFINE(USE_DMALLOC) ])
|
|
|
|
AC_OUTPUT(Makefile)
|