diff --git a/Makefile b/Makefile index 040c797..0d36089 100644 --- a/Makefile +++ b/Makefile @@ -28,14 +28,8 @@ ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ## THE POSSIBILITY OF SUCH DAMAGE. -GLEW_DEST ?= /usr - include config/version -LIBDIR ?= $(GLEW_DEST)/lib -TARDIR = ../glew-$(GLEW_VERSION) -TARBALL = ../glew_$(GLEW_VERSION).tar.gz - SHELL = /bin/sh SYSTEM = $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;') SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1) @@ -46,9 +40,11 @@ else $(error "Platform '$(SYSTEM)' not supported") endif -ifeq (undefined, $(origin SHARED_OBJ_EXT)) -SHARED_OBJ_EXT = o -endif +GLEW_DEST ?= /usr +LIBDIR ?= $(GLEW_DEST)/lib +SHARED_OBJ_EXT ?= o +TARDIR = ../glew-$(GLEW_VERSION) +TARBALL = ../glew_$(GLEW_VERSION).tar.gz AR = ar INSTALL = install diff --git a/auto/src/glew_head.h b/auto/src/glew_head.h index c69599b..0d8a67b 100644 --- a/auto/src/glew_head.h +++ b/auto/src/glew_head.h @@ -18,7 +18,7 @@ #define __GLEXT_H_ #define __gl_ATI_h_ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__MINGW32__) /* * GLEW does not include to avoid name space pollution. @@ -28,7 +28,7 @@ /* */ #ifndef APIENTRY #define GLEW_APIENTRY_DEFINED -# if defined(__CYGWIN__) || defined(__MINGW32__) +# if defined(__MINGW32__) # define APIENTRY __stdcall # elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) # define APIENTRY __stdcall @@ -37,14 +37,14 @@ # endif #endif #ifndef GLAPI -# if defined(__CYGWIN__) || defined(__MINGW32__) +# if defined(__MINGW32__) # define GLAPI extern # endif #endif /* */ #ifndef CALLBACK #define GLEW_CALLBACK_DEFINED -# if defined(__CYGWIN__) || defined(__MINGW32__) +# if defined(__MINGW32__) # define CALLBACK __attribute__ ((__stdcall__)) # elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) # define CALLBACK __stdcall @@ -81,7 +81,7 @@ typedef _W64 int ptrdiff_t; #endif #ifndef GLAPI -# if defined(__CYGWIN__) || defined(__MINGW32__) +# if defined(__MINGW32__) # define GLAPI extern # else # define GLAPI WINGDIAPI diff --git a/config/Makefile.cygming b/config/Makefile.cygming new file mode 100644 index 0000000..a39b24c --- /dev/null +++ b/config/Makefile.cygming @@ -0,0 +1,19 @@ +NAME = glew32 +CC = gcc -mno-cygwin +# use gcc for linking, with ld it does not work +LD = gcc -mno-cygwin +ifneq (undefined, $(origin GLEW_MX)) +CFLAGS.EXTRA = -DGLEW_MX +endif +CFLAGS.SO = -DGLEW_BUILD +#LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK) +LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) +LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32 +LDFLAGS.EXTRA = -L/mingw/lib +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) diff --git a/config/Makefile.cygwin b/config/Makefile.cygwin index a39b24c..c724e42 100644 --- a/config/Makefile.cygwin +++ b/config/Makefile.cygwin @@ -1,19 +1,21 @@ -NAME = glew32 -CC = gcc -mno-cygwin +NAME = GLEW +GLEW_DEST ?= /usr/X11R6 +CC = cc # use gcc for linking, with ld it does not work -LD = gcc -mno-cygwin +LD = cc ifneq (undefined, $(origin GLEW_MX)) CFLAGS.EXTRA = -DGLEW_MX endif -CFLAGS.SO = -DGLEW_BUILD -#LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK) -LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) -LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32 -LDFLAGS.EXTRA = -L/mingw/lib +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LIBDIR = $(GLEW_DEST)/lib +LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic WARN = -Wall -W POPT = -O2 -BIN.SUFFIX = .exe -LIB.SONAME = lib$(NAME).dll -LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib -LIB.SHARED = $(NAME).dll -LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a