libtool-patches
[Top][All Lists]
Advanced

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

Remove -fPIC -DPIC under DJGPP


From: Laurynas Biveinis
Subject: Remove -fPIC -DPIC under DJGPP
Date: Wed, 13 Dec 2000 23:03:16 +0100

Hello,

libtool from multi-language branch uses -fPIC -DPIC flags if libtool
is called with -prefer-pic, even if system does not support any kind
shared libraries or PIC code at all. This might be unnecessarry or 
even harmful, so I've made a patch which disables those flags for DJGPP.

Please CC on replies,
Laurynas


2000-12-13  Laurynas Biveinis  <address@hidden>

        * ltcf-c.sh: clear ac_cv_prog_cc_pic for DJGPP. Do not add
        '-DPIC' to ac_cv_prog_cc_pic for DJGPP.
        * ltcf-cxx.sh: likewise.
        * ltcf-gcj.sh: likewise.
        * ltconfig.sh: fix typo.

Index: ltcf-c.sh
===================================================================
RCS file: /home/cvs/libtool/Attic/ltcf-c.sh,v
retrieving revision 1.1.2.18
diff -u -r1.1.2.18 ltcf-c.sh
--- libtool.my/ltcf-c.sh        2000/11/11 13:42:59     1.1.2.18
+++ libtool.my/ltcf-c.sh        2000/12/13 20:33:02
@@ -546,6 +546,10 @@
       # we not sure about C++ programs.
       ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
       ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      ac_cv_prog_cc_pic=
+      ;;
     cygwin* | mingw* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
@@ -640,7 +644,16 @@
       ;;
     esac
   fi
-  ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
+  case "$host_os" in
+      # Platforms which do not suport PIC and -DPIC is meaningless
+      # on them:
+      *djgpp*)
+        ac_cv_prog_cc_pic=
+        ;;
+      *)
+        ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
+        ;;
+  esac
 fi

 need_lc=yes
Index: ltcf-cxx.sh
===================================================================
RCS file: /home/cvs/libtool/Attic/ltcf-cxx.sh,v
retrieving revision 1.1.2.24
diff -u -r1.1.2.24 ltcf-cxx.sh
--- libtool.my/ltcf-cxx.sh      2000/10/30 22:48:18     1.1.2.24
+++ libtool.my/ltcf-cxx.sh      2000/12/13 20:33:09
@@ -587,6 +587,10 @@
     # we not sure about C++ programs.
     ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
     ;;
+  *djgpp*)
+    # DJGPP does not support shared libraries at all
+    ac_cv_prog_cc_pic=
+    ;;
   cygwin* | mingw* | os2*)
     # This hack is so that the source file can tell whether it is being
     # built for inclusion in a dll (and should export symbols for example).
@@ -778,7 +782,17 @@
       ;;
   esac
 fi
-ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
+
+case "$host_os" in
+    # Platforms which do not suport PIC and -DPIC is meaningless
+    # on them:
+    *djgpp*)
+      ac_cv_prog_cc_pic=
+      ;;
+    *)
+      ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
+      ;;
+esac


 # Figure out "hidden" C++ library dependencies from verbose
Index: ltcf-gcj.sh
===================================================================
RCS file: /home/cvs/libtool/Attic/ltcf-gcj.sh,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 ltcf-gcj.sh
--- libtool.my/ltcf-gcj.sh      2000/11/01 00:18:34     1.1.2.9
+++ libtool.my/ltcf-gcj.sh      2000/12/13 20:33:14
@@ -546,6 +546,10 @@
       # we not sure about C++ programs.
       ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
       ;;
+    *djgpp*)
+      # DJGPP does not suppot shared libraries at all
+      ac_cv_prog_cc_pic=
+      ;;
     cygwin* | mingw* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
Index: ltconfig.in
===================================================================
RCS file: /home/cvs/libtool/Attic/ltconfig.in,v
retrieving revision 1.246.2.35
diff -u -r1.246.2.35 ltconfig.in
--- libtool.my/ltconfig.in      2000/09/30 05:27:52     1.246.2.35
+++ libtool.my/ltconfig.in      2000/12/13 20:33:36
@@ -1272,7 +1272,7 @@
   ;;
 esac

-# Handle CRLF in mingw too chain
+# Handle CRLF in mingw tool chain
 opt_cr=
 case "$host_os" in
 mingw*)



reply via email to

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