mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2024-12-12 13:42:21 +00:00
- Added configure test for -ldl
- Using HAVE_DLOPEN in source files
This commit is contained in:
parent
791d886807
commit
76847ab8a3
8 changed files with 106 additions and 48 deletions
23
configure.in
23
configure.in
|
@ -25,7 +25,7 @@ AC_PROG_CC
|
|||
AC_PROG_RANLIB
|
||||
#AC_PROG_LIBTOOL
|
||||
|
||||
# Checks for libraries.
|
||||
dnl Checks for libraries.
|
||||
#AC_CHECK_LIB(GL, glBegin)
|
||||
# FIXME: Replace `main' with a function in `-lX11':
|
||||
#AC_CHECK_LIB(X11, [main])
|
||||
|
@ -59,16 +59,29 @@ AC_HEADER_TIME
|
|||
AC_STRUCT_TM
|
||||
AC_TYPE_UID_T
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_ERROR_AT_LINE
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
dnl -----------------------------
|
||||
dnl Checks for library functions.
|
||||
dnl -----------------------------
|
||||
|
||||
#AC_FUNC_ERROR_AT_LINE
|
||||
#AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_MMAP
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_STAT
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS([bzero floor getcwd gethostbyname getmntent getpagesize gettimeofday memmove memset mkdir munmap pow putenv select socket sqrt strcasecmp strchr strdup strerror strrchr strstr])
|
||||
#AC_CHECK_FUNCS([bzero floor getcwd gethostbyname getmntent getpagesize gettimeofday memmove memset mkdir munmap pow putenv select socket sqrt strcasecmp strchr strdup strerror strrchr strstr])
|
||||
AC_CHECK_FUNCS(dlopen)
|
||||
|
||||
DL_LIBS=""
|
||||
if test "x$ac_cv_func_dlopen" != "xyes"; then
|
||||
AC_CHECK_LIB(dl,
|
||||
dlopen,
|
||||
AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have the dlopen function.]) DL_LIBS="-ldl"
|
||||
)
|
||||
fi
|
||||
AC_SUBST(DL_LIBS)
|
||||
|
||||
AS="$CC"
|
||||
ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES)"
|
||||
|
|
|
@ -99,7 +99,7 @@ ref_softsdl_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_sdl.c
|
|||
|
||||
AM_CFLAGS = -Wall -Werror -pipe -I/usr/X11R6/include $(shell sdl-config --cflags) -DOPENGL -fPIC
|
||||
|
||||
quake2_LDFLAGS = -lm -ldl -lpthread
|
||||
quake2_LDFLAGS = -lm -lpthread @DL_LIBS@
|
||||
|
||||
ref_glx_so_LDFLAGS = -shared
|
||||
ref_glx_so_LDADD = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lGL
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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
|
||||
* of the License, 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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
|
||||
of the License, 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
/*
|
||||
** GLW_IMP.C
|
||||
**
|
||||
|
@ -31,14 +33,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/vt.h>
|
||||
|
||||
/* not needed
|
||||
#ifdef HAVE_SYS_VT_H
|
||||
# include <sys/vt.h>
|
||||
#endif
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "gl_local.h"
|
||||
#include "keys.h"
|
||||
|
|
47
src/gl_glx.c
47
src/gl_glx.c
|
@ -1,22 +1,24 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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
|
||||
* of the License, 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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
|
||||
of the License, 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
/*
|
||||
** GLW_IMP.C
|
||||
**
|
||||
|
@ -31,6 +33,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -39,7 +45,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "gl_local.h"
|
||||
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -49,7 +53,9 @@
|
|||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#include <dlfcn.h>
|
||||
#ifdef HAVE_DLOPEN
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
/* merged from sys_bsd.c -- jaq */
|
||||
#ifndef RTLD_NOW
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
** QGL_Shutdown() - unloads libraries, NULLs function pointers
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <float.h>
|
||||
|
||||
|
@ -46,7 +50,9 @@
|
|||
//#include <GL/glx.h>
|
||||
//#include <GL/fxmesa.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
#ifdef HAVE_DLOPEN
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
/* merged in from qgl_irix.c -- jaq
|
||||
* irix used log_fp instead of glw_state.log_fp for the fprintf calls
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <sys/wait.h>
|
||||
#include <stdio.h>
|
||||
/* merged in from snd_bsd.c -- jaq */
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/soundcard.h>
|
||||
#else /* bsd */
|
||||
|
|
10
src/vid_so.c
10
src/vid_so.c
|
@ -23,13 +23,21 @@
|
|||
// is used for both the software and OpenGL rendering versions of the
|
||||
// Quake refresh engine.
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
/* merged in from irix/vid_so.c -- jaq */
|
||||
#ifdef __sgi
|
||||
#define SO_FILE "/etc/quake2.conf"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dlfcn.h> // ELF dl loader
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
# include <dlfcn.h> // ELF dl loader
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
|
Loading…
Reference in a new issue