dnl
-dnl This file is part of Bakefile (http://bakefile.sourceforge.net)
+dnl This file is part of Bakefile (http://www.bakefile.org)
dnl
dnl Copyright (C) 2003-2007 Vaclav Slavik and others
dnl
PLATFORM_BEOS=1
;;
* )
- dnl wxWidgets-specific: allow unknown Unix systems
+ dnl wxWidgets-specific: allow unknown Unix systems
dnl AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM])
;;
esac
;;
*-*-linux* )
- if test "x$GCC" != "xyes"; then
- AC_CACHE_CHECK([for Intel compiler], bakefile_cv_prog_icc,
- [
- AC_TRY_COMPILE([],
- [
- #ifndef __INTEL_COMPILER
- This is not ICC
- #endif
- ],
- bakefile_cv_prog_icc=yes,
- bakefile_cv_prog_icc=no
- )
- ])
- if test "$bakefile_cv_prog_icc" = "yes"; then
- PIC_FLAG="-KPIC"
- fi
+ if test "$INTELCC" = "yes"; then
+ PIC_FLAG="-KPIC"
+ elif test "x$SUNCXX" = "xyes"; then
+ SHARED_LD_CC="${CC} -G -o"
+ SHARED_LD_CXX="${CXX} -G -o"
+ PIC_FLAG="-KPIC"
fi
;;
*-*-solaris2* )
- if test "x$GCC" != xyes ; then
+ if test "x$SUNCXX" = xyes ; then
SHARED_LD_CC="${CC} -G -o"
SHARED_LD_CXX="${CXX} -G -o"
PIC_FLAG="-KPIC"
chmod +x shared-ld-sh
SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o"
- SHARED_LD_MODULE_CXX="$SHARED_LD_MODULE_CC"
+ SHARED_LD_MODULE_CXX="CXX=\$(CXX) $SHARED_LD_MODULE_CC"
dnl Most apps benefit from being fully binded (its faster and static
dnl variables initialized at startup work).
SONAME_FLAG=
case "${BAKEFILE_HOST}" in
- *-*-linux* | *-*-freebsd* | *-*-k*bsd*-gnu )
- SONAME_FLAG="-Wl,-soname,"
+ *-*-linux* | *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | \
+ *-*-k*bsd*-gnu | *-*-mirbsd* )
+ if test "x$SUNCXX" = "xyes"; then
+ SONAME_FLAG="-h "
+ else
+ SONAME_FLAG="-Wl,-soname,"
+ fi
USE_SOVERSION=1
USE_SOVERLINUX=1
USE_SOSYMLINKS=1
AC_CHECK_TOOL(STRIP, strip, :)
AC_CHECK_TOOL(NM, nm, :)
- case ${BAKEFILE_HOST} in
- *-hp-hpux* )
- dnl HP-UX install doesn't handle the "-d" switch so don't
- dnl use it there
- INSTALL_DIR="mkdir -p"
- ;;
- * )
- dnl we must refer to makefile's $(INSTALL) variable and not
- dnl current value of shell variable, hence the single quoting:
- INSTALL_DIR='$(INSTALL) -d'
- ;;
- esac
+ dnl This check is necessary because "install -d" doesn't exist on
+ dnl all platforms (e.g. HP/UX), see http://www.bakefile.org/ticket/80
+ AC_MSG_CHECKING([for command to install directories])
+ INSTALL_TEST_DIR=acbftest$$
+ $INSTALL -d $INSTALL_TEST_DIR > /dev/null 2>&1
+ if test $? = 0 -a -d $INSTALL_TEST_DIR; then
+ rmdir $INSTALL_TEST_DIR
+ dnl we must refer to makefile's $(INSTALL) variable and not
+ dnl current value of shell variable, hence the single quoting:
+ INSTALL_DIR='$(INSTALL) -d'
+ AC_MSG_RESULT([$INSTALL -d])
+ else
+ INSTALL_DIR="mkdir -p"
+ AC_MSG_RESULT([mkdir -p])
+ fi
AC_SUBST(INSTALL_DIR)
LDFLAGS_GUI=
[
AC_PREREQ([2.58])
+ dnl We need to always run C/C++ compiler tests, but it's also possible
+ dnl for the user to call these macros manually, hence this instead of
+ dnl simply calling these macros. See http://www.bakefile.org/ticket/64
+ AC_REQUIRE([AC_BAKEFILE_PROG_CC])
+ AC_REQUIRE([AC_BAKEFILE_PROG_CXX])
+
if test "x$BAKEFILE_HOST" = "x"; then
if test "x${host}" = "x" ; then
AC_MSG_ERROR([You must call the autoconf "CANONICAL_HOST" macro in your configure.ac (or .in) file.])
AC_BAKEFILE_DEPS
AC_BAKEFILE_RES_COMPILERS
- BAKEFILE_BAKEFILE_M4_VERSION="0.2.2"
+ BAKEFILE_BAKEFILE_M4_VERSION="0.2.3"
dnl includes autoconf_inc.m4:
$1
cat <<EOF >bk-deps
#!/bin/sh
-# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
+# This script is part of Bakefile (http://www.bakefile.org) autoconf
# script. It is used to track C/C++ files dependencies in portable way.
#
# Permission is given to use this file in any way.
if test ${D}DEPSMODE = gcc ; then
${D}* ${D}{DEPSFLAG}
status=${D}?
- if test ${D}{status} != 0 ; then
- exit ${D}{status}
- fi
- # move created file to the location we want it in:
+
+ # determine location of created files:
while test ${D}# -gt 0; do
case "${D}1" in
-o )
done
depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\`
depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\`
+
+ # if the compiler failed, we're done:
+ if test ${D}{status} != 0 ; then
+ rm -f ${D}depfile
+ exit ${D}{status}
+ fi
+
+ # move created file to the location we want it in:
if test -f ${D}depfile ; then
sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d
rm -f ${D}depfile
linking_flag="-dynamiclib"
ldargs="-r -keep_private_externs -nostdlib"
+if test "x${D}CXX" = "x"; then
+ CXX="c++"
+fi
+
while test ${D}# -gt 0; do
case ${D}1 in
args="${D}{args} ${D}1 ${D}2"
shift
;;
+
+ -arch|-isysroot)
+ # collect these options and values
+ ldargs="${D}{ldargs} ${D}1 ${D}2"
+ shift
+ ;;
-s|-Wl,*)
# collect these load args
# Link one module containing all the others
#
if test ${D}{verbose} = 1; then
- echo "c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o"
+ echo "${D}CXX ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o"
fi
-c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o
+${D}CXX ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o
status=${D}?
#
#
if test ${D}{status} = 0; then
if test ${D}{verbose} = 1; then
- echo "c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}"
+ echo "${D}CXX ${D}{linking_flag} master.${D}${D}.o ${D}{args}"
fi
- c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}
+ ${D}CXX ${D}{linking_flag} master.${D}${D}.o ${D}{args}
status=${D}?
fi
cat <<EOF >bk-make-pch
#!/bin/sh
-# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
+# This script is part of Bakefile (http://www.bakefile.org) autoconf
# script. It is used to generated precompiled headers.
#
# Permission is given to use this file in any way.