2010-08-06 15:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* ChangeLog
  * include/harbour.hbx
  * src/rtl/Makefile
  + src/rtl/libname.prg
  + tests/libname.prg
    + Added HB_LIBNAME( <cDynLibName>[, <cDynLibDir> ] ) -> <cOSDynLibName>
      Serves to convert a raw dynlib name, f.e. "hbct" to OS specific
      notation, by adding platform specific extension, lib name prefix and
      optional directory

  * utils/hbmk2/hbmk2.prg
    ! Fixed dynlib prefix for symbian
This commit is contained in:
Viktor Szakats
2010-08-06 13:16:35 +00:00
parent 855cd11443
commit abfa725104
6 changed files with 145 additions and 2 deletions

View File

@@ -16,6 +16,20 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-08-06 15:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* ChangeLog
* include/harbour.hbx
* src/rtl/Makefile
+ src/rtl/libname.prg
+ tests/libname.prg
+ Added HB_LIBNAME( <cDynLibName>[, <cDynLibDir> ] ) -> <cOSDynLibName>
Serves to convert a raw dynlib name, f.e. "hbct" to OS specific
notation, by adding platform specific extension, lib name prefix and
optional directory
* utils/hbmk2/hbmk2.prg
! Fixed dynlib prefix for symbian
2010-08-06 14:35 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
* contrib/hbqt/qtgui/hbqtgui.hbc
@@ -2057,7 +2071,7 @@
DYNAMIC CHARADD
PROCEDURE Main()
LOCAL l := hb_libLoad( "hbct.dll" )
LOCAL l := hb_libLoad( hb_libName( "hbct" ) )
IF ! Empty( l )
QOUT( CHARADD( "abc", Chr( 1 ) ) )
ENDIF

View File

@@ -608,6 +608,7 @@ DYNAMIC HB_LIBERROR
DYNAMIC HB_LIBFREE
DYNAMIC HB_LIBGETFUNSYM
DYNAMIC HB_LIBLOAD
DYNAMIC HB_LIBNAME
DYNAMIC HB_MACROBLOCK
DYNAMIC HB_MATHERBLOCK
DYNAMIC HB_MATHERMODE

View File

@@ -227,6 +227,7 @@ PRG_SOURCES := \
hbi18n2.prg \
hbini.prg \
input.prg \
libname.prg \
listbox.prg \
memoedit.prg \
memvarbl.prg \

View File

@@ -0,0 +1,94 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* HB_LIBNAME()
*
* Copyright 2010 Viktor Szakats (harbour.01 syenar.hu)
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
FUNCTION hb_LibName( cLibName, cLibDir )
LOCAL cDir, cName, cExt
LOCAL cLibPrefix
LOCAL cLibExt
IF hb_isString( cLibName )
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__OS2 ) .OR. ;
defined( __PLATFORM__SYMBIAN )
cLibExt := ".dll"
#elif defined( __PLATFORM__DOS )
cLibExt := ""
#elif defined( __PLATFORM__DARWIN )
cLibExt := ".dylib"
#elif defined( __PLATFORM__HPUX )
cLibExt := ".sl"
#else
cLibExt := ".so"
#endif
#if ! defined( __PLATFORM__UNIX ) .OR. ;
defined( __PLATFORM__SYMBIAN )
cLibPrefix := ""
#else
cLibPrefix := "lib"
#endif
hb_FNameSplit( cLibName, @cDir, @cName, @cExt )
IF Empty( cDir ) .AND. hb_isString( cLibDir )
cDir := cLibDir
ENDIF
IF Empty( cExt )
cExt := cLibExt
ENDIF
RETURN hb_FNameMerge( cDir, cLibPrefix + cName, cExt )
ENDIF
RETURN ""

29
harbour/tests/libname.prg Normal file
View File

@@ -0,0 +1,29 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
*
* Copyright 2010 Viktor Szakats (harbour.01 syenar.hu)
* www - http://harbour-project.org
*
*/
#include "simpleio.ch"
PROCEDURE Main()
? hb_LibName( NIL )
? hb_LibName( "" )
? hb_LibName( "name" )
? hb_LibName( "name.ext" )
? hb_LibName( "name." )
? hb_LibName( "name.ext", NIL )
? hb_LibName( "dir\name.ext", NIL )
? hb_LibName( "name.ext", "mydir" )
? hb_LibName( "dir\name.ext", "mydir" )
? hb_LibName( "name.ext", "mydir\" )
? hb_LibName( "dir\name.ext", "mydir\" )
RETURN

View File

@@ -1244,7 +1244,11 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
OTHERWISE
aCOMPSUP := { "gcc" }
ENDCASE
cDynLibNamePrefix := "lib"
IF hbmk[ _HBMK_cPLAT ] == "symbian"
cDynLibNamePrefix := ""
ELSE
cDynLibNamePrefix := "lib"
ENDIF
DO CASE
CASE hbmk[ _HBMK_cPLAT ] == "vxworks"
l_aLIBHBGT := {}