configure: use LIB_EXT rather than hardcoded .so
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 8 Mar 2014 19:48:04 +0000 (19:48 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 11 Mar 2014 12:50:43 +0000 (12:50 +0000)
Some platforms different library extension - dll, dylib, a.
Honor that when we are creating the required links.

Rename LIB_EXTENSION to LIB_EXT while we're here.

With libglapi linking aside, building classic drivers on
non-linux platforms should be possible now.

v2: Resolve conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
configure.ac
install-gallium-links.mk
install-lib-links.mk
src/glx/apple/Makefile
src/mesa/drivers/dri/Makefile.am

index 6141a5493e61a36c85a4eb035a957c1435b9f715..5e1d09166ec7c677d1c1f5c23868420e403ce147 100644 (file)
@@ -320,19 +320,22 @@ dnl
 dnl library names
 dnl
 if test "$enable_static" = yes; then
-    LIB_EXTENSION='a'
+    LIB_EXT='a'
 else
     case "$host_os" in
     darwin* )
-        LIB_EXTENSION='dylib' ;;
+        LIB_EXT='dylib' ;;
     cygwin* )
-        LIB_EXTENSION='dll' ;;
+        LIB_EXT='dll' ;;
     aix* )
-        LIB_EXTENSION='a' ;;
+        LIB_EXT='a' ;;
     * )
-        LIB_EXTENSION='so' ;;
+        LIB_EXT='so' ;;
     esac
 fi
+
+AC_SUBST([LIB_EXT])
+
 AC_ARG_WITH([gl-lib-name],
   [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
     [specify GL library name @<:@default=GL@:>@])],
index debfe6c0a80f8f45cfee2f77dcc7fd38a33d5e52..49264639e708905d649748e9d52d8949e8dddc4b 100644 (file)
@@ -10,10 +10,10 @@ all-local : .libs/install-gallium-links
                link_dir=$(top_builddir)/$(LIB_DIR)/egl;        \
        fi;                                                     \
        $(MKDIR_P) $$link_dir;                                  \
-       file_list=$(dri_LTLIBRARIES:%.la=.libs/%.so*);          \
-       file_list+=$(vdpau_LTLIBRARIES:%.la=.libs/%.so*);       \
-       file_list+=$(egl_LTLIBRARIES:%.la=.libs/%.so*);         \
-       file_list+=$(lib_LTLIBRARIES:%.la=.libs/%.so*);         \
+       file_list=$(dri_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*);  \
+       file_list+=$(vdpau_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
+       file_list+=$(egl_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
+       file_list+=$(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
        for f in $$file_list; do                                \
                if test -h .libs/$$f; then                      \
                        cp -d $$f $$link_dir;                   \
index 9dd4c30d47c3bad72f8a9bfe0e9b590d29db83af..2707eb8834b461e797255fdf54109e780d52a797 100644 (file)
@@ -5,7 +5,7 @@ all-local : .libs/install-mesa-links
 
 .libs/install-mesa-links : $(lib_LTLIBRARIES)
        $(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR);       \
-       for f in $(lib_LTLIBRARIES:%.la=.libs/%.so*); do        \
+       for f in $(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); do \
                if test -h .libs/$$f; then                      \
                        cp -d $$f $(top_builddir)/$(LIB_DIR);   \
                else                                            \
index 39cfec3ad6bc1f81c2dbe9d11c30f126b730eae8..91a72189253bb73929d8192130166ca754e27086 100644 (file)
@@ -23,7 +23,7 @@ RM=rm
 #The directory with the final binaries.
 BUILD_DIR=builds
 
-default: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXTENSION)
+default: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
 
 SOURCES = \
        apple_cgl.c \
@@ -88,10 +88,10 @@ INCLUDES = -I. -Iinclude -I..\
 
 ##### TARGETS #####
 
-default: depend $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXTENSION)
+default: depend $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
 
 # Make libGL
-$(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXTENSION):  $(OBJECTS) $(GLAPI_LIB) Makefile
+$(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT):  $(OBJECTS) $(GLAPI_LIB) Makefile
        $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
                -major 1 -minor 2 $(MKLIB_OPTIONS) \
                -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
@@ -114,7 +114,7 @@ install_headers: include/GL/gl.h
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
        $(INSTALL) -m 644 include/GL/gl.h $(DESTDIR)$(INSTALL_DIR)/include/GL
 
-install_libraries: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXTENSION)
+install_libraries: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
        $(MAKE) -C $(TOP)/src/mesa install-libgl
 
 install: install_libraries
index b0d0a1c6d212f751a1b436e7a1ea1f02c8ced304..187e4789a55db4aad2bf51b8c08c8f8ddc8c1f46 100644 (file)
@@ -9,37 +9,37 @@ SUBDIRS+=common
 if HAVE_I915_DRI
 SUBDIRS += i915
 MEGADRIVERS_DEPS += i915/libi915_dri.la
-MEGADRIVERS += i915_dri.so
+MEGADRIVERS += i915_dri.@LIB_EXT@
 endif
 
 if HAVE_I965_DRI
 SUBDIRS += i965
 MEGADRIVERS_DEPS += i965/libi965_dri.la
-MEGADRIVERS += i965_dri.so
+MEGADRIVERS += i965_dri.@LIB_EXT@
 endif
 
 if HAVE_NOUVEAU_DRI
 SUBDIRS += nouveau
 MEGADRIVERS_DEPS += nouveau/libnouveau_dri.la
-MEGADRIVERS += nouveau_vieux_dri.so
+MEGADRIVERS += nouveau_vieux_dri.@LIB_EXT@
 endif
 
 if HAVE_R200_DRI
 SUBDIRS += r200
 MEGADRIVERS_DEPS += r200/libr200_dri.la
-MEGADRIVERS += r200_dri.so
+MEGADRIVERS += r200_dri.@LIB_EXT@
 endif
 
 if HAVE_RADEON_DRI
 SUBDIRS += radeon
 MEGADRIVERS_DEPS += radeon/libradeon_dri.la
-MEGADRIVERS += radeon_dri.so
+MEGADRIVERS += radeon_dri.@LIB_EXT@
 endif
 
 if HAVE_SWRAST_DRI
 SUBDIRS += swrast
 MEGADRIVERS_DEPS += swrast/libswrast_dri.la
-MEGADRIVERS += swrast_dri.so
+MEGADRIVERS += swrast_dri.@LIB_EXT@
 endif
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -68,21 +68,21 @@ dri_LTLIBRARIES = mesa_dri_drivers.la
 # Add a link to allow setting LD_LIBRARY_PATH/LIBGL_DRIVERS_PATH to /lib of the build tree.
 all-local: mesa_dri_drivers.la
        $(AM_V_at)$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
-       $(AM_V_GEN)ln -f .libs/mesa_dri_drivers.so \
-                        $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so;
+       $(AM_V_GEN)ln -f .libs/mesa_dri_drivers.@LIB_EXT@ \
+                        $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.@LIB_EXT@;
        $(AM_V_GEN)for i in $(MEGADRIVERS); do \
-               ln -f $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so \
+               ln -f $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.@LIB_EXT@ \
                      $(top_builddir)/$(LIB_DIR)/$$i; \
        done;
 
 # hardlink each megadriver instance, but don't actually have
-# mesa_dri_drivers.so in the set of final installed files.
+# mesa_dri_drivers.@LIB_EXT@ in the set of final installed files.
 install-data-hook:
        for i in $(MEGADRIVERS); do \
-               ln -f $(DESTDIR)$(dridir)/mesa_dri_drivers.so \
+               ln -f $(DESTDIR)$(dridir)/mesa_dri_drivers.@LIB_EXT@ \
                      $(DESTDIR)$(dridir)/$$i; \
        done;
-       $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.so
+       $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.@LIB_EXT@
        $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.la
 
 endif