Subject: Re: cp/mv/rm problems with .exe extension filenames
From: [email-masked] (Earnie Boyd)

25 Sep 1998 09:24:27 -0700
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: gw32 <[email-masked]>

Y'all make this too hard!!  

Easier would be to create a shell wrapper for cp, mv and rm.  

For an example take a look at the install script that I created for
the install process found in the archives and in
http://aquarius.franken.de/docs/develop/gnuwin32/GNUWin32.txt.

---Arne Glenstrup <[email-masked]> wrote:
>
> Hi,
> 
> 
> Has anybody found a REALLY good solution to this problem yet? I agree
> with Steven that Cygwin32 has a serious compatibility problem here:
lots
> of makefiles will break, i fear.
> 
> So here's what I have done in my case to circumvent the problem:
> 
> 1) Wrote an autoconf macro:
> 
> dnl MYMAC_SYS_EXE
> dnl ------------
> dnl
> dnl If the compiler generates foo.exe when instructed to generate foo,
> dnl set $exe to `.exe', else set $exe to `'
> 
> AC_DEFUN(MYMAC_SYS_EXE, [dnl
> AC_LANG_SAVE
> AC_LANG_CPLUSPLUS
>   AC_CACHE_CHECK([whether the C++ compiler (${CXX}) generates .exe
files],
>     mymac_cv_sys_exe,[dnl
> cat > conftest.$ac_ext <<EOF
> dnl This sometimes fails to find confdefs.h, for some reason.
> dnl [#]line __oline__ "[$]0"
> [#]line __oline__ "configure"
> #include "confdefs.h"
> int main() { return 0; }
> EOF
> mymac_cv_sys_exe=no
> if eval $ac_link; then
>   if test -f conftest.exe
>   then
>     mymac_cv_sys_exe=yes
>   fi
> fi
> rm -f conftest*]
> )
> if test $mymac_cv_sys_exe = yes
> then
>   exe='.exe'
> else
>   exe=
> fi
> AC_SUBST(exe)
> AC_LANG_RESTORE
> ])
> 
> 2) Added the following line to configure.in:
> 
> MYMAC_SYS_EXE
> 
> 3) In all Makefile.in files, shell commands to move executables, are
>    changed like this:
> 
>      FROM                                TO
>      ====                                ==
>      $(CXX) -o foo $(OBJ) foo.c          $(CXX) -o foo $(OBJ) foo.c
>      cp foo bar                          cp foo@exe@ bar@exe@
>      mv foo oldfoo                       mv foo@exe@ oldfoo@exe@
> 
>      $(CXX) -o hello.world hello.c       $(CXX) -o hello.world hello.c
>      cp hello.world hello.underworld     cp hello.world
hello.underworld
>      mv hello.world hello                mv hello.world hello@exe@
> 
>    Am I right in thinking that this zany .exe-stuff is only appended
to
>    executables without a dot in their name?
> 
> 4) And of course invoking autoconf and configure and makefiles in the
>    right order as usual.
> 
> 
> This seems right now to be my best bet for keeping things runnable on
> several platforms besides Cygwin32. Comments on better ideas or
> great mistakes in the above points are very welcome.
> 
> -- Arne
>
__________________________________________________________________________
> Arne John Glenstrup        | Windows 95: n.  32 bit extensions and a
      
> [email-masked]              |  graphical shell for a 16 bit patch to
an 8   
> http://www.diku.dk/~panic/ |  bit operating system originally coded
for a 4
>                               bit microprocessor, written by a 2 bit
company
>                               that can't stand 1 bit of competition.
> 
> 
> -
> For help on using this list (especially unsubscribing), send a
message to
> "[email-masked]" with one line of text: "help".
> 

==
-                \\||//
-----------o0O0--Earnie--0O0o------------
--        [email-masked]        --
-- http://freeyellow.com/members5/gw32 --
--------------ooo0O--O0ooo---------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".