[AD] New shared object naming conventions

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


The attached patch modifies allegro5-config to reflect the new shared
object naming convention that I'm told by kazzmir we will be using.
Note that the CMake files are still using the old naming convention.

-- 
Regards,
Ryan Patterson <mailto:cgamesplay@xxxxxxxxxx>
Index: scons/unix.scons
===================================================================
--- scons/unix.scons	(revision 11076)
+++ scons/unix.scons	(working copy)
@@ -257,8 +257,14 @@
     replaces[ '@includedir@' ] = os.path.join(prefix, "include")
     replaces[ '@libdir@' ] = os.path.join(prefix, "lib")
     replaces[ '@bindir@' ] = os.path.join(prefix, "bin")
-    replaces[ '@LINK_WITH_STATIC_LIBS@' ] = 'no'
-    replaces[ '@LIB_TO_LINK@' ] = 'alleg'
+    if context.isStatic():
+    	replaces['@LIB_LINKAGE@'] = '-static'
+    else:
+    	replaces['@LIB_LINKAGE@'] = ''
+    if context.isDebug():
+    	replaces['@LIB_TYPE@'] = '-debug'
+    else:
+    	replaces['@LIB_TYPE@'] = ''
     ldflags = ''
     if supportModules():
         ldflags = '-Wl,--export-dynamic'
Index: misc/allegro5-config.in
===================================================================
--- misc/allegro5-config.in	(revision 11076)
+++ misc/allegro5-config.in	(working copy)
@@ -20,8 +20,8 @@
 lib_path=@libdir@
 bin_path=@bindir@
 
-static_libs=@LINK_WITH_STATIC_LIBS@
-lib_type=@LIB_TO_LINK@
+lib_linkage=@LIB_LINKAGE@
+lib_type=@LIB_TYPE@
 
 accepts_frameworks=no
 
@@ -38,25 +38,25 @@
 Usage: allegro5-config [OPTIONS] [LIBRARIES]
 
 Options:
-	--prefix[=DIR]
-	--exec-prefix[=DIR]
-	--version[=VERSION]
-	--cflags
-	--cppflags
-	--libs
-	--static
-	--shared
+        --prefix[=DIR]
+        --exec-prefix[=DIR]
+        --version[=VERSION]
+        --cflags
+        --cppflags
+        --libs
+        --static
+        --shared
 EOF
    if test "$accepts_frameworks" = "yes"; then
-      echo "	--frameworks"
+      echo "        --frameworks"
    fi
    cat <<EOF
-	--env
+        --env
 
 Libraries:
-	release
-	debug
-	profile
+        release
+        debug
+        profile
 EOF
    exit $1
 }
@@ -74,89 +74,96 @@
    case $1 in
 
       --prefix=*)
-	 prefix=$optarg
-	 if test $exec_prefix_set = no; then
-	    exec_prefix=$optarg
-	 fi
+         prefix=$optarg
+         if test $exec_prefix_set = no; then
+            exec_prefix=$optarg
+         fi
       ;;
 
       --prefix)
-	 echo_prefix=yes
+         echo_prefix=yes
       ;;
 
       --exec-prefix=*)
-	 exec_prefix=$optarg
-	 exec_prefix_set=yes
+         exec_prefix=$optarg
+         exec_prefix_set=yes
       ;;
 
       --exec-prefix)
-	 echo_exec_prefix=yes
+         echo_exec_prefix=yes
       ;;
 
       --version=*)
-	 version=$optarg
+         version=$optarg
       ;;
 
       --version)
-	 echo $version
+         echo $version
       ;;
 
       --cflags)
-	 echo_cflags=yes
+         echo_cflags=yes
       ;;
 
       --cppflags)
-	 echo_cppflags=yes
+         echo_cppflags=yes
       ;;
 
       --libs)
-	 echo_libs=yes
+         echo_libs=yes
       ;;
 
       --static)
-	 static_libs=yes
-	 echo_libs=yes
+         lib_linkage=-static
+         echo_libs=yes
       ;;
 
       --shared)
-	 static_libs=no
-	 echo_libs=yes
+         lib_linkage=
+         echo_libs=yes
       ;;
 
       --frameworks)
-	 if test "$accepts_frameworks" = "yes"; then
-	    echo_frameworks=yes
-	 else
-	    usage 1 1>&2
-	 fi
+         if test "$accepts_frameworks" = "yes"; then
+            echo_frameworks=yes
+         else
+            usage 1 1>&2
+         fi
       ;;
 
       --env)
-	 echo_env=yes
+         echo_env=yes
       ;;
 
       release)
-	 lib_type=alleg
+         lib_type=
       ;;
 
       debug)
-	 allegro_cflags=-DDEBUGMODE $allegro_cflags
-	 allegro_cppflags=-DDEBUGMODE $allegro_cppflags
-	 lib_type=allegd
+         allegro_cflags="-DDEBUGMODE $allegro_cflags"
+         allegro_cppflags="-DDEBUGMODE $allegro_cppflags"
+         lib_type=-debug
       ;;
 
       profile)
-	 lib_type=allegp
+         lib_type=-profile
       ;;
 
       *)
-	 usage 1 1>&2
+         usage 1 1>&2
       ;;
 
    esac
    shift
 done
 
+# Check argument sanity
+if test "$lib_type" = "-profile" && test "$lib_linkage" = "-static"; then
+   echo "There is no static-linked profiling configuration." >&2
+   exit 1
+fi
+
+# Perform actions
 if test "$echo_prefix" = "yes"; then
    echo $prefix
 fi
@@ -183,11 +190,7 @@
 
 if test "$echo_libs" = "yes"; then
    libdirs=-L$lib_path
-   if test "$static_libs" = "yes"; then
-      echo $libdirs $allegro_ldflags -l${lib_type}_s $allegro_libs
-   else
-      echo $libdirs $allegro_ldflags -l$lib_type-$version
-   fi
+   echo $libdirs $allegro_ldflags -lallegro$lib_linkage$lib_type-$version
 fi
 
 if test "$echo_frameworks" = "yes"; then


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/