Mercurial > hg > xemacs-beta
annotate aclocal.m4 @ 4932:8b63e21b0436
fix compile issues with gcc 4
-------------------- ChangeLog entries follow: --------------------
ChangeLog addition:
2010-01-24 Ben Wing <ben@xemacs.org>
* aclocal.m4 (XE_SHLIB_STUFF):
Use -export-all-symbols instead of -export-dynamic on PE targets
(Cygwin and MinGW).
* configure.ac (XE_EXPAND_VARIABLE):
* configure.ac (TAB):
Create variable XEMACS_CC_GPP to check whether we're running g++.
Don't just check for an executable called `g++' -- it might be
called g++-4 or whatever. Instead, check for either named `g++*'
or claiming to be g++ when called with --version. Rewrite code do
use the variable.
Add -fno-strict-aliasing to optimization flags when GCC and
optimized, and in all cases with g++, since under these circumstances
strict aliasing is otherwise assumed, and XEmacs can't easily be
made to respect its restrictions.
* configure: Regenerate.
lib-src/ChangeLog addition:
2010-01-24 Ben Wing <ben@xemacs.org>
* fakemail.c (args_size):
* fakemail.c (parse_header):
* ootags.c (C_entries):
Fix warnings about possible use of uninitialized vars.
lwlib/ChangeLog addition:
2010-01-24 Ben Wing <ben@xemacs.org>
* xlwgauge.c (GaugeResize):
* xlwgauge.c (GaugeSize):
Fix warnings about possible use of uninitialized vars.
modules/ChangeLog addition:
2010-01-24 Ben Wing <ben@xemacs.org>
* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
* postgresql/postgresql.c (print_pgconn):
* postgresql/postgresql.c (Fpq_connectdb):
* postgresql/postgresql.c (Fpq_connect_start):
* postgresql/postgresql.c (Fpq_exec):
* postgresql/postgresql.c (Fpq_get_result):
Fix g++ 4.3 complaints about implicit conversions of string
literals (const char *) to char *.
src/ChangeLog addition:
2010-01-24 Ben Wing <ben@xemacs.org>
* chartab.c (decode_char_table_range):
* extents.c (extent_fragment_update):
* objects-msw.c (initialize_font_instance):
* process.c (Fgetenv):
* redisplay-output.c (get_next_display_block):
Fix warnings about possible use of uninitialized vars.
* compiler.h:
* compiler.h (REGISTER):
* event-stream.c (is_scrollbar_event):
* window.c (window_scrollbar_width):
* window.c (window_scrollbar_height):
* window.c (window_left_window_gutter_width):
* window.c (window_right_window_gutter_width):
Add USED_IF_SCROLLBARS. Use it to fix warnings about unused
vars when --with-scrollbars=no.
* config.h.in:
Change comment to explain better why DECLARE_INLINE_HEADER
is needed.
* dialog-msw.c:
* emacs.c (SHEBANG_EXE_PROGNAME_LENGTH):
* emacs.c (main_1):
* event-msw.c (struct mswin_message_debug):
* event-msw.c (debug_output_mswin_message):
* font-mgr.c:
* font-mgr.c (Ffc_config_filename):
* glyphs-msw.c (struct):
* glyphs-msw.c (bitmap_table):
* glyphs-x.c (update_widget_face):
* intl-win32.c (struct lang_to_string):
* intl-win32.c (lang_to_string_table):
* nas.c:
* objects-xlike-inc.c:
* objects-xlike-inc.c (xft_find_charset_font):
* syswindows.h:
* win32.c (mswindows_output_last_error):
Fix g++ 4.3 complaints about implicit conversions of string
literals (const char *) to char *.
* lisp.h:
G++ 4.3 needs #include <limits> to avoid errors about min/max.
* lisp.h (disabled_assert_with_message):
Use disabled_assert* whenever asserts are disabled. Rewrite
disabled_assert* to avoid complaints about unused vars by
pretending to use the vars but casting them to (void).
Remove code that defined assert() weirdly if DEBUG_XEMACS but
not USE_ASSERTIONS -- configure sets USE_ASSERTIONS automatically
when DEBUG_XEMACS, and if the user has forced it off, then
so be it.
* lisp.h (SYMBOL_KEYWORD):
Put some of the combined `extern Lisp_Object's back under
the file they are declared in. Cosmetic fix.
* number.h:
Remove `extern Lisp_Object' decls that duplicate lisp.h,
since they have different C vs. C++ linkage.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sun, 24 Jan 2010 22:04:58 -0600 |
parents | aa5ed11f473b |
children | e6508b64ee08 ff554e6a2d29 |
rev | line source |
---|---|
265 | 1 dnl aclocal.m4 --- Dynamically linked library support for XEmacs |
388 | 2 dnl Copyright (C) 1998, 1999 J. Kean Johnston. |
3 dnl Author: J. Kean Johnston <jkj@sco.com>, based on work in libtool. | |
4 dnl This file is part of XEmacs. | |
5 | |
6 dnl | |
7 dnl There are several things we care about here. First, we need to find | |
8 dnl out how we create an executable that has its symbols exported, so | |
9 dnl that dynamically loaded modules have access to the internal XEmacs | |
10 dnl symbols. This is stored in ``ld_dynamic_link_flags'' and is used | |
11 dnl in the main Makefile. | |
12 dnl Next, we need to know how we compile actual shared libraries, and | |
13 dnl the objects in them. For these purposes, we need to determine the | |
14 dnl C compiler flags used to produce shared objects (``dll_cflags''), | |
15 dnl what linker to use to create the final shared object that will be | |
16 dnl loaded (``dll_ld'') and the flags to pass to that linker | |
17 dnl (``dll_ldflags''). This information is used by ellcc to build up | |
18 dnl the command line when compiling modules. We build up two other commands | |
19 dnl for extremely weird systems where special things need to be done. | |
20 dnl The first is ``dll_ldo'', which is the flag used to specify the output | |
21 dnl file name, and the second is ``dll_post'' which is inserted after the | |
22 dnl list of objects. | |
23 dnl After all of this, we should be able to: | |
24 dnl $(CC) $(CFLAGS) $(dll_cflags) -c module.c | |
25 dnl to produce a single shared object | |
26 dnl And then: | |
27 dnl $(dll_ld) $(dll_ldflags) $(dll_ldo) module.ell module.o $(dll_post) | |
28 dnl to create the loadable shared library. | |
29 dnl | |
30 dnl NOTE: In the code below, where I have modified things to work with | |
31 dnl XEmacs, we use $canonical instead of libtool's $host, and we use | |
32 dnl $internal_configuration instead of $host_alias. To make typing | |
33 dnl shorter we assign these to $xehost and $xealias | |
34 | |
35 AC_DEFUN(XE_SHLIB_STUFF,[ | |
36 dll_ld= | |
37 dll_ldflags= | |
38 dll_cflags= | |
39 dll_post= | |
40 dll_ldo="-o" | |
41 ld_dynamic_link_flags= | |
2651 | 42 xehost=$ac_cv_build |
43 xealias=$ac_cv_build_alias | |
388 | 44 |
3312 | 45 AC_MSG_CHECKING([how to build dynamic libraries for ${xehost}]) |
46 AC_MSG_RESULT() | |
388 | 47 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. |
48 case "$xehost" in | |
49 *-*-linux-gnu*) ;; | |
50 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` | |
51 esac | |
52 | |
2651 | 53 xehost_cpu=`echo $xehost | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'` |
54 xehost_vendor=`echo $xehost | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'` | |
55 xehost_os=`echo $xehost | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'` | |
388 | 56 |
57 # Now see if the compiler is really GCC. | |
58 if test "$GCC" = "yes"; then | |
59 XEGCC=yes | |
60 else | |
2651 | 61 AC_MSG_CHECKING([whether we are using GNU C]) |
388 | 62 AC_EGREP_CPP(yes,[ |
63 #ifdef __GNUC__ | |
64 yes; | |
65 #endif | |
66 ],XEGCC=yes, XEGCC=no) | |
67 AC_MSG_RESULT([${XEGCC}]) | |
68 fi | |
69 | |
2651 | 70 AC_MSG_CHECKING([how to produce PIC code]) |
388 | 71 wl= |
72 | |
73 can_build_shared=yes | |
1756 | 74 if test "$XEGCC" = yes -o "$__ICC" = yes; then |
388 | 75 wl='-Wl,' |
76 | |
77 case "$xehost_os" in | |
4759
aa5ed11f473b
Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents:
3773
diff
changeset
|
78 aix[[4-9]]* | irix[[5-9]]* | osf[[3-9]]) |
388 | 79 # PIC is the default for these OSes. |
80 ;; | |
81 | |
1678 | 82 *darwin*) dll_cflags='-dynamic' |
83 ;; | |
84 | |
460 | 85 os2*) |
388 | 86 # We can build DLLs from non-PIC. |
87 ;; | |
88 amigaos*) | |
89 # FIXME: we need at least 68020 code to build shared libraries, but | |
90 # adding the `-m68020' flag to GCC prevents building anything better, | |
91 # like `-m68040'. | |
92 dll_cflags='-m68020 -resident32 -malways-restore-a4' | |
93 ;; | |
442 | 94 *cygwin* | *mingw* ) |
95 # PIC is the default | |
96 ;; | |
388 | 97 *) |
98 dll_cflags='-fPIC' | |
99 ;; | |
100 esac | |
101 else | |
102 # PORTME Check for PIC flags for the system compiler. | |
103 case "$xehost_os" in | |
4759
aa5ed11f473b
Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents:
3773
diff
changeset
|
104 hpux1[[0-9]]*) |
388 | 105 # Is there a better link_static_flag that works with the bundled CC? |
106 wl='-Wl,' | |
107 dll_cflags='+Z' | |
108 ;; | |
109 | |
460 | 110 irix[[5-9]]*) |
388 | 111 wl='-Wl,' |
112 # PIC (with -KPIC) is the default. | |
113 ;; | |
114 | |
115 os2*) | |
116 # We can build DLLs from non-PIC. | |
117 ;; | |
118 | |
460 | 119 osf[[3-9]]*) |
388 | 120 # All OSF/1 code is PIC. |
121 wl='-Wl,' | |
122 ;; | |
123 | |
4759
aa5ed11f473b
Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents:
3773
diff
changeset
|
124 aix[[4-9]]*) |
460 | 125 # All AIX code is PIC. |
126 wl='-Wl,' | |
127 ;; | |
128 | |
388 | 129 sco3.2v5*) |
130 dll_cflags='-belf -Kpic' | |
131 wl='-Wl,' | |
132 ;; | |
265 | 133 |
388 | 134 unixware*) |
135 dll_cflags="-KPIC" | |
136 wl="-Wl," | |
137 ;; | |
138 | |
139 sysv4*) | |
140 dll_cflags="-KPIC" | |
141 wl="-Wl," | |
142 ;; | |
143 | |
144 sysv5*) | |
145 dll_cflags="-KPIC" | |
146 wl="-Wl," | |
147 ;; | |
148 | |
149 solaris2*) | |
150 dll_cflags='-KPIC' | |
151 wl='-Wl,' | |
152 ;; | |
153 | |
154 uts4*) | |
155 dll_cflags='-pic' | |
156 ;; | |
157 | |
158 *) | |
159 can_build_shared=no | |
160 ;; | |
161 esac | |
162 fi | |
163 | |
164 if test -n "$dll_cflags"; then | |
165 AC_MSG_RESULT([${dll_cflags}]) | |
442 | 166 |
388 | 167 # Check to make sure the dll_cflags actually works. |
168 AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works]) | |
169 save_CFLAGS="$CFLAGS" | |
170 CFLAGS="$CFLAGS $dll_cflags -DPIC" | |
3312 | 171 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int x=0;])],[ |
388 | 172 # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also |
173 # reports no error. So, we need to grep stderr for (Bundled). | |
174 if grep '(Bundled)' config.log >/dev/null; then | |
175 AC_MSG_RESULT(no) | |
176 can_build_shared=no | |
177 dll_cflags= | |
178 else | |
179 AC_MSG_RESULT(yes) | |
180 fi], [AC_MSG_RESULT(no) | |
181 can_build_shared=no | |
182 dll_cflags=]) | |
183 CFLAGS="$save_CFLAGS" | |
184 else | |
185 AC_MSG_RESULT(none) | |
186 fi | |
187 | |
188 dnl | |
189 dnl Now comes the LD trickery. We do things differently to libtool here. | |
190 dnl I believe that libtool is incorrect in trying to drive the linker | |
191 dnl directly. This can cause considerable problems if the module you are | |
192 dnl compiling has C++ or other static initializers. If we use ld directly, | |
442 | 193 dnl we don't end up with the crt stuff being linked in, and we don't end up |
388 | 194 dnl with any .init or .fini sections (or the moral equivalent thereof). |
442 | 195 dnl gcc takes great care to do this properly when invoked in -shared |
196 dnl mode, and we really do want this behavior. Perhaps the libtool folks | |
388 | 197 dnl are not aware that any SVR4 based dynamic loader will automatically |
198 dnl execute code in the .init section before dlopen() returns. This is | |
442 | 199 dnl vital, as the module may have been compiled to rely on that behavior. |
388 | 200 dnl |
201 dnl So, having said all of that, we diverge from libtool significantly | |
202 dnl here. We want to try and use the C compiler as much as possible. Only | |
2079 | 203 dnl if the C compiler itself cannot create shared libraries do we try to |
388 | 204 dnl find the linker. |
205 dnl | |
206 dnl The other advantage to my scheme is that it removes the dependancy | |
207 dnl on a given compiler version remaining static with relation to the | |
208 dnl version of XEmacs. With the libtool way, it picks up the linker that | |
209 dnl gcc uses, which can be the internal collect2 that comes with gcc. | |
210 dnl If the user ever changes their compiler version, the paths will no | |
211 dnl longer be correct, and ellcc will break. This is clearly unacceptable. | |
442 | 212 dnl By using the compiler driver on the path, we don't have this problem. |
388 | 213 dnl If that is not clear, consider that gcc -print-prog-name=ld can |
214 dnl produce something along the lines of: | |
215 dnl /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld | |
216 dnl If you ever change GCC versions, then that path no longer exists. | |
217 dnl | |
218 dnl So, we change the check order here. We first check to see if we are | |
219 dnl using GCC, and if so, we see if -shared works. If it does, great. | |
220 dnl If we are not using gcc, but the system C compiler can produce | |
221 dnl shared objects, we try that. Only if all of that fails do we revert | |
222 dnl back to the libtool ld trickery. | |
223 dnl | |
442 | 224 dnl We don't do ANY of this if we can't produce shared objects. |
388 | 225 dnl |
226 if test "$can_build_shared" = "yes"; then | |
227 cc_produces_so=no | |
228 xldf= | |
229 xcldf= | |
2651 | 230 AC_MSG_CHECKING([if C compiler can produce shared libraries]) |
1756 | 231 if test "$XEGCC" = yes -o "$__ICC" = yes; then |
1678 | 232 case "$xehost_os" in |
233 *darwin*) | |
234 xcldf='-bundle' | |
235 xldf='-bundle -bundle_loader ../../src/xemacs' | |
236 ;; | |
237 *) | |
238 xcldf="-shared" | |
239 xldf="-shared" | |
240 ;; | |
241 esac | |
388 | 242 else # Not using GCC |
243 case "$xehost_os" in | |
4759
aa5ed11f473b
Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents:
3773
diff
changeset
|
244 aix[[4-9]]*) |
388 | 245 xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc" |
246 xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc" | |
247 ;; | |
248 | |
249 freebsd2* | netbsd* | openbsd*) | |
250 xldf="-Bshareable" | |
251 xcldf="${wl}-Bshareable" | |
252 ;; | |
253 | |
254 freebsd3*) | |
255 xcldf="-shared" | |
256 ;; | |
257 | |
258 hpux*) | |
259 xldf="-b +s" | |
260 xcldf="${wl}-b ${wl}+s" | |
261 ;; | |
262 | |
460 | 263 irix[[5-9]]* | osf[[3-9]]*) |
388 | 264 xcldf="${wl}-shared" |
265 xldf="-shared" | |
266 ;; | |
267 | |
268 sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*) | |
269 xcldf="-G" | |
270 xldf="-G" | |
271 ;; | |
272 esac | |
273 fi # End if if we are using gcc | |
265 | 274 |
388 | 275 if test -n "$xcldf"; then |
276 save_LDFLAGS=$LDFLAGS | |
277 save_LIBS=$LIBS | |
278 save_xe_libs=$xe_libs | |
279 LDFLAGS="$xcldf $LDFLAGS" | |
280 LIBS= | |
281 xe_libs= | |
3312 | 282 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AS_MESSAGE_LOG_FD' |
283 AC_LINK_IFELSE([AC_LANG_SOURCE([int x=0;])], | |
284 [cc_produces_so=yes],[cc_produces_so=no]) | |
388 | 285 LDFLAGS=$save_LDFLAGS |
286 LIBS=$save_LIBS | |
287 xe_libs=$save_xe_libs | |
3312 | 288 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AS_MESSAGE_LOG_FD' |
388 | 289 else |
290 cc_produces_so=no | |
291 fi | |
292 AC_MSG_RESULT([${cc_produces_so}]) | |
293 | |
294 LTLD=$LD | |
295 if test -z "$LTLD"; then | |
296 ac_prog=ld | |
297 if test "$XEGCC" = yes; then | |
298 # Check if gcc -print-prog-name=ld gives a path. | |
2651 | 299 AC_MSG_CHECKING([for ld used by GCC]) |
388 | 300 ac_prog=`($CC -print-prog-name=ld) 2>&5` |
301 case "$ac_prog" in | |
302 # Accept absolute paths. | |
303 /*) | |
304 if test -z "$LTLD"; then | |
724 | 305 # case "$ac_prog" in |
306 # *gcc-lib*) LTLD="$CC" | |
307 # ;; | |
308 # *) | |
309 LTLD="$ac_prog" | |
310 # ;; | |
311 # esac | |
388 | 312 fi |
313 ;; | |
314 "") | |
315 # If it fails, then pretend we aren't using GCC. | |
316 ac_prog=ld | |
317 ;; | |
318 *) | |
319 # If it is relative, then search for the first ld in PATH. | |
320 with_gnu_ld=unknown | |
321 ;; | |
322 esac | |
323 else | |
2651 | 324 AC_MSG_CHECKING([for GNU ld]) |
388 | 325 fi |
326 | |
327 if test -z "$LTLD"; then | |
328 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
329 for ac_dir in $PATH; do | |
330 test -z "$ac_dir" && ac_dir=. | |
331 if test -f "$ac_dir/$ac_prog"; then | |
332 LTLD="$ac_dir/$ac_prog" | |
333 # Check to see if the program is GNU ld. I'd rather use --version, | |
334 # but apparently some GNU ld's only accept -v. | |
335 # Break only if it was the GNU/non-GNU ld that we prefer. | |
3773 | 336 if "$LTLD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then |
388 | 337 xe_gnu_ld=yes |
338 else | |
339 xe_gnu_ld=no | |
340 fi | |
341 fi | |
342 done | |
343 IFS="$ac_save_ifs" | |
344 fi | |
345 | |
346 if test -n "$LTLD"; then | |
347 AC_MSG_RESULT([${LTLD}]) | |
348 else | |
349 AC_MSG_RESULT(no) | |
350 fi | |
351 | |
352 if test -z "$LTLD" -a "$cc_produces_so" = no; then | |
353 AC_MSG_ERROR(no acceptable linker found in \$PATH) | |
354 exit 1 | |
355 fi | |
356 fi | |
357 | |
358 dnl | |
359 dnl Order of the tests changed somewhat to prevent repetition | |
360 dnl | |
361 ld_dynamic_link_flags= | |
362 | |
363 # Check to see if it really is or isn't GNU ld. | |
2651 | 364 AC_MSG_CHECKING([if the linker is GNU ld]) |
388 | 365 # I'd rather use --version here, but apparently some GNU ld's only accept -v. |
3773 | 366 if $LTLD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then |
388 | 367 xe_gnu_ld=yes |
368 else | |
369 xe_gnu_ld=no | |
370 fi | |
371 AC_MSG_RESULT([${xe_gnu_ld}]) | |
372 | |
373 case "$xehost_os" in | |
4759
aa5ed11f473b
Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents:
3773
diff
changeset
|
374 amigaos*) |
aa5ed11f473b
Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents:
3773
diff
changeset
|
375 # On this operating system, we should treat GNU ld like the system ld. |
388 | 376 gnu_ld_acts_native=yes |
377 ;; | |
378 *) | |
379 gnu_ld_acts_native=no | |
380 ;; | |
381 esac | |
382 | |
383 if test "$cc_produces_so" = "yes"; then | |
384 dll_ld=$CC | |
1678 | 385 case "$xehost_os" in |
386 *darwin*) | |
387 dnl On Darwin, we test with xcldf, but we use xldf | |
388 dll_ldflags=$xldf | |
389 ;; | |
390 *) | |
391 dll_ldflags=$xcldf | |
392 ;; | |
393 esac | |
388 | 394 can_build_shared=yes |
442 | 395 ld_shlibs=yes |
388 | 396 else |
397 # OK - only NOW do we futz about with ld. | |
398 # See if the linker supports building shared libraries. | |
2651 | 399 AC_MSG_CHECKING([whether the linker supports shared libraries]) |
388 | 400 dll_ld=$CC |
401 dll_ldflags=$LDFLAGS | |
402 ld_shlibs=yes | |
403 can_build_shared=yes | |
404 if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then | |
405 # See if GNU ld supports shared libraries. | |
3773 | 406 if $LTLD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null; then |
388 | 407 dll_ld=$CC |
408 dll_ldflags="-shared" | |
409 ld_shlibs=yes | |
410 else | |
411 ld_shlibs=no | |
412 fi | |
413 else | |
414 # PORTME fill in a description of your system's linker (not GNU ld) | |
415 case "$xehost_os" in | |
460 | 416 aix[[4-9]]*) |
388 | 417 dll_ldflags=$xcldf |
418 ;; | |
419 | |
420 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor | |
421 # support. Future versions do this automatically, but an explicit c++rt0.o | |
422 # doesn't break anything, and helps significantly (at the cost of a little | |
423 # extra space). | |
424 freebsd2.2*) | |
425 dll_ld=$LTLD | |
426 dll_ldflags=$xldf | |
427 dll_post="/usr/lib/c++rt0.o" | |
428 ;; | |
429 | |
430 # Unfortunately, older versions of FreeBSD 2 don't have this feature. | |
431 freebsd2*) | |
432 dll_ld=$LTLD | |
433 dll_ldflags="-Bshareable" | |
434 ;; | |
265 | 435 |
388 | 436 # FreeBSD 3, at last, uses gcc -shared to do shared libraries. |
437 freebsd3*) | |
438 dll_ldflags="-shared" | |
439 ;; | |
440 | |
441 hpux*) | |
442 dll_ld=$LTLD | |
443 dll_ldflags=$xldf | |
444 ;; | |
445 | |
460 | 446 irix[[5-9]]*) |
388 | 447 dll_ld=$LTLD |
448 dll_ldflags=$xldf | |
449 ;; | |
450 | |
451 netbsd*) | |
452 # Tested with NetBSD 1.2 ld | |
453 dll_ld=$LTLD | |
454 dll_ldflags=$xldf | |
455 ;; | |
456 | |
457 openbsd*) | |
458 dll_ld=$LTLD | |
459 dll_ldflags=$xldf | |
460 ;; | |
461 | |
462 osf3* | osf4*) | |
463 dll_ld=$LTLD | |
464 dll_ldflags=$xldf | |
465 ;; | |
466 | |
467 # For both SCO and Solaris we MAY want to have LDFLAGS include -z text | |
468 sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*) | |
469 dll_ld=$LTLD | |
470 case "$dll_ld" in | |
471 *gcc*) dll_ldflags="-shared" | |
472 dll_ld=$CC | |
473 ;; | |
474 *) dll_ldflags="-G" | |
475 ;; | |
476 esac | |
477 ;; | |
478 | |
479 uts4*) | |
480 dll_ld=$LTLD | |
481 dll_ldflags="-G" | |
482 ;; | |
483 | |
484 bsdi*) | |
485 dll_ldflags="-r" | |
486 dll_ld="shlicc2" | |
487 ;; | |
1470 | 488 |
388 | 489 *) |
490 ld_shlibs=no | |
491 can_build_shared=no | |
492 ;; | |
493 esac | |
494 fi | |
495 AC_MSG_RESULT([${ld_shlibs}]) | |
496 if test "$ld_shlibs" = "no"; then | |
497 can_build_shared=no | |
498 fi | |
499 fi # End of if cc_produces_so = no | |
265 | 500 |
388 | 501 dnl |
502 dnl Last thing, check how to get a linked executable to have its symbols | |
503 dnl exported, so that the modules have access to them. | |
504 dnl | |
442 | 505 dnl XEmacs FIXME - we need to set ld_dynamic_link_flags properly for |
388 | 506 dnl most of these systems, which was missing from libtool. I know they |
507 dnl all have a way of doing this, but someone needs to look at this | |
508 dnl for each OS and make sure it is correct. Remember that the arguments | |
509 dnl are passed when temacs is linked, this is NOT for modules. The sole | |
510 dnl purpose of the argument is to get the internal XEmacs symbols exposed | |
511 dnl for modules to use. This means that the COMPILER (and NOT the linker) | |
512 dnl is most often used to create temacs, so arguments to the linker will | |
513 dnl usually need to be prefix with ${wl} or some other such thing. | |
514 dnl | |
515 | |
4932 | 516 if test "$xe_gnu_ld" = yes -a "$ld_shlibs" = yes; then |
517 case "$xehost_os" in | |
518 *cygwin* | *mingw* ) | |
519 # -export-all-symbols is the PE equivalent of ELF-specific -export-dynamic | |
520 ld_dynamic_link_flags="${wl}-export-all-symbols" | |
521 ;; | |
522 | |
523 *) | |
388 | 524 ld_dynamic_link_flags="${wl}-export-dynamic" |
4932 | 525 ;; |
526 esac | |
388 | 527 fi |
528 | |
529 if test -z "$ld_dynamic_link_flags"; then | |
530 case "$xehost_os" in | |
460 | 531 aix[[3-9]]*) |
388 | 532 ld_dynamic_link_flags= |
533 ;; | |
534 | |
1678 | 535 *darwin*) |
536 ld_dynamic_link_flags= | |
537 ;; | |
538 | |
388 | 539 freebsd2.2*) |
540 ld_dynamic_link_flags= | |
541 ;; | |
542 | |
543 freebsd2*) | |
544 ld_dynamic_link_flags= | |
545 ;; | |
546 | |
547 freebsd3*) | |
548 ld_dynamic_link_flags= | |
549 ;; | |
550 | |
551 hpux*) | |
552 ld_dynamic_link_flags="${wl}-E" | |
553 ;; | |
554 | |
460 | 555 irix[[5-9]]*) |
388 | 556 ld_dynamic_link_flags= |
557 ;; | |
558 | |
559 netbsd*) | |
560 ld_dynamic_link_flags= | |
561 ;; | |
562 | |
563 openbsd*) | |
564 ld_dynamic_link_flags= | |
565 ;; | |
566 | |
567 osf3* | osf4*) | |
568 ld_dynamic_link_flags= | |
569 ;; | |
570 | |
398 | 571 solaris2* | solaris7*) |
426 | 572 ld_dynamic_link_flags= |
398 | 573 ;; |
574 | |
4759
aa5ed11f473b
Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents:
3773
diff
changeset
|
575 unixware* | sysv5* | sysv4*) |
388 | 576 ld_dynamic_link_flags="${wl}-Bexport" |
577 ;; | |
578 | |
579 uts4*) | |
580 ld_dynamic_link_flags= | |
581 ;; | |
582 | |
583 esac | |
584 fi # End of if -z ld_dynamic_link_flags | |
585 fi # End of if test "$can_build_shared" = "yes" | |
586 | |
265 | 587 AC_SUBST(dll_ld) |
588 AC_SUBST(dll_cflags) | |
388 | 589 AC_SUBST(dll_ldflags) |
590 AC_SUBST(dll_post) | |
591 AC_SUBST(dll_ldo) | |
592 AC_SUBST(ld_dynamic_link_flags) | |
265 | 593 ])dnl |
388 | 594 |