X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b8deabaf4ca6cc5f433c17c5e6eeac3bc90cf25..9e1da4827a0ec18f9766d664b9af12c25e3f71fb:/build/aclocal/bakefile.m4 diff --git a/build/aclocal/bakefile.m4 b/build/aclocal/bakefile.m4 index e8dac96091..8d539f04be 100644 --- a/build/aclocal/bakefile.m4 +++ b/build/aclocal/bakefile.m4 @@ -126,8 +126,7 @@ AC_DEFUN([AC_BAKEFILE_PLATFORM], PLATFORM_BEOS=1 ;; * ) - dnl wxWidgets-specific: allow unknown Unix systems - dnl AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM]) + AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM]) ;; esac fi @@ -208,6 +207,10 @@ AC_DEFUN([AC_BAKEFILE_SUFFIXES], dlldir="$libdir" case "${BAKEFILE_HOST}" in + dnl PA-RISC HP systems used .sl but IA64 use ELF-64 and so use the + dnl standard .so extension + ia64-hp-hpux* ) + ;; *-hp-hpux* ) SO_SUFFIX="sl" SO_SUFFIX_MODULE="sl" @@ -309,7 +312,9 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD], ;; *-*-linux* ) - if test "$INTELCC" = "yes"; then + dnl newer icc versions use -fPIC just as gcc does and, in fact, the + dnl newest (v10+) ones don't even understand -KPIC any longer + if test "$INTELCC" = "yes" -a "$INTELCC8" != "yes"; then PIC_FLAG="-KPIC" elif test "x$SUNCXX" = "xyes"; then SHARED_LD_CC="${CC} -G -o" @@ -331,7 +336,7 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD], chmod +x shared-ld-sh SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o" - SHARED_LD_MODULE_CXX="CXX=\$(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). @@ -484,7 +489,7 @@ AC_DEFUN([AC_BAKEFILE_SHARED_VERSIONS], USE_SOVERLINUX=0 USE_SOVERSOLARIS=0 USE_SOVERCYGWIN=0 - USE_SOSYMLINKS=0 + USE_SOTWOSYMLINKS=0 USE_MACVERSION=0 SONAME_FLAG= @@ -498,20 +503,19 @@ AC_DEFUN([AC_BAKEFILE_SHARED_VERSIONS], fi USE_SOVERSION=1 USE_SOVERLINUX=1 - USE_SOSYMLINKS=1 + USE_SOTWOSYMLINKS=1 ;; *-*-solaris2* ) SONAME_FLAG="-h " USE_SOVERSION=1 USE_SOVERSOLARIS=1 - USE_SOSYMLINKS=1 ;; *-*-darwin* ) USE_MACVERSION=1 USE_SOVERSION=1 - USE_SOSYMLINKS=1 + USE_SOTWOSYMLINKS=1 ;; *-*-cygwin* ) @@ -525,7 +529,7 @@ AC_DEFUN([AC_BAKEFILE_SHARED_VERSIONS], AC_SUBST(USE_SOVERSOLARIS) AC_SUBST(USE_SOVERCYGWIN) AC_SUBST(USE_MACVERSION) - AC_SUBST(USE_SOSYMLINKS) + AC_SUBST(USE_SOTWOSYMLINKS) AC_SUBST(SONAME_FLAG) ]) @@ -554,16 +558,7 @@ AC_DEFUN([AC_BAKEFILE_DEPS], if test "x$GCC" = "xyes"; then DEPSMODE=gcc - case "${BAKEFILE_HOST}" in - *-*-darwin* ) - dnl -cpp-precomp (the default) conflicts with -MMD option - dnl used by bk-deps (see also http://developer.apple.com/documentation/Darwin/Conceptual/PortingUnix/compiling/chapter_4_section_3.html) - DEPSFLAG="-no-cpp-precomp -MMD" - ;; - * ) - DEPSFLAG="-MMD" - ;; - esac + DEPSFLAG="-MMD" AC_MSG_RESULT([gcc]) elif test "x$MWCC" = "xyes"; then DEPSMODE=mwcc @@ -640,21 +635,8 @@ AC_DEFUN([AC_BAKEFILE_CHECK_BASIC_STUFF], AC_CHECK_TOOL(STRIP, strip, :) AC_CHECK_TOOL(NM, nm, :) - 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 + dnl Don't use `install -d`, see http://trac.wxwidgets.org/ticket/13452 + INSTALL_DIR="mkdir -p" AC_SUBST(INSTALL_DIR) LDFLAGS_GUI= @@ -743,20 +725,19 @@ AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS], GCC_PCH=1 ], [ - AC_TRY_COMPILE([], - [ - #if !defined(__INTEL_COMPILER) || \ - (__INTEL_COMPILER < 800) - There is no PCH support - #endif - ], - [ - AC_MSG_RESULT([yes]) - ICC_PCH=1 - ], - [ - AC_MSG_RESULT([no]) - ]) + if test "$INTELCXX8" = "yes"; then + AC_MSG_RESULT([yes]) + ICC_PCH=1 + if test "$INTELCXX10" = "yes"; then + ICC_PCH_CREATE_SWITCH="-pch-create" + ICC_PCH_USE_SWITCH="-pch-use" + else + ICC_PCH_CREATE_SWITCH="-create-pch" + ICC_PCH_USE_SWITCH="-use-pch" + fi + else + AC_MSG_RESULT([no]) + fi ]) if test $GCC_PCH = 1 -o $ICC_PCH = 1 ; then USE_PCH=1 @@ -772,6 +753,8 @@ AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS], AC_SUBST(GCC_PCH) AC_SUBST(ICC_PCH) + AC_SUBST(ICC_PCH_CREATE_SWITCH) + AC_SUBST(ICC_PCH_USE_SWITCH) AC_SUBST(BK_MAKE_PCH) ]) @@ -828,7 +811,11 @@ AC_DEFUN([AC_BAKEFILE], AC_BAKEFILE_DEPS AC_BAKEFILE_RES_COMPILERS - BAKEFILE_BAKEFILE_M4_VERSION="0.2.3" + dnl OBJCFLAGS is set by Autoconf, but OBJCXXFLAGS is not: + AC_SUBST(OBJCXXFLAGS) + + + BAKEFILE_BAKEFILE_M4_VERSION="0.2.9" dnl includes autoconf_inc.m4: $1 @@ -862,10 +849,8 @@ cat <bk-deps # Permission is given to use this file in any way. DEPSMODE=${DEPSMODE} -DEPSDIR=.deps DEPSFLAG="${DEPSFLAG}" - -mkdir -p ${D}DEPSDIR +DEPSDIRBASE=.deps if test ${D}DEPSMODE = gcc ; then ${D}* ${D}{DEPSFLAG} @@ -886,9 +871,13 @@ if test ${D}DEPSMODE = gcc ; then esac shift done + objfilebase=\`basename ${D}objfile\` + builddir=\`dirname ${D}objfile\` depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\` depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\` - + depsdir=${D}builddir/${D}DEPSDIRBASE + mkdir -p ${D}depsdir + # if the compiler failed, we're done: if test ${D}{status} != 0 ; then rm -f ${D}depfile @@ -897,21 +886,22 @@ if test ${D}DEPSMODE = gcc ; then # 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 + sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{depsdir}/${D}{objfilebase}.d rm -f ${D}depfile else # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d - depfile=\`basename ${D}objfile | sed -e 's/\\..*${D}/.d/g'\` + depfile=\`echo "${D}objfile" | sed -e 's/\\..*${D}/.d/g'\` if test ! -f ${D}depfile ; then # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++) depfile="${D}objfile.d" fi if test -f ${D}depfile ; then - sed -e "/^${D}objfile/!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d + sed -e "\\,^${D}objfile,!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{depsdir}/${D}{objfilebase}.d rm -f ${D}depfile fi fi exit 0 + elif test ${D}DEPSMODE = mwcc ; then ${D}* || exit ${D}? # Run mwcc again with -MM and redirect into the dep file we want @@ -931,8 +921,15 @@ elif test ${D}DEPSMODE = mwcc ; then fi prevarg="${D}arg" done - ${D}* ${D}DEPSFLAG >${D}{DEPSDIR}/${D}{objfile}.d + + objfilebase=\`basename ${D}objfile\` + builddir=\`dirname ${D}objfile\` + depsdir=${D}builddir/${D}DEPSDIRBASE + mkdir -p ${D}depsdir + + ${D}* ${D}DEPSFLAG >${D}{depsdir}/${D}{objfilebase}.d exit 0 + elif test ${D}DEPSMODE = unixcc; then ${D}* || exit ${D}? # Run compiler again with deps flag and redirect into the dep file. @@ -953,8 +950,15 @@ elif test ${D}DEPSMODE = unixcc; then esac shift done - eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{DEPSDIR}/${D}{objfile}.d + + objfilebase=\`basename ${D}objfile\` + builddir=\`dirname ${D}objfile\` + depsdir=${D}builddir/${D}DEPSDIRBASE + mkdir -p ${D}depsdir + + eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{depsdir}/${D}{objfilebase}.d exit 0 + else ${D}* exit ${D}? @@ -1093,6 +1097,8 @@ header="${D}{2}" shift shift +builddir=\`echo ${D}outfile | sed -e 's,/\\.pch/.*${D},,g'\` + compiler="" headerfile="" @@ -1105,7 +1111,7 @@ while test ${D}{#} -gt 0; do headerfile="${D}{incdir}/${D}{header}" fi ;; - -use-pch|-use_pch ) + -use-pch|-use_pch|-pch-use ) shift add_to_cmdline=0 ;; @@ -1124,8 +1130,8 @@ else else mkdir -p \`dirname ${D}{outfile}\` fi - depsfile=".deps/\`echo ${D}{outfile} | tr '/.' '__'\`.d" - mkdir -p .deps + depsfile="${D}{builddir}/.deps/\`echo ${D}{outfile} | tr '/.' '__'\`.d" + mkdir -p ${D}{builddir}/.deps if test "x${GCC_PCH}" = "x1" ; then # can do this because gcc is >= 3.4: ${D}{compiler} -o ${D}{outfile} -MMD -MF "${D}{depsfile}" "${D}{headerfile}" @@ -1137,7 +1143,7 @@ else #include "${D}header" EOT # using -MF icc complains about differing command lines in creation/use - ${D}compiler -c -create_pch ${D}outfile -MMD ${D}file && \\ + ${D}compiler -c ${ICC_PCH_CREATE_SWITCH} ${D}outfile -MMD ${D}file && \\ sed -e "s,^.*:,${D}outfile:," -e "s, ${D}file,," < ${D}dfile > ${D}depsfile && \\ rm -f ${D}file ${D}dfile ${D}{filename}.o fi