update.
[chise/xemacs-chise.git.1] / aclocal.m4
index ff5c7ae..0dcfd2e 100644 (file)
@@ -84,11 +84,11 @@ AC_MSG_CHECKING(how to produce PIC code)
 wl=
 
 can_build_shared=yes
 wl=
 
 can_build_shared=yes
-if test "$XEGCC" = yes; then
+if test "$XEGCC" = yes -o "$__ICC" = yes; then
   wl='-Wl,'
 
   case "$xehost_os" in
   wl='-Wl,'
 
   case "$xehost_os" in
-  aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
+  aix[[3-9]]* | irix[[5-9]]* | osf[[3-9]])
     # PIC is the default for these OSes.
     ;;
 
     # PIC is the default for these OSes.
     ;;
 
@@ -101,6 +101,9 @@ if test "$XEGCC" = yes; then
     # like `-m68040'.
     dll_cflags='-m68020 -resident32 -malways-restore-a4'
     ;;
     # like `-m68040'.
     dll_cflags='-m68020 -resident32 -malways-restore-a4'
     ;;
+  *cygwin* | *mingw* )
+    # PIC is the default
+    ;;
   *)
     dll_cflags='-fPIC'
     ;;
   *)
     dll_cflags='-fPIC'
     ;;
@@ -108,13 +111,13 @@ if test "$XEGCC" = yes; then
 else
   # PORTME Check for PIC flags for the system compiler.
   case "$xehost_os" in
 else
   # PORTME Check for PIC flags for the system compiler.
   case "$xehost_os" in
-  hpux9* | hpux10*)
+  hpux9* | hpux1[[0-9]]*)
     # Is there a better link_static_flag that works with the bundled CC?
     wl='-Wl,'
     dll_cflags='+Z'
     ;;
 
     # Is there a better link_static_flag that works with the bundled CC?
     wl='-Wl,'
     dll_cflags='+Z'
     ;;
 
-  irix5* | irix6*)
+  irix[[5-9]]*)
     wl='-Wl,'
     # PIC (with -KPIC) is the default.
     ;;
     wl='-Wl,'
     # PIC (with -KPIC) is the default.
     ;;
@@ -123,11 +126,16 @@ else
     # We can build DLLs from non-PIC.
     ;;
 
     # We can build DLLs from non-PIC.
     ;;
 
-  osf3* | osf4*)
+  osf[[3-9]]*)
     # All OSF/1 code is PIC.
     wl='-Wl,'
     ;;
 
     # All OSF/1 code is PIC.
     wl='-Wl,'
     ;;
 
+  aix[[3-9]]*)
+    # All AIX code is PIC.
+    wl='-Wl,'
+    ;;
+
   sco3.2v5*)
     dll_cflags='-belf -Kpic'
     wl='-Wl,'
   sco3.2v5*)
     dll_cflags='-belf -Kpic'
     wl='-Wl,'
@@ -170,7 +178,7 @@ fi
 
 if test -n "$dll_cflags"; then
   AC_MSG_RESULT([${dll_cflags}])
 
 if test -n "$dll_cflags"; then
   AC_MSG_RESULT([${dll_cflags}])
-  
+
   # Check to make sure the dll_cflags actually works.
   AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works])
   save_CFLAGS="$CFLAGS"
   # Check to make sure the dll_cflags actually works.
   AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works])
   save_CFLAGS="$CFLAGS"
@@ -197,13 +205,13 @@ dnl Now comes the LD trickery. We do things differently to libtool here.
 dnl I believe that libtool is incorrect in trying to drive the linker
 dnl directly. This can cause considerable problems if the module you are
 dnl compiling has C++ or other static initializers. If we use ld directly,
 dnl I believe that libtool is incorrect in trying to drive the linker
 dnl directly. This can cause considerable problems if the module you are
 dnl compiling has C++ or other static initializers. If we use ld directly,
-dnl we dont end up with the crt stuff being linked in, and we dont end up
+dnl we don't end up with the crt stuff being linked in, and we don't end up
 dnl with any .init or .fini sections (or the moral equivalent thereof).
 dnl with any .init or .fini sections (or the moral equivalent thereof).
-dnl gcc takes great care to do this propperly when invoked in -shared
-dnl mode, and we really do want this behaviour. Perhaps the libtool folks
+dnl gcc takes great care to do this properly when invoked in -shared
+dnl mode, and we really do want this behavior. Perhaps the libtool folks
 dnl are not aware that any SVR4 based dynamic loader will automatically
 dnl execute code in the .init section before dlopen() returns. This is
 dnl are not aware that any SVR4 based dynamic loader will automatically
 dnl execute code in the .init section before dlopen() returns. This is
-dnl vital, as the module may have been compiled to rely on that behaviour.
+dnl vital, as the module may have been compiled to rely on that behavior.
 dnl
 dnl So, having said all of that, we diverge from libtool significantly
 dnl here. We want to try and use the C compiler as much as possible. Only
 dnl
 dnl So, having said all of that, we diverge from libtool significantly
 dnl here. We want to try and use the C compiler as much as possible. Only
@@ -216,7 +224,7 @@ dnl version of XEmacs. With the libtool way, it picks up the linker that
 dnl gcc uses, which can be the internal collect2 that comes with gcc.
 dnl If the user ever changes their compiler version, the paths will no
 dnl longer be correct, and ellcc will break. This is clearly unacceptable.
 dnl gcc uses, which can be the internal collect2 that comes with gcc.
 dnl If the user ever changes their compiler version, the paths will no
 dnl longer be correct, and ellcc will break. This is clearly unacceptable.
-dnl By using the compiler driver on the path, we dont have this problem.
+dnl By using the compiler driver on the path, we don't have this problem.
 dnl If that is not clear, consider that gcc -print-prog-name=ld can
 dnl produce something along the lines of:
 dnl   /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld
 dnl If that is not clear, consider that gcc -print-prog-name=ld can
 dnl produce something along the lines of:
 dnl   /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld
@@ -228,19 +236,19 @@ dnl If we are not using gcc, but the system C compiler can produce
 dnl shared objects, we try that. Only if all of that fails do we revert
 dnl back to the libtool ld trickery.
 dnl
 dnl shared objects, we try that. Only if all of that fails do we revert
 dnl back to the libtool ld trickery.
 dnl
-dnl We dont do ANY of this if we can't produce shared objects.
+dnl We don't do ANY of this if we can't produce shared objects.
 dnl
 if test "$can_build_shared" = "yes"; then
 cc_produces_so=no
 xldf=
 xcldf=
 AC_MSG_CHECKING(if C compiler can produce shared libraries)
 dnl
 if test "$can_build_shared" = "yes"; then
 cc_produces_so=no
 xldf=
 xcldf=
 AC_MSG_CHECKING(if C compiler can produce shared libraries)
-if test "$XEGCC" = yes; then
+if test "$XEGCC" = yes -o "$__ICC" = yes; then
   xcldf="-shared"
   xldf="-shared"
 else # Not using GCC
   case "$xehost_os" in
   xcldf="-shared"
   xldf="-shared"
 else # Not using GCC
   case "$xehost_os" in
-    aix3* | aix4*)
+    aix[[3-9]]*)
       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
       ;;
       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
       ;;
@@ -259,7 +267,7 @@ else # Not using GCC
       xcldf="${wl}-b ${wl}+s"
       ;;
 
       xcldf="${wl}-b ${wl}+s"
       ;;
 
-    irix5* | irix6* | osf3* | osf4*)
+    irix[[5-9]]* | osf[[3-9]]*)
       xcldf="${wl}-shared"
       xldf="-shared"
       ;;
       xcldf="${wl}-shared"
       xldf="-shared"
       ;;
@@ -305,12 +313,13 @@ if test -z "$LTLD"; then
     # Accept absolute paths.
     /*)
       if test -z "$LTLD"; then
     # Accept absolute paths.
     /*)
       if test -z "$LTLD"; then
-        case "$ac_prog" in
-          *gcc-lib*) LTLD="$CC"
-                     ;;
-          *)         LTLD="$ac_prog"
-                     ;;
-        esac
+#        case "$ac_prog" in
+#          *gcc-lib*) LTLD="$CC"
+#                     ;;
+#          *)
+         LTLD="$ac_prog"
+#                     ;;
+#        esac
       fi
       ;;
     "")
       fi
       ;;
     "")
@@ -386,6 +395,7 @@ if test "$cc_produces_so" = "yes"; then
   dll_ld=$CC
   dll_ldflags=$xcldf
   can_build_shared=yes
   dll_ld=$CC
   dll_ldflags=$xcldf
   can_build_shared=yes
+  ld_shlibs=yes
 else
   # OK - only NOW do we futz about with ld.
   # See if the linker supports building shared libraries.
 else
   # OK - only NOW do we futz about with ld.
   # See if the linker supports building shared libraries.
@@ -411,7 +421,7 @@ else
       dll_ldflags=$xldf
       ;;
 
       dll_ldflags=$xldf
       ;;
 
-    aix4*)
+    aix[[4-9]]*)
       dll_ldflags=$xcldf
       ;;
 
       dll_ldflags=$xcldf
       ;;
 
@@ -441,7 +451,7 @@ else
       dll_ldflags=$xldf
       ;;
 
       dll_ldflags=$xldf
       ;;
 
-    irix5* | irix6*)
+    irix[[5-9]]*)
       dll_ld=$LTLD
       dll_ldflags=$xldf
       ;;
       dll_ld=$LTLD
       dll_ldflags=$xldf
       ;;
@@ -509,7 +519,7 @@ dnl
 dnl Last thing, check how to get a linked executable to have its symbols
 dnl exported, so that the modules have access to them.
 dnl
 dnl Last thing, check how to get a linked executable to have its symbols
 dnl exported, so that the modules have access to them.
 dnl
-dnl XEmacs FIXME - we need to set ld_dynamic_link_flags propperly for
+dnl XEmacs FIXME - we need to set ld_dynamic_link_flags properly for
 dnl most of these systems, which was missing from libtool. I know they
 dnl all have a way of doing this, but someone needs to look at this
 dnl for each OS and make sure it is correct. Remember that the arguments
 dnl most of these systems, which was missing from libtool. I know they
 dnl all have a way of doing this, but someone needs to look at this
 dnl for each OS and make sure it is correct. Remember that the arguments
@@ -528,11 +538,7 @@ fi
 
 if test -z "$ld_dynamic_link_flags"; then
   case "$xehost_os" in
 
 if test -z "$ld_dynamic_link_flags"; then
   case "$xehost_os" in
-  aix3*)
-    ld_dynamic_link_flags=
-    ;;
-
-  aix4*)
+  aix[[3-9]]*)
     ld_dynamic_link_flags=
     ;;
 
     ld_dynamic_link_flags=
     ;;
 
@@ -552,7 +558,7 @@ if test -z "$ld_dynamic_link_flags"; then
     ld_dynamic_link_flags="${wl}-E"
     ;;
 
     ld_dynamic_link_flags="${wl}-E"
     ;;
 
-  irix5* | irix6*)
+  irix[[5-9]]*)
     ld_dynamic_link_flags=
     ;;
 
     ld_dynamic_link_flags=
     ;;
 
@@ -569,7 +575,7 @@ if test -z "$ld_dynamic_link_flags"; then
     ;;
 
   solaris2* | solaris7*)
     ;;
 
   solaris2* | solaris7*)
-    ld_dynamic_link_flags="${wl}-Bdynamic"
+    ld_dynamic_link_flags=
     ;;
 
   sco3.2v5* | unixware* | sysv5* | sysv4*)
     ;;
 
   sco3.2v5* | unixware* | sysv5* | sysv4*)