Debian Codegraph @

libphobos/m4/libtool.m4

raw
1 #
2 # Minimal libtool support for the D language.
3 # Adapted from the Go language support files.
4 #
5
6 # _LT_LANG_D_CONFIG([TAG])
7 # --------------------------
8 # Ensure that the configuration variables for the GNU D compiler
9 # are suitably defined. These variables are subsequently used by _LT_CONFIG
10 # to write the compiler configuration to `libtool'.
11 m4_defun([_LT_LANG_D_CONFIG],
12 [AC_REQUIRE([AC_PROG_GDC])dnl
13 AC_LANG_SAVE
14
15 # Source file extension for D test sources.
16 ac_ext=d
17
18 # Object file extension for compiled D test sources.
19 objext=o
20 _LT_TAGVAR(objext, $1)=$objext
21
22 # Code to be used in simple compile tests
23 lt_simple_compile_test_code="\
24 module object;
25 shared int some_variable = 0;
26 "
27
28 # Code to be used in simple link tests
29 lt_simple_link_test_code="\
30 module object;
31 extern(C) int main() { return 0; }
32 "
33
34 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
35 _LT_TAG_COMPILER
36
37 # save warnings/boilerplate of simple test code
38 _LT_COMPILER_BOILERPLATE
39 _LT_LINKER_BOILERPLATE
40
41 # Allow CC to be a program name with arguments.
42 lt_save_CC=$CC
43 lt_save_CFLAGS=$CFLAGS
44 lt_save_GCC=$GCC
45 GCC=yes
46 CC=${GDC-"gdc"}
47 CFLAGS=$GDCFLAGS
48 compiler=$CC
49 _LT_TAGVAR(compiler, $1)=$CC
50 _LT_TAGVAR(LD, $1)=$CC
51 _LT_CC_BASENAME([$compiler])
52
53 # GDC did not exist at the time GCC didn't implicitly link libc in.
54 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55
56 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
57 _LT_TAGVAR(reload_flag, $1)=$reload_flag
58 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
59
60 ## CAVEAT EMPTOR:
61 ## There is no encapsulation within the following macros, do not change
62 ## the running order or otherwise move them around unless you know exactly
63 ## what you are doing...
64 if test -n "$compiler"; then
65 _LT_COMPILER_NO_RTTI($1)
66 _LT_COMPILER_PIC($1)
67 _LT_COMPILER_C_O($1)
68 _LT_COMPILER_FILE_LOCKS($1)
69 _LT_LINKER_SHLIBS($1)
70 _LT_LINKER_HARDCODE_LIBPATH($1)
71
72 _LT_CONFIG($1)
73 fi
74
75 AC_LANG_RESTORE
76
77 GCC=$lt_save_GCC
78 CC=$lt_save_CC
79 CFLAGS=$lt_save_CFLAGS
80 ])# _LT_LANG_D_CONFIG