]> git.saurik.com Git - wxWidgets.git/blobdiff - build/aclocal/bakefile.m4
Add missing files to release tarballs
[wxWidgets.git] / build / aclocal / bakefile.m4
index ec925156352c9ae1b33fba63b225d804d7d1a83d..0516430743cf10df9e4482a36d85766835264d36 100644 (file)
@@ -309,6 +309,12 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
       ;;
 
       *-*-darwin* )
+        AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH
+        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"
+
         dnl Most apps benefit from being fully binded (its faster and static
         dnl variables initialized at startup work).
         dnl This can be done either with the exe linker flag -Wl,-bind_at_load
@@ -316,9 +322,9 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
         dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
 
         dnl If using newer dev tools then there is a -single_module flag that
-        dnl we can use to do this, otherwise we'll need to use a helper
+        dnl we can use to do this for dylibs, otherwise we'll need to use a helper
         dnl script.  Check the version of gcc to see which way we can go:
-        AC_CACHE_CHECK([for gcc 3.1 or later], wx_cv_gcc31, [
+        AC_CACHE_CHECK([for gcc 3.1 or later], bakefile_cv_gcc31, [
            AC_TRY_COMPILE([],
                [
                    #if (__GNUC__ < 3) || \
@@ -327,28 +333,21 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
                    #endif
                ],
                [
-                   wx_cv_gcc31=yes
+                   bakefile_cv_gcc31=yes
                ],
                [
-                   wx_cv_gcc31=no
+                   bakefile_cv_gcc31=no
                ]
            )
         ])
-        if test "$wx_cv_gcc31" = "no"; then
-            AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH
-            chmod +x shared-ld-sh
-
+        if test "$bakefile_cv_gcc31" = "no"; then
             dnl Use the shared-ld-sh helper script
             SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o"
-            SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o"
             SHARED_LD_CXX="$SHARED_LD_CC"
-            SHARED_LD_MODULE_CXX="$SHARED_LD_MODULE_CC"
         else
             dnl Use the -single_module flag and let the linker do it for us
             SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o"
-            SHARED_LD_MODULE_CC="\${CC} -bundle -single_module -headerpad_max_install_names -o"
             SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o"
-            SHARED_LD_MODULE_CXX="\${CXX} -bundle -single_module -headerpad_max_install_names -o"
         fi
 
         if test "x$GCC" == "xyes"; then
@@ -360,20 +359,32 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
       ;;
 
       *-*-aix* )
-        dnl at least gcc 2.95 warns that -fPIC is ignored when compiling
-       dnl each and every file under AIX which is annoying, so don't use
-       dnl it there (it's useless as AIX runs on position-independent
-       dnl architectures only anyhow)
         if test "x$GCC" = "xyes"; then
-           PIC_FLAG=""
-           SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o"
-           SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o"
-       else
-            dnl the abs path below used to be hardcoded here so I guess it must
-            dnl be some sort of standard location under AIX?
+            dnl at least gcc 2.95 warns that -fPIC is ignored when
+            dnl compiling each and every file under AIX which is annoying,
+            dnl so don't use it there (it's useless as AIX runs on
+            dnl position-independent architectures only anyhow)
+            PIC_FLAG=""
+
+            dnl -bexpfull is needed by AIX linker to export all symbols (by
+            dnl default it doesn't export any and even with -bexpall it
+            dnl doesn't export all C++ support symbols, e.g. vtable
+            dnl pointers) but it's only available starting from 5.1 (with
+            dnl maintenance pack 2, whatever this is), see
+            dnl http://www-128.ibm.com/developerworks/eserver/articles/gnu.html
+            case "${BAKEFILE_HOST}" in
+                *-*-aix5* )
+                    LD_EXPFULL="-Wl,-bexpfull"
+                    ;;
+            esac
+
+            SHARED_LD_CC="\$(CC) -shared $LD_EXPFULL -o"
+            SHARED_LD_CXX="\$(CXX) -shared $LD_EXPFULL -o"
+        else
+            dnl FIXME: makeC++SharedLib is obsolete, what should we do for
+            dnl        recent AIX versions?
             AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib,
                           makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib)
-            dnl FIXME - what about makeCSharedLib?            
             SHARED_LD_CC="$AIX_CC_LD -p 0 -o"
             SHARED_LD_CXX="$AIX_CXX_LD -p 0 -o"
         fi
@@ -392,7 +403,7 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
             PIC_FLAG="-KPIC"
         fi
       ;;
-      
+
       *-*-cygwin* | *-*-mingw32* )
         PIC_FLAG=""
         SHARED_LD_CC="\$(CC) -shared -o"
@@ -407,7 +418,7 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
         AC_BAKEFILE_CREATE_FILE_DLLAR_SH
         chmod +x dllar.sh
       ;;
-      
+
       powerpc-apple-macos* | \
       *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-k*bsd*-gnu | \
       *-*-sunos4* | \
@@ -531,8 +542,16 @@ AC_DEFUN([AC_BAKEFILE_DEPS],
         DEPSMODE=unixcc
         DEPSFLAG="-M"
         AC_MSG_RESULT([SGI cc])
+    elif test "x$HPCC" = "xyes"; then
+        DEPSMODE=unixcc
+        DEPSFLAG="+make"
+        AC_MSG_RESULT([HP cc])
+    elif test "x$COMPAQCC" = "xyes"; then
+        DEPSMODE=gcc
+        DEPSFLAG="-MD"
+        AC_MSG_RESULT([Compaq cc])
     else
-       DEPS_TRACKING=0
+        DEPS_TRACKING=0
         AC_MSG_RESULT([none])
     fi
 
@@ -540,7 +559,7 @@ AC_DEFUN([AC_BAKEFILE_DEPS],
         AC_BAKEFILE_CREATE_FILE_BK_DEPS
         chmod +x bk-deps
     fi
-    
+
     AC_SUBST(DEPS_TRACKING)
 ])
 
@@ -1259,7 +1278,12 @@ if test ${D}DEPSMODE = gcc ; then
         sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.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'\`
+        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
             rm -f ${D}depfile
@@ -1267,11 +1291,7 @@ if test ${D}DEPSMODE = gcc ; then
     fi
     exit 0
 elif test ${D}DEPSMODE = mwcc ; then
-    ${D}*
-    status=${D}?
-    if test ${D}{status} != 0 ; then
-        exit ${D}{status}
-    fi
+    ${D}* || exit ${D}?
     # Run mwcc again with -MM and redirect into the dep file we want
     # NOTE: We can't use shift here because we need ${D}* to be valid
     prevarg=
@@ -1292,7 +1312,7 @@ elif test ${D}DEPSMODE = mwcc ; then
     ${D}* ${D}DEPSFLAG >${D}{DEPSDIR}/${D}{objfile}.d
     exit 0
 elif test ${D}DEPSMODE = unixcc; then
-    ${D}* || exit
+    ${D}* || exit ${D}?
     # Run compiler again with deps flag and redirect into the dep file.
     # It doesn't work if the '-o FILE' option is used, but without it the
     # dependency file will contain the wrong name for the object. So it is