libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool 1.4.2 and OS/2


From: Andreas Buening
Subject: libtool 1.4.2 and OS/2
Date: Thu, 20 Dec 2001 16:42:24 +0100

Hello!

I made a few changes to libtool.m4 to support .a libraries
as well as .lib libraries for OS/2 (support for .lib
libraries was missing). I also removed a bug in the
determination of PATH_SEPARATOR. Additionally I use
an environment variable $EMX_DESCRIPTION that is used for
the internal library description string in the module definition
file (some people want this to have full control over the dll).
Further I changed a few lines in libltdl/ltdl.h and
libltdl/ltdl.c so that I could compile libtool. However, I don't
know, whether the code really works or what it is doing. ;-) 
I hope the changes I made are (more or less) obvious.


****************************************

--- old/libtool-1.4.2/libtool.m4        Tue Sep 11 03:16:00 2001
+++ gnu/libtool-1.4.2/libtool.m4        Sun Dec 16 19:56:34 2001
@@ -367,7 +367,7 @@
 if test "X${PATH_SEPARATOR+set}" != Xset; then
   UNAME=${UNAME-`uname 2>/dev/null`}
   case X$UNAME in
-    *-DOS) lt_cv_sys_path_separator=';' ;;
+    *-DOS | *OS/2) lt_cv_sys_path_separator=';' ;;
     *)     lt_cv_sys_path_separator=':' ;;
   esac
   PATH_SEPARATOR=$lt_cv_sys_path_separator
@@ -1684,11 +1684,13 @@
     ;;
 
   os2*)
+    if test "$ac_objext" = "obj"; then libext=lib; fi
     hardcode_libdir_flag_spec='-L$libdir'
     hardcode_minus_L=yes
     allow_undefined_flag=unsupported
-    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > 
$output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> 
$output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " 
SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> 
$output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC 
-Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags 
$output_objdir/$libname.def'
-    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a 
$output_objdir/$libname.def'
+#   Some people want to have control over the library's description, therefore 
I use $EMX_DESCRIPTION for that
+    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > 
$output_objdir/$libname.def~$echo "DESCRIPTION \"${EMX_DESCRIPTION-$libname}\"" 
>> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo 
" SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> 
$output_objdir/$libname.def~emxexp -u $libobjs >> 
$output_objdir/$libname.def~$CC -Zdll $CFLAGS $LDFLAGS -o $lib $libobjs 
$deplibs $compiler_flags $output_objdir/$libname.def'
+    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.$libext 
$output_objdir/$libname.def'
     ;;
 
   osf3*)
@@ -2218,8 +2220,12 @@
 os2*)
   libname_spec='$name'
   need_lib_prefix=no
-  library_names_spec='$libname.dll $libname.a'
-  dynamic_linker='OS/2 ld.exe'
+  library_names_spec='$libname.dll $libname.$libext'
+  if test "$ac_objext" = "o"; then
+    dynamic_linker='OS/2 ld.exe'
+  else
+    dynamic_linker='OS/2 link386.exe'
+  fi
   shlibpath_var=LIBPATH
   ;;
 
@@ -2593,7 +2599,7 @@
 libext="$libext"
 
 # Executable file suffix (normally "").
-exeext="$exeext"
+exeext="$ac_exeext"
 
 # Additional compiler flags for building library objects.
 pic_flag=$lt_pic_flag

****************************************

--- old/libtool-1.4.2/libltdl/ltdl.c    Tue Sep 11 02:02:06 2001
+++ gnu/libtool-1.4.2/libltdl/ltdl.c    Sun Dec 16 19:12:28 2001
@@ -29,6 +29,10 @@
 #  include <config.h>
 #endif

+#ifdef __EMX__
+#include<sys/types.h>
+#endif
+
 #if HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
@@ -100,7 +104,7 @@
 /* --- WINDOWS SUPPORT --- */


-#ifdef DLL_EXPORT
+#if defined DLL_EXPORT && !defined __EMX__
 #  define LT_GLOBAL_DATA       __declspec(dllexport)
 #else
 #  define LT_GLOBAL_DATA
@@ -108,7 +112,7 @@

 /* fopen() mode flags for reading a text file */
 #undef LT_READTEXT_MODE
-#ifdef __WINDOWS__
+#if defined __WINDOWS__ || defined __EMX__
 #  define LT_READTEXT_MODE "rt"
 #else
 #  define LT_READTEXT_MODE "r"

****************************************

--- old/libtool-1.4.2/libltdl/ltdl.h    Sun Sep  2 18:29:02 2001
+++ gnu/libtool-1.4.2/libltdl/ltdl.h    Sun Dec 16 19:07:46 2001
@@ -111,7 +111,7 @@
 #  endif
 #endif

-#ifdef __WINDOWS__
+#if defined __WINDOWS__ || defined __EMX__
 #  ifndef __CYGWIN__
 /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
    separator when it is set. */

****************************************

bye,
Andreas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]