1 # demo.at -- Linking and loading. -*- Autotest -*-
3 # Copyright (C) 2003-2004, 2011-2019, 2021-2024 Free Software
5 # Written by Gary V. Vaughan, 2003
7 # This file is part of GNU Libtool.
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING. If not, a copy
21 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 AT_BANNER([Linking and loading.])
29 ## ------------------------------------------- ##
30 ## Some functions shared by later tests cases. ##
31 ## ------------------------------------------- ##
33 # This function needs to be used, rather than 'exit', when a 'trap' handler is
34 # in effect that refers to $?.
42 test -n "$objdir" || exit 1
43 mv -f "$objdir"/temp/libs/* "$objdir"
44 mv -f "$objdir/temp/libhello.la" .
50 test -n "$objdir" || exit 1
51 $lt_INSTALL -d "$objdir/temp/libs"
52 cp -f libhello.la "$objdir/temp"
53 cp -f "$objdir"/libhello.* "$objdir/lt-hell$EXEEXT" "$objdir/temp/libs"
59 m4_define([_LT_DEMO_SETUP],
60 [AT_DATA([configure.ac],
61 [[AC_INIT([demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
62 AC_CONFIG_AUX_DIR([build-aux])
63 AC_CONFIG_MACRO_DIRS([m4])
67 LT_INIT([dlopen win32-dll])
68 AC_SUBST([LIBTOOL_DEPS])
70 test yes = "$enable_static" && STATIC=-static
73 case $lt_cv_sys_global_symbol_pipe in
74 ?*) binary_helldl=yes ;;
76 AM_CONDITIONAL([BINARY_HELLDL], [test yes = "$binary_helldl"])
79 AC_CONFIG_FILES([Makefile])
80 AC_CONFIG_HEADERS([config.h:config.in.h])
84 AT_DATA([Makefile.am],
85 [[AUTOMAKE_OPTIONS = no-dependencies foreign
86 ACLOCAL_AMFLAGS = -I m4
88 # Build a libtool library, libhello.la for installation in libdir.
89 lib_LTLIBRARIES = libhello.la
90 libhello_la_SOURCES = hello.c foo.c
91 libhello_la_LIBADD = $(LIBM)
92 libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
93 libhello_la_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_LIBHELLO
95 include_HEADERS = foo.h
103 bin_PROGRAMS = hell hell_static $(BUILD_helldl)
105 # Build hell from main.c and libhello.la
106 hell_SOURCES = main.c
107 hell_LDADD = libhello.la
109 # Create a statically linked version of hell.
110 hell_static_SOURCES = main.c
111 hell_static_LDADD = libhello.la
112 hell_static_LDFLAGS = $(STATIC)
116 # Create a version of hell that does a preloaded dlopen.
117 helldl_SOURCES = dlmain.c
118 helldl_LDFLAGS = -export-dynamic -dlpreopen libhello.la
119 helldl_DEPENDENCIES = libhello.la
123 # Create a script that says that -dlopen is not supported.
125 helldl helldl$(EXEEXT):
127 echo '#! /bin/sh' > $@
128 echo 'echo sorry, -dlopen is unsupported' >> $@
133 libtool: $(LIBTOOL_DEPS)
134 $(SHELL) ./config.status --recheck
136 include $(srcdir)/demo.mk
140 [[## Don't abort for lack of demo.mk
147 /* At some point, cygwin will stop defining __CYGWIN32__, but b19 and
148 * earlier do not define __CYGWIN__. This snippet allows us to check
149 * for __CYGWIN__ reliably for both current, old, and (probable) future
158 #if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
159 # ifdef BUILDING_LIBHELLO
161 # define LIBHELLO_SCOPE extern __declspec (dllexport)
164 # define LIBHELLO_SCOPE extern __declspec (dllimport)
167 #ifndef LIBHELLO_SCOPE
168 # define LIBHELLO_SCOPE extern
171 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
172 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
173 /* DATA imports from DLLs on WIN32 can't be const, because runtime
174 relocations are performed -- see ld's documentation on pseudo-relocs. */
175 # define LT_DLSYM_CONST
176 #elif defined __osf__
177 /* This system does not cope well with relocations in const data. */
178 # define LT_DLSYM_CONST
180 # define LT_DLSYM_CONST const
183 /* Silly constants that the functions return. */
184 #define HELLO_RET 0xe110
185 #define FOO_RET 0xf00
193 LIBHELLO_SCOPE int nothing;
203 [[#include <config.h>
209 /* Give a global variable definition. */
210 int nothing = FOO_RET;
213 printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
219 [[#include <config.h>
220 int hell1 (void) { return 1; }
224 [[#include <config.h>
225 int hell2 (void) { return 2; }
229 [[#include <config.h>
235 printf ("** This is not GNU Hello. There is no built-in mail reader. **\n");
241 [[#include <config.h>
248 printf ("Welcome to GNU Hell!\n");
250 /* Try assigning to the nothing variable. */
253 /* Just call the functions and check return values. */
254 if (foo () != FOO_RET)
257 if (hello () != HELLO_RET)
265 [[#include <config.h>
271 #define STREQ !strcmp
273 #define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols
281 extern LT_DLSYM_CONST lt_dlsymlist lt_preloaded_symbols[];
285 const lt_dlsymlist *s;
290 printf ("Welcome to *modular* GNU Hell!\n");
292 /* Look up the symbols we require for this demonstration. */
293 s = lt_preloaded_symbols;
297 const char *name = s->name;
298 printf ("found symbol: %s\n", name);
299 if (STREQ ("@INIT@", name))
300 ((void(*)())s->address)();
301 if (STREQ ("hello", name))
302 phello = (int(*)())s->address;
303 else if (STREQ ("foo", name))
304 pfoo = (int(*)())s->address;
305 else if (STREQ ("nothing", name))
307 /* In an ideal world we could do this... */
308 pnothing = (int*)s->address;
310 /* In an ideal world a shared lib would be able to export data */
311 pnothing = (int*)¬hing;
314 printf ("found file: %s\n", s->name);
318 /* Try assigning to the nothing variable. */
322 fprintf (stderr, "did not find the 'nothing' variable\n");
324 /* Just call the functions and check return values. */
327 if ((*pfoo) () != FOO_RET)
331 fprintf (stderr, "did not find the 'foo' function\n");
335 if ((*phello) () != HELLO_RET)
339 fprintf (stderr, "did not find the 'hello' function\n");
345 LT_AT_HOST_DATA([expout],
346 [[Welcome to GNU Hell!
348 ** This is not GNU Hello. There is no built-in mail reader. **
355 # _LT_CHECK_EXECUTE([TARGETS])
356 # ----------------------------
357 # Run the listed make rules, and check that the built binaries work.
358 m4_define([_LT_CHECK_EXECUTE],
359 [LT_AT_CHECK_EXECUTE([$1],
360 [./hell_static], [./hell])
361 AT_CHECK([./helldl$EXEEXT |
362 $EGREP '(Welcome to .*GNU Hell|unsupported)'], 0, [ignore])
368 # Run the make install rule, and check that installed binaries work too.
369 m4_define([_LT_CHECK_INSTALL],
370 [# Windows hosts search for dlls in the command path.
371 PATH=$prefix/lib:$PATH
373 LT_AT_CHECK_EXECUTE([install],
374 [$prefix/bin/hell_static], [$prefix/bin/hell])
375 AT_CHECK([$prefix/bin/helldl$EXEEXT |
376 $EGREP '(Welcome to .*GNU Hell|unsupported)'], 0, [ignore])
384 AT_SETUP([link against a preloaded static library])
388 LT_AT_CHECK_CONFIG([--disable-shared],
389 [^build_old_libs=yes], [^build_libtool_libs=no])
392 LT_AT_CHECK_UNINSTALL
401 AT_SETUP([build and dynamically load a module])
405 LT_AT_CHECK_CONFIG([--disable-static],
406 [^build_old_libs=no], [^build_libtool_libs=yes])
409 LT_AT_CHECK_UNINSTALL
418 AT_SETUP([preload static and dynamic module])
422 LT_AT_CHECK_CONFIG([],
423 [^build_old_libs=yes], [^build_libtool_libs=yes])
426 LT_AT_CHECK_UNINSTALL
435 # This is one of the essential tests for deplibs_check_method=pass_all.
436 # If this one passes with pass_all, it is likely that pass_all works.
438 AT_SETUP([deplibs_check_method])
443 [[EXTRA_LIBRARIES = libhell0.a
445 libhell0_a_LIBADD = hello.$(OBJEXT) foo.$(OBJEXT)
446 EXTRA_LTLIBRARIES = libhell1.la libhell2.la
447 libhell1_la_SOURCES = hell1.c
448 libhell1_la_LIBADD = -L. -lhell0
449 libhell1_la_LDFLAGS = -no-undefined -rpath $(libdir)
450 libhell1_la_DEPENDENCIES = libhell0.a
451 libhell2_la_SOURCES = hell2.c
452 libhell2_la_LIBADD = -L. -lhell0
453 libhell2_la_LDFLAGS = -no-undefined -rpath $(libdir)
454 libhell2_la_DEPENDENCIES = libhell0.a
455 EXTRA_PROGRAMS = hell0
456 hell0_SOURCES = main.c
457 hell0_LDADD = libhell1.la libhell2.la $(LIBM)
459 # 'hell0' in EXTRA_PROGRAMS gets translated to 'hell0.exe'; but we
460 # must explicitly list the wrapper script 'hell0'. (bin_PROGRAMS
461 # are handled seamlessly by automake rules; the extra step is only
462 # necessary for EXTRA_PROGRAMS)
463 CLEANFILES = $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) hell0
465 deplibs-check: hell0$(EXEEXT)
468 LT_AT_CHECK_CONFIG([--disable-static])
469 LT_AT_MAKE([deplibs-check])
470 LT_AT_EXEC_CHECK([./hell0], 0, [expout])
479 AT_SETUP([disable fast install])
483 LT_AT_CHECK_CONFIG([--enable-fast-install=no])
484 AT_CHECK([$EGREP '^hardcode_action=relink' libtool && (exit 77)], 1)
488 LT_AT_CHECK_UNINSTALL
497 AT_SETUP([force PIC objects])
501 LT_AT_CHECK_CONFIG([--with-pic])
511 AT_SETUP([force non-PIC objects])
513 AT_CHECK([case $host in
514 hppa*|amd64*|x86_64*|s390*)
515 # These hosts cannot use non-PIC shared libs
518 # Libtool does not build non-PIC shared libs on these hosts
522 if test "X$build" = "X$host" && test -d "/etc/selinux"; then
523 _selinux=`getenforce 2>/dev/null || echo "Disabled"`
526 _sebool_allow_execmod=`getsebool allow_execmod 2>/dev/null`
527 case $_sebool_allow_execmod in
529 # SELinux policy disallows non-PIC
539 LT_AT_CHECK_CONFIG([--with-pic=no])
549 AT_SETUP([hardcoding library path])
554 [[hardcode_tests = hc-direct hc-libflag hc-libpath hc-minusL
555 CLEANFILES = $(hardcode_tests)
557 # Unfortunately, in order to test libtool thoroughly, we need access
558 # to its private directory.
559 objdir = `$(LIBTOOL) --config | $(SED) -n -e 's/^objdir=\(.*\)$$/\1/p'`
561 # Test programs to see what gets hardcoded.
563 hardcode: $(hardcode_tests)
564 SET_HARDCODE_FLAGS = \
565 eval `$(LIBTOOL) --config | $(SED) -n -e '/^hardcode_.*=/p; /^wl=/p'`
566 hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
568 @echo "You may ignore any linking errors from the following command:"
569 @shlib=./$(objdir)/libhello.a; \
570 eval "`$(GREP) '^library_names' libhello.la`"; \
571 for lib in $$library_names; do \
572 shlib="./$(objdir)/$$lib"; \
574 $(SET_HARDCODE_FLAGS); \
576 flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
577 echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
578 eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
580 hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
581 @$(SET_HARDCODE_FLAGS); \
582 libdir=`pwd`/$(objdir); \
583 flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
584 if test -z "$$flag"; then \
585 echo "echo unsupported > $@"; \
586 echo unsupported > $@ || status="$$?"; \
588 echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM)"; \
589 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM) || status="$$?"; \
593 hc-libpath: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
595 @echo "You may ignore any linking errors from the following command:"
596 @$(SET_HARDCODE_FLAGS); \
597 eval `$(LIBTOOL) --config | $(GREP) '^shlibpath_var='`; \
599 flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
600 echo "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
601 eval "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
603 hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES)
605 @$(SET_HARDCODE_FLAGS); \
607 flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
608 echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
609 eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
612 LT_AT_CHECK_CONFIG([--disable-static])
616 eval `$EGREP '^library_names=' libhello.la`
617 AT_CHECK([test -n "$library_names" || (exit 77)])
619 # Extra tools we may need
620 : ${DUMPSTABS="dumpstabs"}
622 LT_AT_MAKE([hardcode])
624 eval "`$LIBTOOL --config | $EGREP '^hardcode_(direct|minus_L|shlibpath_var|libdir_flag_spec)='`"
626 AT_CHECK([[exit_status=0
627 func_hardcode_filter_fp ()
629 $FGREP -v "LT_OBJDIR \"$objdir/\"" 2>/dev/null
633 hc-direct) expected="$hardcode_direct" ;;
634 hc-libpath) expected="$hardcode_shlibpath_var" ;;
635 hc-minusL) expected="$hardcode_minus_L" ;;
638 if test -n "$hardcode_libdir_flag_spec"; then
650 # Discover whether the objdir really was hardcoded.
653 # Solaris cc may store the command line in a debugging section,
654 # which leads to false positives. Unfortunately, Solaris strip
655 # is not capable to remove the section (unlike GNU binutils strip).
656 # So we use dumpstabs if it seems to work.
657 if { $DUMPSTABS -d $file; } >/dev/null 2>&1; then
658 if $DUMPSTABS -d $file 2>/dev/null | $FGREP "$objdir" >/dev/null 2>&1; then
664 # At least AIX fgrep doesn't work for binary files, and AIX also
665 # doesn't have strings(1), so we need this strange conversion
666 # (which only works on ASCII).
667 # AIX fgrep also has a limited line length, so we turn unprintable
668 # characters into newlines.
669 elif cat $file | (tr '\000-\037\200-\377' '\n' || cat) 2>/dev/null \
670 | func_hardcode_filter_fp | $FGREP "$objdir" > /dev/null 2>&1; then
673 elif cat $file | func_hardcode_filter_fp | $FGREP "$objdir" > /dev/null 2>&1; then
674 # We retry fgrep without tr, in case the above lead to a false negative.
676 elif ($SED -e '1!d' $file | $GREP 'unsupported') >/dev/null 2>&1; then
677 hardcoded=unsupported
683 if test yes = "$expected"; then
684 echo "$objdir was hardcoded in '$file', as libtool expected"
686 echo "$objdir was hardcoded in '$file', which fooled libtool" 1>&2
692 if test no = "$expected"; then
693 echo "$objdir was not hardcoded in '$file', as libtool expected"
695 echo "$objdir was not hardcoded in '$file', which fooled libtool" 1>&2
701 if test unsupported = "$expected"; then
702 echo "'$file' was not linked properly, as libtool expected"
704 echo "'$file' was not linked properly, which fooled libtool" 1>&2
719 AT_SETUP([binary relinking at install time])
720 AT_KEYWORDS([interactive])dnl This test causes a popup on Windows
728 # Check to make sure we have a dynamic library.
729 eval `$EGREP '^library_names=' libhello.la`
730 AT_CHECK([test -n "$library_names" || (exit 77)])
733 # AIX 5.3 '/bin/sh' will invoke the trap for 0 at the end of a
734 # function, so we set the trap outside of a function to be portable.
735 trap func_restore_files 0 1 2 13 15
737 eval "`$LIBTOOL --config | $EGREP '^shlibpath_overrides_runpath='`"
738 eval "`$LIBTOOL --config | $EGREP '^hardcode_(action|direct|into_libs)='`"
740 # Allow the binary to link on-demand if need be.
741 ./hell$EXEEXT >/dev/null || :
743 # Remove libhello.la from build tree.
744 rm -f libhello.la "$objdir"/libhello.*
746 # Either uninstalled ./hell will run using the just installed libraries
747 # when the uninstalled libs are missing, or relinking at install time
748 # is necessary, and the uninstalled ./hell has only the uninstalled
749 # library paths hardcoded.
750 AT_CHECK([./hell$EXEEXT >/dev/null || test relink,yes = "$hardcode_action,$hardcode_direct"])
752 # Link an incomplete libhello.la.
753 LT_AT_MAKE([libhello.la], [libhello_la_OBJECTS=hello.lo])
754 AT_CHECK([test -f libhello.la])
756 # Try running uninstalled ./hell with only broken libhello.la in build tree.
757 # If the following has normal exit status, shlibpath_overrides_runpath is
758 # wrong, and should be set to 'no' on this host.
759 # The unusual '|| (exit 1)' is to normalize all non-zero exit statuses.
760 LT_AT_CHECK([./hell || (exit 1)], 1, [ignore], [ignore])
762 test relink = "$hardcode_action" ||
763 test yes = "$shlibpath_overrides_runpath" ||
765 AT_CHECK([rm -f $objdir/lt-hell$EXEEXT])
766 AT_CHECK([cp $objdir/hell$EXEEXT $objdir/lt-hell$EXEEXT])
768 # Running demo/hell with installed libhello.la.
769 # If the following check fails, then shlibpath_overrides_runpath is
770 # wrong, and should be set to 'yes' on this host.
771 LT_AT_CHECK([./hell], 0, [expout])
776 # Undo the effect of the previous 'trap' command. Some shellology:
777 # We cannot use "trap - 0 1 2 3 13 15", because Solaris sh would attempt to
778 # execute the command "-". "trap '' ..." is fine only for signal 0 (= normal
779 # exit); for the others we need to call 'exit' explicitly. The value of $? is
780 # 128 + signal number and is set before the trap-registered command is run.
782 trap 'func_exit $?' 1 2 3 13 15
787 ## ----------------- ##
788 ## Demo noinst link. ##
789 ## ----------------- ##
791 AT_SETUP([uninstalled libraries have priority])
799 # Remove libhello.la and hell from build tree.
800 rm -f libhello.la "hell$EXEEXT"
802 # If this check fails (i.e. the make succeeds), then the installed library
803 # was used, which is wrong.
804 AT_CHECK([$as_unset LIBTOOL; $as_unset LIBTOOLIZE; $MAKE hell$EXEEXT libhello_la_OBJECTS=hello.lo || (exit 1)],
805 [1], [ignore], [ignore])
814 AT_SETUP([linking with long file names])
818 AT_DATA([Makefile.am],
819 [[AUTOMAKE_OPTIONS = no-dependencies foreign
820 ACLOCAL_AMFLAGS = -I m4
822 # Build a libtool library, libhello.la for installation in libdir.
823 lib_LTLIBRARIES = libhello.la
824 libhello_la_SOURCES = longer_file_name_hello.c longer_file_name_foo.c longer_file_name_foo2.c
825 libhello_la_LIBADD = $(LIBM)
826 libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
827 libhello_la_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_LIBHELLO
829 include_HEADERS = foo.h
832 BUILD_helldl = helldl
837 bin_PROGRAMS = hell hell_static $(BUILD_helldl)
839 # Build hell from longer_file_name_main.c and libhello.la
840 hell_SOURCES = longer_file_name_main.c
841 hell_LDADD = libhello.la
843 # Create a statically linked version of hell.
844 hell_static_SOURCES = longer_file_name_main.c
845 hell_static_LDADD = libhello.la
846 hell_static_LDFLAGS = $(STATIC)
850 # Create a version of hell that does a preloaded dlopen.
851 helldl_SOURCES = longer_file_name_dlmain.c
852 helldl_LDFLAGS = -export-dynamic -dlpreopen libhello.la
853 helldl_DEPENDENCIES = libhello.la
857 # Create a script that says that -dlopen is not supported.
859 helldl helldl$(EXEEXT):
861 echo '#! /bin/sh' > $@
862 echo 'echo sorry, -dlopen is unsupported' >> $@
867 libtool: $(LIBTOOL_DEPS)
868 $(SHELL) ./config.status --recheck
872 [[#include <config.h>
879 printf ("Welcome to GNU Hell!\n");
881 /* Try assigning to the nothing variable. */
884 /* Just call the functions and check return values. */
885 if (foo () != FOO_RET)
888 if (foo2 () != FOO_RET)
891 if (hello () != HELLO_RET)
902 /* At some point, cygwin will stop defining __CYGWIN32__, but b19 and
903 * earlier do not define __CYGWIN__. This snippet allows us to check
904 * for __CYGWIN__ reliably for both current, old, and (probable) future
913 #if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
914 # ifdef BUILDING_LIBHELLO
916 # define LIBHELLO_SCOPE extern __declspec (dllexport)
919 # define LIBHELLO_SCOPE extern __declspec (dllimport)
922 #ifndef LIBHELLO_SCOPE
923 # define LIBHELLO_SCOPE extern
926 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
927 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
928 /* DATA imports from DLLs on WIN32 can't be const, because runtime
929 relocations are performed -- see ld's documentation on pseudo-relocs. */
930 # define LT_DLSYM_CONST
931 #elif defined __osf__
932 /* This system does not cope well with relocations in const data. */
933 # define LT_DLSYM_CONST
935 # define LT_DLSYM_CONST const
938 /* Silly constants that the functions return. */
939 #define HELLO_RET 0xe110
940 #define FOO_RET 0xf00
949 LIBHELLO_SCOPE int nothing;
959 [[#include <config.h>
966 printf ("foo2 cos (0.0) = %g\n", (double) cos ((double) 0.0));
971 LT_AT_HOST_DATA([expout],
972 [[Welcome to GNU Hell!
975 ** This is not GNU Hello. There is no built-in mail reader. **
978 for file in dlmain.c foo.c foo2.c hello.c main.c; do
979 mv $file longer_file_name_$file