Mercurial > hg > xemacs-beta
comparison aclocal.m4 @ 442:abe6d1db359e r21-2-36
Import from CVS: tag r21-2-36
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:35:02 +0200 |
parents | a5df635868b2 |
children | 223736d75acb |
comparison
equal
deleted
inserted
replaced
441:72a7cfa4a488 | 442:abe6d1db359e |
---|---|
90 case "$xehost_os" in | 90 case "$xehost_os" in |
91 aix3* | aix4* | irix5* | irix6* | osf3* | osf4*) | 91 aix3* | aix4* | irix5* | irix6* | osf3* | osf4*) |
92 # PIC is the default for these OSes. | 92 # PIC is the default for these OSes. |
93 ;; | 93 ;; |
94 | 94 |
95 os2*) | 95 aix3* | aix4* | os2*) |
96 # We can build DLLs from non-PIC. | 96 # We can build DLLs from non-PIC. |
97 ;; | 97 ;; |
98 amigaos*) | 98 amigaos*) |
99 # FIXME: we need at least 68020 code to build shared libraries, but | 99 # FIXME: we need at least 68020 code to build shared libraries, but |
100 # adding the `-m68020' flag to GCC prevents building anything better, | 100 # adding the `-m68020' flag to GCC prevents building anything better, |
101 # like `-m68040'. | 101 # like `-m68040'. |
102 dll_cflags='-m68020 -resident32 -malways-restore-a4' | 102 dll_cflags='-m68020 -resident32 -malways-restore-a4' |
103 ;; | |
104 *cygwin* | *mingw* ) | |
105 # PIC is the default | |
103 ;; | 106 ;; |
104 *) | 107 *) |
105 dll_cflags='-fPIC' | 108 dll_cflags='-fPIC' |
106 ;; | 109 ;; |
107 esac | 110 esac |
168 esac | 171 esac |
169 fi | 172 fi |
170 | 173 |
171 if test -n "$dll_cflags"; then | 174 if test -n "$dll_cflags"; then |
172 AC_MSG_RESULT([${dll_cflags}]) | 175 AC_MSG_RESULT([${dll_cflags}]) |
173 | 176 |
174 # Check to make sure the dll_cflags actually works. | 177 # Check to make sure the dll_cflags actually works. |
175 AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works]) | 178 AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works]) |
176 save_CFLAGS="$CFLAGS" | 179 save_CFLAGS="$CFLAGS" |
177 CFLAGS="$CFLAGS $dll_cflags -DPIC" | 180 CFLAGS="$CFLAGS $dll_cflags -DPIC" |
178 AC_TRY_COMPILE(,[int x=0;],[ | 181 AC_TRY_COMPILE(,[int x=0;],[ |
195 dnl | 198 dnl |
196 dnl Now comes the LD trickery. We do things differently to libtool here. | 199 dnl Now comes the LD trickery. We do things differently to libtool here. |
197 dnl I believe that libtool is incorrect in trying to drive the linker | 200 dnl I believe that libtool is incorrect in trying to drive the linker |
198 dnl directly. This can cause considerable problems if the module you are | 201 dnl directly. This can cause considerable problems if the module you are |
199 dnl compiling has C++ or other static initializers. If we use ld directly, | 202 dnl compiling has C++ or other static initializers. If we use ld directly, |
200 dnl we dont end up with the crt stuff being linked in, and we dont end up | 203 dnl we don't end up with the crt stuff being linked in, and we don't end up |
201 dnl with any .init or .fini sections (or the moral equivalent thereof). | 204 dnl with any .init or .fini sections (or the moral equivalent thereof). |
202 dnl gcc takes great care to do this propperly when invoked in -shared | 205 dnl gcc takes great care to do this properly when invoked in -shared |
203 dnl mode, and we really do want this behaviour. Perhaps the libtool folks | 206 dnl mode, and we really do want this behavior. Perhaps the libtool folks |
204 dnl are not aware that any SVR4 based dynamic loader will automatically | 207 dnl are not aware that any SVR4 based dynamic loader will automatically |
205 dnl execute code in the .init section before dlopen() returns. This is | 208 dnl execute code in the .init section before dlopen() returns. This is |
206 dnl vital, as the module may have been compiled to rely on that behaviour. | 209 dnl vital, as the module may have been compiled to rely on that behavior. |
207 dnl | 210 dnl |
208 dnl So, having said all of that, we diverge from libtool significantly | 211 dnl So, having said all of that, we diverge from libtool significantly |
209 dnl here. We want to try and use the C compiler as much as possible. Only | 212 dnl here. We want to try and use the C compiler as much as possible. Only |
210 dnl if the C compiler itself cannot create shared libraries to we try to | 213 dnl if the C compiler itself cannot create shared libraries to we try to |
211 dnl find the linker. | 214 dnl find the linker. |
214 dnl on a given compiler version remaining static with relation to the | 217 dnl on a given compiler version remaining static with relation to the |
215 dnl version of XEmacs. With the libtool way, it picks up the linker that | 218 dnl version of XEmacs. With the libtool way, it picks up the linker that |
216 dnl gcc uses, which can be the internal collect2 that comes with gcc. | 219 dnl gcc uses, which can be the internal collect2 that comes with gcc. |
217 dnl If the user ever changes their compiler version, the paths will no | 220 dnl If the user ever changes their compiler version, the paths will no |
218 dnl longer be correct, and ellcc will break. This is clearly unacceptable. | 221 dnl longer be correct, and ellcc will break. This is clearly unacceptable. |
219 dnl By using the compiler driver on the path, we dont have this problem. | 222 dnl By using the compiler driver on the path, we don't have this problem. |
220 dnl If that is not clear, consider that gcc -print-prog-name=ld can | 223 dnl If that is not clear, consider that gcc -print-prog-name=ld can |
221 dnl produce something along the lines of: | 224 dnl produce something along the lines of: |
222 dnl /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld | 225 dnl /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld |
223 dnl If you ever change GCC versions, then that path no longer exists. | 226 dnl If you ever change GCC versions, then that path no longer exists. |
224 dnl | 227 dnl |
226 dnl using GCC, and if so, we see if -shared works. If it does, great. | 229 dnl using GCC, and if so, we see if -shared works. If it does, great. |
227 dnl If we are not using gcc, but the system C compiler can produce | 230 dnl If we are not using gcc, but the system C compiler can produce |
228 dnl shared objects, we try that. Only if all of that fails do we revert | 231 dnl shared objects, we try that. Only if all of that fails do we revert |
229 dnl back to the libtool ld trickery. | 232 dnl back to the libtool ld trickery. |
230 dnl | 233 dnl |
231 dnl We dont do ANY of this if we can't produce shared objects. | 234 dnl We don't do ANY of this if we can't produce shared objects. |
232 dnl | 235 dnl |
233 if test "$can_build_shared" = "yes"; then | 236 if test "$can_build_shared" = "yes"; then |
234 cc_produces_so=no | 237 cc_produces_so=no |
235 xldf= | 238 xldf= |
236 xcldf= | 239 xcldf= |
384 | 387 |
385 if test "$cc_produces_so" = "yes"; then | 388 if test "$cc_produces_so" = "yes"; then |
386 dll_ld=$CC | 389 dll_ld=$CC |
387 dll_ldflags=$xcldf | 390 dll_ldflags=$xcldf |
388 can_build_shared=yes | 391 can_build_shared=yes |
392 ld_shlibs=yes | |
389 else | 393 else |
390 # OK - only NOW do we futz about with ld. | 394 # OK - only NOW do we futz about with ld. |
391 # See if the linker supports building shared libraries. | 395 # See if the linker supports building shared libraries. |
392 AC_MSG_CHECKING(whether the linker supports shared libraries) | 396 AC_MSG_CHECKING(whether the linker supports shared libraries) |
393 dll_ld=$CC | 397 dll_ld=$CC |
507 | 511 |
508 dnl | 512 dnl |
509 dnl Last thing, check how to get a linked executable to have its symbols | 513 dnl Last thing, check how to get a linked executable to have its symbols |
510 dnl exported, so that the modules have access to them. | 514 dnl exported, so that the modules have access to them. |
511 dnl | 515 dnl |
512 dnl XEmacs FIXME - we need to set ld_dynamic_link_flags propperly for | 516 dnl XEmacs FIXME - we need to set ld_dynamic_link_flags properly for |
513 dnl most of these systems, which was missing from libtool. I know they | 517 dnl most of these systems, which was missing from libtool. I know they |
514 dnl all have a way of doing this, but someone needs to look at this | 518 dnl all have a way of doing this, but someone needs to look at this |
515 dnl for each OS and make sure it is correct. Remember that the arguments | 519 dnl for each OS and make sure it is correct. Remember that the arguments |
516 dnl are passed when temacs is linked, this is NOT for modules. The sole | 520 dnl are passed when temacs is linked, this is NOT for modules. The sole |
517 dnl purpose of the argument is to get the internal XEmacs symbols exposed | 521 dnl purpose of the argument is to get the internal XEmacs symbols exposed |