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'. 11m4_defun([_LT_LANG_D_CONFIG], 12[AC_REQUIRE([AC_PROG_GDC])dnl 13AC_LANG_SAVE 14 15# Source file extension for D test sources. 16ac_ext=d 17 18# Object file extension for compiled D test sources. 19objext=o 20_LT_TAGVAR(objext, $1)=$objext 21 22# Code to be used in simple compile tests 23lt_simple_compile_test_code="\ 24 module object; 25 shared int some_variable = 0; 26" 27 28# Code to be used in simple link tests 29lt_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. 42lt_save_CC=$CC 43lt_save_CFLAGS=$CFLAGS 44lt_save_GCC=$GCC 45GCC=yes 46CC=${GDC-"gdc"} 47CFLAGS=$GDCFLAGS 48compiler=$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... 64if 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) 73fi 74 75AC_LANG_RESTORE 76 77GCC=$lt_save_GCC 78CC=$lt_save_CC 79CFLAGS=$lt_save_CFLAGS 80])# _LT_LANG_D_CONFIG 81