mikmod-3.2.8/0000755000000000000000000000000013117573666011521 5ustar rootrootmikmod-3.2.8/Makefile.am0000644000000000000000000000032712350764324013546 0ustar rootrootAUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src pkgdata_DATA = mikmodrc EXTRA_DIST = mikmod.lsm mikmod.cfg $(pkgdata_DATA) \ dos os2 macosx win32 \ config.h.cmake CMakeLists.txt cmake mikmod-3.2.8/src/0000755000000000000000000000000013117572536012303 5ustar rootrootmikmod-3.2.8/src/mplayer.c0000644000000000000000000000777413040414034014116 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mplayer.c,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Threaded player functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(__OS2__)||defined(__EMX__) #define INCL_DOS #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "mplayer.h" #include "mthreads.h" #include "mconfig.h" #include "mutilities.h" extern MODULE *mf; #if LIBMIKMOD_VERSION >= 0x030200 static MP_DATA playdata; #endif static BOOL active = 0, paused = 1, use_threads = 0; static int volume = -1; #ifdef USE_THREADS static DEFINE_MUTEX(data); #endif static DEFINE_THREAD(updater,updater_mode); static void do_update(void) { #if LIBMIKMOD_VERSION >= 0x030200 int i; unsigned long cur_time; #endif BOOL locked = 0; MikMod_Update(); if (updater_mode == MTH_RUNNING) { MUTEX_LOCK(data); locked = 1; } if (volume>=0) { Player_SetVolume (volume); volume = -1; } paused = Player_Paused(); active = Player_Active(); #if LIBMIKMOD_VERSION >= 0x030200 if (mf) { if (!config.fakevolbars) { cur_time = Time1000(); for (i = 0; i < mf->numchn; i++) { playdata.vstatus[i].time = cur_time; playdata.vstatus[i].volamp = (Voice_RealVolume(Player_GetChannelVoice(i)) * playdata.vinfo[i].volume) >> 16; } } /* Query current voice status */ Player_QueryVoices(mf->numchn, playdata.vinfo); } #endif if (locked) MUTEX_UNLOCK(data); } #ifdef USE_THREADS #ifdef HAVE_PTHREAD static void* MP_updater(void *dummy) #else static void MP_updater(void *dummy) #endif { while (active && (updater_mode == MTH_RUNNING)) { do_update(); SLEEP(5); } updater_mode = MTH_NORUN; active = 0; paused = 1; #ifdef HAVE_PTHREAD return NULL; #else return; #endif } #endif /* Initialise the threads. Returns if threads are used. */ BOOL MP_Init (void) { #ifdef USE_THREADS static int firstcall = 1; if (firstcall) { firstcall = 0; use_threads = 1; if (!MikMod_InitThreads() || !INIT_MUTEX(data)) use_threads = 0; } #endif return use_threads; } /* Inits a new thread for a new song to be played */ void MP_Start (void) { MP_Init(); do_update(); #ifdef USE_THREADS if (use_threads) { updater_mode = MTH_RUNNING; use_threads = THREAD_START(updater, MP_updater, NULL); } #endif } /* MikMod_Update(), if threads are not used */ void MP_Update (void) { if (!use_threads) { do_update(); } } /* Removes the thread started by MP_Start() */ void MP_End (void) { if (updater_mode == MTH_RUNNING) THREAD_JOIN(updater,updater_mode); active = 0; paused = 1; } /* Wrapper for Player_Active() */ BOOL MP_Active (void) { return (active != 0); } /* Wrapper for Player_TogglePause() */ void MP_TogglePause (void) { Player_TogglePause(); paused = Player_Paused(); } /* Wrapper for Player_Paused() */ BOOL MP_Paused (void) { return (paused != 0); } /* Wrapper for Player_SetVolume() */ void MP_Volume (int vol) { MUTEX_LOCK(data); volume = vol; MUTEX_UNLOCK(data); } #if LIBMIKMOD_VERSION >= 0x030200 /* Returns a copy of the actual playdata */ void MP_GetData (MP_DATA *data) { MUTEX_LOCK(data); *data = playdata; MUTEX_UNLOCK(data); } #endif mikmod-3.2.8/src/Makefile.am0000644000000000000000000000217312350757564014346 0ustar rootroot## Process this file with automake to produce Makefile.in AM_CFLAGS = @LIBMIKMOD_CFLAGS@ bin_PROGRAMS = mikmod man_MANS = mikmod.1 mikmod_SOURCES = \ display.c marchive.c mikmod.c mlist.c mconfig.c mwindow.c mmenu.c \ mwidget.c mdialog.c mconfedit.c mutilities.c mplayer.c mlistedit.c \ rcfile.c noinst_HEADERS = \ display.h keys.h marchive.h mconfedit.h mconfig.h mdialog.h mlist.h \ mlistedit.h mmenu.h mplayer.h mthreads.h mutilities.h mwidget.h \ mwindow.h player.h rcfile.h EXTRA_mikmod_SOURCES = \ mfnmatch.c mgetopt.c mgetopt1.c musleep.c EXTRA_DIST = CMakeLists.txt \ dosvideo.inc os2video.inc winvideo.inc mfnmatch.h mgetopt.h $(man_MANS) mikmod_LDFLAGS = @LIBMIKMOD_LDADD@ mikmod_LDADD = @EXTRA_OBJ@ @LIBMIKMOD_LIBS@ @PLAYER_LIB@ mikmod_DEPENDENCIES = @EXTRA_OBJ@ mgetopt.o: $(srcdir)/mgetopt.c $(srcdir)/mgetopt.h $(COMPILE) -o $@ -c $(srcdir)/mgetopt.c mgetopt1.o: $(srcdir)/mgetopt1.c $(srcdir)/mgetopt.h $(COMPILE) -o $@ -c $(srcdir)/mgetopt1.c mfnmatch.o: $(srcdir)/mfnmatch.c $(srcdir)/mfnmatch.h $(COMPILE) -o $@ -c $(srcdir)/mfnmatch.c musleep.o: $(srcdir)/musleep.c $(COMPILE) -o $@ -c $(srcdir)/musleep.c mikmod-3.2.8/src/mlist.h0000644000000000000000000000565712255111204013600 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mlist.h,v 1.1.1.1 2004/01/16 02:07:37 raph Exp $ Playlist management functions ==============================================================================*/ #ifndef MLIST_H #define MLIST_H #include /* for BOOL and CHAR */ #define PL_CONT_NEXT (1) #define PL_CONT_PREV (2) #define PL_CONT_POS (3) #define PM_MODULE (1) /* Module repeatly */ #define PM_MULTI (2) /* PlayList repeatly */ #define PM_SHUFFLE (4) /* shuffle PlayList */ #define PM_RANDOM (8) /* PlayList in random order */ #define PL_IDENT "MikMod playlist\n" typedef struct { CHAR *file; CHAR *archive; int time; BOOL played; } PLAYENTRY; typedef struct { PLAYENTRY *entry; int length; int current; BOOL curr_deleted; int add_pos; } PLAYLIST; extern PLAYLIST playlist; BOOL PL_isPlaylistFilename(const CHAR *filename); void PL_InitList(PLAYLIST * pl); void PL_InitCurrent(PLAYLIST * pl); void PL_ClearList(PLAYLIST * pl); BOOL PL_CurrentDeleted(PLAYLIST * pl); int PL_GetCurrentPos(PLAYLIST * pl); PLAYENTRY *PL_GetCurrent(PLAYLIST * pl); PLAYENTRY *PL_GetEntry(PLAYLIST * pl, int number); int PL_GetLength(PLAYLIST * pl); void PL_SetTimeCurrent(PLAYLIST * pl, long sngtime); void PL_SetPlayedCurrent(PLAYLIST * pl); BOOL PL_DelEntry(PLAYLIST * pl, int number); BOOL PL_DelDouble(PLAYLIST * pl); void PL_Add(PLAYLIST * pl, const CHAR *file, const CHAR *arc, int time, BOOL played); void PL_StartInsert(PLAYLIST * pl, int pos); void PL_StopInsert(PLAYLIST * pl); BOOL PL_Load(PLAYLIST * pl, const CHAR *filename); BOOL PL_Save(PLAYLIST * pl, const CHAR *filename); char *PL_GetFilename(void); BOOL PL_LoadDefault(PLAYLIST * pl); BOOL PL_SaveDefault(PLAYLIST * pl); /* Get new playlist entry and change current accordingly */ BOOL PL_ContNext(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int mode); BOOL PL_ContPrev(PLAYLIST * pl, CHAR **retfile, CHAR **retarc); BOOL PL_ContPos(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int number); void PL_Sort(PLAYLIST * pl, int (*compar) (PLAYENTRY * small, PLAYENTRY * big)); void PL_Randomize(PLAYLIST * pl); #endif /* ex:set ts=4: */ mikmod-3.2.8/src/CMakeLists.txt0000644000000000000000000000127712351477360015050 0ustar rootroot ########### next target ############### SET(mikmod_SRCS display.c marchive.c mikmod.c mlist.c mconfig.c mwindow.c mmenu.c mwidget.c mdialog.c mconfedit.c mutilities.c mplayer.c mlistedit.c rcfile.c ) IF (NOT HAVE_USLEEP) LIST (APPEND mikmod_SRCS "musleep.c") ENDIF() IF (NOT HAVE_FNMATCH) LIST (APPEND mikmod_SRCS "mfnmatch.c") ENDIF() IF (NOT HAVE_GETOPT_LONG_ONLY) LIST (APPEND mikmod_SRCS "mgetopt.c") LIST (APPEND mikmod_SRCS "mgetopt1.c") ENDIF() include_directories(${MIKMOD_INCLUDE_DIR}) add_executable(mikmod ${mikmod_SRCS}) target_link_libraries(mikmod ${MIKMOD_LIBRARIES} ${EXTRA_LIBS}) install(TARGETS mikmod DESTINATION bin) mikmod-3.2.8/src/mgetopt.h0000644000000000000000000001075410001643545014126 0ustar rootroot/* Declarations for getopt. Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #if defined (__STDC__) && __STDC__ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ extern int getopt (); extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); #endif /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* _GETOPT_H */ mikmod-3.2.8/src/mutilities.h0000644000000000000000000001446712372226644014656 0ustar rootroot/* MikMod module player (c) 1998 - 2014 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== Some utility functions ==============================================================================*/ #ifndef MUTILITIES_H #define MUTILITIES_H #ifdef _WIN32 #include #endif #if defined(__OS2__)||defined(__EMX__) #include #ifndef HAVE_CONFIG_H #define RETSIGTYPE void #endif #endif #if defined(__MORPHOS__) || defined(__AROS__) || defined(AMIGAOS) || \ defined(__amigaos__) || defined(__amigados__) || \ defined(AMIGA) || defined(_AMIGA) || defined(__AMIGA__) #include #define _mikmod_amiga 1 #endif #include /* for BOOL */ /*========== Constants */ #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef PATH_MAX #if defined(MAXPATHLEN) /* */ #define PATH_MAX MAXPATHLEN #elif defined(_WIN32) && defined(_MAX_PATH) #define PATH_MAX _MAX_PATH #elif defined(_WIN32) && defined(MAX_PATH) #define PATH_MAX MAX_PATH #elif defined(__OS2__) && defined(CCHMAXPATH) #define PATH_MAX CCHMAXPATH #else #define PATH_MAX 256 #endif #endif /* PATH_MAX */ #include #define PATH_SEP '/' #define PATH_SEP_STR "/" #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define PATH_SEP_SYS '\\' #define PATH_SEP_SYS_STR "\\" void path_conv(char *file); char *path_conv_sys(const char *file); char *path_conv_sys2(const char *file); #else #define PATH_SEP_SYS '/' #define PATH_SEP_SYS_STR "/" #define path_conv(file) #define path_conv_sys(file) (file) #define path_conv_sys2(file) (file) #endif #ifdef _mikmod_amiga #define IS_PATH_SEP(c) ((c) == PATH_SEP || (c) == ':') static inline char *FIND_FIRST_DIRSEP(const char *_the_path) { char *p = strchr(_the_path, ':'); if (p != NULL) return p; return strchr(_the_path, PATH_SEP); } static inline char *FIND_LAST_DIRSEP (const char *_the_path) { char *p = strrchr(_the_path, PATH_SEP); if (p != NULL) return p; return strchr(_the_path, ':'); } #else #define IS_PATH_SEP(c) ((c) == PATH_SEP) #define FIND_FIRST_DIRSEP(p) strchr((p), PATH_SEP) #define FIND_LAST_DIRSEP(p) strrchr((p), PATH_SEP) #endif /*========== Types */ /* pointer-sized signed int (ssize_t/intptr_t) : */ #if defined(_WIN64) /* win64 is LLP64, not LP64 */ typedef long long SINTPTR_T; #else /* long should be pointer-sized for all others : */ typedef long SINTPTR_T; #endif /*========== Variables */ /* storage buffer length - used everywhere */ #define STORAGELEN 320 extern char storage[STORAGELEN+2]; /*========== Routines and macros */ #undef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define BTST(v, m) ((v) & (m) ? 1 : 0) #ifdef _WIN32 #define stat _stat #ifndef S_ISDIR #define S_ISDIR(st_mode) ((st_mode & _S_IFDIR) == _S_IFDIR) #endif #ifndef S_ISCHR #define S_ISCHR(st_mode) ((st_mode & _S_IFCHR) == _S_IFCHR) #endif #ifndef S_ISFIFO #define S_ISFIFO(st_mode) ((st_mode & _S_IFIFO) == _S_IFIFO) #endif #endif #if defined(__EMX__)||defined(_WIN32) #undef S_ISBLK /* MinGW sys/stat.h does define S_ISBLK */ #define S_ISBLK(st_mode) 0 #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #undef S_ISLNK /* djgpp-v2.04 does define S_ISLNK (and has lstat, too..) */ #define lstat stat #define S_ISSOCK(st_mode) 0 #define S_ISLNK(st_mode) 0 #endif #if defined(_WIN32)&&!defined(__MINGW32__)&&!defined(__WATCOMC__) typedef struct dirent { char name[PATH_MAX+1]; unsigned long* handle; int filecnt; char d_name[PATH_MAX+1]; } DIR; DIR* opendir (const char* dirName); struct dirent *readdir (DIR* dir); int closedir (DIR* dir); #endif /* dirent _WIN32 */ /* allocate memory for a formated string and do a sprintf */ char *str_sprintf2(const char *fmt, const char *arg1, const char *arg2); char *str_sprintf(const char *fmt, const char *arg); /* tmpl: file name template ending in 'XXXXXX' without path or NULL name_used: if !=NULL pointer to name of temp file, must be freed return: file descriptor or -1 */ int get_tmp_file (const char *tmpl, char **name_used); /* allocate and return a name for a temporary file (under UNIX not used because of tempnam race condition) */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) char *get_tmp_name(void); #endif BOOL file_exist(const char *file); /* determines if a given path is absolute or relative */ BOOL path_relative(const char *path); /* allocate and return a filename including the path for a config file 'name': filename without the path */ char *get_cfg_name(const char *name); /* Return precise time in milliseconds */ unsigned long Time1000(void); #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) #define filecmp strcasecmp #else #define filecmp strcmp #endif #if defined(__OS2__)||defined(__EMX__)||(defined(_WIN32)&&!defined(__MINGW32__)) #define strcasecmp(s,t) stricmp(s,t) #endif #ifdef HAVE_VSNPRINTF # ifdef _WIN32 # define VSNPRINTF _vsnprintf # else # define VSNPRINTF vsnprintf # endif #else #define VSNPRINTF(str,size,format,ap) vsprintf(str,format,ap) #endif #ifndef HAVE_SNPRINTF #define SNPRINTF mik_snprintf int mik_snprintf(char *buffer, size_t n, const char *format, ...); #else # ifdef _WIN32 # define SNPRINTF _snprintf # else # define SNPRINTF snprintf # endif #endif /* Return newly malloced version and cmdline for the driver with the number drvno. */ BOOL driver_get_info (int drvno, char **version, char **cmdline); #endif /* MUTILITIES_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/display.h0000644000000000000000000000357712221561560014123 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: display.h,v 1.1.1.1 2004/01/16 02:07:35 raph Exp $ Common display definitions, curses-related ==============================================================================*/ #ifndef DISPLAY_H #define DISPLAY_H /*========== Core definitions */ /* maximum screen width we handle */ #define MAXWIDTH 200 /*========== Panel definitions */ #define DISPLAY_ROOT 0 #define DISPLAY_HELP 1 #define DISPLAY_SAMPLE 2 #define DISPLAY_INST 3 #define DISPLAY_MESSAGE 4 #define DISPLAY_LIST 5 #define DISPLAY_CONFIG 6 #if LIBMIKMOD_VERSION >= 0x030200 #define DISPLAY_VOLBARS 7 #define DISPLAY_COUNT 8 #else #define DISPLAY_COUNT 7 #endif /*========== Routines */ typedef enum { COM_NONE, MENU_ACTIVATE } COMMAND; void display_message(char *str); void display_status(void); int display_header(void); void display_start(void); void display_extractbanner(void); void display_loadbanner(void); void display_pausebanner(void); void display_init(void); #endif /* DISPLAY_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/mthreads.h0000644000000000000000000001013213040414034014237 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mthreads.h,v 1.1.1.1 2004/01/16 02:07:43 raph Exp $ More or less portable thread functions ==============================================================================*/ #ifndef MTHREADS_H #define MTHREADS_H #ifdef HAVE_USLEEP #ifndef HAVE_USLEEP_PROTO void usleep(unsigned long); #endif #else int usleep_new(unsigned long); #endif #if defined(__OS2__)||defined(__EMX__) #define SLEEP(n) DosSleep(n) #elif defined(_WIN32) #define SLEEP(n) Sleep(n*10) #elif !defined(HAVE_USLEEP) #define SLEEP(n) usleep_new(n*1000) #else #define SLEEP(n) usleep(n*1000) #endif typedef enum { MTH_NORUN, /* thread does not run */ MTH_RUNNING, /* thread runs */ MTH_QUITTING /* thread is scheduled for quitting */ } MTH_MODE; #define USE_THREADS #ifdef HAVE_PTHREAD #if defined(__OpenBSD__) && !defined(_POSIX_THREADS) #define _POSIX_THREADS #endif #include #define DECLARE_MUTEX(name) \ extern pthread_mutex_t _mm_mutex_##name #define DEFINE_MUTEX(name) \ pthread_mutex_t _mm_mutex_##name = PTHREAD_MUTEX_INITIALIZER #define INIT_MUTEX(name) \ (1) #define MUTEX_LOCK(name) \ pthread_mutex_lock(&_mm_mutex_##name) #define MUTEX_UNLOCK(name) \ pthread_mutex_unlock(&_mm_mutex_##name) #define DEFINE_THREAD(name,modevar) \ MTH_MODE modevar = MTH_NORUN; \ pthread_t _mm_thread_##name #define THREAD_START(name,fkt,arg) \ (pthread_create(&_mm_thread_##name, NULL, &fkt, arg)==0) #define THREAD_JOIN(name,modevar) \ { modevar = MTH_QUITTING; \ pthread_join (_mm_thread_##name, NULL); \ } #elif defined(__OS2__)||defined(__EMX__) #include #define DECLARE_MUTEX(name) \ extern HMTX _mm_mutex_##name #define DEFINE_MUTEX(name) \ HMTX _mm_mutex_##name = NULLHANDLE #define INIT_MUTEX(name) \ (!DosCreateMutexSem((PSZ) NULL, &_mm_mutex_##name, 0, 0)) #define MUTEX_LOCK(name) \ if (_mm_mutex_##name) \ DosRequestMutexSem(_mm_mutex_##name, SEM_INDEFINITE_WAIT) #define MUTEX_UNLOCK(name) \ if (_mm_mutex_##name) \ DosReleaseMutexSem(_mm_mutex_##name) #define DEFINE_THREAD(name,modevar) \ int modevar = MTH_NORUN #define THREAD_START(name,fkt,arg) \ (_beginthread(fkt, NULL, 4096, arg) != -1) #define THREAD_JOIN(name,modevar) \ { modevar = MTH_QUITTING; \ while (modevar==MTH_QUITTING) SLEEP(1); \ } #elif defined(_WIN32) #include #include #define DECLARE_MUTEX(name) \ extern HANDLE _mm_mutex_##name #define DEFINE_MUTEX(name) \ HANDLE _mm_mutex_##name #define INIT_MUTEX(name) \ (_mm_mutex_##name = CreateMutex(NULL, FALSE, "mm_mutex("#name")")) #define MUTEX_LOCK(name) \ if (_mm_mutex_##name) WaitForSingleObject(_mm_mutex_##name, INFINITE) #define MUTEX_UNLOCK(name) \ if (_mm_mutex_##name) ReleaseMutex(_mm_mutex_##name) #define DEFINE_THREAD(name,modevar) \ int modevar = MTH_NORUN #define THREAD_START(name,fkt,arg) \ (_beginthread(fkt, 4096, arg) != -1) #define THREAD_JOIN(name,modevar) \ { modevar = MTH_QUITTING; \ while (modevar==MTH_QUITTING) SLEEP(1); \ } #else #undef USE_THREADS #define DECLARE_MUTEX(name) #define DEFINE_MUTEX(name) #define INIT_MUTEX(name) (0) #define MUTEX_LOCK(name) #define MUTEX_UNLOCK(name) #define DEFINE_THREAD(name,modevar) \ int modevar = MTH_NORUN #define THREAD_START(name,fkt,arg) (0) #define THREAD_JOIN(name,modevar) #endif #endif /* MTHREADS_H */ mikmod-3.2.8/src/display.c0000644000000000000000000010071712365204164014113 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: display.c,v 1.8 2004/02/02 01:35:52 raph Exp $ Display routines for the different panels and the playlist menu ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include "display.h" #include "player.h" #include "mconfig.h" #include "mlist.h" #include "mutilities.h" #include "mwindow.h" #include "mconfedit.h" #include "keys.h" #include "mplayer.h" #include "mlistedit.h" /*========== Display layout */ /* minimum width of one column */ #define MINWIDTH 20 /* minimum width of second column */ #define MINVISIBLE 10 /* half width */ int halfwidth; /* format used for message/banner lines : like "%-80.80s" */ char fmt_fullwidth[20]; /* format used for sample/instrument lines - like "%3i %-35.35s" (the big number being halfwidth-5) */ char fmt_halfwidth[20]; /* start of information panels */ #define PANEL_Y 7 #if LIBMIKMOD_VERSION >= 0x030200 static MP_DATA playdata; /* The characters used to represent different visual things */ #define CHAR_AMPLITUDE1 '=' #define CHAR_AMPLITUDE0 '-' #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define CHAR_SAMPLE_KICK3 '*' #define CHAR_SAMPLE_KICK2 '\x07' #define CHAR_SAMPLE_KICK1 '\xf9' #define CHAR_SAMPLE_KICK0 '\xfa' #else #define CHAR_SAMPLE_KICK3 '@' #define CHAR_SAMPLE_KICK2 'O' #define CHAR_SAMPLE_KICK1 'o' #define CHAR_SAMPLE_KICK0 '.' #endif static char samp_char[4] = { CHAR_SAMPLE_KICK0, CHAR_SAMPLE_KICK1, CHAR_SAMPLE_KICK2, CHAR_SAMPLE_KICK3 }; static ATTRS samp_attr[4] = { ATTR_SAMPLES_KICK0, ATTR_SAMPLES_KICK1, ATTR_SAMPLES_KICK2, ATTR_SAMPLES_KICK3 }; /* The routine for dynamically repainting current panel */ static void (*dynamic_repaint) (MWINDOW *win) = NULL; static MWINDOW *dynamic_repaint_win; #endif static void display_title(void); static void set_window_title(const char *content); /*========== Variables */ extern BOOL quiet; extern MODULE *mf; static MWINDOW *root; static int cur_display = DISPLAY_SAMPLE, old_display = DISPLAY_SAMPLE; /* first line of displayed information in the panels */ static int first_help = 0; static int first_sample = 0; static int first_inst = 0; static int first_comment = 0; static int first_list = 0; #if LIBMIKMOD_VERSION >= 0x030200 static int first_volbar = 0; #endif /* computes printf templates when screen size changes, so that two-column display fills the screen */ static void setup_printf(void) { int maxx, winy; win_get_size(root, &maxx, &winy); if (maxx > MAXWIDTH) maxx = MAXWIDTH; if (maxx < 0) maxx = 0; halfwidth = maxx >> 1; if (halfwidth < MINWIDTH) halfwidth = MINWIDTH; SNPRINTF(fmt_fullwidth, 20, "%%-%d.%ds", maxx, maxx); SNPRINTF(fmt_halfwidth, 20, "%%3i %%-%d.%ds", halfwidth - 5, halfwidth - 5); } /* enlarges a text line to fill the root window width */ static void enlarge (int x, char *str) { int winx, winy, len; win_get_size(root, &winx, &winy); winx -= x; len = strlen (str); if (len < winx) memset(str + len, ' ', winx - len); if (winx>=0) str[winx] = '\0'; } /* first line : MikMod version */ static void display_version(void) { if (quiet) return; strcpy (storage,mikversion); enlarge (0,storage); win_attrset(ATTR_TITLE); win_print(root, 0, 0, storage); } static BOOL remove_msg = 0; static time_t start_time; static char old_message[STORAGELEN + 1]; /* displays a warning message on the top right corner of the display */ void display_message(char *str) { int len = strlen(str)+1; if (quiet) return; if (len > STORAGELEN) len = STORAGELEN; old_message[0] = ' '; strncpy(&old_message[1], str, len-1); old_message[len] = '\0'; enlarge (strlen(mikversion),old_message); win_attrset(ATTR_WARNING); win_print(root, strlen(mikversion), 0, str); remove_msg = 1; start_time = time(NULL); } /* changes the warning message */ static void update_message(void) { if (remove_msg && old_message[0]) { win_attrset(ATTR_WARNING); win_print(root, strlen(mikversion), 0, old_message); } } /* removes the warning message */ static void remove_message(void) { if (remove_msg) { time_t end_time = time(NULL); if (end_time - start_time >= 6) { display_version(); remove_msg = 0; } } } /* display a banner/message from line skip, at position origin returns updated skip value if it is out of bounds and would prevent the message from being seen. */ static int display_banner(MWINDOW *win, const char *banner, int origin, int skip, BOOL wrap) { const char *buf = banner; char str[MAXWIDTH + 1]; int i, n, t, winx, winy; win_get_size(win, &winx, &winy); if (winx < 5 || winy < 1) return skip; /* count message lines */ for (t = 0; *buf; t++) { n = 0; while ((((n < winx) && (n < MAXWIDTH)) || (!wrap)) && (*buf != '\r') && (*buf != '\n') && (*buf)) buf++, n++; if ((*buf == '\r') || (*buf == '\n')) buf++; } /* update skip value */ if (skip < 0) skip = 0; if (skip + winy - origin > t) skip = t - winy + origin; if (skip < 0) skip = 0; if (t - skip + origin > winy) t = winy - origin + skip; /* skip first lines */ buf = banner; for (i = 0; i < skip && i < t; i++) { n = 0; while ((((n < winx) && (n < MAXWIDTH)) || (!wrap)) && ((*buf != '\r') && (*buf != '\n') && (*buf))) buf++, n++; if ((*buf == '\r') || (*buf == '\n')) buf++; } /* display lines */ for (i = skip; i < t; i++) { for (n = 0; (((n < winx) && (n < MAXWIDTH)) || (!wrap)) && (*buf != '\r') && (*buf != '\n') && (*buf); buf++) { if (*buf < ' ') str[n] = ' '; else str[n] = *buf; if (n < MAXWIDTH) n++; } if ((*buf == '\r') || (*buf == '\n')) buf++; if (n) { str[n] = '\0'; SNPRINTF(storage, STORAGELEN, fmt_fullwidth, str); win_print(win, 0, i - skip + origin, storage); } else win_clrtoeol(win, 0, i - skip + origin); } if (!origin) /* clear to bottom of window */ for(i += origin - skip; i < winy; i++) win_clrtoeol(win, 0, i); return skip; } /* displays the "paused" banner */ void display_pausebanner(void) { if (quiet) return; win_attrset(ATTR_BANNER); display_banner(root, pausebanner, 1, 0, 0); } /* display the "extracting" banner */ void display_extractbanner(void) { if (quiet) return; win_attrset(ATTR_BANNER); display_banner(root, extractbanner, 1, 0, 0); win_refresh(); } /* display the "loading" banner */ void display_loadbanner(void) { if (quiet) return; win_attrset(ATTR_BANNER); display_banner(root, loadbanner, 1, 0, 0); win_refresh(); } /* second line : driver settings */ static void display_driver(void) { char reverb[13]; if (quiet) return; if (md_reverb) SNPRINTF(reverb, 12, "reverb: %2d", md_reverb); else strcpy(reverb, "no reverb"); SNPRINTF(storage, STORAGELEN, "%s: %d bit %s %s, %u Hz, %s", md_driver->Name, (md_mode & DMODE_16BITS) ? 16 : 8, (md_mode & DMODE_INTERP) ? (md_mode & DMODE_SURROUND ? "interp. surround" : "interpolated") : (md_mode & DMODE_SURROUND ? "surround" : "normal"), (md_mode & DMODE_STEREO) ? "stereo" : "mono", md_mixfreq, reverb); enlarge(0,storage); win_print(root, 0, 1, storage); } /* third line : filename */ static void display_file(void) { PLAYENTRY *entry; if (quiet) return; storage[0] = '\0'; if ((entry = PL_GetCurrent(&playlist))) { CHAR *archive = entry->archive, *file; if (archive && !config.fullpaths) { archive = FIND_LAST_DIRSEP(entry->archive); if (archive) archive++; else archive = entry->archive; } file = FIND_LAST_DIRSEP(entry->file); if (file && !config.fullpaths) file++; else file = entry->file; if ((archive) && (strlen(file) < MAXWIDTH - 13)) { if (strlen(archive) + strlen(file) > MAXWIDTH - 10) { archive += strlen(archive) - (MAXWIDTH - 13 - strlen(file)); SNPRINTF(storage, STORAGELEN, "File: %s (...%s)", file, archive); } else SNPRINTF(storage, STORAGELEN, "File: %s (%s)", file, archive); } else SNPRINTF(storage, STORAGELEN, "File: %.70s", file); } enlarge(0,storage); win_print(root, 0, 2, storage); } /* fourth and fifth lines : module name and format */ static void display_name(void) { if (quiet || !mf) return; SNPRINTF(storage, STORAGELEN, "Name: %.70s", mf->songname); enlarge(0,storage); win_print(root, 0, 3, storage); SNPRINTF(storage, STORAGELEN, "Type: %s, Periods: %s, %s", mf->modtype, (mf->flags & UF_XMPERIODS) ? "XM type" : "mod type", (mf->flags & UF_LINEAR) ? "linear" : "log"); enlarge(0,storage); win_print(root, 0, 4, storage); } /* sixth line : player status */ void display_status(void) { #if LIBMIKMOD_VERSION >= 0x030200 int i; unsigned long cur_time; static MP_DATA data; #endif if (quiet) return; remove_message(); if (MP_Paused() || !mf) return; win_attrset(ATTR_SONG_STATUS); if (mf->sngpos < mf->numpos) { PLAYENTRY *cur = PL_GetCurrent(&playlist); char time[7] = ""; char channels[17] = ""; if (cur && cur->time > 0) SNPRINTF(time, 7, "/%2d:%02d", (int)((cur->time / 60) % 60), (int)(cur->time % 60)); #if LIBMIKMOD_VERSION >= 0x030107 if (mf->flags & UF_NNA) { SNPRINTF(channels, 17, "%2d/%d+%d->%d", mf->realchn, mf->numchn, mf->totalchn - mf->realchn, mf->totalchn); } else #endif SNPRINTF(channels, 17, "%2d/%d ", mf->realchn, mf->numchn); SNPRINTF(storage, STORAGELEN, "pat:%03d/%03d pos:%2.2X spd:%2d/%3d " "vol:%3d%%/%3d%% time:%2d:%02d%s chn:%s", mf->sngpos, mf->numpos - 1, mf->patpos, mf->sngspd, mf->bpm, (mf->volume * 100 + 127) >> 7, (md_volume * 100 + 127) >> 7, (int)(((mf->sngtime >> 10) / 60) % 60), (int)((mf->sngtime >> 10) % 60), time, channels); enlarge(0,storage); win_print(root, 0, 5, storage); } #if LIBMIKMOD_VERSION >= 0x030200 if (config.fakevolbars) { MP_GetData (&data); cur_time = Time1000(); for (i = 0; i < mf->numchn; i++) { unsigned int delta = (cur_time - playdata.vstatus[i].time) / 10; if (delta>0) playdata.vstatus[i].time = cur_time; if (playdata.vstatus[i].volamp > delta) playdata.vstatus[i].volamp -= delta; else playdata.vstatus[i].volamp = 0; } for (i = 0; i < mf->numchn; i++) { playdata.vinfo[i] = data.vinfo[i]; if (playdata.vinfo[i].kick) playdata.vstatus[i].volamp = playdata.vinfo[i].volume; } } else { MP_GetData (&playdata); } if (dynamic_repaint) dynamic_repaint(dynamic_repaint_win); #endif } /* seventh line to bottom of screen: information panel */ static BOOL display_information(void) { static const char *panel_name[] = { "Help", "Samples", "Instruments", "Message", "playList", "Configuration", #if LIBMIKMOD_VERSION >= 0x030200 "Volume", #endif }; char paneltitle[STORAGELEN]; BOOL change = 0; int i; ATTRS attr; char *tmp; if (quiet) return 1; /* sanity check */ if (!mf && ((cur_display == DISPLAY_INST) || (cur_display == DISPLAY_SAMPLE) || (cur_display == DISPLAY_MESSAGE) #if LIBMIKMOD_VERSION >= 0x030200 || (cur_display == DISPLAY_VOLBARS) #endif )) { cur_display = DISPLAY_LIST; change = 1; } while (1) { if ((cur_display == DISPLAY_INST && (!(mf->flags & UF_INST))) || (cur_display == DISPLAY_MESSAGE && !mf->comment)) { cur_display = (cur_display == old_display) ? DISPLAY_SAMPLE : old_display; change = 1; } else break; } if (change) { win_change_panel(cur_display); return 0; } /* set panel title */ paneltitle[0] = 0; for (i = DISPLAY_HELP; i < DISPLAY_COUNT; i++) { if ((i == DISPLAY_SAMPLE && !mf) || (i == DISPLAY_INST && (!mf || !(mf->flags & UF_INST))) || (i == DISPLAY_MESSAGE && (!mf || !mf->comment)) #if LIBMIKMOD_VERSION >= 0x030200 || (i == DISPLAY_VOLBARS && !mf) #endif ) continue; SNPRINTF(paneltitle + strlen(paneltitle), STORAGELEN, "%c%s%c", i == cur_display ? '[' : ' ', panel_name[i - 1], i == cur_display ? ']' : ' '); } enlarge (0,paneltitle); tmp = paneltitle + strlen(paneltitle); attr = ATTR_INFO_INACTIVE; while (--tmp >= paneltitle) { ATTRS newattr = attr; if (*tmp == ']') newattr = ATTR_INFO_ACTIVE; else if (tmp[1] == '[') newattr = ATTR_INFO_INACTIVE; else if (isupper((int)*tmp)) newattr = (attr == ATTR_INFO_ACTIVE) ? ATTR_INFO_AHOTKEY : (attr == ATTR_INFO_INACTIVE) ? ATTR_INFO_IHOTKEY : newattr; else if (isupper((int)tmp[1])) newattr = (attr == ATTR_INFO_AHOTKEY) ? ATTR_INFO_ACTIVE : (attr == ATTR_INFO_IHOTKEY) ? ATTR_INFO_INACTIVE : newattr; if ((newattr != attr) && (tmp[1])) { win_attrset(attr); win_print(root, tmp - paneltitle + 1, 6, tmp + 1); tmp[1] = 0; } attr = newattr; } win_attrset(attr); win_print(root, 0, 6, paneltitle); return 1; } /* help panel */ static void display_help(MWINDOW *win, int diff) { /* *INDENT-OFF* */ static const char helptext[] = #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) "Keys help (depending on your terminal and your curses library,\n" "========= some of these keys might not be recognized)\n" #else "Keys help\n" "=========\n" #endif "\n" "H/F1 show help panel " "() decrease/increase tempo\n" "S/F2 show samples panel " "{} decrease/increase bpm\n" "I/F3 show instrument panel " ":/; toggle interpolation\n" "M/F4 show message panel " "U toggle surround sound\n" "L/F5 show list panel " "1..0 volume 10%..100%\n" "C/F6 show config panel " "<> decrease/increase volume\n" #if LIBMIKMOD_VERSION >= 0x030200 "V/F7 show volume bars " "P switch to previous module\n" "ENTER in list panel, activate menu " "N switch to next module\n" "Left/- previous pattern " "R restart module\n" "Right/+ next pattern " "Space toggle pause\n" "Up/Down scroll panel " "^L refresh screen\n" "PgUp/PgDn scroll panel (faster) " "F toggle fake/real volume bars\n" "Home/End start/end of panel " "Q exit MikMod\n"; #else "ENTER in list panel, activate menu " "P switch to previous module\n" "Left/- previous pattern " "N switch to next module\n" "Right/+ next pattern " "R restart module\n" "Up/Down scroll panel " "Space toggle pause\n" "PgUp/PgDn scroll panel (faster) " "^L refresh screen\n" "Home/End start/end of panel " "Q exit MikMod\n"; #endif /* *INDENT-ON* */ first_help += diff; win_attrset(ATTR_HELP); first_help = display_banner(win, helptext, 0, first_help, 0); win_status(""); } static void convert_string(char *str) { for (; str && *str; str++) if (*str < ' ') *str = ' '; } /* helper function for scrollable panels */ void updatefirst(MWINDOW *win, int *first, int *winx, int *count, int *semicount, int diff, int total) { int wx, scount; *first += diff; win_get_size(win, &wx, &scount); *winx = wx; if (semicount) { if (wx < MINWIDTH + MINVISIBLE) *count = scount; else *count = scount * 2; } else *count = scount; if ((wx <= 0) || (scount <= 0)) *count = 0; if (*first >= total - *count) *first = total - *count; if (*first < 0) *first = 0; if (semicount) { if ((total > scount) && (total < *count)) { scount = (total + 1) >> 1; if (wx < MINWIDTH + MINVISIBLE) *count = scount; else *count = scount * 2; } *semicount = scount; } } /* sample panel */ static void display_sample(MWINDOW *win, int diff) { int count, semicount, t, winx; updatefirst(win, &first_sample, &winx, &count, &semicount, diff, mf->numsmp); win_clear(win); /* Sets attrs */ for (t = first_sample; t < mf->numsmp && t < (count + first_sample); t++) { int x = ((t - first_sample) < semicount) ? 0 : halfwidth; if (x < winx) { SNPRINTF(storage, STORAGELEN, fmt_halfwidth, t, mf->samples[t].samplename ? mf->samples[t]. samplename : ""); convert_string(storage); win_print(win, x, (t - first_sample) % semicount, storage); } } if (mf->numsmp == 1) win_status("1 Sample"); else { SNPRINTF(storage, STORAGELEN, "%d Samples", mf->numsmp); win_status(storage); } } #if LIBMIKMOD_VERSION >= 0x030200 static void dynamic_display_sample(MWINDOW *win) { int count, semicount, t, winx; int voice, vol, chancount; char sampchar[2]; if (cur_display != DISPLAY_SAMPLE) return; sampchar[1] = 0; updatefirst(win, &first_sample, &winx, &count, &semicount, 0, mf->numsmp); for (t = first_sample; t < mf->numsmp && t < (count + first_sample); t++) { int x = ((t - first_sample) < semicount) ? 0 : halfwidth; sampchar[0] = ' '; if (x < winx) { vol = chancount = 0; for (voice = 0; voice < mf->numchn; voice++) { if (playdata.vinfo[voice].s == &mf->samples[t]) { vol += playdata.vstatus[voice].volamp; chancount++; } } if (chancount) { vol /= chancount; if (vol >= 56) voice = 3; else if (vol >= 44) voice = 2; else if (vol >= 26) voice = 1; else voice = 0; sampchar[0] = samp_char[voice]; win_attrset(samp_attr[voice]); } else win_attrset(ATTR_SAMPLES); win_print(win, x + 3, (t - first_sample) % semicount, sampchar); } } } #endif /* instrument panel */ static void display_inst(MWINDOW *win, int diff) { int count, semicount, t, winx; updatefirst(win, &first_inst, &winx, &count, &semicount, diff, mf->numins); win_clear(win); /* Sets attrs */ for (t = first_inst; t < mf->numins && t < (count + first_inst); t++) { int x = ((t - first_inst) < semicount) ? 0 : halfwidth; if (x < winx) { SNPRINTF(storage, STORAGELEN, fmt_halfwidth, t, mf->instruments[t].insname ? mf->instruments[t]. insname : ""); convert_string(storage); win_print(win, x, (t - first_inst) % semicount, storage); } } if (mf->numins == 1) win_status("1 Instrument"); else { SNPRINTF(storage, STORAGELEN, "%d Instruments", mf->numins); win_status(storage); } } #if LIBMIKMOD_VERSION >= 0x030200 static void dynamic_display_inst(MWINDOW *win) { int count, semicount, t, winx; int voice, vol, chancount; char sampchar[2]; if (cur_display != DISPLAY_INST) return; sampchar[1] = 0; updatefirst(win, &first_inst, &winx, &count, &semicount, 0, mf->numins); for (t = first_inst; t < mf->numins && t < (count + first_inst); t++) { int x = ((t - first_inst) < semicount) ? 0 : halfwidth; sampchar[0] = ' '; if (x < winx) { vol = chancount = 0; for (voice = 0; voice < mf->numchn; voice++) { if (playdata.vinfo[voice].i == &mf->instruments[t]) { vol += playdata.vstatus[voice].volamp; chancount++; } } if (chancount) { vol /= chancount * 16; if (vol >= 4) vol = 3; sampchar[0] = samp_char[vol]; win_attrset(samp_attr[vol]); } else win_attrset(ATTR_SAMPLES); win_print(win, x + 3, (t - first_inst) % semicount, sampchar); } } } #endif /* comment panel */ static void display_comment(MWINDOW *win, int diff) { first_comment += diff; win_attrset(ATTR_HELP); first_comment = display_banner(win, mf->comment, 0, first_comment, 1); win_status(""); } #if LIBMIKMOD_VERSION >= 0x030200 static void dynamic_display_volbars(MWINDOW *win) { int count, t, i, v, winx, barw; int loww, medw; char *tmp; if (cur_display != DISPLAY_VOLBARS) return; updatefirst(win, &first_volbar, &winx, &count, NULL, 0, mf->numchn); winx -= 5; barw = winx / 2; if (barw < 3) return; else if (barw > 30) barw = 30; loww = barw * 3 / 4; medw = (barw - loww) * 3 / 4; for (t = first_volbar; t < (first_volbar + count) && t < mf->numchn; t++) { v = playdata.vstatus[t].volamp * barw / 32; memset(&storage, ' ', barw); storage[barw] = '\0'; memset(&storage, CHAR_AMPLITUDE1, v / 2); if (v & 1) { storage[v / 2] = CHAR_AMPLITUDE0; v = v/2 + 1; } else v = v/2; if (v < barw) { win_attrset(ATTR_VOLBAR); win_print(win, (mf->numchn > 100 ? 6 : 5) + v, t - first_volbar, storage + v); storage[v] = '\0'; } if (v > loww + medw) { win_attrset(ATTR_VOLBAR_HIGH); win_print(win,(mf->numchn > 100 ? 6 : 5) + loww + medw, t - first_volbar, storage + loww + medw); storage[loww + medw] = '\0'; } if (v > loww) { win_attrset(ATTR_VOLBAR_MED); win_print(win, (mf->numchn > 100 ? 6 : 5) + loww, t - first_volbar, storage + loww); storage[loww] = '\0'; } if (v > 0) { win_attrset(ATTR_VOLBAR_LOW); win_print(win, (mf->numchn > 100 ? 6 : 5), t - first_volbar, storage); } storage[0] = '\0'; if (playdata.vinfo[t].i && !config.forcesamples) { for (i=0; i < mf->numins && playdata.vinfo[t].i != &mf->instruments[i]; i++); SNPRINTF(storage, STORAGELEN, "%3i %s", i, playdata.vinfo[t].i->insname ? playdata.vinfo[t].i->insname : ""); } else if (playdata.vinfo[t].s) { for (i=0; i < mf->numsmp && playdata.vinfo[t].s != &mf->samples[i]; i++); SNPRINTF(storage, STORAGELEN, "%3i %s", i, playdata.vinfo[t].s->samplename ? playdata.vinfo[t].s->samplename : ""); } convert_string(storage); tmp = storage; for (v = 0; *tmp && (v < winx - barw - 2); tmp++, v++); for (; v < winx - barw - 2; tmp++, v++) *tmp = ' '; *tmp = 0; win_attrset(ATTR_VOLBAR_INSTR); win_print(win, (mf->numchn > 100 ? 6 : 5) + barw + 2, t - first_volbar, storage); } if (mf->numchn == 1) strcpy(storage, "1 Channel"); else SNPRINTF(storage, STORAGELEN, "%d Channels", mf->numchn); if (!config.forcesamples && (mf->flags & UF_INST)) strcat(storage, ", displaying instrument names"); else strcat(storage, ", displaying sample names"); if (config.fakevolbars) strcat(storage, " and fake volume bars"); else strcat(storage, " and real volume bars"); win_status(storage); } static void display_volbars(MWINDOW *win, int diff) { int count, t, winx; updatefirst(win, &first_volbar, &winx, &count, NULL, diff, mf->numchn); win_clear(win); /* Sets attrs */ for (t = first_volbar; t < (first_volbar + count) && t < mf->numchn; t++) { if (mf->numchn > 100) SNPRINTF(storage, STORAGELEN, "[%3d]", t); else SNPRINTF(storage, STORAGELEN, "[%2d]", t); win_print(win, 0, t - first_volbar, storage); } /* display the remaining of the window immediately to prevent flickering */ dynamic_display_volbars(win); } #endif static void display_playentry(MWINDOW *win, PLAYENTRY *pos, PLAYENTRY *cur, int nr, int y, int x, BOOL reverse, int width) { char *name, sort; char time[8] = "", tmpfmt[30]; int timelen = 0; if (pos->time > 0) { SNPRINTF(time, 7, " %2d:%02d", (int)((pos->time / 60) % 60), (int)(pos->time % 60)); timelen = strlen(time); } name = FIND_LAST_DIRSEP(pos->file); if (name && !config.fullpaths) name++; else name = pos->file; if (pos == cur) sort = '>'; else if (pos->played) sort = '*'; else sort = ' '; if (pos->archive) { if (strlen(name) > width - 13 - timelen) { name = name + strlen(name) - (width - 16 - timelen); if (timelen) { sprintf(tmpfmt, "%%4i %%c...%%-%ds%%s(pack)", width - 22); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c...%%-%ds(pack)", width - 16); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } } else if (timelen) { sprintf(tmpfmt, "%%4i %%c%%-%ds%%s(pack)", width - 19); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c%%-%ds(pack)", width - 13); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } } else if (strlen(name) > width - 7 - timelen) { name = name + strlen(name) - (width - 10 - timelen); if (timelen) { sprintf(tmpfmt, "%%4i %%c...%%-%ds%%s", width - 16); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c...%%-%ds", width - 10); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } } else if (timelen) { sprintf(tmpfmt, "%%4i %%c%%-%ds%%s", width - 13); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c%%-%ds", width - 7); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } win_attrset(reverse ? ATTR_PLAYENTRY_ACTIVE : ATTR_PLAYENTRY_INACTIVE); win_print(win, x, y, storage); } /* playlist panel */ static void display_list(MWINDOW *win, int diff, COMMAND com) { static const char *no_data = "\nPlaylist is empty!\n"; static int actLine = -1; int count, semicount, playcount, t, winx, x, width; PLAYENTRY *cur; playcount = PL_GetLength(&playlist); if (actLine >= playcount) actLine = playcount - 1; if (com == MENU_ACTIVATE) { list_open (&actLine); return; } win_clear(win); if (playcount) { win_get_size(win, &winx, &semicount); if (semicount < 0) semicount = 0; if (winx < 40 + MINVISIBLE) { count = semicount; width = winx; } else { count = semicount * 2; width = winx >> 1; } cur = PL_GetCurrent(&playlist); if (actLine < 0) { actLine = PL_GetCurrentPos(&playlist); first_list = actLine - semicount / 2; if (first_list < 0) first_list = 0; } actLine += diff; if (actLine < 0) actLine = 0; else if (actLine >= playcount) actLine = playcount - 1; if (actLine < first_list) first_list = actLine; else if (actLine >= first_list + count) first_list = actLine - count + 1; for (t = first_list; t < playcount && t < (count + first_list); t++) { x = (t - first_list) < semicount ? 0 : width; if (x < winx) display_playentry(win, PL_GetEntry(&playlist, t), cur, t, (t - first_list) % semicount, x, actLine == t, width); } } else { first_list += diff; first_list = display_banner(win, no_data, 0, first_list, 1); } switch (playcount) { case 0: win_status("Press enter to open playlist menu"); break; case 1: win_status("1 Module"); break; default: SNPRINTF(storage, STORAGELEN, "%d Modules", playcount); win_status(storage); break; } } /* open config-editor panel */ static void display_config(MWINDOW *win, int diff) { static BOOL open = 0; win_clear(win); if (!open) { config_open(); open = 1; } } /* display panel contents */ static void display_panel(MWINDOW *win, int diff, COMMAND com) { #if LIBMIKMOD_VERSION >= 0x030200 dynamic_repaint = NULL; dynamic_repaint_win = win; #endif switch (cur_display) { case DISPLAY_HELP: display_help(win, diff); break; case DISPLAY_SAMPLE: #if LIBMIKMOD_VERSION >= 0x030200 dynamic_repaint = dynamic_display_sample; #endif display_sample(win, diff); break; case DISPLAY_INST: #if LIBMIKMOD_VERSION >= 0x030200 dynamic_repaint = dynamic_display_inst; #endif display_inst(win, diff); break; case DISPLAY_MESSAGE: display_comment(win, diff); break; case DISPLAY_LIST: display_list(win, diff, com); break; case DISPLAY_CONFIG: display_config(win, diff); break; #if LIBMIKMOD_VERSION >= 0x030200 case DISPLAY_VOLBARS: dynamic_repaint = dynamic_display_volbars; display_volbars(win, diff); break; #endif } } /* displays the top of the screen */ int display_header(void) { if (quiet) return 1; display_version(); update_message(); if (MP_Paused()) { display_pausebanner(); set_window_title("paused"); } else { win_attrset(ATTR_SONG_STATUS); display_driver(); display_file(); display_name(); display_status(); display_title(); } return display_information(); } static void display_head_resize (MWINDOW *win, int dx, int dy) { setup_printf(); } static BOOL display_head_repaint(MWINDOW * win) { int cur_panel = win_get_panel(); if (cur_panel != cur_display) old_display = cur_display; cur_display = cur_panel; return display_header(); } static BOOL display_panel_repaint(MWINDOW * win) { display_panel(win, 0, COM_NONE); return 1; } void display_start(void) { if (quiet) return; first_inst = first_sample = first_comment = 0; win_panel_repaint(); } /* handle interface-specific keys */ static BOOL display_handle_key(MWINDOW * win, int ch) { switch (ch) { case KEY_DOWN: display_panel(win, 1, COM_NONE); break; case KEY_UP: display_panel(win, -1, COM_NONE); break; case KEY_RIGHT: if (cur_display != DISPLAY_LIST) return 0; /* fall through */ case KEY_NPAGE: display_panel(win, win->height, COM_NONE); break; case KEY_LEFT: if (cur_display != DISPLAY_LIST) return 0; /* fall through */ case KEY_PPAGE: display_panel(win, -win->height, COM_NONE); break; case KEY_HOME: display_panel(win, -32000, COM_NONE); break; #ifdef KEY_END case KEY_END: display_panel(win, 32000, COM_NONE); break; #endif case KEY_ENTER: case '\r': if (cur_display == DISPLAY_LIST) display_panel(win, 0, MENU_ACTIVATE); else return 0; break; default: return 0; } return 1; } /* setup interface */ void display_init(void) { static ATTRS attrs[]={ATTR_HELP, /* Help */ ATTR_SAMPLES, /* Sample */ ATTR_SAMPLES, /* Inst */ ATTR_HELP, /* Message */ ATTR_PLAYENTRY_INACTIVE,/* Playlist */ ATTR_CONFIG, /* Config */ ATTR_VOLBAR}; /* Volbars */ int i; root = win_get_window_root(); win_panel_set_repaint(DISPLAY_ROOT, display_head_repaint); win_panel_set_resize(DISPLAY_ROOT, 1, display_head_resize); for (i = 1; i < DISPLAY_COUNT; i++) { win_panel_open(i, 0, PANEL_Y, 999, 999, 0, NULL, attrs[i-1]); win_panel_set_repaint(i, display_panel_repaint); win_panel_set_handle_key(i, display_handle_key); win_panel_set_resize(i, 1, NULL); } win_change_panel(cur_display); setup_printf(); } static void display_title(void) { char *file; if (!mf) { return; } if (!mf->songname || strlen(mf->songname)==0) { PLAYENTRY *entry=NULL; entry = PL_GetCurrent(&playlist); if (entry != NULL) { file = entry->file; if (!config.fullpaths) { file = FIND_LAST_DIRSEP(entry->file); if (file) { file++; } else { file = entry->file; } } set_window_title(file); } return; } set_window_title(mf->songname); } /* This will set the xterm (or equivalent) Title and Icon title. * * The title contains -= MikMod x.x.x =- (%s) where %s is the content * the icon contains -= MikMod x.x.x =- * * pass NULL as songname to reset the title */ static void set_window_title(const char *content) { /* TODO: Can we do something similar for OS2? */ /* Win32 console application set title */ #if defined(_WIN32) SNPRINTF(storage,STORAGELEN,"%s (%s)", mikversion, content); SetConsoleTitle(storage); #endif /* Unix/Xterm (and compatible/similar) * * Written using the 'Xterm-Title mini-howto' */ #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) char *env_term; static int last_config=0; if (!config.window_title && !last_config) { return; } if (last_config && !config.window_title) { /* xterm title setting has just been disabled */ content = NULL; } last_config = config.window_title; env_term = getenv("TERM"); if (env_term==NULL) { return; } if (content!=NULL) { SNPRINTF(storage,STORAGELEN,"%s (%s)", mikversion, content); } else { storage[0] = '\0'; } if ( strcmp(env_term, "xterm")==0 || strcmp(env_term, "xterm-color")==0 || strcmp(env_term, "rxvt")==0 || strcmp(env_term, "aixterm")==0 || strcmp(env_term, "dtterm")==0 || strcmp(env_term, "Eterm")==0 ) { printf("%c]0;%s%c", '\033', storage, '\007'); printf("%c]1;%s%c", '\033', mikversion, '\007'); } else if (strcmp(env_term, "iris-ansi")==0) { printf("%cP1.y%s%c\\", '\033', storage, '\033'); printf("%cP3.y%s%c\\", '\033', mikversion, '\033'); } else if (strcmp(env_term, "hpterm")==0) { printf("\033&f0k%dD%s", (int) strlen(storage), storage); printf("\033&f-1k%dD%s", (int) strlen(mikversion), mikversion); } #endif } /* ex:set ts=4: */ mikmod-3.2.8/src/player.h0000644000000000000000000000752313071724104013744 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for (c) 2004, Raphael Assenat complete list. 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. */ /*============================================================================== $Id: player.h,v 1.3 2004/01/29 02:48:06 raph Exp $ Module player which uses the MikMod library as the player engine. ==============================================================================*/ #ifndef PLAYER_H #define PLAYER_H /*========== Messages */ #define playerversion "3.2.8" #define mikversion "-= MikMod " playerversion " =-" #define mikcopyr mikversion \ "\n(c) 2004 Raphael Assenat and others - see file AUTHORS for complete list" #define mikbanner mikcopyr "\n\n" \ " - MikMod authors and contributors are:\n" \ " Jean-Philippe Ajirent - Peter Amstutz - Raphael Assenat - Anders Bjoerklund\n"\ " Dimitri Boldyrev - Peter Breitling - Arne de Bruijn - Douglas Carmichael\n"\ " Chris Conn - Arnout Cosman - Shlomi Fish - Paul Fisher - Tobias Gloth\n" \ " Roine Gustaffson - Bjornar Henden - Simon Hosie - Stephan Kanthak\n" \ " Alexander Kerkhove - ``Kodiak'' - Mario Koeppen - Mike Leibow\n" \ " Andy Lo A Foe - Frank Loemker - Sylvain Marchand - Claudio Matsuoka\n" \ " Jeremy McDonald - Steve McIntyre - Brian McKinney - Samuel A Megens\n" \ " ``MenTaLguY'' - Jean-Paul Mikkers - Thomas Neumann - C Ray C\n" \ " Steffen Rusitschka - Ozkan Sezer - Jake Stine - Stefan Tibus - Tinic Urou\n"\ " Miodrag Vallat - Kev Vance - Lutz Vieweg - Vince Vu\n" \ " Valtteri Vuorikoski - Andrew Zabolotny\n" \ "\n" \ " - This program is free software covered by the GNU General Public License\n" \ " and comes with ABSOLUTELY NO WARRANTY.\n" \ "\nType 'mikmod -h' for command line options!\n" #define pausebanner \ "'||''|. | '||' '|' .|'''.| '||''''| '||''|. \n" \ " || || ||| || | ||.. ' || . || || \n" \ " ||...|' | || || | ''|||. ||''| || ||\n" \ " || .''''|. || | . '|| || || ||\n" \ ".||. .|. .||. '|..' |'....|' .||.....|.||...|' \n" #define extractbanner \ "'||''''| . . || \n" \ " || . ... ....||. ... .. .... .... .||. ... .. ... ... .\n" \ " ||''| '|..' || ||' '''' .|| .| '' || || || || || || \n" \ " || .|. || || .|' || || || || || || |'' \n" \ ".||.....|.| ||. '|.'.||. '|..'|' '|...' '|.'.||..||. ||.'||||.\n" \ " .|....'\n" #define loadbanner \ "'||' '|| || \n" \ " || ... .... .. || ... .. ... ... .\n" \ " || .| '|. '' .|| .' '|| || || || || || \n" \ " || || || .|' || |. || || || || |'' \n" \ ".||.....| '|..|' '|..'|' '|..'||. .||. .||. || .'||||.\n" \ " .|....'\n" /*========== Player control */ void Player_SetNextMod(int pos); #endif /* ex:set ts=4: */ mikmod-3.2.8/src/mconfig.c0000644000000000000000000007234413040414034014062 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mconfig.c,v 1.3 2004/01/29 17:36:13 raph Exp $ Configuration file management ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "player.h" #include "mconfig.h" #include "mwindow.h" #include "mlist.h" #include "mutilities.h" #include "rcfile.h" static LABEL_CONV renice_conv[] = { {RENICE_NONE, "RENICE_NONE"}, {RENICE_PRI, "RENICE_PRI"}, {RENICE_REAL, "RENICE_REAL"}, {-1, NULL} }; static LABEL_CONV attrs_mono_conv[] = { {A_NORMAL, "normal"}, {A_BOLD, "bold"}, {A_REVERSE, "reverse"}, {-1, NULL} }; static const char *attrs_colf_label[] = { "black","blue","green","cyan","red","magenta","brown","gray", "b_black","b_blue","b_green","b_cyan","b_red","b_magenta", "yellow","white", NULL }; static const char *attrs_colb_label[] = { "black","blue","green","cyan","red","magenta","brown","gray", NULL }; const char *attrs_label[ATTRS_COUNT] = { "WARNING", "TITLE", "BANNER", "SONG_STATUS", "INFO_INACTIVE", "INFO_ACTIVE", "INFO_IHOTKEY", "INFO_AHOTKEY", "HELP", "PLAYENTRY_INACTIVE", "PLAYENTRY_ACTIVE", "SAMPLES", "SAMPLES_KICK3", "SAMPLES_KICK2", "SAMPLES_KICK1", "SAMPLES_KICK0", "CONFIG", "VOLBAR", "VOLBAR_LOW", "VOLBAR_MED", "VOLBAR_HIGH", "VOLBAR_INSTR", "MENU_FRAME", "MENU_INACTIVE", "MENU_ACTIVE", "MENU_IHOTKEY", "MENU_AHOTKEY", "DLG_FRAME", "DLG_LABEL", "DLG_STR_TEXT", "DLG_STR_CURSOR", "DLG_BUT_INACTIVE", "DLG_BUT_ACTIVE", "DLG_BUT_IHOTKEY", "DLG_BUT_AHOTKEY", "DLG_BUT_ITEXT", "DLG_BUT_ATEXT", "DLG_LIST_FOCUS", "DLG_LIST_NOFOCUS", "STATUS_LINE", "STATUS_TEXT" }; /*========== Color scheme */ static int color_attributes[ATTRS_COUNT] = { COLOR_RED_B | COLOR_WHITE_F, /* ATTR_WARNING */ COLOR_CYAN_B | COLOR_WHITE_F, /* ATTR_TITLE */ COLOR_BLACK_B | COLOR_LGREEN_F, /* ATTR_BANNER */ COLOR_BLUE_B | COLOR_WHITE_F, /* ATTR_SONG_STATUS */ COLOR_CYAN_B | COLOR_BLUE_F, /* ATTR_INFO_INACTIVE */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_INFO_ACTIVE */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_INFO_IHOTKEY */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_INFO_AHOTKEY */ COLOR_BLACK_B | COLOR_BROWN_F, /* ATTR_HELP */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_PLAYENTRY_INACTIVE */ COLOR_BLACK_B | COLOR_LCYAN_F, /* ATTR_PLAYENTRY_ACTIVE */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_SAMPLES */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_SAMPLES_KICK3 */ COLOR_BLACK_B | COLOR_LCYAN_F, /* ATTR_SAMPLES_KICK2 */ COLOR_BLACK_B | COLOR_LBLUE_F, /* ATTR_SAMPLES_KICK1 */ COLOR_BLACK_B | COLOR_BLUE_F, /* ATTR_SAMPLES_KICK0 */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_CONFIG */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_VOLBAR */ COLOR_BLACK_B | COLOR_LGREEN_F, /* ATTR_VOLBAR_LOW */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_VOLBAR_MED */ COLOR_BLACK_B | COLOR_LRED_F, /* ATTR_VOLBAR_HIGH */ COLOR_BLACK_B | COLOR_GREEN_F, /* ATTR_VOLBAR_INSTR */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_MENU_FRAME */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_MENU_INACTIVE */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_MENU_ACTIVE */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_MENU_IHOTKEY */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_MENU_AHOTKEY */ COLOR_GRAY_B | COLOR_BLACK_F, /* ATTR_DLG_FRAME */ COLOR_GRAY_B | COLOR_BLUE_F, /* ATTR_DLG_LABEL */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_DLG_STR_TEXT */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_DLG_STR_CURSOR */ COLOR_CYAN_B | COLOR_GRAY_F, /* ATTR_DLG_BUT_INACTIVE */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_DLG_BUT_ACTIVE */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_DLG_BUT_IHOTKEY */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_DLG_BUT_AHOTKEY */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_DLG_BUT_ITEXT */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_DLG_BUT_ATEXT */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_DLG_LIST_FOCUS */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_DLG_LIST_NOFOCUS */ COLOR_BLACK_B | COLOR_LCYAN_F, /* ATTR_STATUS_LINE */ COLOR_BLACK_B | COLOR_CYAN_F /* ATTR_STATUS_TEXT */ }; static int mono_attributes[ATTRS_COUNT] = { A_REVERSE, /* ATTR_WARNING */ A_REVERSE, /* ATTR_TITLE */ A_NORMAL, /* ATTR_BANNER */ A_NORMAL, /* ATTR_SONG_STATUS */ A_REVERSE, /* ATTR_INFO_INACTIVE */ A_NORMAL, /* ATTR_INFO_ACTIVE */ A_NORMAL, /* ATTR_INFO_IHOTKEY */ A_NORMAL, /* ATTR_INFO_AHOTKEY */ A_NORMAL, /* ATTR_HELP */ A_NORMAL, /* ATTR_PLAYENTRY_INAVTIVE */ A_REVERSE, /* ATTR_PLAYENTRY_ACTIVE */ A_NORMAL, /* ATTR_SAMPLES */ A_BOLD, /* ATTR_SAMPLES_KICK3 */ A_NORMAL, /* ATTR_SAMPLES_KICK2 */ A_NORMAL, /* ATTR_SAMPLES_KICK1 */ A_NORMAL, /* ATTR_SAMPLES_KICK0 */ A_NORMAL, /* ATTR_CONFIG */ A_NORMAL, /* ATTR_VOLBAR */ A_NORMAL, /* ATTR_VOLBAR_LOW */ A_NORMAL, /* ATTR_VOLBAR_MED */ A_BOLD, /* ATTR_VOLBAR_HIGH */ A_NORMAL, /* ATTR_VOLBAR_INSTR */ A_REVERSE, /* ATTR_MENU_FRAME */ A_REVERSE, /* ATTR_MENU_INACTIVE */ A_NORMAL, /* ATTR_MENU_ACTIVE */ A_NORMAL, /* ATTR_MENU_IHOTKEY */ A_REVERSE, /* ATTR_MENU_AHOTKEY */ A_REVERSE, /* ATTR_DLG_FRAME */ A_REVERSE, /* ATTR_DLG_LABEL */ A_NORMAL, /* ATTR_DLG_STR_TEXT */ A_REVERSE, /* ATTR_DLG_STR_CURSOR */ A_REVERSE, /* ATTR_DLG_BUT_INACTIVE */ A_BOLD, /* ATTR_DLG_BUT_ACTIVE */ A_NORMAL, /* ATTR_DLG_BUT_IHOTKEY */ A_REVERSE, /* ATTR_DLG_BUT_AHOTKEY */ A_REVERSE, /* ATTR_DLG_BUT_ITEXT */ A_BOLD, /* ATTR_DLG_BUT_ATEXT */ A_BOLD, /* ATTR_DLG_LIST_FOCUS */ A_NORMAL, /* ATTR_DLG_LIST_NOFOCUS */ A_NORMAL, /* ATTR_STATUS_LINE */ A_NORMAL /* ATTR_STATUS_TEXT */ }; /*========== default archiver */ /* The following table describes how MikMod should deal with archives. The first two fields are for identification. The code will consider that a given file is a recognized archive if a signature is found at a fixed location in the file. The first field is the offset into the archive of the signature, and the second field points to the signature to check. If the offset is negative, the extension of the file is matched against the parts of the second field. The third field contains the name of the program and its arguments to invoke to list the archive. Here %A is replaced with the archive name and %a with a short version of the archive name (for DOS and WIN) or the archive name. For the special case of mono-file archives (gzip and bzip2 compressed files, for example), set this field to NULL. In this case, the code will determine the contents of the file without having to invoke the list function of the archiver. This is necessary since bzip2 has no list function, and the only way to get the archive contents is to test it, which can be a really slow process. The fourth field is the column in the archive listing output where the filenames begin (starting from zero for the leftmost column). A good archiver will put them last on the line, so they can embed spaces and be as long as necessary. The fifth field contains the program and its arguments to extract the modules from archives. Here %A is replaced with the archive name, %a with a short version of the archive name (for DOS and WIN) or the archive name, %f with the file name, and %d with the destination name (for non UNIX systems only). The last three fields specify which part to use from the extracted file (if the extraction program mixes status information and the module). The first skipstart lines starting from the first occurence of skippat and the last skipend lines from the extracted file are removed. */ /* use similar signature idea to "file" to see what format we have... */ static char pksignat[] = "PK\x03\x04"; static char zoosignat[] = "\xdc\xa7\xc4\xfd"; static char rarsignat[] = "Rar!"; static char gzsignat[] = "\x1f\x8b"; static char bzip2signat[] = "BZh"; static char tarsignat[] = "ustar"; static char lhsignat[] = "-lh"; static char lzsignat[] = "-lz"; /* interesting file extensions */ static char targzext[] = ".TAR.GZ .TAZ .TGZ"; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) static char tarbzip2ext[] = ".TAR.BZ2 .TBZ .TBZ2"; #endif static ARCHIVE archiver_def[] = { /* location, marker, list, filenames column, extract, skippat, skipstart, skipend */ #ifdef _mikmod_amiga { 0, pksignat, "unzip -vqq \"%a\" > \"%d\"", 58, "unzip -pqq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 20, zoosignat, "zoo lq \"%a\" > \"%d\"", 47, "zoo xpq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 0, rarsignat, "unrar v -c- \"%a\" > \"%d\"", 1, "unrar p -inul \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 2, lhsignat, "lha vvq \"%a\" > \"%d\"", -1, "lha pq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 2, lzsignat, "lha vvq \"%a\" > \"%d\"", -1, "lha pq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, {257, tarsignat, "tar -tf \"%a\" > \"%d\"", 0, "tar -xOf \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { -1, targzext, "tar -tzf \"%a\" > \"%d\"", 0, "tar -xOzf \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { -1, tarbzip2ext, "tar --use-compress-program=bzip2 -tf \"%a\" > \"%d\"", 0, "tar --use-compress-program=bzip2 -xOf \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 0, gzsignat, NULL, 0, "gzip -dqc \"%a\" > \"%d\"", NULL, 0, 0}, { 0, bzip2signat, NULL, 0, "bzip2 -dqc \"%a\" > \"%d\"", NULL, 0, 0} #elif !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) { 0, pksignat, "unzip -vqq \"%a\"", 58, "unzip -pqq \"%a\" \"%f\"", NULL, 0, 0}, { 20, zoosignat, "zoo lq \"%a\"", 47, "zoo xpq \"%a\" \"%f\"", NULL, 0, 0}, { 0, rarsignat, "unrar v -c- \"%a\"", 1, "unrar p -inul \"%a\" \"%f\"", NULL, 0, 0}, { 2, lhsignat, "lha vvq \"%a\"", -1, "lha pq \"%a\" \"%f\"", NULL, 0, 0}, { 2, lzsignat, "lha vvq \"%a\"", -1, "lha pq \"%a\" \"%f\"", NULL, 0, 0}, {257, tarsignat, "tar -tf \"%a\"", 0, "tar -xOf \"%a\" \"%f\"", NULL, 0, 0}, { -1, targzext, "tar -tzf \"%a\"", 0, "tar -xOzf \"%a\" \"%f\"", NULL, 0, 0}, { -1, tarbzip2ext, "tar --use-compress-program=bzip2 -tf \"%a\"", 0, "tar --use-compress-program=bzip2 -xOf \"%a\" \"%f\"", NULL, 0, 0}, { 0, gzsignat, NULL, 0, "gzip -dqc \"%a\"", NULL, 0, 0}, { 0, bzip2signat, NULL, 0, "bzip2 -dqc \"%a\"", NULL, 0, 0} #else /* { 0, pksignat, "unzip -lqq \"%a\"", 41, "unzip -pqq \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, { 0, rarsignat, "unrar v -c- \"%a\"", 1, "unrar p -inul \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, {257, tarsignat, "tar -tf \"%a\"", 0, "tar -xOf \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, */ { 0, pksignat, "pkunzip -vb \"%a\"", 47, "pkunzip -c \"%a\" \"%f\" >\"%d\"", "to console", 2, 1}, { 20, zoosignat, "zoo lq \"%a\"", 47, "zoo xpq \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, { 0, rarsignat, "rar v -y -c- \"%a\"", 1, "rar p -y -c- \"%a\" \"%f\" >\"%d\"", "--- Printing ", 2, 2}, { 2, lhsignat, "lha v %a", -1, "lha p /n %a %f >\"%d\"", NULL, 3, 0}, { 2, lzsignat, "lha v %a", -1, "lha p /n %a %f >\"%d\"", NULL, 3, 0}, {257, tarsignat, "djtar -t \"%A\"", 36, "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"", NULL, 0, 0}, { -1, targzext, "djtar -t \"%A\"", 36, "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"", NULL, 0, 0}, { 0, gzsignat, NULL, 27, "gzip -dqc \"%a\" >\"%d\"", NULL, 0, 0}, { 0, bzip2signat, NULL, 0, "bzip2 -dqc \"%a\" >\"%d\"", NULL, 0, 0} #endif }; #define CNT_ARCHIVER_DEF (sizeof(archiver_def)/sizeof(archiver_def[0])) char *CF_GetFilename(void) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) return get_cfg_name("mikmod.cfg"); #else return get_cfg_name(".mikmodrc"); #endif } char *CF_GetDefaultFilename(void) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) return NULL; #else return str_sprintf2("%s" PATH_SEP_STR "%s", PACKAGE_DATA_DIR, "mikmodrc"); #endif } static void init_themes(CONFIG *cfg) { cfg->cnt_themes = THEME_COUNT; cfg->themes = (THEME *) malloc (sizeof(THEME)*cfg->cnt_themes); cfg->themes[THEME_COLOR].name = ""; cfg->themes[THEME_COLOR].color = 1; cfg->themes[THEME_COLOR].attrs = color_attributes; cfg->themes[THEME_MONO].name = ""; cfg->themes[THEME_MONO].color = 0; cfg->themes[THEME_MONO].attrs = mono_attributes; cfg->theme = THEME_COLOR; } static void write_theme(THEME *theme) { int i; rc_write_string("NAME", theme->name, NULL); if (theme->color) { char str[30]; for (i=0; iattrs[i] & (COLOR_FMASK+COLOR_BOLDMASK)) >> COLOR_FSHIFT]); strcat (str,","); strcat (str,attrs_colb_label [(theme->attrs[i] & COLOR_BMASK) >> COLOR_BSHIFT]); rc_write_string(attrs_label[i], str, NULL); } } else { for (i=0; iattrs[i],NULL); } } void CF_theme_free (THEME *theme) { if (theme) { if (theme->name) free (theme->name); if (theme->attrs) free (theme->attrs); } } void CF_theme_copy (THEME *dest, THEME *src) { dest->color = src->color; dest->name = strdup (src->name); dest->attrs = (int *) malloc (sizeof(int)*ATTRS_COUNT); memcpy (dest->attrs,src->attrs,sizeof(int)*ATTRS_COUNT); } /* Free all themes and return {NULL, 0} */ void CF_themes_free (THEME **themes, int *cnt) { if (themes && *themes) { int i; for (i=0; i<*cnt; i++) CF_theme_free (&(*themes)[i]); free (*themes); } *cnt = 0; if (themes) *themes = NULL; } /* Free the user themes (themes above THEME_COUNT) */ void CF_themes_free_user (THEME **themes, int *cnt) { if (themes && *themes) { int i; for (i=THEME_COUNT; i<*cnt; i++) CF_theme_free (&(*themes)[i]); *cnt = THEME_COUNT; *themes = (THEME *) realloc (*themes, sizeof(THEME)*(*cnt)); } } /* Free the theme at 'pos' in the array themes (length: cnt) */ void CF_theme_remove (int pos, THEME **themes, int *cnt) { int i; if (*cnt>0) { (*cnt)--; if (*themes) CF_theme_free (&(*themes)[pos]); if (*cnt>0) { for (i=pos; i<*cnt; i++) (*themes)[i] = (*themes)[i+1]; *themes = (THEME *) realloc (*themes, sizeof(THEME)*(*cnt)); } else { free (*themes); *themes = NULL; } } } /* Copy theme and insert it alphabetically sorted in themes (after the intern themes). cnt: size of the array themes Return: position of insertion */ int CF_theme_insert (THEME **themes, int *cnt, THEME *theme) { int i, pos = *cnt; if (*cnt >= THEME_COUNT) { pos = THEME_COUNT; while (pos<*cnt && strcasecmp((*themes)[pos].name,theme->name) < 0) pos++; } (*cnt)++; *themes = (THEME *) realloc (*themes,sizeof(THEME)*(*cnt)); for (i=*cnt-1; i>pos; i--) (*themes)[i] = (*themes)[i-1]; CF_theme_copy (&(*themes)[pos], theme); return pos; } static void read_theme(CONFIG *cfg) { int i, fg, bg; int attrs[ATTRS_COUNT]; THEME theme = {NULL,-1,NULL}; char *str = NULL, *pos, *end; theme.attrs = attrs; if (!rc_read_string("NAME", &theme.name, THEME_NAME_LEN)) return; for (i=0; ithemes, &cfg->cnt_themes, &theme); free (theme.name); } static void write_archiver(ARCHIVE *archiver) { rc_write_int("LOCATION", archiver->location, NULL); rc_write_string("MARKER", archiver->marker, NULL); rc_write_string("LIST", archiver->list, NULL); rc_write_int("NAMEOFFSET", archiver->nameoffset, NULL); rc_write_string("EXTRACT", archiver->extract, NULL); rc_write_string("SKIPPAT", archiver->skippat, NULL); rc_write_int("SKIPSTART", archiver->skipstart, NULL); rc_write_int("SKIPEND", archiver->skipend, NULL); } static void read_archiver(CONFIG *cfg) { ARCHIVE arch; memset (&arch, 0, sizeof(ARCHIVE)); if (!rc_read_int("LOCATION", &arch.location, -1, 999)) return; rc_read_string("MARKER", &arch.marker, 999); rc_read_string("LIST", &arch.list, PATH_MAX+200); rc_read_int("NAMEOFFSET", &arch.nameoffset, -1, 999); rc_read_string("EXTRACT", &arch.extract, PATH_MAX+200); rc_read_string("SKIPPAT", &arch.skippat, 999); rc_read_int("SKIPSTART", &arch.skipstart, 0, 999); rc_read_int("SKIPEND", &arch.skipend, 0, 999); if (cfg->archiver == archiver_def) { cfg->cnt_archiver = 1; cfg->archiver = (ARCHIVE *) malloc (sizeof(ARCHIVE)); } else { cfg->cnt_archiver++; cfg->archiver = (ARCHIVE *) realloc (cfg->archiver, sizeof(ARCHIVE)*cfg->cnt_archiver); } cfg->archiver[cfg->cnt_archiver-1] = arch; } void CF_Init(CONFIG *cfg) { cfg->driver = 0; #if LIBMIKMOD_VERSION >= 0x030107 rc_set_string(&cfg->driveroptions, "", 255); #endif cfg->stereo = 1; cfg->mode_16bit = 1; cfg->frequency = 44100; cfg->interpolate = 1; cfg->hqmixer = 0; cfg->surround = 0; cfg->reverb = 0; cfg->volume = 100; cfg->volrestrict = 0; cfg->fade = 0; cfg->loop = 0; cfg->panning = 1; cfg->extspd = 1; cfg->playmode = PM_MULTI; cfg->curious = 0; cfg->tolerant = 1; cfg->renice = RENICE_NONE; cfg->statusbar = 2; cfg->save_config = 1; cfg->save_playlist = 1; rc_set_string(&cfg->pl_name, "playlist.mpl", PATH_MAX); cfg->cnt_hotlist = 0; cfg->hotlist = NULL; cfg->fullpaths = 0; #if LIBMIKMOD_VERSION >= 0x030200 cfg->forcesamples = 0; cfg->fakevolbars = 1; #endif cfg->window_title = 1; init_themes (cfg); cfg->cnt_archiver = CNT_ARCHIVER_DEF; cfg->archiver = archiver_def; } BOOL CF_Save(CONFIG * cfg) { char *name; int i; if (!(name = CF_GetFilename())) return 0; if (!rc_save (name,mikversion)) { free(name); rc_close(); return 0; } free(name); rc_write_int("DRIVER", cfg->driver, "DRIVER = , nth driver for output, default: 0\n"); #if LIBMIKMOD_VERSION >= 0x030107 rc_write_string("DRV_OPTIONS", cfg->driveroptions, "DRV_OPTIONS = \"options\", the driver options, e.g. \"buffer=14,count=16\"\n" " for the OSS-driver\n"); #endif rc_write_bool("STEREO", cfg->stereo, "STEREO = Yes|No, stereo or mono output, default: stereo\n"); rc_write_bool("16BIT", cfg->mode_16bit, "16BIT = Yes|No, 8 or 16 bit output, default: 16 bit\n"); rc_write_int("FREQUENCY", cfg->frequency, "FREQUENCY = , mixing frequency, default: 44100 Hz\n"); rc_write_bool("INTERPOLATE", cfg->interpolate, "INTERPOLATE = Yes|No, use interpolate mixing, default: Yes\n"); rc_write_bool("HQMIXER", cfg->hqmixer, "HQMIXER = Yes|No, use high-quality (but slow) software mixer, default: No\n"); rc_write_bool("SURROUND", cfg->surround, "SURROUND = Yes|No, use surround mixing, default: No\n"); rc_write_int("REVERB", cfg->reverb, "REVERB = , set reverb amount (0-15), default: 0 (none)\n"); rc_write_int("VOLUME", cfg->volume, "VOLUME = , volume from 0 (silence) to 100, default: 100\n"); rc_write_bool("VOLRESTRICT", cfg->volrestrict, "VOLRESTRICT = Yes|No, restrict volume of player to volume supplied by user,\n" " default: No\n"); rc_write_bool("FADEOUT", cfg->fade, "FADEOUT = Yes|No, volume fade at the end of the module, default: No\n"); rc_write_bool("LOOP", cfg->loop, "LOOP = Yes|No, enable in-module loops, default: No\n"); rc_write_bool("PANNING", cfg->panning, "PANNING = Yes|No, process panning effects, default: Yes\n"); rc_write_bool("EXTSPD", cfg->extspd, "EXTSPD = Yes|No, process Protracker extended speed effect, default: Yes\n"); rc_write_bool("PM_MODULE", BTST(cfg->playmode, PM_MODULE), "PM_MODULE = Yes|No, Module repeats, default: No\n"); rc_write_bool("PM_MULTI", BTST(cfg->playmode, PM_MULTI), "PM_MULTI = Yes|No, PlayList repeats, default: Yes\n"); rc_write_bool("PM_SHUFFLE", BTST(cfg->playmode, PM_SHUFFLE), "PM_SHUFFLE = Yes|No, Shuffle list at start and if all entries are played,\n" " default: No\n"); rc_write_bool("PM_RANDOM", BTST(cfg->playmode, PM_RANDOM), "PM_RANDOM = Yes|No, PlayList in random order, default: No\n"); rc_write_bool("CURIOUS", cfg->curious, "CURIOUS = Yes|No, look for hidden patterns in module, default: No\n"); rc_write_bool("TOLERANT", cfg->tolerant, "TOLERANT = Yes|No, don't halt on file access errors, default: Yes\n"); rc_write_label("RENICE", renice_conv, cfg->renice, "RENICE = RENICE_NONE (change nothing), RENICE_PRI (Renice to -20) or\n" " RENICE_REAL (get realtime priority), default: RENICE_NONE\n" " Note that RENICE_PRI is only available under FreeBSD, Linux, NetBSD,\n" " OpenBSD and OS/2, and RENICE_REAL is only available under FreeBSD, Linux\n" " and OS/2.\n"); rc_write_int("STATUSBAR", cfg->statusbar, "STATUSBAR = , size of statusbar from 0 to 2, default: 2\n"); rc_write_bool("SAVECONFIG", cfg->save_config, "SAVECONFIG = Yes|No, save configuration on exit, default: Yes\n"); rc_write_bool("SAVEPLAYLIST", cfg->save_playlist, "SAVEPLAYLIST = Yes|No, save playlist on exit, default: Yes\n"); rc_write_string("PL_NAME", cfg->pl_name, "PL_NAME = \"name\", name under which the playlist will be saved\n" " by selecting 'Save' in the playlist-menu\n"); if (cfg->cnt_hotlist > 0) { rc_write_string("HOTLIST", cfg->hotlist[0], "HOTLIST = \"name\", entries in the directory hotlist,\n" " can occur any time in this file\n"); for (i=1; icnt_hotlist; i++) rc_write_string("HOTLIST",cfg->hotlist[i],NULL); } rc_write_bool("FULLPATHS", cfg->fullpaths, "FULLPATHS = Yes|No, display full path of files, default: Yes\n"); #if LIBMIKMOD_VERSION >= 0x030200 rc_write_bool("FORCESAMPLES", cfg->forcesamples, "FORCESAMPLES = Yes|No, always display sample names (instead of\n" " instrument names) in volumebars panel, default: No\n"); rc_write_bool("FAKEVOLUMEBARS", cfg->fakevolbars, "FAKEVOLUMEBARS = Yes|No, display fast, but not always accurate, volumebars\n" " in volumebars panel, default: Yes\n" " The real volumebars (when this setting is \"No\") take some CPU time to\n" " be computed, and don't work with every driver.\n"); #endif rc_write_bool("WINDOWTITLE", cfg->window_title, "WINDOWTITLE = Yes|No, set the term/window title to song name\n" " (or filename if song has no title), default: Yes\n"); rc_write_string ("THEME",cfg->themes[cfg->theme].name, "THEME = \"name\", name of the theme to use, default: "); if (cfg->cnt_themes>THEME_COUNT) { rc_write_struct ("THEME", "Definition of the themes\n" " NAME = \"name\", specifies the name of the theme\n" " = normal | bold | reverse , for mono themes or\n" " = , , for color themes\n" " where = black | blue | green | cyan | red | magenta |\n" " brown | gray | b_black | b_blue | b_green |\n" " b_cyan | b_red | b_magenta | yellow | white\n" " = black | blue | green | cyan | red | magenta |\n" " brown | gray\n"); write_theme (&cfg->themes[THEME_COUNT]); rc_write_struct_end (NULL); for (i=THEME_COUNT+1; icnt_themes; i++) { rc_write_struct ("THEME",NULL); write_theme (&cfg->themes[i]); rc_write_struct_end (NULL); } } if (cfg->cnt_archiver > 0) { rc_write_struct ("ARCHIVER", "Definition of the archiver\n" " LOCATION = , -1: MARKER gives list of possible file extensions\n" " otherwise: location where MARKER must be found in the file\n" " MARKER = , see LOCATION, e.g. \".TAR.GZ .TGZ\" or \"PK\\x03\\x04\"\n" " LIST = , command to list archive content (%A archive name,\n" " %a short(DOS/WIN) archive name)\n" " NAMEOFFSET = , column where file names begin,\n" " -1: start at column 0 and end at first space\n" " EXTRACT = , command to extract a file to stdout (%A archive name,\n" " %a short archive name, %f file name, %d destination name(non UNIX))\n" " SKIPPAT = , Remove the first SKIPSTART lines starting from the first\n" " occurence of SKIPPAT and the last SKIPEND lines from the\n" " extracted file (if the command EXTRACT mixes status\n" " information and the module).\n" " SKIPSTART = , \n" " SKIPEND = , \n"); write_archiver (&cfg->archiver[0]); rc_write_struct_end (NULL); for (i=1; icnt_archiver; i++) { rc_write_struct ("ARCHIVER",NULL); write_archiver (&cfg->archiver[i]); rc_write_struct_end (NULL); } } rc_close(); return 1; } void CF_string_array_insert (int pos, char ***value, int *cnt, char *arg, int length) { int i; (*cnt)++; *value = (char **) realloc (*value, sizeof(char*)*(*cnt)); for (i=*cnt-1; i>pos; i--) (*value)[i] = (*value)[i-1]; (*value)[pos] = NULL; rc_set_string (&(*value)[pos], arg, length); } void CF_string_array_remove (int pos, char ***value, int *cnt) { int i; if (*cnt>0) { (*cnt)--; if (*value && (*value)[pos]) free ((*value)[pos]); if (*cnt>0) { for (i=pos; i<*cnt; i++) (*value)[i] = (*value)[i+1]; *value = (char **) realloc (*value, sizeof(char*)*(*cnt)); } else { free (*value); *value = NULL; } } } BOOL CF_Load(CONFIG *cfg) { char *name = CF_GetFilename(), *str = NULL; int i; if (!name) return 0; if (!rc_load(name)) { free(name); rc_close(); name = CF_GetDefaultFilename(); if (!name) return 0; if (!rc_load(name)) { free(name); rc_close(); return 0; } } free(name); rc_read_int("DRIVER", &cfg->driver, 0, 999); #if LIBMIKMOD_VERSION >= 0x030107 rc_read_string("DRV_OPTIONS", &cfg->driveroptions, 255); #endif rc_read_bool("STEREO", &cfg->stereo); rc_read_bool("16BIT", &cfg->mode_16bit); rc_read_int("FREQUENCY", &cfg->frequency, 4000, 60000); rc_read_bool("INTERPOLATE", &cfg->interpolate); rc_read_bool("HQMIXER", &cfg->hqmixer); rc_read_bool("SURROUND", &cfg->surround); rc_read_int("REVERB", &cfg->reverb, 0, 15); rc_read_int("VOLUME", &cfg->volume, 0, 100); rc_read_bool("VOLRESTRICT", &cfg->volrestrict); rc_read_bool("FADEOUT", &cfg->fade); rc_read_bool("LOOP", &cfg->loop); rc_read_bool("PANNING", &cfg->panning); rc_read_bool("EXTSPD", &cfg->extspd); rc_read_bit("PM_MODULE", &cfg->playmode, PM_MODULE); rc_read_bit("PM_MULTI",&cfg->playmode, PM_MULTI); rc_read_bit("PM_SHUFFLE", &cfg->playmode, PM_SHUFFLE); rc_read_bit("PM_RANDOM", &cfg->playmode, PM_RANDOM); rc_read_bool("CURIOUS", &cfg->curious); rc_read_bool("TOLERANT", &cfg->tolerant); rc_read_label("RENICE", &cfg->renice, renice_conv); rc_read_int("STATUSBAR", &cfg->statusbar, 0, 2); rc_read_bool("SAVECONFIG", &cfg->save_config); rc_read_bool("SAVEPLAYLIST", &cfg->save_playlist); rc_read_string("PL_NAME", &cfg->pl_name, PATH_MAX); path_conv(cfg->pl_name); while (rc_read_string("HOTLIST",&str,PATH_MAX)) { path_conv(str); CF_string_array_insert (cfg->cnt_hotlist, &cfg->hotlist, &cfg->cnt_hotlist, str, PATH_MAX); } rc_read_bool("FULLPATHS", &cfg->fullpaths); #if LIBMIKMOD_VERSION >= 0x030200 rc_read_bool("FORCESAMPLES", &cfg->forcesamples); rc_read_bool("FAKEVOLUMEBARS", &cfg->fakevolbars); #endif rc_read_bool("WINDOWTITLE", &cfg->window_title); while (rc_read_struct("THEME")) { read_theme (cfg); rc_read_struct_end(); } if (rc_read_string("THEME", &str, THEME_NAME_LEN)) { for (i=0; icnt_themes; i++) { if (!strcasecmp(str,cfg->themes[i].name)) { cfg->theme = i; break; } } } while (rc_read_struct("ARCHIVER")) { read_archiver (cfg); rc_read_struct_end(); } free (str); rc_close(); return 1; } /* ex:set ts=4: */ mikmod-3.2.8/src/Makefile.in0000644000000000000000000005256313071724200014345 0ustar rootroot# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = mikmod$(EXEEXT) subdir = src DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \ $(top_srcdir)/m4/libmikmod.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_mikmod_OBJECTS = display.$(OBJEXT) marchive.$(OBJEXT) \ mikmod.$(OBJEXT) mlist.$(OBJEXT) mconfig.$(OBJEXT) \ mwindow.$(OBJEXT) mmenu.$(OBJEXT) mwidget.$(OBJEXT) \ mdialog.$(OBJEXT) mconfedit.$(OBJEXT) mutilities.$(OBJEXT) \ mplayer.$(OBJEXT) mlistedit.$(OBJEXT) rcfile.$(OBJEXT) mikmod_OBJECTS = $(am_mikmod_OBJECTS) mikmod_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mikmod_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(mikmod_SOURCES) $(EXTRA_mikmod_SOURCES) DIST_SOURCES = $(mikmod_SOURCES) $(EXTRA_mikmod_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_OBJ = @EXTRA_OBJ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_DATA_DIR = @PACKAGE_DATA_DIR@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLAYER_LIB = @PLAYER_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = @LIBMIKMOD_CFLAGS@ man_MANS = mikmod.1 mikmod_SOURCES = \ display.c marchive.c mikmod.c mlist.c mconfig.c mwindow.c mmenu.c \ mwidget.c mdialog.c mconfedit.c mutilities.c mplayer.c mlistedit.c \ rcfile.c noinst_HEADERS = \ display.h keys.h marchive.h mconfedit.h mconfig.h mdialog.h mlist.h \ mlistedit.h mmenu.h mplayer.h mthreads.h mutilities.h mwidget.h \ mwindow.h player.h rcfile.h EXTRA_mikmod_SOURCES = \ mfnmatch.c mgetopt.c mgetopt1.c musleep.c EXTRA_DIST = CMakeLists.txt \ dosvideo.inc os2video.inc winvideo.inc mfnmatch.h mgetopt.h $(man_MANS) mikmod_LDFLAGS = @LIBMIKMOD_LDADD@ mikmod_LDADD = @EXTRA_OBJ@ @LIBMIKMOD_LIBS@ @PLAYER_LIB@ mikmod_DEPENDENCIES = @EXTRA_OBJ@ all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) mikmod$(EXEEXT): $(mikmod_OBJECTS) $(mikmod_DEPENDENCIES) $(EXTRA_mikmod_DEPENDENCIES) @rm -f mikmod$(EXEEXT) $(mikmod_LINK) $(mikmod_OBJECTS) $(mikmod_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marchive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mconfedit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mconfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mdialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfnmatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgetopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgetopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mikmod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlistedit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mplayer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/musleep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutilities.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mwidget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mwindow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rcfile.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 mgetopt.o: $(srcdir)/mgetopt.c $(srcdir)/mgetopt.h $(COMPILE) -o $@ -c $(srcdir)/mgetopt.c mgetopt1.o: $(srcdir)/mgetopt1.c $(srcdir)/mgetopt.h $(COMPILE) -o $@ -c $(srcdir)/mgetopt1.c mfnmatch.o: $(srcdir)/mfnmatch.c $(srcdir)/mfnmatch.h $(COMPILE) -o $@ -c $(srcdir)/mfnmatch.c musleep.o: $(srcdir)/musleep.c $(COMPILE) -o $@ -c $(srcdir)/musleep.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mikmod-3.2.8/src/mlistedit.c0000644000000000000000000010331712365204164014443 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mlistedit.c,v 1.1.1.1 2004/01/16 02:07:43 raph Exp $ The playlist editor ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #if defined(__MINGW32__) || defined(__EMX__) || defined(__DJGPP__) #include #elif defined(__OS2__) /* Watcom */ #include #elif defined(_WIN32) /* MSVC, etc. */ #include #else #include #endif #include #include "mlistedit.h" #include "mlist.h" #include "player.h" #include "mdialog.h" #include "rcfile.h" #include "mconfig.h" #include "mconfedit.h" #include "marchive.h" #include "mwidget.h" #include "keys.h" #include "display.h" #include "mutilities.h" #define FREQ_SEL '*' #define FREQ_SEL_STR "*" #define FREQ_UNSEL ' ' #define FREQ_UNSEL_STR " " /* Function, which is called on Ok/Cancel button select button: 0: Ok 1: Cancel path: Selected file data: user-pointer which was passed to freq_open() Return: close fileselector? */ typedef BOOL (*handleFreqFunc) (int button, char *file, void *data); /* Function, which is called for every new directory during directory scanning in scan_dir(). scan_dir() is canceled if the function returns 1. */ typedef BOOL (*handleScandirFunc) (char *path, int added, int removed, void *data); typedef enum { FREQ_ADD, FREQ_TOGGLE, FREQ_REMOVE } FREQ_MODE; typedef struct { WID_LIST *w; /* the directory list */ char path[PATH_MAX<<1]; /* path of currently displayed directory */ BOOL before_add; /* TRUE until first call of entry_add() */ int actline; /* pos in playlist for insertion */ /* -1 -> append entries */ int cnt_list; char **searchlist; /* sorted playlist archives or files */ /* (if archives are not available)*/ handleFreqFunc handle_freq; void *data; } FREQ_DATA; typedef struct { WID_LIST *w; /* the directory list */ FREQ_DATA *freq; } HLIST_DATA; typedef struct { MMENU *menu; int *actLine; } MENU_DATA; typedef struct { WID_LABEL *w; BOOL stop; } FREQ_SCAN_DATA; /* compare function for qsort on the searchlist */ static int searchlist_cmp (char **key, char **member) { return (filecmp(*key,*member)); } /* compare function for bsearch on the searchlist */ static int searchlist_search_cmp (char *key, char **member) { return (filecmp(key,*member)); } /* compare function for qsort on the directory list */ static int dirlist_cmp (char **small, char **big) { if (IS_PATH_SEP((*small)[strlen(*small)-1])) { if (IS_PATH_SEP((*big)[strlen(*big)-1])) return(filecmp(*small+2,*big+2)); else return -1; } else if (IS_PATH_SEP((*big)[strlen(*big)-1])) return 1; return(filecmp(*small+2,*big+2)); } /* compare function for bearch on the directory list */ static int dirlist_search_cmp (char *key, char **member) { if (IS_PATH_SEP(key[strlen(key)-1])) { if (IS_PATH_SEP((*member)[strlen(*member)-1])) return(filecmp(key,*member+2)); else return -1; } else if (IS_PATH_SEP((*member)[strlen(*member)-1])) return 1; return(filecmp(key,*member+2)); } /* Add/Remove tag marks to the files in entries (count: cnt) from directory path according to the searchlist */ static void freq_set_marks (char **entries, int cnt, const char *path, FREQ_DATA *data) { int i; char file[PATH_MAX<<1], *fstart; strcpy (file,path); fstart = file+strlen(file); for (i=0; icnt_list > 0 && bsearch (file,data->searchlist,data->cnt_list, sizeof(char*),(int(*)())searchlist_search_cmp)) *(entries[i]) = FREQ_SEL; else *(entries[i]) = FREQ_UNSEL; } } /* Check if size of playlist has changed (due to e.g. resolving of playlists). If so, rebuild searchlist. */ static void freq_check_searchlist (FREQ_DATA *data) { int i, len = PL_GetLength(&playlist); if (len != data->cnt_list) { data->searchlist = (char **) realloc (data->searchlist, sizeof(char*) * len); data->cnt_list = len; if (len) { for (i=0; iarchive) data->searchlist[i] = entry->archive; else data->searchlist[i] = entry->file; } qsort (data->searchlist, len, sizeof(char*),(int(*)())searchlist_cmp); } if (data->w) { freq_set_marks (data->w->entries,data->w->cnt,data->path,data); wid_repaint ((WIDGET*)data->w); } } } /* Insert ins in (already enlarged) searchlist pl. pl must be sorted (according to filecmp()).*/ static void entry_insert (int left, int right, char **pl, char *ins) { int pos=0, cmp=0, last = right; if (right<0) { pl[0] = ins; } else { while (left<=right) { pos = (left+right)/2; cmp = filecmp(ins,pl[pos]); if (cmp<0) right = pos-1; else left = pos+1; } if (cmp>0) pos++; for (cmp=last; cmp>=pos; cmp--) pl[cmp+1] = pl[cmp]; pl[pos] = ins; } } /* Insert entry path+file at position data->actline into the playlist and update the (before and afterwards sorted) searchlist and actline from data. Return: Number of added entries */ static int entry_add (char *path, char *file, FREQ_DATA *data) { int len, old_len = PL_GetLength(&playlist); char buffer[STORAGELEN]; strcpy (buffer,path); if (file) strcat (buffer,file); if (data) { if (data->actline < 0 && data->before_add) { /* "Load" was selected -> Remove old entries */ data->before_add = 0; PL_ClearList(&playlist); old_len = PL_GetLength(&playlist); freq_check_searchlist (data); } else PL_StartInsert(&playlist, data->actline); } MA_FindFiles(&playlist, buffer); PL_StopInsert(&playlist); len = PL_GetLength(&playlist); if (!old_len && len) PL_InitCurrent(&playlist); /* Update the searchlist */ if (len>old_len && data) { int i, start, end; data->searchlist = (char **) realloc (data->searchlist, sizeof(char*) * len); start = data->actline; if (start<0) start = old_len; end = start+len-old_len; for (i=start; iarchive ? entry->archive:entry->file; entry_insert (0,data->cnt_list-1,data->searchlist,ins); data->cnt_list++; } if (data->actline>=0) data->actline += len-old_len; } return len-old_len; } /* remove all entries with archive==path+file (or file==path+file, if archive not set) from the playlist and update the (before and afterwards sorted) searchlist and actline from data. Return: Number of removed entries */ static int entry_remove_by_name(char *path, char *file, FREQ_DATA *data) { int len = PL_GetLength(&playlist); char buffer[STORAGELEN]; int cnt_remove = 0, i; char **pos; strcpy (buffer,path); if (file) strcat (buffer,file); /* Update the searchlist */ while (data->cnt_list>0 && (pos = (char **) bsearch(buffer,data->searchlist,data->cnt_list, sizeof(char*),(int(*)())searchlist_search_cmp))) { while (pos < data->searchlist + data->cnt_list - 1) { *pos = *(pos+1); pos++; } data->cnt_list--; } data->searchlist = (char **) realloc (data->searchlist, sizeof(char*) * data->cnt_list); /* Remove the entries from the playlist */ for (i=len-1; i>=0; i--) { PLAYENTRY *entry = PL_GetEntry(&playlist, i); if (!filecmp (entry->archive ? entry->archive:entry->file, buffer)) { PL_DelEntry(&playlist, i); if (i < data->actline) data->actline--; cnt_remove++; } } return cnt_remove; } /* Scan directory path for modules and add all files to the playlist, which are not already in data->searchlist (if data!=NULL). recursive: Scan recursively links : Follow links */ static void scan_dir (char *path, BOOL recursive, BOOL links, FREQ_DATA *freq_data, FREQ_MODE mode, handleScandirFunc func, void *data, int *added, int *removed) { #define DIR_BLOCK 10 DIR *dir; struct dirent *entry; struct stat statbuf; char file[PATH_MAX<<1], *pathend, **dirs=NULL; int cnt = 0, max = 0, i; if ( #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32)&&!defined(_mikmod_amiga) !strcmp (path,"/proc/") || !strcmp (path,"/dev/") || #endif !(dir = opendir (path_conv_sys(path)))) return; if (func) { int add=-1, rem=-1; if (added) add = *added; if (removed) rem = *removed; if (func (path,add,rem,data)) { closedir (dir); return; } } strcpy (file,path); pathend = file+strlen(file); while ((entry = readdir (dir))) { strcpy (pathend,entry->d_name); path_conv(pathend); if (!lstat(path_conv_sys(file), &statbuf)) { if (S_ISDIR(statbuf.st_mode)) { /* if dir, process it after the files */ if (recursive && (links || !S_ISLNK(statbuf.st_mode)) && strcmp (entry->d_name,"..") && strcmp (entry->d_name,".")) { /* FIXME: check for cyclic links is missing */ if (cnt >= max) { max += DIR_BLOCK; dirs = (char **) realloc (dirs, sizeof(char*) * max); } dirs[cnt++] = strdup (entry->d_name); } } else if (!S_ISCHR(statbuf.st_mode) && !S_ISBLK(statbuf.st_mode) && !S_ISFIFO(statbuf.st_mode) && !S_ISSOCK(statbuf.st_mode) && MA_TestName (file, 0 , 0)) { /* file of known type: add/remove it */ char **pos = NULL; int j = 0; if (freq_data && freq_data->cnt_list > 0) pos = (char **) bsearch(file,freq_data->searchlist,freq_data->cnt_list, sizeof(char*),(int(*)())searchlist_search_cmp); if (pos) { if (mode != FREQ_ADD) { j = entry_remove_by_name(file, NULL, freq_data); if (removed) *removed += j; } else if (freq_data->actline < 0 && freq_data->before_add) { j = entry_add(file, NULL, freq_data); if (added) *added += j; } } else { if (mode != FREQ_REMOVE) { j = entry_add(file, NULL, freq_data); if (added) *added += j; } } } } while (win_main_iteration()); } /* now process dirs after files are already processed */ for (i=0; i= max) { max += ENT_BLOCK; *entries = (char **) realloc (*entries, sizeof(char*) * max); } strcpy (pathend,entry->d_name); path_conv (pathend); if (!stat(path_conv_sys(file), &statbuf)) if (S_ISDIR(statbuf.st_mode)) strcat (pathend,PATH_SEP_STR); help = (char *) malloc (sizeof(char) * (strlen(pathend) + 3)); strcpy (help," "); strcat (help,pathend); (*entries)[(*cnt)++] = help; } freq_set_marks (*entries,*cnt,path,data); closedir (dir); if (*cnt) qsort (*entries, *cnt, sizeof(char*),(int(*)())dirlist_cmp); } } /* free directory list read with freq_readdir() */ static void freq_freedir (char **entries, int cnt) { int i; for (i=0; iw->w.width-2; if (strlen(data->path) <= max) wid_list_set_title (data->w, data->path); else { char path[MAXWIDTH]; strcpy (path, "..."); strcat (path, &data->path[strlen(data->path)-max+3]); wid_list_set_title (data->w, path); } wid_repaint ((WIDGET*)data->w); } /* change directory to path (read directory and display it) */ static void freq_changedir (const char *path, FREQ_DATA *data) { char **entries, *last= NULL, *end, **pos = NULL, ch; int cnt; freq_readdir (path,&entries,&cnt,data); if (entries && cnt>0) { /* Check if new path is part of the old one and find position in entries where the old path continues to correctly reposition active entry */ if (strlen(path) < strlen(data->path)) { last = data->path+strlen(path); ch = *last; *last = '\0'; if (!filecmp (data->path, path)) { *last = ch; end = last; while (*end && !IS_PATH_SEP(*end)) end++; if (IS_PATH_SEP(*end)) { *(end+1) = '\0'; pos=(char**) bsearch(last, entries, cnt, sizeof(char*), (int(*)())dirlist_search_cmp); } else pos = NULL; } } if (!pos) pos = entries; strcpy (data->path, path); wid_list_set_entries (data->w, (const char **)entries, 0, cnt); wid_list_set_active (data->w, pos-entries); freq_set_title (data); freq_freedir (entries,cnt); } else dlg_error_show ("Unable to read directory \"%s\"!",path); } static void hlist_close (HLIST_DATA *data) { dialog_close(data->w->w.d); free (data); } static int cb_hlist_list_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { HLIST_DATA *data = (HLIST_DATA *) w->data; int cur = ((WID_LIST*)w)->cur; /* return in hotlist -> change to the selected dir */ freq_check_searchlist (data->freq); if (cur < config.cnt_hotlist) freq_changedir (config.hotlist[cur],data->freq); hlist_close(data); return EVENT_HANDLED; } return focus; } static int cb_hlist_button_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { HLIST_DATA *data = (HLIST_DATA *) w->data; int button = ((WID_BUTTON *) w)->active; int cur = data->w->cur; freq_check_searchlist (data->freq); switch (button) { case 0: /* change To */ if (cur < config.cnt_hotlist) freq_changedir (config.hotlist[cur],data->freq); hlist_close(data); break; case 1: /* Add current */ CF_string_array_insert (cur,&config.hotlist,&config.cnt_hotlist, data->freq->path,PATH_MAX); wid_list_set_entries (data->w,(const char **)config.hotlist,-1,config.cnt_hotlist); wid_repaint ((WIDGET*)data->w); break; case 2: /* Remove */ CF_string_array_remove (cur,&config.hotlist,&config.cnt_hotlist); wid_list_set_entries (data->w,(const char **)config.hotlist,-1,config.cnt_hotlist); wid_repaint ((WIDGET*)data->w); break; case 3: /* Cancel */ hlist_close(data); break; } return EVENT_HANDLED; } return focus; } /* open the directory hotlist editor */ static void freq_hotlist (FREQ_DATA *freq_data) { DIALOG *d = dialog_new(); WIDGET *w; HLIST_DATA *data = (HLIST_DATA *) malloc (sizeof(HLIST_DATA)); w = wid_list_add(d, 1, (const char **)config.hotlist, config.cnt_hotlist); wid_set_size (w, 74, 10); data->w = (WID_LIST*)w; data->freq = freq_data; wid_set_func(w, NULL, cb_hlist_list_focus, data); w = wid_button_add(d, 1, "|&Add current|&Remove|&Cancel", 0); wid_set_func(w, NULL, cb_hlist_button_focus, data); dialog_open(d, "Directory hotlist"); } /* Check if file is a directory and copy the resulting path from path and file to dest */ static BOOL path_update (char *dest, char *path, char *file) { char *end; if (!strcmp (file,".."PATH_SEP_STR)) { strcpy (dest, path); end = dest+strlen(dest)-2; while (end>dest && !IS_PATH_SEP(*end)) *end-- = '\0'; } else if (!strcmp (file,"."PATH_SEP_STR)) { strcpy (dest, path); } else if (IS_PATH_SEP(file[strlen(file)-1])) { strcpy (dest, path); strcat (dest, file); } else return 0; return 1; } static int cb_scan_dir_stop_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { if (((WID_BUTTON *) w)->active == 0) ((FREQ_SCAN_DATA*)w->data)->stop = 1; return EVENT_HANDLED; } return focus; } /* Show progress during directory scanning */ BOOL cb_freq_scan_dir (char *path, int added, int removed, void *data) { FREQ_SCAN_DATA *scan_data = (FREQ_SCAN_DATA*)data; if (strlen(path) > 50) sprintf (storage,"Scanning ...%s...\n" "%4d entrie(s) added, %4d entrie(s) removed", &path[strlen(path)-47], added, removed); else sprintf (storage,"Scanning %s...\n" "%4d entrie(s) added, %4d entrie(s) removed", path, added, removed); wid_label_set_label ((WID_LABEL*)(scan_data->w),storage); dialog_repaint (scan_data->w->w.d->win); win_refresh(); return scan_data->stop; } /* Scan directory path for modules and add/remove them to the playlist according to mode */ static void freq_scan_dir (char *path, FREQ_DATA *data, FREQ_MODE mode) { int added=0, removed=0; DIALOG *d = dialog_new(); WIDGET *w; FREQ_SCAN_DATA scan_data; scan_data.stop = 0; if (strlen(path) > 50) sprintf (storage,"Scanning ...%-47s...\n" " 0 entrie(s) added, 0 entrie(s) removed", &path[strlen(path)-47]); else sprintf (storage,"Scanning %-50s...\n" " 0 entrie(s) added, 0 entrie(s) removed",path); scan_data.w = (WID_LABEL*)wid_label_add(d, 1, storage); w = wid_button_add(d, 2, "&Stop", 0); wid_set_func(w, NULL, cb_scan_dir_stop_focus, &scan_data); dialog_open(d, "Message"); win_refresh(); scan_dir (path, 1, 0, data, mode, cb_freq_scan_dir, &scan_data, &added, &removed); dialog_close(d); freq_set_marks (data->w->entries,data->w->cnt,data->path,data); sprintf (storage,"Added %d entrie(s) and removed %d entrie(s).", added,removed); dlg_message_open(storage, "&Ok", 0, 0, NULL, NULL); } /* Add/Remove entries to/from the playlist */ static void freq_add (FREQ_DATA *data, FREQ_MODE mode) { char *file = data->w->entries[data->w->cur]; char *path = data->path; char help[PATH_MAX<<1]; if (path_update (help,path,file+2)) { freq_scan_dir (help, data, mode); } else if (*file == FREQ_SEL) { if (mode != FREQ_ADD) { if (entry_remove_by_name(path, file+2, data) > 0) *file = FREQ_UNSEL; } else if (data->actline < 0 && data->before_add) if (entry_add(path, file+2, data) > 0) *file = FREQ_SEL; } else { if (mode != FREQ_REMOVE) { if (entry_add(path, file+2, data) > 0) *file = FREQ_SEL; } } wid_list_set_active (data->w,data->w->cur+1); win_panel_repaint(); } static void freq_close (FREQ_DATA *data) { if (data) { if (data->w) dialog_close(data->w->w.d); if (data->searchlist) free (data->searchlist); free (data); } PL_DelDouble(&playlist); } /* Ok/Back was selected and data->handle_freq() is present -> call function Return: close fileselector? */ static BOOL freq_call_func (int button, FREQ_DATA *data) { char file[PATH_MAX<<1]; strcpy (file, data->path); strcat (file, data->w->entries[data->w->cur]+2); return data->handle_freq (button,file,data->data); } static int cb_freq_list_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { FREQ_DATA *data = (FREQ_DATA *) w->data; int cur = ((WID_LIST*)w)->cur; char path[PATH_MAX<<1], *cur_entry; freq_check_searchlist (data); path[0] = '\0'; cur_entry = ((WID_LIST*)w)->entries[cur]+2; /* Default action for dirs: change dir For files: call user-function or add entry to playlist */ if (!path_update(path,data->path,cur_entry)) { if (data->handle_freq) { if (freq_call_func (0,data)) freq_close (data); } else freq_add (data,FREQ_ADD); } if (path[0] != '\0') freq_changedir (path,data); return EVENT_HANDLED; } return focus; } static BOOL cb_freq_cd_do (WIDGET *w,int button, void *input, void *data) { if (button<=0) { char *pos; path_conv((char *)input); pos = (char*)input + strlen((char*)input); /* Check if path ends with '/' */ if (!IS_PATH_SEP(*(pos-1))) { *pos = PATH_SEP; *(pos+1) = '\0'; } freq_check_searchlist ((FREQ_DATA *)data); freq_changedir ((char *)input, (FREQ_DATA *)data); } return 1; } static void freq_cd (FREQ_DATA *data) { dlg_input_str ("Change directory to:", "<&Ok>|&Cancel", data->path, PATH_MAX, cb_freq_cd_do, data); } static int cb_freq_list_key(WIDGET *w, int ch) { FREQ_DATA *data = (FREQ_DATA *) w->data; freq_check_searchlist (data); if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_IC: /* Insert -> Add */ freq_add (data,FREQ_ADD); break; default: return 0; } return EVENT_HANDLED; } static int cb_freq_button_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { FREQ_DATA *data = (FREQ_DATA *) w->data; int button = ((WID_BUTTON *) w)->active; freq_check_searchlist (data); switch (button) { case 0: /* Add */ freq_add (data,FREQ_ADD); break; case 1: /* Toggle */ freq_add (data,FREQ_TOGGLE); break; case 2: /* Cd */ freq_cd (data); break; case 3: /* HotList */ freq_hotlist (data); break; case 4: /* Back / Ok */ if (!data->handle_freq || freq_call_func (0,data)) freq_close (data); break; case 5: /* Back */ if (data->handle_freq && freq_call_func (1,data)) freq_close (data); break; } return EVENT_HANDLED; } return focus; } /* Init initial path and searchlist */ static FREQ_DATA *freq_data_init (const char *path) { struct stat statbuf; FREQ_DATA *data = (FREQ_DATA *) malloc(sizeof(FREQ_DATA)); char *pos; data->path[0] = '\0'; if (path_relative(path)) { getcwd (data->path,PATH_MAX); path_conv (data->path); if (!IS_PATH_SEP(data->path[strlen(data->path)-1])) strcat (data->path, PATH_SEP_STR); } strcat (data->path,path); if (stat(path_conv_sys(data->path), &statbuf) || !S_ISDIR(statbuf.st_mode)) if ((pos = FIND_LAST_DIRSEP(data->path)) != NULL) *(pos+1) = '\0'; pos = data->path+strlen(data->path); if (!IS_PATH_SEP(*(pos-1))) { *pos = PATH_SEP; *(pos+1) = '\0'; } data->w = NULL; data->before_add = 1; data->actline = -1; data->cnt_list = 0; data->searchlist = NULL; freq_check_searchlist (data); return data; } /* Open a file requester. func!=NULL: func is called if Ok or Cancel is selected func==NULL: no Ok button, Add is default */ void freq_open (const char *title, const char *path, int actline, handleFreqFunc func, void *data) { FREQ_DATA *freq_data; DIALOG *d = dialog_new(); WIDGET *w; char **entries, *path_first = NULL; int cnt; freq_data = freq_data_init (path); freq_data->actline = actline; freq_data->handle_freq = func; freq_data->data = data; freq_readdir(freq_data->path,&entries,&cnt,freq_data); if (!entries || !cnt) { /* show error after file selector is open */ path_first = strdup (freq_data->path); /* error on initial path -> try root directory */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) strcpy (freq_data->path,"c:"PATH_SEP_STR); #elif defined _mikmod_amiga strcpy (freq_data->path,"SYS:"); /* or use ":" instead??? */ #else strcpy (freq_data->path,PATH_SEP_STR); #endif freq_readdir(freq_data->path,&entries,&cnt,freq_data); if (!entries || !cnt) { /* again an error -> give up */ freq_close (freq_data); if (path_first) free (path_first); return; } } w = wid_list_add(d, 1, (const char **)entries, cnt); freq_data->w = (WID_LIST*)w; wid_set_func(w, cb_freq_list_key, cb_freq_list_focus, freq_data); freq_freedir(entries, cnt); if (func) w = wid_button_add(d, 1, "&Add|&Toggle|&Cd|&Hlist|<&Ok>|&Back", 0); else w = wid_button_add(d, 1, "<&Add>|&Toggle|&Cd|&Hlist|&Back", 0); wid_set_func(w, NULL, cb_freq_button_focus, freq_data); dialog_open(d, title); /* Size of list widget is necessary -> set title after dialog_open() */ freq_set_title (freq_data); if (path_first) { dlg_error_show ("Unable to read directory \"%s\"!",path_first); free (path_first); } } static BOOL cb_list_scan_dir (char *path, int added, int removed, void *data) { BOOL quiet = (BOOL)(SINTPTR_T)data; char str[70], *pos; int i; if (!quiet) { if (strlen(path) > 43) sprintf (str,"\rScanning ...%s... (%d added)", &path[strlen(path)-40],added); else sprintf (str,"\rScanning %s... (%d added)",path,added); pos = str+strlen(str); for (i=strlen(str); i<(70-1); i++) *pos++ = ' '; *pos = '\0'; printf ("%s", str); fflush(stdout); } return 0; } /* test if path is a directory and recursively scan it for modules */ int list_scan_dir (char *path, BOOL quiet) { struct stat statbuf; int added = 0; char dir[PATH_MAX<<1]="", *pos; #if defined(__EMX__)||defined(__OS2__)||defined(__DJGPP__)||defined(_WIN32) if (*path!=PATH_SEP && *(path+1)!=':') #else if (!IS_PATH_SEP(*path)) #endif { getcwd (dir,PATH_MAX); path_conv (dir); if (!IS_PATH_SEP(dir[strlen(dir)-1])) strcat (dir, PATH_SEP_STR); } strcat (dir,path); pos = dir+strlen(dir); if (!IS_PATH_SEP(*(pos-1))) { *pos = PATH_SEP; *(pos+1) = '\0'; } if (!stat(path_conv_sys(dir), &statbuf) && S_ISDIR(statbuf.st_mode)) scan_dir (dir, 1, 0, NULL, FREQ_ADD, cb_list_scan_dir, (void *)(SINTPTR_T)quiet, &added, NULL); return added; } /* remove an entry from the playlist */ static void entry_remove (int entry) { PL_DelEntry(&playlist, entry); } /* remove an entry from the playlist and delete the associated module */ static BOOL cb_delete_entry(WIDGET *w, int button, void *input, void *entry) { if (button<=0) { PLAYENTRY *cur = PL_GetEntry(&playlist, (SINTPTR_T)entry); if (cur->archive) { if (unlink(path_conv_sys(cur->archive)) == -1) dlg_error_show("Error deleting archive \"%s\"!",cur->archive); } else { if (unlink(path_conv_sys(cur->file)) == -1) dlg_error_show("Error deleting file \"%s\"!",cur->file); } entry_remove((SINTPTR_T)entry); } return 1; } /* split a filename into the name and the last extension */ static void split_name(char *file, char **name, char **ext) { *name = FIND_LAST_DIRSEP(file); if (!*name) *name = file; *ext = strrchr(*name, '.'); if (!*ext) *ext = &(*name[strlen(*name)]); } static BOOL sort_rev = 0; /* *INDENT-OFF* */ static enum { SORT_NAME, SORT_EXT, SORT_PATH, SORT_TIME } sort_mode = SORT_NAME; /* *INDENT-ON* */ static int cb_cmp_sort(PLAYENTRY * small, PLAYENTRY * big) { char ch_s = ' ', ch_b = ' ', *ext_s, *ext_b, *name_s, *name_b; int ret = 0; switch (sort_mode) { case SORT_NAME: split_name(small->file, &name_s, &ext_s); split_name(big->file, &name_b, &ext_b); ch_s = *ext_s; ch_b = *ext_b; *ext_s = '\0'; *ext_b = '\0'; ret = strcasecmp(name_s, name_b); *ext_s = ch_s; *ext_b = ch_b; break; case SORT_EXT: split_name(small->file, &name_s, &ext_s); split_name(big->file, &name_b, &ext_b); ret = strcasecmp(ext_s, ext_b); break; case SORT_PATH: ext_s = small->archive; if (!ext_s) ext_s = small->file; name_s = FIND_LAST_DIRSEP(ext_s); if (name_s) { ch_s = *name_s; *name_s = '\0'; } ext_b = big->archive; if (!ext_b) ext_b = big->file; name_b = FIND_LAST_DIRSEP(ext_b); if (name_b) { ch_b = *name_b; *name_b = '\0'; } ret = strcasecmp(ext_s, ext_b); if (name_s) *name_s = ch_s; if (name_b) *name_b = ch_b; break; case SORT_TIME: ret = (small->time == big->time ? 0 : (small->time < big->time ? -1 : 1)); break; } return (sort_rev) ? -ret : ret; } /* overwrites an existdng playlist */ static BOOL cb_overwrite (WIDGET *w, int button, void *input, void *file) { if (button<=0) { path_conv((char *)file); if (PL_Save(&playlist, (char *)file)) rc_set_string(&config.pl_name, (char *)file, PATH_MAX); else dlg_error_show("Error saving playlist \"%s\"!",file); } if (file) free(file); return 1; } static BOOL cb_browse (int button, char *file, void *data) { if (!button) { wid_str_set_input ((WID_STR*)data, file, -1); wid_repaint ((WIDGET*)data); } return 1; } /* saves a playlist */ static BOOL cb_save_as(WIDGET *w, int button, void *input, void *data) { path_conv((char *)input); if (button == 0) { /* Browse */ freq_open ("Select directory/file",(char*)input,(SINTPTR_T)data, cb_browse,w); return 0; } else if (button == 1 || button == -1) { /* Ok / Str-Widget */ if (file_exist((char*)input)) { char *f_copy = strdup((char*)input); char *msg = str_sprintf("File \"%s\" exists.\n" "Really overwrite the file?", f_copy); dlg_message_open(msg, "&Yes|&No", 1, 1, cb_overwrite, f_copy); free(msg); } else { if (PL_Save(&playlist, (char*)input)) rc_set_string(&config.pl_name, (char*)input, PATH_MAX); else dlg_error_show("Error saving playlist \"%s\"!",input); } } return 1; } /* playlist menu handler */ static void cb_handle_menu(MMENU * menu) { MENU_DATA *data = (MENU_DATA *) menu->data; int actLine = *data->actLine; PLAYENTRY *cur; char *name, *msg; /* main menu */ if (!menu->id) { switch (menu->cur) { case 0: /* play highlighted module */ if (actLine >= 0) Player_SetNextMod(actLine); break; case 1: /* remove highlighted module */ if (actLine >= 0) entry_remove(actLine); break; case 2: /* delete highlighted module */ cur = PL_GetEntry(&playlist, actLine); if (!cur) break; if (cur->archive) { name = FIND_LAST_DIRSEP(cur->file); if (name) name++; else name = cur->file; if (strlen(cur->archive) > 60) msg = str_sprintf2("File \"%s\" is in an archive!\n" "Really delete whole archive\n" " \"...%s\"?", name, &(cur-> archive[strlen(cur->archive) - 57])); else msg = str_sprintf2("File \"%s\" is in an archive!\n" "Really delete whole archive\n" " \"%s\"?", name, cur->archive); dlg_message_open(msg, "&Yes|&No", 1, 1, cb_delete_entry, (void *)(SINTPTR_T)actLine); } else { if (strlen(cur->file) > 50) msg = str_sprintf("Delete file \"...%s\"?", &(cur->file[strlen(cur->file) - 47])); else msg = str_sprintf("Delete file \"%s\"?", cur->file); dlg_message_open(msg, "&Yes|&No", 1, 1, cb_delete_entry, (void *)(SINTPTR_T)actLine); } free(msg); break; case 5: /* shuffle list */ PL_Randomize(&playlist); break; case 7: /* cancel */ break; default: return; } /* file menu */ } else if (menu->id == 1) { switch (menu->cur) { case 0: /* load */ freq_open ("Load modules/playlists", config.pl_name, -1, NULL, NULL); break; case 1: /* insert */ freq_open ("Insert modules/playlists", config.pl_name, actLine, NULL, NULL); break; case 2: /* save */ if (!PL_Save(&playlist, config.pl_name)) dlg_error_show("Error saving playlist \"%s\"!",config.pl_name); break; case 3: /* save as */ dlg_input_str("Save playlist as:", "&Browse|<&Ok>|&Cancel", config.pl_name, PATH_MAX, cb_save_as, (void*)(SINTPTR_T)actLine); break; default: return; } /* sort menu */ } else { /* reverse flag */ sort_rev = (SINTPTR_T)menu->entries[5].data; switch (menu->cur) { case 0: /* by name */ sort_mode = SORT_NAME; PL_Sort(&playlist, cb_cmp_sort); break; case 1: /* by extension */ sort_mode = SORT_EXT; PL_Sort(&playlist, cb_cmp_sort); break; case 2: /* by path */ sort_mode = SORT_PATH; PL_Sort(&playlist, cb_cmp_sort); break; case 3: /* by time */ sort_mode = SORT_TIME; PL_Sort(&playlist, cb_cmp_sort); break; default: return; } } menu_close(data->menu); return; } void list_open(int *actLine) { static MENU_DATA menu_data; static MENTRY file_entries[] = { {"&Load...", 0, "Load new playlists/modules"}, {"&Insert...", 0, "Insert new playlists/modules in current playlist"}, {"&Save", 0, NULL}, {"Save &as...", 0, "Save playlist in a specified file"}, {NULL,NULL,NULL} }; static MMENU file_menu = { 0, 0, -1, 1, file_entries, cb_handle_menu, NULL, &menu_data, 1 }; static MENTRY sort_entries[] = { {"by &name", 0, "Sort list by name of modules"}, {"by &extension", 0, "Sort list by extension of modules"}, {"by &path", 0, "Sort list by path of modules/archives"}, {"by &time", 0, "Sort list by playing time of modules"}, {"%---------", 0, NULL}, {"[%c] &reverse", 0, "Smaller to bigger or reverse sort"}, {NULL,NULL,NULL} }; static MMENU sort_menu = { 0, 0, -1, 1, sort_entries, cb_handle_menu, NULL, &menu_data, 2 }; static MENTRY entries[] = { {"&Play", 0, "Play selected entry"}, {"&Remove", 0, "Remove selected entry from list"}, {"&Delete...", 0, "Remove selected entry from list and delete it on disk"}, {"%----------", 0, NULL}, {"&File %>", &file_menu, "Load/Save playlist/modules"}, {"&Shuffle", 0, "Shuffle the list"}, {"S&ort %>", &sort_menu, "Sort the list"}, {"&Back", 0, "Leave menu"}, {NULL,NULL,NULL} }; static MMENU menu = { 0, 0, -1, 1, entries, cb_handle_menu, NULL, &menu_data, 0 }; menu_data.menu = &menu; menu_data.actLine = actLine; set_help(&file_entries[2], "Save list in '%s'", config.pl_name); menu_open(&menu, 5, 5); } mikmod-3.2.8/src/mconfedit.c0000644000000000000000000005561312257221430014415 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mconfedit.c,v 1.2 2004/01/29 17:36:13 raph Exp $ The config editor ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rcfile.h" #include "mconfig.h" #include "mconfedit.h" #include "mlist.h" #include "mmenu.h" #include "mdialog.h" #include "mutilities.h" #define OPT_DRIVER 0 #if LIBMIKMOD_VERSION >= 0x030107 #define OPT_DRV_OPTION 1 #define OPT_STEREO 2 #define OPT_MODE_16BIT 3 #define OPT_FREQUENCY 4 #define OPT_INTERPOLATE 5 #define OPT_HQMIXER 6 #define OPT_SURROUND 7 #define OPT_REVERB 8 #else #define OPT_STEREO 1 #define OPT_MODE_16BIT 2 #define OPT_FREQUENCY 3 #define OPT_INTERPOLATE 4 #define OPT_HQMIXER 5 #define OPT_SURROUND 6 #define OPT_REVERB 7 #endif #define OPT_VOLUME 0 #define OPT_VOLRESTRICT 1 #define OPT_FADE 2 #define OPT_LOOP 3 #define OPT_PANNING 4 #define OPT_EXTSPD 5 #define OPT_PM_MODULE 0 #define OPT_PM_MULTI 1 #define OPT_PM_SHUFFLE 2 #define OPT_PM_RANDOM 3 #define OPT_CURIOUS 1 #define OPT_TOLERANT 2 #define OPT_FULLPATHS 3 #define OPT_EDITTHEME 4 #define OPT_THEME 5 #define OPT_WINDOWTITLE 6 #if LIBMIKMOD_VERSION >= 0x030200 #define OPT_SAMPLES 7 #define OPT_FAKEVOLBARS 8 #define OPT_RENICE 9 #define OPT_STATUSBAR 10 #else #define OPT_RENICE 7 #define OPT_STATUSBAR 8 #endif #define OPT_S_CONFIG 0 #define OPT_S_PLAYLIST 1 #define MENU_MAIN 0 #define MENU_OUTPUT 1 #define MENU_PLAYBACK 2 #define MENU_OTHER 3 #define MENU_USE 4 #define MENU_SAVE 5 #define MENU_REVERT 6 static void handle_menu(MMENU *menu); #if LIBMIKMOD_VERSION >= 0x030107 static char driveroptions[100] = ""; #endif static MENTRY output_entries[] = { {NULL, 0, "The device driver for output"}, #if LIBMIKMOD_VERSION >= 0x030107 {NULL, driveroptions, "Driver options (e.g. \"buffer=14,count=16\" for the OSS-driver)"}, #endif {"[%c] &Stereo", 0, "mono/stereo output"}, {"[%c] 16 &bit output", 0, "8/16 bit output"}, {"&Frequency [%d]|Enter mixing frequency:|4000|60000", 0, "Mixing frequency in hertz (from 4000 Hz to 60000 Hz)"}, {"[%c] &Interpolate", 0, "Use interpolated mixing"}, {"[%c] &HQmixer", 0, "Use high-quality (but slower) software mixer"}, {"[%c] S&urround", 0, "Use surround mixing"}, {"&Reverb [%d]|Enter reverb amount:|0|15", 0, "Reverb amount from 0 (no reverb) to 15"}, {NULL,NULL,NULL} }; static MMENU output_menu = { 0, 0, -1, 1, output_entries, handle_menu, NULL, NULL, 1 }; static MENTRY playback_entries[] = { {"&Volume [%d]|Enter output volume:|0|100", 0, "Output volume from 0 to 100 in %"}, {"[%c] &Restrict Volume", 0, "Restrict volume of player to volume supplied by user (with 1..0,<,>)"}, {"[%c] &Fadeout", 0, "Force volume fade at the end of module"}, {"[%c] &Loops", 0, "Enable in-module loops"}, {"[%c] &Panning", 0, "Process panning effects"}, {"[%c] Pro&tracker", 0, "Use extended protracker effects"}, {NULL,NULL,NULL} }; static MMENU playback_menu = { 0, 0, -1, 1, playback_entries, handle_menu, NULL, NULL, 2 }; static MENTRY plmode_entries[] = { {"[%c] Loop &module", 0, "Loop current module"}, {"[%c] Loop &list", 0, "Play the list repeatedly"}, {"[%c] &Shuffle list", 0, "Shuffle list at start and when all entries are played"}, {"[%c] List &random", 0, "Play list in random order"}, {NULL,NULL,NULL} }; static MMENU plmode_menu = { 0, 0, -1, 1, plmode_entries, handle_menu, NULL, NULL, 4 }; static MENTRY exit_entries[] = { {"[%c] Save &config", 0, NULL}, {"[%c] Save &playlist", 0, NULL}, {NULL,NULL,NULL} }; static MMENU exit_menu = { 0, 0, -1, 1, exit_entries, handle_menu, NULL, NULL, 5 }; static MENTRY other_entries[] = { {"&Playmode %>", &plmode_menu, "Playlist playing mode"}, {"[%c] &Curious", 0, "Look for hidden patterns in module"}, {"[%c] &Tolerant", 0, "Don't halt on file access errors"}, {"[%c] &Full path", 0, "Display full path of files"}, {"&Edit theme", 0, "Copy, edit, or delete active theme"}, {NULL, 0, "Color theme to use ((C) color theme, (M) mono theme)"}, {"[%c] &Window title", 0, "Set the term/window title to song name/filename"}, #if LIBMIKMOD_VERSION >= 0x030200 {"[%c] Sample&names", 0, "Always display sample names in volumebars panel"}, {"[%c] Fake &volumebars", 0, "Display fast (non CPU-intensive) volumebars"}, #endif {"&Scheduling [%o]|Normal|Renice|Realtime", 0, "Change process priority, MikMod must be restarted to change this"}, {"Status&bar [%o]|None|Small|Big", 0, "Size of the statusbar"}, {"&On exit %>", &exit_menu, ""}, {NULL,NULL,NULL} }; static MMENU other_menu = { 0, 0, -1, 1, other_entries, handle_menu, NULL, NULL, 3 }; static MENTRY entries[] = { {"&Output options %>", &output_menu, ""}, {"&Playback options %>", &playback_menu, ""}, {"O&ther options %>", &other_menu, ""}, {"%------------", 0, NULL}, {"&Use config", 0, "Activate the edited configuration"}, {"S&ave config", 0, "Save and activate the edited configuration"}, {"R&evert config", 0, "Reset the configuration to the actual used one"}, {NULL,NULL,NULL} }; static MMENU menu = { 0, 0, -1, 0, entries, handle_menu, NULL, NULL, 0 }; typedef struct { WIDGET *w; /* bold/... - indicator */ WID_STR *str_w; WID_COLORSEL *col_w; WID_LIST *list_w; int cur_attr; /* selected attribute in list widget */ THEME theme; THEME test_theme; int orig_theme; /* index into themes-arry */ } THEME_DATA; /* Copies of the config theme entries, needed for use/save/revert config */ static int cnt_themes = 0; static THEME *themes = NULL; /* set help text of menu entry free old menu->help and malloc new entry */ void set_help(MENTRY *entry, const char *str, ...) { va_list args; int len = 0; if (entry->help) free(entry->help); va_start(args, str); VSNPRINTF (storage, STORAGELEN, str, args); va_end(args); len = MIN(strlen(storage), STORAGELEN); entry->help = (char *) malloc(sizeof(char) * (len + 1)); strncpy(entry->help, storage, len); entry->help[len] = '\0'; } static char *skip_number(char *str) { while (str && *str == ' ') str++; while (str && isdigit((int)*str)) str++; while (str && *str == ' ') str++; return str; } /* extract drivers for the option menu */ static void get_drivers(MENTRY *entry) { char *driver = MikMod_InfoDriver(), *pos, *start; int len = 0, x = 0; BOOL end; for (pos = skip_number(driver); pos && *pos; pos++) { if (*pos == '\n') { if (x > 35) x = 35; len += x; x = 0; pos = skip_number(pos + 1); } x++; } x--; if (*(pos - 1) != '\n') len += (x >= 35 ? 35 : x); if (entry->text) free(entry->text); entry->text = (char *) malloc(sizeof(char) * (len + 25)); strcpy(entry->text, "&Driver [%o]|Autodetect"); start = skip_number(driver); end = !(start && *start); for (pos = start; !end; pos++) { end = !*pos; if (*pos == '\n' || (!*pos && *(pos - 1) != '\n')) { strcat(entry->text, "|"); len = strlen(entry->text); /* don't embed text in braces or 'v#.#' in string */ for (x = 0; x < 34 && start + x <= pos; x++) { if (*(start + x) == '(') break; if ((*(start + x)) == 'v' && isdigit((int)*(start + x + 1))) break; } while (x > 0 && *(start + x - 1) == ' ') x--; strncat(entry->text, start, x); entry->text[len + x] = '\0'; pos = skip_number(pos + 1); start = pos; } } #if (LIBMIKMOD_VERSION >= 0x030200) && defined(HAVE_MIKMOD_FREE) /* MikMod_free() is in libmikmod-3.2.0 beta3 and newer versions. */ MikMod_free(driver); #else free(driver); #endif } /* extract drivers options for the option menu */ static void get_driver_options(MENTRY *entry, MENTRY *dr_entry) { int drvno = (SINTPTR_T) dr_entry->data; char *cmdline; if (entry->text) free (entry->text); if (driver_get_info (drvno, NULL, &cmdline) && drvno) { int cmdlen = 0, i = drvno; char *end, *pos = strchr(dr_entry->text, '|'); while (pos && i>0) { pos = strchr(pos+1, '|'); i--; } end = pos; if (pos && *pos && i==0) { pos++; end = strchr(pos, '|'); if (!end) end = pos+strlen(pos); } if (cmdline) { cmdlen = strlen (cmdline); if (cmdline[cmdlen-1] == '\n') cmdlen--; } entry->text = (char *) malloc(sizeof(char) * (cmdlen+end-pos+50+20)); strcpy(entry->text, "Driver &options [%s]|Enter driver options"); if (end > pos && cmdlen > 0) { strcat (entry->text, " (Options for "); strncat(entry->text, pos, end-pos); strcat (entry->text, ":\n"); strncat(entry->text, cmdline, cmdlen); strcat (entry->text, "):|255|16"); } else strcat(entry->text, ":|255|16"); if (cmdline) free (cmdline); } else { entry->text = (char *) malloc(sizeof(char) * 50); strcpy(entry->text, "Driver &options [%s]|Enter driver options:|255|16"); } } /* extract themes for the other menu */ static void get_themes(MENTRY *entry) { int i, j, len = 0; for (i=0; i32 ? 32:j) + 5; } if (entry->text) free (entry->text); entry->text = (char *) malloc(sizeof(char) * (len + 15)); strcpy(entry->text, "T&heme [%o]"); for (i=0; itext, "|"); strcat(entry->text,themes[i].color ? "(C) ":"(M) "); len = strlen(entry->text); j = strlen (themes[i].name); j = (j>32 ? 32:j); strncat(entry->text, themes[i].name, j); entry->text[len + j] = '\0'; } } static int config_get_act_theme(void) { return (SINTPTR_T)other_entries[OPT_THEME].data; } static void config_set_act_theme(int act_theme) { other_entries[OPT_THEME].data = (void *)(SINTPTR_T)act_theme; } static void theme_get_attrs (THEME_DATA *data) { int *attr = &data->theme.attrs[data->cur_attr]; if (data->theme.color) { if (data->col_w) *attr = data->col_w->active; if (((WID_TOGGLE*)data->w)->selected == 1) *attr |= COLOR_BOLDMASK; else *attr &= ~COLOR_BOLDMASK; } else { WID_CHECK *cw = (WID_CHECK*)data->w; if (cw->selected == 1) *attr = A_NORMAL; else if (cw->selected == 2) *attr = A_BOLD; else if (cw->selected == 4) *attr = A_REVERSE; } } static void theme_set_attrs (THEME_DATA *data, int repaint) { int cur = data->cur_attr, i = 0; if (data->theme.color) { if (data->col_w) { wid_colorsel_set_active((WID_COLORSEL*)data->col_w, data->theme.attrs[cur]); if (repaint) wid_repaint ((WIDGET*)data->col_w); } if (data->theme.attrs[cur] & COLOR_BOLDMASK) i = 1; else i = 0; wid_toggle_set_selected((WID_TOGGLE*)data->w, i); } else { if (data->theme.attrs[cur] == A_NORMAL) i = 1; else if (data->theme.attrs[cur] == A_BOLD) i = 2; else if (data->theme.attrs[cur] == A_REVERSE) i = 4; wid_check_set_selected ((WID_CHECK*)data->w, i); } if (repaint) wid_repaint (data->w); } static int cb_theme_list_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { THEME_DATA *data = (THEME_DATA *) w->data; theme_get_attrs (data); data->cur_attr = ((WID_LIST*)w)->cur; theme_set_attrs (data,1); return EVENT_HANDLED; } return focus; } static void theme_edit_close (THEME_DATA *data) { win_set_theme (&config.themes[config.theme]); config_set_act_theme (data->orig_theme); get_themes(&other_entries[OPT_THEME]); if (data->w) dialog_close(data->w->d); CF_theme_free (&data->theme); CF_theme_free (&data->test_theme); free (data); } static int cb_theme_button_focus(WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { THEME_DATA *data = (THEME_DATA *) w->data; int button = ((WID_BUTTON *) w)->active; switch (button) { case 0: /* Ok */ theme_get_attrs (data); if (data->theme.name) free (data->theme.name); data->theme.name = strdup(data->str_w->input); CF_theme_remove (data->orig_theme,&themes,&cnt_themes); data->orig_theme = CF_theme_insert (&themes, &cnt_themes, &data->theme); theme_edit_close (data); break; case 1: /* Test */ if (win_has_colors() || !data->theme.color) { theme_get_attrs (data); CF_theme_free (&data->test_theme); CF_theme_copy (&data->test_theme,&data->theme); win_set_theme (&data->test_theme); win_panel_repaint(); } else { /* Cancel */ theme_edit_close (data); } break; case 2: /* Cancel */ theme_edit_close (data); break; } return EVENT_HANDLED; } return focus; } static int cb_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { THEME_DATA *data = (THEME_DATA *) w->data; if (data->list_w->w.has_focus) return FOCUS_DONT; } return focus; } static void theme_edit (int act_theme) { DIALOG *d = dialog_new(); WIDGET *w; char title[200]; THEME_DATA *data = (THEME_DATA *) malloc(sizeof(THEME_DATA)); data->cur_attr = 0; data->orig_theme = act_theme; data->test_theme.name = NULL; data->test_theme.attrs = NULL; CF_theme_copy (&data->theme, &themes[act_theme]); w = wid_list_add(d, 1, attrs_label, ATTRS_COUNT); wid_list_set_selection_mode ((WID_LIST*)w, WID_SEL_BROWSE); wid_set_size (w, 20, -1); wid_set_func(w, NULL, cb_theme_list_focus, data); data->list_w = (WID_LIST*) w; data->str_w = (WID_STR*)wid_str_add(d, 0, data->theme.name, THEME_NAME_LEN); wid_set_size ((WIDGET*)data->str_w, 26, -1); if (data->theme.color) { if (win_has_colors()) { data->col_w = (WID_COLORSEL*)wid_colorsel_add(d, 1, "sdex", 0); wid_set_func((WIDGET*)data->col_w, NULL, cb_focus, data); data->w = wid_toggle_add (d,0,"&bold",0,0); } else { data->col_w = NULL; data->w = wid_toggle_add (d,2,"&bold",0,0); } wid_set_func(data->w, NULL, cb_focus, data); } else { data->w = wid_check_add (d,2,"&normal|&bold|&reverse",0,0); wid_set_func(data->w, NULL, cb_focus, data); } theme_set_attrs (data,0); if (win_has_colors() || !data->theme.color) w = wid_button_add(d, -1, "&Ok|&Test|&Cancel", 0); else w = wid_button_add(d, -1, "&Ok|&Cancel", 0); wid_set_func(w, NULL, cb_theme_button_focus, data); strcpy (title,"Edit theme "); strncat (title, data->theme.name, 180); dialog_open(d, title); } /* Return a unique name among the themes which is based on src_name */ static char *theme_uniq_name (char *src_name) { char buf[THEME_NAME_LEN+1], *pos, *name; int i, n, len; strncpy (buf,src_name,THEME_NAME_LEN); buf[THEME_NAME_LEN] = '\0'; for (pos = buf+strlen(buf)-1; pos>=buf && isspace((int)*pos); pos--) *pos = '\0'; if (pos>buf && isdigit((int)*pos) && isdigit((int)*(pos-1))) *(pos-2) = '\0'; if (strlen(buf) > THEME_NAME_LEN-5) buf[THEME_NAME_LEN-5] = '\0'; strcat (buf," %02d"); len = strlen(buf)+1; name = (char *) malloc (sizeof(char)*len); n = 2; do { SNPRINTF (name,len,buf,n); for (i=0; i=cnt_themes) return name; n++; } while (n<100); free (name); return NULL; } static void theme_copy (int *act_theme) { THEME newtheme; newtheme.color = themes[*act_theme].color; newtheme.attrs = themes[*act_theme].attrs; if ((newtheme.name = theme_uniq_name (themes[*act_theme].name))) { *act_theme = CF_theme_insert (&themes,&cnt_themes,&newtheme); free (newtheme.name); } } /* theme edit callback */ static BOOL cb_themeedit (WIDGET *w, int button, void *input, void *data) { int act_theme = config_get_act_theme(); BOOL user_theme = act_theme >= THEME_COUNT; if (button>2 || (!user_theme && button>1)) return 1; switch (button) { case 0: /* Copy */ theme_copy (&act_theme); break; case 1: /* Edit or Copy + Edit */ if (!user_theme) theme_copy (&act_theme); theme_edit (act_theme); break; case 2: /* Delete (if user_theme) */ CF_theme_remove (act_theme,&themes,&cnt_themes); if (act_theme>=cnt_themes) act_theme--; break; } config_set_act_theme (act_theme); get_themes(&other_entries[OPT_THEME]); return 1; } static void config_set_config(CONFIG *cfg) { int i; output_entries[OPT_DRIVER].data = (void *)(SINTPTR_T)cfg->driver; #if LIBMIKMOD_VERSION >= 0x030107 strcpy ((char *)output_entries[OPT_DRV_OPTION].data,cfg->driveroptions); #endif output_entries[OPT_STEREO].data = (void *)(SINTPTR_T)cfg->stereo; output_entries[OPT_MODE_16BIT].data = (void *)(SINTPTR_T)cfg->mode_16bit; output_entries[OPT_FREQUENCY].data = (void *)(SINTPTR_T)cfg->frequency; output_entries[OPT_INTERPOLATE].data = (void *)(SINTPTR_T)cfg->interpolate; output_entries[OPT_HQMIXER].data = (void *)(SINTPTR_T)cfg->hqmixer; output_entries[OPT_SURROUND].data = (void *)(SINTPTR_T)cfg->surround; output_entries[OPT_REVERB].data = (void *)(SINTPTR_T)cfg->reverb; playback_entries[OPT_VOLUME].data = (void *)(SINTPTR_T)cfg->volume; playback_entries[OPT_VOLRESTRICT].data = (void *)(SINTPTR_T)cfg->volrestrict; playback_entries[OPT_FADE].data = (void *)(SINTPTR_T)cfg->fade; playback_entries[OPT_LOOP].data = (void *)(SINTPTR_T)cfg->loop; playback_entries[OPT_PANNING].data = (void *)(SINTPTR_T)cfg->panning; playback_entries[OPT_EXTSPD].data = (void *)(SINTPTR_T)cfg->extspd; plmode_entries[OPT_PM_MODULE].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_MODULE); plmode_entries[OPT_PM_MULTI].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_MULTI); plmode_entries[OPT_PM_SHUFFLE].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_SHUFFLE); plmode_entries[OPT_PM_RANDOM].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_RANDOM); other_entries[OPT_CURIOUS].data = (void *)(SINTPTR_T)cfg->curious; other_entries[OPT_TOLERANT].data = (void *)(SINTPTR_T)cfg->tolerant; other_entries[OPT_FULLPATHS].data = (void *)(SINTPTR_T)cfg->fullpaths; other_entries[OPT_WINDOWTITLE].data = (void *)(SINTPTR_T)cfg->window_title; #if LIBMIKMOD_VERSION >= 0x030200 other_entries[OPT_SAMPLES].data = (void *)(SINTPTR_T)cfg->forcesamples; other_entries[OPT_FAKEVOLBARS].data = (void *)(SINTPTR_T)cfg->fakevolbars; #endif other_entries[OPT_RENICE].data = (void *)(SINTPTR_T)cfg->renice; other_entries[OPT_STATUSBAR].data = (void *)(SINTPTR_T)cfg->statusbar; exit_entries[OPT_S_CONFIG].data = (void *)(SINTPTR_T)cfg->save_config; exit_entries[OPT_S_PLAYLIST].data = (void *)(SINTPTR_T)cfg->save_playlist; #if LIBMIKMOD_VERSION >= 0x030107 get_driver_options (&output_entries[OPT_DRV_OPTION], &output_entries[OPT_DRIVER]); #endif CF_themes_free (&themes, &cnt_themes); for (i = 0; i < cfg->cnt_themes; i++) CF_theme_insert (&themes, &cnt_themes, &cfg->themes[i]); config_set_act_theme(cfg->theme); get_themes(&other_entries[OPT_THEME]); } static void config_get_config(CONFIG *cfg) { int i; cfg->driver = (SINTPTR_T)output_entries[OPT_DRIVER].data; #if LIBMIKMOD_VERSION >= 0x030107 rc_set_string(&cfg->driveroptions, (char *)output_entries[OPT_DRV_OPTION].data, 99); #endif cfg->stereo = (BOOL)(SINTPTR_T)output_entries[OPT_STEREO].data; cfg->mode_16bit = (BOOL)(SINTPTR_T)output_entries[OPT_MODE_16BIT].data; cfg->frequency = (SINTPTR_T)output_entries[OPT_FREQUENCY].data; cfg->interpolate = (BOOL)(SINTPTR_T)output_entries[OPT_INTERPOLATE].data; cfg->hqmixer = (BOOL)(SINTPTR_T)output_entries[OPT_HQMIXER].data; cfg->surround = (BOOL)(SINTPTR_T)output_entries[OPT_SURROUND].data; cfg->reverb = (SINTPTR_T)output_entries[OPT_REVERB].data; cfg->volume = (SINTPTR_T)playback_entries[OPT_VOLUME].data; cfg->volrestrict = (BOOL)(SINTPTR_T)playback_entries[OPT_VOLRESTRICT].data; cfg->fade = (BOOL)(SINTPTR_T)playback_entries[OPT_FADE].data; cfg->loop = (BOOL)(SINTPTR_T)playback_entries[OPT_LOOP].data; cfg->panning = (BOOL)(SINTPTR_T)playback_entries[OPT_PANNING].data; cfg->extspd = (BOOL)(SINTPTR_T)playback_entries[OPT_EXTSPD].data; cfg->playmode = (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_MODULE].data) ? PM_MODULE : 0) | (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_MULTI].data) ? PM_MULTI : 0) | (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_SHUFFLE].data) ? PM_SHUFFLE : 0) | (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_RANDOM].data) ? PM_RANDOM : 0); cfg->curious = (BOOL)(SINTPTR_T)other_entries[OPT_CURIOUS].data; cfg->tolerant = (BOOL)(SINTPTR_T)other_entries[OPT_TOLERANT].data; cfg->fullpaths = (BOOL)(SINTPTR_T)other_entries[OPT_FULLPATHS].data; cfg->window_title = (BOOL)(SINTPTR_T)other_entries[OPT_WINDOWTITLE].data; #if LIBMIKMOD_VERSION >= 0x030200 cfg->forcesamples = (BOOL)(SINTPTR_T)other_entries[OPT_SAMPLES].data; cfg->fakevolbars = (BOOL)(SINTPTR_T)other_entries[OPT_FAKEVOLBARS].data; #endif cfg->renice = (SINTPTR_T)other_entries[OPT_RENICE].data; cfg->statusbar = (SINTPTR_T)other_entries[OPT_STATUSBAR].data; cfg->save_config = (BOOL)(SINTPTR_T)exit_entries[OPT_S_CONFIG].data; cfg->save_playlist = (BOOL)(SINTPTR_T)exit_entries[OPT_S_PLAYLIST].data; CF_themes_free_user (&cfg->themes, &cfg->cnt_themes); for (i=THEME_COUNT; ithemes, &cfg->cnt_themes, &themes[i]); cfg->theme = config_get_act_theme(); } static void handle_menu(MMENU *mn) { switch (mn->id) { case MENU_MAIN: switch (mn->cur) { case MENU_USE: config_get_config(&config); Player_SetConfig(&config); win_status("Configuration activated"); config_set_config(&config); break; case MENU_SAVE: config_get_config(&config); CF_Save(&config); Player_SetConfig(&config); win_status("Configuration saved and activated"); config_set_config(&config); break; case MENU_REVERT: config_set_config(&config); win_status("Changed configuration reseted"); break; } break; case MENU_OUTPUT: #if LIBMIKMOD_VERSION >= 0x030107 if (mn->cur == OPT_DRIVER) get_driver_options(&output_entries[OPT_DRV_OPTION], &output_entries[OPT_DRIVER]); #endif break; case MENU_OTHER: if (mn->cur == OPT_EDITTHEME) { if (config_get_act_theme() < THEME_COUNT) dlg_message_open("Copy or copy and edit active (default-)theme?", "&Copy|Copy + &Edit|&Cancel", 2, 0, cb_themeedit, NULL); else dlg_message_open("Copy, edit, or delete the active theme?", "&Copy|&Edit|Delete|&Cancel", 3, 0, cb_themeedit, NULL); } break; } } /* open config editor */ void config_open(void) { char *name = CF_GetFilename(); set_help(&exit_entries[OPT_S_CONFIG], "Save config at exit in '%s'", name); if (name) free(name); name = PL_GetFilename(); set_help(&exit_entries[OPT_S_PLAYLIST], "Save playlist at exit in '%s'", name); if (name) free(name); get_drivers(&output_entries[OPT_DRIVER]); config_set_config(&config); menu_open(&menu, 5, 5); } /* ex:set ts=4: */ mikmod-3.2.8/src/mwidget.c0000644000000000000000000010751112650703634014110 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mwidget.c,v 1.1.1.1 2004/01/16 02:07:33 raph Exp $ Widget and Dialog creation functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "display.h" #include "player.h" #include "mwindow.h" #include "mwidget.h" #include "keys.h" #include "mutilities.h" #define STR_WIDTH_MAX 70 #define STR_WIDTH_MIN 20 #define INT_WIDTH_MAX 11 #define LIST_WIDTH_DEFAULT 60 #define LIST_WIDTH_MIN 15 #define LIST_HEIGHT_DEFAULT 20 #define LIST_HEIGHT_MIN 5 #define WWIN(w) ((w)->w.d->win) static ATTRS base_attr (DIALOG *d, ATTRS attrs) { if (d->attrs >= 0) return d->attrs; return attrs; } static void label_free(WID_LABEL *w) { free(w->msg); free(w); } static void label_paint(WID_LABEL *w) { char *start, *pos; int y = w->w.y; win_attrset(base_attr(w->w.d,ATTR_DLG_LABEL)); start = w->msg; for (pos = w->msg; *pos; pos++) { if (*pos == '\n') { *pos = '\0'; win_print(WWIN(w),w->w.x, y, start); *pos = '\n'; start = pos + 1; y++; } } win_print(WWIN(w),w->w.x, y, start); } static int label_handle_event(WID_LABEL *w, WID_EVENT event, int ch) { return 0; } static void label_get_size(WID_LABEL *w, int *width, int *height) { char *pos; int x = 0; *width = 0; *height = 0; for (pos = w->msg; *pos; pos++) { if (*pos == '\n') { (*height)++; if (x > *width) *width = x; x = -1; } x++; } if (x > *width) *width = x; (*height)++; } static void str_free(WID_STR *w) { free(w->input); free(w); } static void str_paint(WID_STR *w) { char hl[2] = " ", ch = ' ', *pos = &w->input[w->start]; int dx = 0, len; win_attrset(ATTR_DLG_STR_TEXT); if (w->w.has_focus) { hl[0] = ch = w->input[w->cur_pos]; if (!hl[0]) hl[0] = ' '; w->input[w->cur_pos] = '\0'; if (*pos) win_print(WWIN(w),w->w.x, w->w.y, pos); dx = strlen(pos); win_attrset(ATTR_DLG_STR_CURSOR); win_print(WWIN(w),w->w.x + dx, w->w.y, hl); win_attrset(ATTR_DLG_STR_TEXT); pos += dx; dx++; *pos = ch; if (*pos) pos++; } len = strlen(pos); if (len + dx > w->w.width) { ch = w->input[w->w.width + w->start]; w->input[w->w.width + w->start] = '\0'; } win_print(WWIN(w),w->w.x + dx, w->w.y, pos); if (len + dx > w->w.width) w->input[w->w.width + w->start] = ch; else if (len + dx < w->w.width) { dx += len; for (len = 0; len < w->w.width - dx; len++) storage[len] = ' '; storage[len] = '\0'; win_print(WWIN(w),w->w.x + dx, w->w.y, storage); } } static int handle_focus(WIDGET *w, int ret, int from_activate) { if (ret && (ret != EVENT_HANDLED) && w->handle_focus) { return w->handle_focus((WIDGET *) w, ret); } else { if (ret == FOCUS_ACTIVATE) { ret = from_activate; if (ret == EVENT_HANDLED) dialog_close(w->d); } return ret; } } static int input_handle_event(WID_STR *w, WID_EVENT event, int ch, BOOL int_input) { char *pos; int i; if (event == WID_HOTKEY) return 0; if (event == WID_GET_FOCUS) return EVENT_HANDLED; if ((event == WID_KEY) && w->w.handle_key) { i = w->w.handle_key((WIDGET *) w, ch); if (i) return i; } switch (ch) { case KEY_UP: return handle_focus((WIDGET*)w, FOCUS_PREV, 0); case KEY_TAB: case KEY_DOWN: return handle_focus((WIDGET*)w, FOCUS_NEXT, 0); case KEY_LEFT: case CTRL_B: if (w->cur_pos > 0) w->cur_pos--; break; case KEY_RIGHT: case CTRL_F: if (w->cur_pos < strlen(w->input)) w->cur_pos++; break; case KEY_HOME: case KEY_PPAGE: case CTRL_A: w->cur_pos = 0; break; #ifdef KEY_END case KEY_END: #endif case KEY_NPAGE: case CTRL_E: w->cur_pos = strlen(w->input); break; case CTRL_K: w->input[w->cur_pos] = '\0'; break; case CTRL_U: w->cur_pos = 0; w->input[w->cur_pos] = '\0'; break; case KEY_DC: case CTRL_D: #ifdef KEY_ASCII_DEL case KEY_ASCII_DEL: #endif if (w->cur_pos < strlen(w->input)) for (pos = &w->input[w->cur_pos]; *pos; pos++) *pos = *(pos + 1); break; case KEY_BACKSPACE: #ifdef KEY_ASCII_BS case KEY_ASCII_BS: #endif if (w->cur_pos > 0) { for (pos = &w->input[w->cur_pos - 1]; *pos; pos++) *pos = *(pos + 1); w->cur_pos--; } break; case KEY_ENTER: case '\r': return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_NEXT); default: if (ch >= 256 || ch < ' ') return 0; if ((int_input && isdigit(ch)) || !int_input) { i = strlen(w->input); if (i < w->length) { for (; i >= w->cur_pos; i--) w->input[i + 1] = w->input[i]; w->input[w->cur_pos] = ch; w->cur_pos++; } } } if (w->cur_pos < w->start) w->start = w->cur_pos; if (w->cur_pos >= w->start + w->w.width) w->start = w->cur_pos - w->w.width + 1; str_paint(w); return EVENT_HANDLED; } static int str_handle_event(WID_STR *w, WID_EVENT event, int ch) { return input_handle_event(w, event, ch, 0); } static void str_get_size(WID_STR *w, int *width, int *height) { if (*width > w->w.def_width) *width = w->w.def_width; if (*width > w->length) *width = w->length + 1; if (*width < STR_WIDTH_MIN) *width = STR_WIDTH_MIN; w->start = w->cur_pos - *width + 1; if (w->start < 0) w->start = 0; *height = 1; } static void int_free(WID_INT *w) { free(w->input); free(w); } static void int_paint(WID_INT *w) { str_paint((WID_STR *) w); } static BOOL int_handle_event(WID_INT *w, WID_EVENT event, int ch) { return input_handle_event((WID_STR *) w, event, ch, 1); } static void int_get_size(WID_INT *w, int *width, int *height) { *width = w->w.def_width; *height = 1; } static void button_free(WID_BUTTON *w) { free(w->button); free(w); } static void button_paint(WID_BUTTON *w) { int cur, x, cnt_hl = 0; char *pos, *hl_pos, *start, hl[2]; BOOL end; for (pos = w->button; *pos; pos++) if (*pos == '&') cnt_hl++; x = (w->w.d->win->width - 1 - w->w.x - ((int)strlen(w->button) + 5 * w->cnt - 1 - cnt_hl)) / 2; cur = 0; hl_pos = NULL; hl[1] = '\0'; start = w->button; end = 0; for (pos = w->button; !end; pos++) { end = !(*pos); if ((*pos == '|') || (*pos == '\0')) { *pos = '\0'; if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_INACTIVE); else win_attrset(ATTR_DLG_BUT_ACTIVE); win_print(WWIN(w),w->w.x + x, w->w.y, "[ "); if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); win_print(WWIN(w),w->w.x + x + 2, w->w.y, start); x += strlen(start) + 2; if (hl_pos) { if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_IHOTKEY); else win_attrset(ATTR_DLG_BUT_AHOTKEY); win_print(WWIN(w),w->w.x + x, w->w.y, hl); if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); win_print(WWIN(w),w->w.x + x + 1, w->w.y, hl_pos); *(hl_pos - 2) = '&'; x += strlen(hl_pos) + 1; hl_pos = NULL; } if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_INACTIVE); else win_attrset(ATTR_DLG_BUT_ACTIVE); win_print(WWIN(w),w->w.x + x, w->w.y, " ]"); x += 4; *pos = '|'; start = pos + 1; cur++; } if (*pos == '&') { *pos = '\0'; pos++; hl_pos = pos + 1; hl[0] = *pos; } } *(pos-1) = '\0'; } static BOOL button_handle_event(WID_BUTTON *w, WID_EVENT event, int ch) { int cur; char *pos; if (event == WID_GET_FOCUS) { if (ch < 0) w->active = w->cnt - 1; else w->active = 0; return EVENT_HANDLED; } if ((event == WID_KEY) && (w->w.handle_key)) { cur = w->w.handle_key((WIDGET *) w, ch); if (cur) return cur; } if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_UP: case KEY_LEFT: if (event == WID_KEY) { w->active--; if (w->active < 0) return handle_focus ((WIDGET*)w, FOCUS_PREV, 0); button_paint(w); } break; case KEY_DOWN: case KEY_RIGHT: case KEY_TAB: if (event == WID_KEY) { w->active++; if (w->active >= w->cnt) return handle_focus ((WIDGET*)w, FOCUS_NEXT, 0); button_paint(w); } break; case KEY_ENTER: case '\r': if (event == WID_KEY) return handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, EVENT_HANDLED); break; default: cur = 0; for (pos = w->button; *pos; pos++) { if (*pos == '|') cur++; if (*pos == '&' && (toupper((int)*(pos+1)) == ch)) { w->active = cur; button_paint(w); return handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, EVENT_HANDLED); } } return 0; } return EVENT_HANDLED; } static void button_get_size(WID_BUTTON *w, int *width, int *height) { char *pos; int hl_cnt = 0; w->cnt = 1; for (pos = w->button; *pos; pos++) { if (*pos == '&') hl_cnt++; if (*pos == '|') w->cnt++; } *width = strlen(w->button) + 5 * w->cnt - 1 - hl_cnt; *height = 1; } static void list_free(WID_LIST *w) { int i; for (i=0; icnt; i++) free (w->entries[i]); free (w->entries); if (w->title) free (w->title); free (w); } static void list_paint(WID_LIST *w) { int i,x,visible; char ch; x = w->w.x+w->w.width-1; visible = w->w.height-2; win_attrset(base_attr(w->w.d,ATTR_DLG_FRAME)); win_box (WWIN(w),w->w.x, w->w.y, x, w->w.y+w->w.height-1); if (w->title) { if (strlen(w->title) > w->w.width-2) { ch = w->title[w->w.width-2]; w->title[w->w.width-2] = '\0'; win_print (WWIN(w),w->w.x+1, w->w.y, w->title); w->title[w->w.width-2] = ch; } else win_print (WWIN(w),w->w.x+1, w->w.y, w->title); } if (w->first > 0) win_print (WWIN(w),x, w->w.y+1, "^"); else win_print (WWIN(w),x, w->w.y+1, "-"); if (w->first+visible < w->cnt) win_print (WWIN(w),x, w->w.y+w->w.height-2, "v"); else win_print (WWIN(w),x, w->w.y+w->w.height-2, "-"); if (visible>2) { i = 0; if (w->cnt > 1) i = w->cur*(visible-3)/(w->cnt-1); win_print (WWIN(w),x, w->w.y+i+2, "*"); } for (i=w->first; ifirst; i++) { storage[0] = '\0'; if (i == w->cur) { if (w->w.has_focus) win_attrset(ATTR_DLG_LIST_FOCUS); else win_attrset(ATTR_DLG_LIST_NOFOCUS); } else win_attrset(base_attr(w->w.d,ATTR_DLG_FRAME)); if (i < w->cnt) { strncpy (storage,w->entries[i],w->w.width-2); storage[w->w.width-2] = '\0'; } for (x=strlen(storage); xw.width-2; x++) storage[x] = ' '; storage[w->w.width-2] = '\0'; win_print (WWIN(w),w->w.x+1, w->w.y+i-w->first+1, storage); } } static int list_handle_event(WID_LIST *w, WID_EVENT event, int ch) { int i, old_cur; if (event == WID_HOTKEY) return 0; if (event == WID_GET_FOCUS) return EVENT_HANDLED; if ((event == WID_KEY) && w->w.handle_key) { i = w->w.handle_key((WIDGET *) w, ch); if (i) return i; } old_cur = w->cur; switch (ch) { case KEY_UP: if (w->cur>0) w->cur--; break; case KEY_DOWN: if (w->curcnt-1) w->cur++; break; case KEY_PPAGE: w->cur -= w->w.height-3; if (w->cur<0) w->cur = 0; break; case KEY_NPAGE: w->cur += w->w.height-3; if (w->cur>=w->cnt) w->cur = w->cnt>0 ? w->cnt-1 : 0; break; case KEY_HOME: w->cur = 0; break; #ifdef KEY_END case KEY_END: w->cur = w->cnt-1; break; #endif case KEY_LEFT: return handle_focus((WIDGET*)w, FOCUS_PREV, 0); case KEY_RIGHT: case KEY_TAB: return handle_focus((WIDGET*)w, FOCUS_NEXT, 0); case KEY_ENTER: case '\r': return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); default: return 0; } if (w->cur < w->first) w->first = w->cur; if (w->cur >= w->first + w->w.height-2) w->first = w->cur - w->w.height + 3; list_paint(w); if (w->sel_mode == WID_SEL_BROWSE && old_cur != w->cur) return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); return EVENT_HANDLED; } static void list_get_size(WID_LIST *w, int *width, int *height) { if (*width > w->w.def_width) *width = w->w.def_width; if (*width < LIST_WIDTH_MIN) *width = LIST_WIDTH_MIN; if (*height > w->w.def_height) *height = w->w.def_height; if (*height < LIST_HEIGHT_MIN) *height = LIST_HEIGHT_MIN; } static void check_toggle_paint(WID_CHECK *w, BOOL toggle) { char *start, *pos, *hl_pos, hl[2], end; char marker[] = " x", help[STORAGELEN]; int cur = 0, x, xx; hl_pos = NULL; hl[1] = '\0'; if (toggle) strcpy (help,"[ ] "); else { strcpy (help,"( ) "); marker[1] = '*'; } help[w->w.width] = '\0'; start = w->button; pos = w->button-1; do { pos++; if ((*pos == '|') || (*pos == '\0')) { end = *pos; *pos = '\0'; if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); help[1] = marker[BTST(w->selected,1<w.x, w->w.y+cur, help); if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_IHOTKEY); else win_attrset(ATTR_DLG_BUT_AHOTKEY); win_print(WWIN(w),w->w.x + x, w->w.y+cur, hl); x++; if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); strcpy (&help[x],hl_pos); xx = x+strlen(hl_pos); if (xx != w->w.width) memset (&help[xx],' ',w->w.width-xx); win_print(WWIN(w),w->w.x + x, w->w.y+cur, &help[x]); *(hl_pos - 2) = '&'; hl_pos = NULL; } else { if (x != w->w.width) memset (&help[x],' ',w->w.width-x); win_print(WWIN(w),w->w.x, w->w.y+cur, help); } *pos = end; start = pos + 1; cur++; } else if (*pos == '&') { *pos = '\0'; pos++; hl_pos = pos + 1; hl[0] = *pos; } } while (*pos); } static BOOL check_toggle_handle_event(WID_CHECK *w, WID_EVENT event, int ch, BOOL toggle) { static WID_EVENT last = WID_KEY; int cur; char *pos; if (event == WID_GET_FOCUS) { if (last != WID_HOTKEY) { /* active entry was already set */ if (ch < 0) w->active = w->cnt - 1; else w->active = 0; } return EVENT_HANDLED; } last = event; if ((event == WID_KEY) && (w->w.handle_key)) { cur = w->w.handle_key((WIDGET *) w, ch); if (cur) return cur; } if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_UP: case KEY_LEFT: if (event == WID_KEY) { w->active--; if (w->active < 0) return handle_focus ((WIDGET*)w, FOCUS_PREV, 0); check_toggle_paint(w,toggle); } break; case KEY_DOWN: case KEY_RIGHT: case KEY_TAB: if (event == WID_KEY) { w->active++; if (w->active >= w->cnt) return handle_focus ((WIDGET*)w, FOCUS_NEXT, 0); check_toggle_paint(w,toggle); } break; case KEY_ENTER: case '\r': if (event == WID_KEY) { cur = handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, 0); if (cur && cur!=FOCUS_ACTIVATE && cur!=FOCUS_DONT) return cur; if (toggle) w->selected ^= 1<active; else w->selected = 1<active; check_toggle_paint(w,toggle); } break; default: cur = 0; for (pos = w->button; *pos; pos++) { if (*pos == '|') cur++; if (*pos == '&' && (toupper((int)*(pos+1)) == ch)) { w->active = cur; check_toggle_paint(w,toggle); cur = handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); if (cur!=FOCUS_ACTIVATE && cur!=FOCUS_DONT) return cur; if (toggle) w->selected ^= 1<active; else w->selected = 1<active; check_toggle_paint(w,toggle); return cur; } } return 0; } return EVENT_HANDLED; } static void check_free(WID_CHECK *w) { free(w->button); free(w); } static void check_paint(WID_CHECK *w) { check_toggle_paint(w, 0); } static BOOL check_handle_event(WID_CHECK *w, WID_EVENT event, int ch) { return check_toggle_handle_event(w, event, ch, 0); } static void check_get_size(WID_CHECK *w, int *width, int *height) { char *pos; int x = 0, hl_cnt = 0; *width = 0; *height = 0; w->cnt = 0; for (pos = w->button; *pos; pos++) { if (*pos == '&') hl_cnt++; if (*pos == '|') { w->cnt++; (*height)++; x += 4 - hl_cnt; if (x > *width) *width = x; hl_cnt = 0; x = -1; } x++; } w->cnt++; (*height)++; x += 4 - hl_cnt; if (x > *width) *width = x; } static void toggle_free(WID_TOGGLE *w) { free(w->button); free(w); } static void toggle_paint(WID_TOGGLE *w) { check_toggle_paint((WID_CHECK *) w, 1); } static BOOL toggle_handle_event(WID_TOGGLE *w, WID_EVENT event, int ch) { return check_toggle_handle_event((WID_CHECK *) w, event, ch, 1); } static void toggle_get_size(WID_TOGGLE *w, int *width, int *height) { check_get_size((WID_CHECK *) w, width, height); } static void colorsel_free(WID_COLORSEL *w) { free(w); } static void colorsel_paint(WID_COLORSEL *w) { int y = w->w.y, x = w->w.x; int act_x = (w->active & COLOR_BMASK) >> COLOR_BSHIFT; int act_y = (w->active & COLOR_FMASK) >> COLOR_FSHIFT; ATTRS border[COLOR_CNT+2][COLOR_CNT*3+2], b[12], attr; win_attrset(base_attr(w->w.d, ATTR_DLG_FRAME)); win_box (WWIN(w), w->w.x, w->w.y, w->w.x+COLOR_CNT*3+1, w->w.y+COLOR_CNT+1); attr = (win_get_theme_color(ATTR_DLG_FRAME) & COLOR_BMASK) >> COLOR_BSHIFT; for (x=0; xw.x+x*3+1, w->w.y+y+1, " X "); } } { ATTRS hotkey = w->w.has_focus ? ATTR_DLG_BUT_AHOTKEY:ATTR_DLG_BUT_IHOTKEY; ATTRS text = w->w.has_focus ? ATTR_DLG_BUT_ATEXT:ATTR_DLG_BUT_ITEXT; char key[2] = " "; const char *pat[2] = {".......< h h >", "..^h hv"}; int p, h = 0; for (p=0; p<2; p++) { for (x=0; x> COLOR_BSHIFT; win_attrset (text); key[0] = pat[p][x]; if (pat[p][x] == 'h') { if (w->hkeys[h]) { border[x*p][x*(1-p)] = (win_get_theme_color(hotkey) & COLOR_BMASK) >> COLOR_BSHIFT; win_attrset (hotkey); key[0] = w->hkeys[h]; } h++; } win_print (WWIN(w), w->w.x+x*(1-p), w->w.y+x*p, key); } } } } for (x=0; x<5; x++) { b[x] = border[act_y][act_x*3+x]; b[10-x] = border[act_y+2][act_x*3+x]; } b[5] = border[act_y+1][act_x*3+4]; b[11] = border[act_y+1][act_x*3]; win_set_forground (COLOR_BLACK_F); win_box_color (WWIN(w),w->w.x+act_x*3, w->w.y+act_y, w->w.x+act_x*3+4, w->w.y+act_y+2, b); } static int colorsel_handle_event(WID_COLORSEL *w, WID_EVENT event, int ch) { int act_x = (w->active & COLOR_BMASK) >> COLOR_BSHIFT; int act_y = (w->active & COLOR_FMASK) >> COLOR_FSHIFT; int i, old_act_x = act_x, old_act_y = act_y; if (event == WID_GET_FOCUS) return EVENT_HANDLED; if (event == WID_KEY && w->w.handle_key) { i = w->w.handle_key((WIDGET *) w, ch); if (i) return i; } if (ch < 256 && isalpha(ch)) ch = toupper(ch); switch (ch) { case KEY_UP: if (event == WID_KEY && act_y>0) act_y--; break; case KEY_LEFT: if (event == WID_KEY && act_x>0) act_x--; break; case KEY_DOWN: if (event == WID_KEY && act_yhkeys, ch)) { if (ch == w->hkeys[0]) if (act_x>0) act_x--; if (ch == w->hkeys[1]) if (act_xhkeys[2]) if (act_y>0) act_y--; if (ch == w->hkeys[3]) if (act_yactive = (act_x << COLOR_BSHIFT) + (act_y << COLOR_FSHIFT); colorsel_paint(w); i = handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); if (i != FOCUS_ACTIVATE && i != FOCUS_DONT) return i; colorsel_paint(w); return i; } return 0; } w->active = (act_x << COLOR_BSHIFT) + (act_y << COLOR_FSHIFT); colorsel_paint (w); if (w->sel_mode == WID_SEL_BROWSE && (old_act_x != act_x || old_act_y != act_y)) return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); return EVENT_HANDLED; } static void colorsel_get_size(WID_COLORSEL *w, int *width, int *height) { *width = 26; *height = 10; } static void dialog_add(DIALOG *d, WIDGET *w) { d->widget = (WIDGET **) realloc(d->widget, (d->cnt + 1) * sizeof(WIDGET *)); d->widget[d->cnt] = w; d->cnt++; } static void widget_init(WIDGET *w, DIALOG *d, BOOL focus, int spacing) { w->x = w->y = w->width = w->height = 1; w->def_width = w->def_height = -1; w->spacing = spacing; w->can_focus = focus; w->has_focus = 0; w->d = d; w->handle_key = w->handle_focus = NULL; w->w_free = w->w_paint = NULL; w->w_handle_event = NULL; w->w_get_size = NULL; w->data = NULL; } WIDGET *wid_label_add(DIALOG *d, int spacing, const char *msg) { WID_LABEL *w = (WID_LABEL *) malloc(sizeof(WID_LABEL)); widget_init((WIDGET *) w, d, 0, spacing); w->w.type = TYPE_LABEL; w->w.w_free = (freeFunc) label_free; w->w.w_paint = (paintFunc) label_paint; w->w.w_handle_event = (handleEventFunc) label_handle_event; w->w.w_get_size = (getSizeFunc) label_get_size; w->msg = strdup(msg); dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_label_set_label (WID_LABEL *w, const char *label) { if (w->msg) free (w->msg); w->msg = strdup (label); } WIDGET *wid_str_add(DIALOG *d, int spacing, const char *input, int length) { int i; WID_STR *w = (WID_STR *) malloc(sizeof(WID_STR)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_STR; w->w.w_free = (freeFunc) str_free; w->w.w_paint = (paintFunc) str_paint; w->w.w_handle_event = (handleEventFunc) str_handle_event; w->w.w_get_size = (getSizeFunc) str_get_size; w->length = length; w->w.def_width = STR_WIDTH_MAX; w->input = (char *) malloc(length + 1); i = MIN(strlen(input), length); strncpy(w->input, input, i); w->input[i] = '\0'; w->cur_pos = strlen(w->input); dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_str_set_input (WID_STR *w, const char *input, int length) { if (length>=0) { if (w->input) free (w->input); if (length) w->input = (char *) malloc(length + 1); w->length = length; } if (w->length == 0) { w->input = NULL; w->cur_pos = w->start = 0; } else { int i = MIN (strlen(input), w->length); strncpy (w->input, input, i); w->input[i] = '\0'; if (w->cur_pos > strlen(w->input)) w->cur_pos = strlen(w->input); if (w->cur_pos < w->start) w->start = w->cur_pos; if (w->cur_pos >= w->start + w->w.width) w->start = w->cur_pos - w->w.width + 1; } } WIDGET *wid_int_add(DIALOG *d, int spacing, int value, int length) { WID_INT *w = (WID_INT *) malloc(sizeof(WID_INT)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_INT; w->w.w_free = (freeFunc) int_free; w->w.w_paint = (paintFunc) int_paint; w->w.w_handle_event = (handleEventFunc) int_handle_event; w->w.w_get_size = (getSizeFunc) int_get_size; w->start = 0; w->length = length; w->w.def_width = INT_WIDTH_MAX; w->input = (char *) malloc(w->length + 1); sprintf(w->input, "%d", value); w->cur_pos = strlen(w->input); dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_int_set_input (WID_INT *w, int value, int length) { char val[20]; sprintf(val, "%d", value); wid_str_set_input ((WID_STR*)w, val,length); } WIDGET *wid_button_add(DIALOG *d, int spacing, const char *button, int active) { WID_BUTTON *w = (WID_BUTTON *) malloc(sizeof(WID_BUTTON)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_BUTTON; w->w.w_free = (freeFunc) button_free; w->w.w_paint = (paintFunc) button_paint; w->w.w_handle_event = (handleEventFunc) button_handle_event; w->w.w_get_size = (getSizeFunc) button_get_size; w->button = strdup(button); w->active = active; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } WIDGET *wid_list_add(DIALOG *d, int spacing, const char **entries, int cnt) { WID_LIST *w = (WID_LIST *) malloc(sizeof(WID_LIST)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_LIST; w->title = NULL; w->entries = NULL; w->sel_mode = WID_SEL_SINGLE; w->cnt = w->cur = w->first = 0; w->w.def_width = LIST_WIDTH_DEFAULT; w->w.def_height = LIST_HEIGHT_DEFAULT; wid_list_set_entries (w,entries,-1,cnt); w->w.w_free = (freeFunc) list_free; w->w.w_paint = (paintFunc) list_paint; w->w.w_handle_event = (handleEventFunc) list_handle_event; w->w.w_get_size = (getSizeFunc) list_get_size; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_list_set_title (WID_LIST *w, const char *title) { if (w->title) free (w->title); w->title = strdup (title); } void wid_list_set_entries (WID_LIST *w, const char **entries, int cur, int cnt) { int i; if (w->entries) { for (i=0; icnt; i++) free (w->entries[i]); free (w->entries); w->entries = NULL; } w->cnt = cnt; if (cur>=0) { w->cur = cur; w->first = cur>0 ? cur-1:0; } if (w->cur >= cnt) w->cur = cnt>0 ? cnt-1:0; if (w->first > w->cur) w->first = w->cur>0 ? w->cur-1:0; if (cnt>0) { w->entries = (char **) malloc(sizeof(char*) * cnt); for (i=0; ientries[i] = strdup(entries[i]); } } void wid_list_set_active (WID_LIST *w, int cur) { if (cur>=0 && cur < w->cnt) { w->cur = cur; if (w->cur < w->first) w->first = w->cur; if (w->cur >= w->first + w->w.height-2) w->first = w->cur - w->w.height + 3; } } void wid_list_set_selection_mode (WID_LIST *w, WID_SEL_MODE mode) { w->sel_mode = mode; } WIDGET *wid_check_add(DIALOG *d, int spacing, const char *button, int active, int selected) { WID_CHECK *w = (WID_CHECK *) malloc(sizeof(WID_CHECK)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_CHECK; w->w.w_free = (freeFunc) check_free; w->w.w_paint = (paintFunc) check_paint; w->w.w_handle_event = (handleEventFunc) check_handle_event; w->w.w_get_size = (getSizeFunc) check_get_size; w->button = strdup(button); w->active = active; w->selected = selected; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_check_set_selected(WID_CHECK *w, int selected) { w->selected = selected; } WIDGET *wid_toggle_add(DIALOG *d, int spacing, const char *button, int active, int selected) { WID_TOGGLE *w = (WID_TOGGLE *) malloc(sizeof(WID_TOGGLE)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_TOGGLE; w->w.w_free = (freeFunc) toggle_free; w->w.w_paint = (paintFunc) toggle_paint; w->w.w_handle_event = (handleEventFunc) toggle_handle_event; w->w.w_get_size = (getSizeFunc) toggle_get_size; w->button = strdup(button); w->active = active; w->selected = selected; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_toggle_set_selected(WID_TOGGLE *w, int selected) { w->selected = selected; } WIDGET *wid_colorsel_add(DIALOG *d, int spacing, const char *hotkeys, int active) { WID_COLORSEL *w = (WID_COLORSEL *) malloc(sizeof(WID_COLORSEL)); int i; widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_COLORSEL; w->w.w_free = (freeFunc) colorsel_free; w->w.w_paint = (paintFunc) colorsel_paint; w->w.w_handle_event = (handleEventFunc) colorsel_handle_event; w->w.w_get_size = (getSizeFunc) colorsel_get_size; w->active = active; if (hotkeys && *hotkeys) { strcpy (w->hkeys, hotkeys); w->hkeys[4] = '\0'; for (i=0; ihkeys); i++) w->hkeys[i] = toupper(w->hkeys[i]); } else memset (&w->hkeys, 0, 5); w->sel_mode = WID_SEL_SINGLE; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_colorsel_set_active(WID_COLORSEL *w, int active) { w->active = active; } void wid_set_size (WIDGET *w, int width, int height) { if (width>=0) w->def_width = width; if (height>=0) w->def_height = height; } void wid_set_func(WIDGET *w, handleKeyFunc key, handleFocusFunc focus, void *data) { w->handle_key = key; w->handle_focus = focus; w->data = data; } void wid_repaint (WIDGET *w) { if (w->w_paint) w->w_paint (w); } BOOL dialog_repaint(MWINDOW *win) { DIALOG *d = (DIALOG *) win->data; int i = 0; win_attrset(base_attr(d,ATTR_DLG_FRAME)); win_clear(win); for (i = 0; i < d->cnt; i++) d->widget[i]->w_paint(d->widget[i]); return 1; } void dialog_close(DIALOG *d) { int i; for (i = 0; i < d->cnt; i++) d->widget[i]->w_free(d->widget[i]); if (d->cnt) free(d->widget); win_close(d->win); free(d); } static BOOL dialog_handle_key(MWINDOW *win, int ch) { DIALOG *d = (DIALOG *) win->data; int ret, i; /* Handle keys common for all widgets here */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) if (ch == KEY_ESC) { dialog_close(d); return 1; } #endif ret = d->widget[d->active]->w_handle_event(d->widget[d->active], WID_KEY,ch); if (!ret) { /* KEY not handled -> try the hotkeys */ for (i = 0; !ret && i < d->cnt; i++) { ret = d->widget[i]->w_handle_event(d->widget[i], WID_HOTKEY, ch); if (ret == FOCUS_ACTIVATE) { d->widget[d->active]->has_focus = 0; d->widget[i]->has_focus = 1; d->active = i; d->widget[d->active]->w_handle_event(d->widget[d->active], WID_GET_FOCUS, ret); dialog_repaint(win); } } } else if (ret < EVENT_HANDLED) { /* FOCUS_{NEXT|PREV} */ d->widget[d->active]->has_focus = 0; do { d->active += ret; if (d->active < 0) d->active = d->cnt - 1; else if (d->active >= d->cnt) d->active = 0; } while (!d->widget[d->active]->can_focus); d->widget[d->active]->has_focus = 1; d->widget[d->active]->w_handle_event(d->widget[d->active], WID_GET_FOCUS, ret); dialog_repaint(win); } return !!ret; } /* Return size of column of widgets which starts at widget start */ static void column_dim (DIALOG *d, int start, int *width, int *height) { int i; *width = d->widget[start]->width; i = start+1; while (icnt && d->widget[i]->spacing>0) { if (d->widget[i]->width > *width) *width = d->widget[i]->width; i++; }; *height = d->widget[i-1]->y+d->widget[i-1]->height-d->widget[start]->y; } /* Layout the dialog widgets and return the calculated size and position of the dialog window (which must be still opened). initial = true: the the focus of the widgets is changed */ static void dialog_layout(DIALOG *d, int initial, int *w_x, int *w_y, int *w_width, int *w_height) { int m_y, m_width = 0, m_height = 0, i, x, y, width, height; int spacing, c_spacing = 1, c_height, c_width; BOOL focus = 1; i = 0; width = 1; height = c_width = c_height = m_height = m_width = 0; while (i < d->cnt) { /* Init all widgets(position and focus) */ spacing = d->widget[i]->spacing; if (i==0 || spacing<0) c_spacing = (spacing == 0 ? 1:abs(spacing)); x = 999; y = 999; d->widget[i]->w_get_size(d->widget[i], &x, &y); d->widget[i]->width = x; d->widget[i]->height = y; if (spacing>0) { c_height += spacing-1; d->widget[i]->x = width; d->widget[i]->y = m_height+c_height; if (x>c_width) c_width = x; } else if (spacing==0) { if (c_height>height) height = c_height; c_height = c_spacing-1; width += c_width + 1; d->widget[i]->x = width; d->widget[i]->y = m_height+c_height; c_width = x; } else { width += c_width + 1; if (width > m_width) m_width = width; if (c_height>height) height = c_height; m_height += height; c_height = -spacing-1; height = 0; width = 1; d->widget[i]->x = width; d->widget[i]->y = m_height+c_height; c_width = x; } c_height += y; if (initial) { if (d->widget[i]->can_focus) { d->widget[i]->has_focus = focus; if (focus) d->active = i; focus = 0; } else d->widget[i]->has_focus = 0; } i++; } width += c_width+1; if (width > m_width) m_width = width; if (c_height>height) height = c_height; m_height += height; width = m_width; height = m_height; win_get_size_max(&m_y, &m_width, &m_height); if (width > m_width-2 || height > m_height-2) { /* preferred size of widgets was to big, try to reduce the size */ int dx = width-m_width+2, dy = height-m_height+2, free_x, old_width = width, old_height = height, i_start, m_c_height, m_c_height_old, c_height_old, c_width_old, m_x; m_width = m_height = 0; i = 0; while (i < d->cnt) { /* reinit all widget positions */ spacing = abs(d->widget[i]->spacing); m_height += (spacing == 0 ? 0:spacing-1); width = 1; /* get height of highest column in row */ x = i; do { x++; } while (xcnt && d->widget[x]->spacing>=0); if (xcnt) m_c_height_old = d->widget[x]->y+d->widget[x]->spacing - d->widget[i]->y+1; else m_c_height_old = old_height - d->widget[i]->y; /* get max x coordinate of last column in row */ m_x = 0; do { x--; if ((d->widget[x]->x+d->widget[x]->width - 1) > m_x) m_x = d->widget[x]->x+d->widget[x]->width - 1; } while (x>0 && d->widget[x]->spacing>0); /* free space on right side of last column in row */ free_x = old_width-1-m_x; m_c_height = 0; /* for all columns in one row */ do { c_height = c_width = 0; i_start = i; column_dim (d, i_start, &c_width_old, &c_height_old); /* for all widgets in one column */ do { x = d->widget[i]->width - dx + free_x; y = d->widget[i]->height - dy + m_c_height_old-c_height_old; d->widget[i]->w_get_size(d->widget[i], &x, &y); if (i>0 && d->widget[i]->spacing > 0) c_height += d->widget[i]->spacing-1; d->widget[i]->x = width; d->widget[i]->y = m_height + c_height; d->widget[i]->width = x; d->widget[i]->height = y; if (x>c_width) c_width = x; c_height += y; y = c_width_old; column_dim (d, i_start, &c_width_old, &c_height_old); free_x += y - c_width_old; i++; } while ((i < d->cnt) && (d->widget[i]->spacing > 0)); width += c_width +1; if (c_height > m_c_height) m_c_height = c_height; } while ((i < d->cnt) && (d->widget[i]->spacing >= 0)); if (width > m_width) m_width = width; m_height += m_c_height; } width = m_width; height = m_height; win_get_size_max(&m_y, &m_width, &m_height); } m_width -= 2; m_height -= 2; *w_x = (m_width - width) / 2 + 1; if (*w_x < 1) *w_x = 1; *w_y = (m_height - height) / 2 + m_y +1; if (*w_y <= m_y) *w_y = m_y+1; *w_width = (width>m_width ? m_width:width); *w_height = (height>m_height ? m_height:height); } static void dialog_handle_resize(MWINDOW *win, int dx, int dy) { DIALOG *d = (DIALOG *) win->data; int x,y,width,height; dialog_layout (d,0,&x,&y,&width,&height); win->x = x; win->y = y; win->width = width; win->height = height; } void dialog_open(DIALOG *d, const char *title) { int x,y,width,height; dialog_layout (d,1,&x,&y,&width,&height); if (!title) title = "Dialog"; win_open(x, y, width, height, 1, title, base_attr(d,ATTR_DLG_FRAME)); win_set_repaint(dialog_repaint); win_set_handle_key(dialog_handle_key); win_set_resize(0, dialog_handle_resize); win_set_data((void *)d); d->win = win_get_window(); dialog_repaint(d->win); } /* set attribute which is used for DLG_FRAME and DLG_LABEL, works only before dialog_open() */ void dialog_set_attr (DIALOG *d, ATTRS attrs) { d->attrs = attrs; } DIALOG *dialog_new(void) { DIALOG *d = (DIALOG *) malloc(sizeof(DIALOG)); d->active = 0; d->cnt = 0; d->attrs = ATTR_NONE; d->win = NULL; d->widget = NULL; return d; } /* ex:set ts=4: */ mikmod-3.2.8/src/marchive.c0000644000000000000000000004751513040414034014240 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: marchive.c,v 1.2 2004/02/01 16:31:16 raph Exp $ Archive support These routines are used to detect different archive/compression formats and decompress/de-archive the mods from them if necessary. ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_FNMATCH_H #include "mfnmatch.h" #else #include #endif #include #include #include #include #include #include #if !defined(S_IREAD) && defined(S_IRUSR) #define S_IREAD S_IRUSR #endif #if !defined(S_IWRITE) && defined(S_IWUSR) #define S_IWRITE S_IWUSR #endif #ifdef HAVE_FCNTL_H #include #endif #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) #include #include #ifdef HAVE_SYS_WAIT_H #include #endif #ifndef WIFEXITED #define WIFEXITED(x) (((x) & 255) == 0) #endif #endif #ifndef O_BINARY #define O_BINARY 0 #endif #include #include "mlist.h" #include "marchive.h" #include "mconfig.h" #include "mutilities.h" #include "display.h" /* module filenames patterns */ static const CHAR *modulepatterns[] = { "*.669", "*.[Aa][Mm][Ff]", "*.[Aa][Pp][Uu][Nn]", "*.[Dd][Ss][Mm]", "*.[Ff][Aa][Rr]", "*.[Gg][Dd][Mm]", "*.[Ii][Mm][Ff]", "*.[Ii][Tt]", "*.[Mm][Ee][Dd]", "*.[Mm][Oo][Dd]", "*.[Mm][Tt][Mm]", "*.[Nn][Ss][Tt]", /* noisetracker */ "*.[Ss]3[Mm]", "*.[Ss][Tt][Mm]", "*.[Ss][Tt][Xx]", "*.[Uu][Ll][Tt]", #if LIBMIKMOD_VERSION >= 0x030303 "*.[Uu][Mm][Xx]", /* unreal umx container */ #endif "*.[Uu][Nn][Ii]", "*.[Xx][Mm]", NULL }; static const CHAR *prefixmodulepatterns[] = { "[Mm][Ee][Dd].*", "[Mm][Oo][Dd].*", "[Nn][Ss][Tt].*", "[Xx][Mm].*", /* found on Aminet */ NULL }; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32)&&!defined(_mikmod_amiga) /* Drop all root privileges we might have. */ BOOL DropPrivileges(void) { if (!geteuid()) { if (getuid()) { /* we are setuid root -> drop setuid to become the real user */ if (setuid(getuid())) return 1; } else { /* we are run as root -> drop all and become user 'nobody' */ struct passwd *nobody; int uid; if (!(nobody = getpwnam("nobody"))) return 1; /* no such user ? */ uid = nobody->pw_uid; if (!uid) /* user 'nobody' has root privileges ? weird... */ return 1; if (setuid(uid)) return 1; } } return 0; } #endif /* Determines if a filename matches a module filename pattern */ static BOOL MA_isModuleFilename(const CHAR *filename) { int t = 0; while (modulepatterns[t]) if (!fnmatch(modulepatterns[t++], filename, FNM_NOESCAPE)) return 1; return 0; } /* The same, but also checks for prefix names */ static BOOL MA_isModuleFilename2(const CHAR *filename) { int t = 0; if (MA_isModuleFilename(filename)) return 1; else while (prefixmodulepatterns[t]) if (!fnmatch(prefixmodulepatterns[t++], filename, FNM_NOESCAPE)) return 1; return 0; } /* Determines if a filename extension matches an archive filename extension pattern */ static BOOL MA_MatchExtension(const CHAR *archive, const CHAR *ends) { const CHAR *pos = ends; int nr, arch_nr; do { while (*pos && *pos != ' ') pos++; nr = pos - ends; arch_nr = strlen(archive); while (nr > 0 && arch_nr > 0 && toupper((int)archive[arch_nr - 1]) == *(ends + nr - 1)) nr--, arch_nr--; if (nr <= 0) return 1; pos++; ends = pos; } while (*(pos - 1)); return 0; } /* Tests if 'filename' has the signature 'header-string' at offset 'header_location' */ static int MA_identify(const CHAR *filename, int header_location, const CHAR *header_string) { int len = MIN(strlen(header_string), 255); if (!len) return 0; if (header_location < 0) { /* check extension of file rather than signature */ return MA_MatchExtension(filename, header_string); } else { /* check in-file signature */ FILE *fp; CHAR id[255+1]; if (!(fp = fopen(path_conv_sys(filename), "rb"))) return 0; fseek(fp, header_location, SEEK_SET); if (!fread(id, len, 1, fp)) { fclose(fp); return 0; } if (!memcmp(id, header_string, len)) { fclose(fp); return 1; } fclose(fp); } return 0; } #if defined(__DJGPP__) #include #include static BOOL filename2short (const char *l, char *s, int len_s) { __dpmi_regs r; r.x.ax = 0x7160; r.h.cl = 1; /* 2 for short -> long conversion */ r.h.ch = 0x80; dosmemput (l, strlen(l)+1, _go32_info_block.linear_address_of_transfer_buffer); r.x.si = _go32_info_block.linear_address_of_transfer_buffer & 0x0f; r.x.ds = _go32_info_block.linear_address_of_transfer_buffer >> 4; r.x.di = (_go32_info_block.linear_address_of_transfer_buffer+512) & 0x0f; r.x.es = (_go32_info_block.linear_address_of_transfer_buffer+512) >> 4; __dpmi_int (0x21, &r); if (r.x.flags & 1) { /* is carry flag set (-> error) ? */ strncpy (s, l, len_s); s[len_s - 1] = '\0'; return 0; } else { dosmemget (_go32_info_block.linear_address_of_transfer_buffer+512, len_s, s); s[len_s - 1] = '\0'; return 1; } } #elif defined(_WIN32) static BOOL filename2short (const char *l, char *s, int len_s) { int copied = GetShortPathName (l, s, len_s); if (copied == 0 || copied >= len_s) { strncpy (s, l, len_s); s[len_s - 1] = '\0'; return 0; } else return 1; } #else static BOOL filename2short (const char *l, char *s, int len_s) { strncpy (s, l, len_s); s[len_s - 1] = '\0'; return 1; } #endif /* Copy pattern, replace in the copy %A with arc, %a with a short version of arc, %f with file, and %d with dest, and return the copy. */ static char* get_command (const char *pattern, const char *arc, const char *file, const char *dest) { int i = 0, len = 0; const char *arg[3]; char *pos, *pat, *command; char buf[PATH_MAX]; pat = strdup (pattern); len = strlen(pattern) + 1; for (pos=pat; i<3 && *pos; pos++) { if (*pos == '%' && (*(pos+1) == 'A' || *(pos+1) == 'a' || *(pos+1) == 'f' || *(pos+1) == 'd')) { switch (*(pos+1)) { case 'A': arg[i] = arc; break; case 'a': filename2short (arc, buf, PATH_MAX); arg[i] = buf; break; case 'f': arg[i] = file; break; case 'd': arg[i] = dest; break; } *(pos+1) = 's'; len += strlen(arg[i]); i++; } } command = (char *) malloc (len*sizeof(char)); SNPRINTF (command,len,pat,arg[0],arg[1],arg[2]); free (pat); return command; } #if !(defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga)) /* Split command in single arguments by inserting '\0' in command and store them in argv. Size of argv: sizeargv */ static void split_command (char *command, char **argv, int sizeargv) { char *pos = command; int i = 0; while (1) { if (!*pos || i >= sizeargv-1) { argv[i] = NULL; return; } if (isspace((int)*pos)) { *pos = '\0'; pos++; while (isspace((int)*pos)) pos++; } if (*pos == '"') { *pos++ = '\0'; argv[i++] = pos; while (*pos != '"' && *pos) pos++; if (*pos) *pos++ = '\0'; } else { argv[i++] = pos; while (!isspace((int)*pos) && *pos) pos++; } } } #endif /* Create a copy of file 'fd' with the first 'start' lines and the last 'end' lines removed. Ignore all lines up to the first occurence of startpat. Unlink the copy and return a file descriptor to the copy. If the file could not be unlinked (e.g. under Windows an open file can not be unlinked), return its name in 'file'.*/ static int MA_truncate (int fd, const char *startpat, int start, int end, char **file) { #define BUFSIZE 5000 char buf[BUFSIZE]; const char *pos; int dest, cnt = -1; long size; char *fdest; if (file) *file = NULL; size = (long) lseek (fd, 0, SEEK_END); if (size < 0) return -1; dest = get_tmp_file(NULL, &fdest); if (dest < 0) return -1; if (unlink (path_conv_sys(fdest)) == 0) { free (fdest); fdest = NULL; } if (end>0 && !lseek(fd, size>BUFSIZE ? -BUFSIZE:-size, SEEK_END) && (cnt=read(fd, buf, sizeof(char)*BUFSIZE)) > 0) { pos = buf+cnt-1; while (end>0 && pos>=buf) { if (*pos == '\n') end--; pos--; size--; } if (pos>=buf && *pos == '\r') size--; } lseek (fd, 0, SEEK_SET); if (((startpat && *startpat) || start>0) && (cnt=read(fd, buf, sizeof(char)*(size>BUFSIZE ? BUFSIZE:size))) > 0) { pos = NULL; if (startpat && *startpat) pos = strstr(buf, startpat); if (!pos) pos = buf; while (start>0 && pos-buf < cnt) { if (*pos == '\n') start--; pos++; } if (pos-buf < cnt) write (dest, pos, sizeof(char)*(cnt-(pos-buf))); size -= cnt; } while (size>0) { cnt = read(fd, buf, sizeof(char)*(size>BUFSIZE ? BUFSIZE:size)); write (dest, buf, sizeof(char)*cnt); size -= cnt; } if (file) { if (fdest) *file = fdest; } else if (fdest) free (fdest); lseek (dest, 0, SEEK_SET); return dest; } #ifdef _mikmod_amiga #define start_redirect() do {} while (0) #define stop_redirect() do {} while (0) #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) static int rd_err, rd_outbak=-1, rd_errbak; #ifdef _WIN32 static char *rd_file = NULL; #endif static void start_redirect (void) { fflush(stdin); /* so any buffered chars will be written out */ fflush(stdout); fflush(stderr); #ifdef _WIN32 /* "nul" seems not to work, use a temp file instead */ rd_err = get_tmp_file(NULL, &rd_file); #else rd_err = open("nul", O_WRONLY | O_CREAT, S_IREAD | S_IWRITE); #endif if (rd_err != -1) { rd_outbak=dup(1); rd_errbak=dup(2); dup2(rd_err,1); dup2(rd_err,2); close(rd_err); } } static void stop_redirect (void) { if (rd_outbak != -1) { dup2(rd_outbak,1); dup2(rd_errbak,2); close(rd_outbak); close(rd_errbak); rd_outbak = -1; #ifdef _WIN32 if (rd_file) { unlink (path_conv_sys(rd_file)); free (rd_file); rd_file = NULL; } #endif } } #endif /* Extracts the file 'file' from the archive 'arc'. Return a file descriptor to the extracted file. If the file could not be unlinked (e.g. under Windows an open file can not be unlinked), return its name in 'extracted'. */ int MA_dearchive(const CHAR *arc, const CHAR *file, CHAR **extracted) { CHAR *tmp_file = NULL, tmp_file_sys[PATH_MAX+1], *command; int tmp_fd = -1, t; if (extracted) *extracted = NULL; /* not an archive file... */ if (!arc || !arc[0]) { tmp_fd = open (path_conv_sys(file), O_RDONLY | O_BINARY, 0600); return tmp_fd; } tmp_file_sys[PATH_MAX] = '\0'; for (t = 0; t= 0) { if (unlink(tmp_file_sys) == 0) { free (tmp_file); tmp_file = NULL; } } #else /* extracting, the Unix way */ { pid_t pid; int status; char *argv[20]; tmp_fd = get_tmp_file (NULL, &tmp_file); if (tmp_fd < 0) return -1; strncpy (tmp_file_sys, path_conv_sys(tmp_file), PATH_MAX); unlink (tmp_file_sys); free (tmp_file); tmp_file = NULL; switch (pid = fork()) { case -1: /* fork failed */ close (tmp_fd); return -1; break; case 0: /* fork succeeded, child process code */ /* if we have root privileges, drop them */ if (DropPrivileges()) exit(0); close(0); close(1); close(2); dup2(tmp_fd, 1); signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); command = get_command (config.archiver[t].extract, path_conv_sys(arc), path_conv_sys2(file), NULL); if (command && *command) { split_command (command, argv, 20); execvp (argv[0], argv); free (command); } close(1); exit(0); break; default: /* fork succeeded, main process code */ waitpid(pid, &status, 0); if (!WIFEXITED(status)) { close(tmp_fd); return -1; } break; } } #endif break; } } if (tmp_fd >= 0) { lseek (tmp_fd, 0, SEEK_SET); if ((config.archiver[t].skippat && config.archiver[t].skippat[0]) || config.archiver[t].skipstart>0 || config.archiver[t].skipend>0) { char *f; t = MA_truncate (tmp_fd, config.archiver[t].skippat, config.archiver[t].skipstart, config.archiver[t].skipend, &f); close (tmp_fd); if (tmp_file) { unlink (tmp_file_sys); free (tmp_file); } tmp_file = f; tmp_fd = t; } } if (extracted) { if (tmp_file) *extracted = tmp_file; } else if (tmp_file) free (tmp_file); return tmp_fd; } /* Test if filename looks like a module or an archive playlist==1: also test against a playlist deep==1 : use Player_LoadTitle() for testing against a module, otherwise test based on the filename */ #if LIBMIKMOD_VERSION < 0x030302 BOOL MA_TestName (char *filename, BOOL plist, BOOL deep) #else BOOL MA_TestName (const char *filename, BOOL plist, BOOL deep) #endif { int t; if (plist && PL_isPlaylistFilename(filename)) return 1; if (deep) { char *title; if ((title=Player_LoadTitle(path_conv_sys(filename)))) { #if (LIBMIKMOD_VERSION >= 0x030200) && defined(HAVE_MIKMOD_FREE) MikMod_free (title); #else free (title); #endif return 1; } else if (MikMod_errno != MMERR_NOT_A_MODULE) return 1; } else if (MA_isModuleFilename2(filename)) return 1; /* FIXME: should only be on if deep==1 */ for (t = 0; t= 0) { if (config.archiver[archive].list && *config.archiver[archive].list) { /* multi-file archive, need to invoke list function */ BOOL endspace = config.archiver[archive].nameoffset < 0; int offset = endspace ? 0:config.archiver[archive].nameoffset; char *string = (char *) malloc (PATH_MAX + 2 + offset); char *command; #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) /* Archive display, the non-Unix way */ FILE *file; char *dest = NULL; #ifdef _mikmod_amiga dest = get_tmp_name(); #endif command = get_command (config.archiver[archive].list, path_conv_sys(filename), NULL, dest); start_redirect(); #ifdef _mikmod_amiga system(command); file = fopen(dest, "r"); #elif defined(__WATCOMC__)||(defined(_WIN32)&&!defined(__LCC__)) file = _popen (command, "r"); #else file = popen (command, "r"); #endif stop_redirect(); free (command); fgets(string, PATH_MAX + offset + 1, file); while (!feof(file)) { string[strlen(string) - 1] = 0; if (endspace) { for (t = 0; string[t]!=' ' && string[t]!='\0'; t++); string[t] = 0; } t = offset; while (isspace((int)*(string+t))) t++; if (MA_isModuleFilename2(string + t)) PL_Add(pl, string + t, filename, 0, 0); fgets(string, PATH_MAX + offset + 1, file); } #ifdef _mikmod_amiga fclose(file); unlink(dest); free(dest); #elif defined(__WATCOMC__)||defined(_WIN32) _pclose(file); #else pclose(file); #endif #else /* Archive display, the Unix way */ int fd[2]; if (!pipe(fd)) { pid_t pid; int status, cur, finished = 0; char ch; switch (pid = fork()) { case -1: /* fork failed */ break; case 0: /* fork succeeded, child process code */ { char *argv[20]; /* if we have root privileges, drop them */ if (DropPrivileges()) exit(0); close(0); close(1); close(2); dup2 (fd[1], 1); dup2 (fd[1], 2); signal (SIGINT, SIG_DFL); signal (SIGQUIT, SIG_DFL); command = get_command (config.archiver[archive].list, path_conv_sys(filename), NULL, NULL); split_command (command, argv, 20); execvp (argv[0], argv); free (command); close(fd[1]); exit(0); break; } default: /* fork succeeded, main process code */ /* have to wait for the child to ensure the command was successful and the pipe contains useful information */ /* read from the pipe */ close(fd[1]); cur = 0; for (;;) { /* check if child process has finished */ if (!finished && waitpid(pid, &status, WNOHANG)) { finished = 1; /* abnormal exit */ if (!WIFEXITED(status)) { close(fd[0]); break; } } /* check for end of pipe, otherwise read char */ if (!read(fd[0], &ch, 1) && finished) break; if (ch == '\n') ch = 0; string[cur++] = ch; if (cur >= PATH_MAX + offset + 1) cur = PATH_MAX + offset; if (!ch) { cur = 0; if (endspace) { for (t = 0; string[t]!=' ' && string[t]!='\0'; t++); string[t] = 0; } t = offset; while (isspace((int)*(string+t))) t++; if (MA_isModuleFilename2(string + t)) PL_Add(pl, string + t, filename, 0, 0); } } close(fd[0]); break; } } #endif free (string); } else { /* single-file archive, guess the name */ const CHAR *dot, *slash; CHAR *spare; dot = strrchr(filename, '.'); slash = FIND_LAST_DIRSEP(filename); if (!slash) slash = filename; else slash++; if (!dot) for (dot = slash; *dot; dot++); spare = (CHAR *) malloc((1 + dot - slash) * sizeof(CHAR)); if (spare) { strncpy(spare, slash, dot - slash); spare[dot - slash] = 0; if (MA_isModuleFilename2(spare)) PL_Add(pl, spare, filename, 0, 0); free(spare); } } } else PL_Add(pl, filename, NULL, 0, 0); } /* ex:set ts=4: */ mikmod-3.2.8/src/mgetopt1.c0000644000000000000000000001062510001643547014201 0ustar rootroot/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "mgetopt.h" #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ mikmod-3.2.8/src/mutilities.c0000644000000000000000000004264513040414034014631 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mutilities.c,v 1.1.1.1 2004/01/16 02:07:34 raph Exp $ Some utility functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) #include #endif #include #include #if defined(_WIN32) #include #elif defined(__OS2__) || defined(__EMX__) #define INCL_DOS #include #include #else #include #endif #include "player.h" #include "mlist.h" #include "marchive.h" #include "mutilities.h" #ifdef _mikmod_amiga #include #include #endif #if defined(__DJGPP__) static const char *get_homedir (void) { return "C:"; /* good enough for msdos */ } #elif defined(_mikmod_amiga) static const char *get_homedir (void) { static char homdir[PATH_MAX]; static char *home = NULL; if (!home) { BPTR lock = GetProgramDir(); if (!lock || !NameFromLock(lock, homdir, PATH_MAX)) strcpy(homdir, "SYS:"); if (!homdir[0]) /* possible?? */ strcpy(homdir, "SYS:"); else { home = homdir + strlen(homdir); if (!IS_PATH_SEP(home[-1])) { home[0] = PATH_SEP; home[1] = 0; } } home = homdir; } return home; } #elif defined(__OS2__)||defined(__EMX__) static const char *get_homedir (void) { const char *home = getenv("HOME"); if (!home || !*home) return "C:"; return home; } #elif defined(_WIN32) static const char *get_homedir (void) { const char *home; # ifndef _WIN64 static int is_w9x = -1; if (is_w9x < 0) { OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(v); if (!GetVersionEx(&v) || v.dwMajorVersion < 4 || v.dwPlatformId < VER_PLATFORM_WIN32_NT) { is_w9x = 1; } else is_w9x = 0; } if (is_w9x) return "C:"; # endif home = getenv("USERPROFILE"); if (!home || !*home) return "C:"; return home; } #else /* unix */ static const char *get_homedir (void) { static const char *home = NULL; static char d[PATH_MAX]; if (!home) { struct passwd *pw = getpwuid(getuid()); memset(d, 0, sizeof(d)); if (pw && pw->pw_dir) { strncpy(d, pw->pw_dir, sizeof(d)); d[sizeof(d) - 1] = 0; home = d; } else if ((home = getenv("HOME")) != NULL) { strncpy(d, home, sizeof(d)); d[sizeof(d) - 1] = 0; home = d; } else { home = ""; /* fubar'ed.. */ } } return home; } #endif /* get_homedir */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) void path_conv(char *file) { if (!file) return; for (; *file; file++) { if (*file == PATH_SEP_SYS) *file = PATH_SEP; } } char *path_conv_sys(const char *file) { static char f[PATH_MAX]; char *pos = f; const char *end = file + PATH_MAX-1; if (!file) return NULL; for (; *file && filef && *(pos-1) == PATH_SEP_SYS && *(pos-2) != ':') pos--; *pos = '\0'; return f; } char *path_conv_sys2(const char *file) { static char f[PATH_MAX]; char *pos = f; const char *end = file + PATH_MAX-1; if (!file) return NULL; for (; *file && file= 0) return fd; else if (errno != EEXIST) /* Any other error will apply also to other names we might try, and there are 2^32 or so of them, so give up now. */ return -1; } /* We got out of the loop because we ran out of combinations to try. */ return -1; #endif } /* tmpl: file name template ending in 'XXXXXX' without path or NULL name_used: if !=NULL pointer to name of temp file, must be freed return: file descriptor or -1 */ int get_tmp_file (const char *tmpl, char **name_used) { static const char *tmpdir = NULL; static const char *tmpsep = ""; char *fulltmpl; int retval; if (!tmpdir) { #if defined(_mikmod_amiga) tmpdir = "T:"; #else /* ! amiga: */ tmpdir = getenv ("TMPDIR"); if (!tmpdir) tmpdir = getenv ("TMP"); if (!tmpdir) tmpdir = getenv ("TEMP"); #ifdef P_tmpdir if (!tmpdir) tmpdir = P_tmpdir; #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) if (!tmpdir) tmpdir = "C:\\"; #else if (!tmpdir) tmpdir = "/tmp"; #endif if (*tmpdir && tmpdir[strlen(tmpdir) - 1] == PATH_SEP_SYS) tmpsep = ""; else tmpsep = PATH_SEP_SYS_STR; #endif /* !amiga */ } if (tmpl == NULL) tmpl = "mmXXXXXX"; fulltmpl = (char *) malloc (strlen(tmpdir)+strlen(tmpsep)+strlen(tmpl)+1); sprintf (fulltmpl, "%s%s%s", tmpdir, tmpsep, tmpl); retval = m_mkstemp (fulltmpl); if (retval == -1) { free (fulltmpl); return -1; } if (name_used) { path_conv (fulltmpl); *name_used = fulltmpl; } else free (fulltmpl); return retval; } #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) /* allocate and return a name for a temporary file (under UNIX not used because of tempnam race condition) */ char *get_tmp_name(void) { CHAR *tmp_file; #if defined(__OS2__) && defined(__WATCOMC__) tmp_file = str_sprintf2("%s" PATH_SEP_STR "%s", getenv("TEMP"), "!MikMod.tmp"); #elif defined(_WIN32) if (!(tmp_file = _tempnam(NULL, ".mod"))) if (!(tmp_file = _tempnam(get_homedir(), ".mod"))) return NULL; #elif defined(_mikmod_amiga) char s[16]; sprintf(s,"%d", rand()); tmp_file = str_sprintf("T:%s.mik", s); #else if (!(tmp_file = tempnam(NULL, ".mod"))) if (!(tmp_file = tempnam(get_homedir(), ".mod"))) return NULL; #endif path_conv(tmp_file); return tmp_file; } #endif /* allocate and return a filename including the path for a config file 'name': filename without the path */ char *get_cfg_name(const char *name) { #if defined(_mikmod_amiga) char *p = str_sprintf2("%s%s", get_homedir(), name); #else char *p = str_sprintf2("%s" PATH_SEP_STR "%s", get_homedir(), name); #endif path_conv (p); return p; } #ifndef HAVE_SNPRINTF /* Not a viable snprintf implementation, but makes code more clear */ int mik_snprintf(char *buffer, size_t n, const char *format, ...) { va_list args; int len; va_start(args, format); len = VSNPRINTF(buffer, n, format, args); va_end(args); if (len < 0) len = (int)n; if ((size_t)len >= n) buffer[n-1] = '\0'; return len; } #endif unsigned long Time1000(void) { #ifdef _WIN32 static __int64 Freq = 0; static __int64 LastCount = 0; static __int64 LastRest = 0; static long LastTime = 0; __int64 Count, Delta; /* Freq was set to -1, if the current hardware does not support high resolution timers. We will use GetTickCount instead then. */ if (Freq < 0) return GetTickCount(); /* Freq is 0 the first time this function is being called. */ if (!Freq) /* try to determine the frequency of the high resulution timer */ if (!QueryPerformanceFrequency((LARGE_INTEGER *) & Freq)) { /* There is no such timer... */ Freq = -1; return GetTickCount(); } /* retrieve current count */ Count = 0; QueryPerformanceCounter((LARGE_INTEGER *) & Count); /* calculate the time passed since last call, and add the rest of those tics that didn't make it into the last reported time. */ Delta = 1000 * (Count - LastCount) + LastRest; LastTime += (long)(Delta / Freq); /* save the new value */ LastRest = Delta % Freq; /* save those ticks not being counted */ LastCount = Count; /* save last count */ return LastTime; #elif defined(__OS2__) || defined(__EMX__) static int first = 1; static ULONG Freq; static long long LastCount = 0; static long long LastRest = 0; static long LastTime = 0; long long Delta, Count; if (first) { first = 0; DosTmrQueryFreq(&Freq); } DosTmrQueryTime((QWORD *) & Count); Delta = 1000 * (Count - LastCount) + LastRest; LastTime += (long)(Delta / Freq); LastRest = Delta % Freq; LastCount = Count; return LastTime; #else struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000 + tv.tv_usec / 1000; #endif } #if defined(_WIN32)&&!defined(__MINGW32__)&&!defined(__WATCOMC__) DIR* opendir (const char* dirName) { struct stat statbuf; DIR* dir; if (stat(dirName,&statbuf) || !S_ISDIR(statbuf.st_mode)) return NULL; dir = (DIR*)malloc(sizeof(DIR)); strcpy (dir->name, dirName); if (dir->name[strlen(dir->name)-1] != PATH_SEP_SYS && dir->name[strlen(dir->name)-1] != PATH_SEP) strcat (dir->name,PATH_SEP_SYS_STR); strcat (dir->name, "*"); dir->handle = INVALID_HANDLE_VALUE; dir->filecnt = 0; return dir; } struct dirent *readdir (DIR* dir) { WIN32_FIND_DATA fileBuffer; if (dir->filecnt == 0) { dir->handle = FindFirstFile (dir->name, &fileBuffer); if (dir->handle == INVALID_HANDLE_VALUE) return NULL; } else if (!FindNextFile (dir->handle, &fileBuffer)) return NULL; strcpy (dir->d_name, fileBuffer.cFileName); dir->filecnt++; return dir; } int closedir (DIR* dir) { if (!FindClose(dir->handle)) { free (dir); return -1; } free (dir); return 0; } #endif /* dirent _WIN32 */ #if LIBMIKMOD_VERSION < 0x030200 static char *skip_number(char *str) { while (str && *str == ' ') str++; while (str && isdigit((int)*str)) str++; while (str && *str == ' ') str++; return str; } #endif /* Return newly malloced version and cmdline for the driver with the number drvno. */ BOOL driver_get_info (int drvno, char **version, char **cmdline) { #if LIBMIKMOD_VERSION >= 0x030200 struct MDRIVER *driver = MikMod_DriverByOrdinal (drvno); if (version) *version = NULL; if (cmdline) *cmdline = NULL; if (drvno<=0 || !driver) return 0; if (driver->Version && version) *version = strdup (driver->Version); if (driver->CmdLineHelp && cmdline) *cmdline = strdup (driver->CmdLineHelp); return 1; #else static char *drv_cmdlineNul[] = { NULL, NULL}; static char *drv_cmdline317[] = { "AudioFile", "machine:t::Audio server machine (hostname:port)\n", "AIX Audio", "buffer:r:12,19,15:Audio buffer log2 size\n", "Advanced Linux Sound", "card:r:0,31,0:Soundcard number\n" "pcm:r:0,3,0:PCM device number\n" "buffer:r:2,16,4:Number of buffer fragments\n", "OS/2 DART", NULL, "DirectSound", "buffer:r:12,19,16:Audio buffer log2 size\n", "Enlightened sound daemon","machine:t::Audio server machine (hostname:port)\n", "HP-UX Audio", "buffer:r:12,19,15:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Macintosh Sound Manager", NULL, "Nosound", NULL, "OS/2 MMPM/2 MCI", "buffer:r:12,19,16:Audio buffer log2 size\n", "Open Sound System","buffer:r:7,17,14:Audio buffer log2 size\n" "count:r:2,255,16:Audio buffer count\n", "Piped Output", "pipe:t::Pipe command\n", "Raw disk writer", "file:t:music.raw:Output file name\n", "Linux sam9407", "card:r:0,999,0:Device number (/dev/sam%d_mod)", "SGI Audio System", "fragsize:r:0,99999,20000:Sound buffer fragment size\n" "bufsize:r:0,199999,40000:Sound buffer total size\n", "Standard output", NULL, "OpenBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "NetBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "SunOS audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Sun audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Solaris audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Linux Ultrasound", NULL, "Wav disk writer", "file:t:music.wav:Output file name\n", "Windows waveform-audio", NULL, NULL, NULL}; static char *drv_cmdline318[] = { "OS/2 DART", "device:r:0,8,0:Waveaudio device index to use (0 - default)\n" "buffer:r:12,16:Audio buffer log2 size\n" "count:r:2,8,2:Number of audio buffers\n", "OS/2 MMPM/2 MCI", "device:r:0,8,0:Waveaudio device index to use (0 - default)\n" "buffer:r:12,16:Audio buffer log2 size\n", "OpenBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "NetBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "SunOS audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "Sun audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "Solaris audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", NULL, NULL}; static char *drv_cmdline319[] = { "DirectSound", "buffer:r:12,19,16:Audio buffer log2 size\n" "globalfocus:b:0:Play if window does not have the focus\n", "Open Sound System","buffer:r:7,17,14:Audio buffer log2 size\n" "count:r:2,255,16:Audio buffer count\n" "card:r:0,99,0:Device number (/dev/dsp%d)\n", NULL, NULL}; static char *drv_cmdline3113[] = { /* 3.1.13 retires alsa-0.4/0.5 driver, adds alsa-1.0.x driver * and removes options */ "Advanced Linux Sound", NULL, NULL, NULL}; #define VERSION_MAX 7 static char **drv_cmdline[VERSION_MAX] = { drv_cmdline317, drv_cmdline318, drv_cmdline319, drv_cmdlineNul, drv_cmdlineNul, drv_cmdlineNul, drv_cmdline3113}; char *driver = MikMod_InfoDriver(), *pos, *start; char **cmd; if (version) *version = NULL; if (cmdline) *cmdline = NULL; for (pos = skip_number(driver); pos && *pos; pos++) { if (*pos == '\n') { drvno--; pos = skip_number(pos + 1); } if (drvno == 1) { int mm_version = (MikMod_GetVersion() & 255) - 7; mm_version = mm_version < 0 ? 0 : (mm_version >= VERSION_MAX ? VERSION_MAX-1 : mm_version); for (; mm_version>=0; mm_version--) { for (cmd = drv_cmdline[mm_version]; *cmd; cmd+=2) { if (!strncmp (*cmd, pos, strlen(*cmd))) { if (version) { start = pos; while (*pos && *pos != '\n') pos++; *version = (char *) malloc (pos-start+1); strncpy (*version, start, pos-start); (*version)[pos-start] = '\0'; } #if LIBMIKMOD_VERSION >= 0x030107 cmd++; if (*cmd && cmdline) *cmdline = strdup (*cmd); #else if (cmdline) *cmdline = strdup ("???\n"); #endif free (driver); return 1; } } } /* unknown driver */ if (cmdline) *cmdline = strdup ("???\n"); break; } } free (driver); return 0; #endif } /* ex:set ts=4: */ mikmod-3.2.8/src/mplayer.h0000644000000000000000000000413110001643550014104 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mplayer.h,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Threaded player functions ==============================================================================*/ #ifndef MPLAYER_H #define MPLAYER_H #include #if LIBMIKMOD_VERSION >= 0x030200 #define MAXVOICES 256 #endif #if LIBMIKMOD_VERSION >= 0x030200 typedef struct { VOICEINFO vinfo[MAXVOICES]; /* Current status for all module voices */ struct { unsigned long time; /* Last time this structure was updated */ UBYTE volamp; /* Volume meter amplitude */ } vstatus[MAXVOICES]; /* Dynamic voice status */ } MP_DATA; /* Returns a copy of the actual playdata */ void MP_GetData (MP_DATA *data); #endif /* Initialise the threads. Returns if threads are used. */ BOOL MP_Init (void); /* Inits a new thread for a new song to be played */ void MP_Start (void); /* MikMod_Update(), if threads are not used */ void MP_Update (void); /* Removes the thread started by MP_Start() */ void MP_End (void); /* Wrapper for Player_Active() */ BOOL MP_Active (void); /* Wrapper for Player_TogglePause() */ void MP_TogglePause (void); /* Wrapper for Player_Paused() */ BOOL MP_Paused (void); /* Wrapper for Player_SetVolume() */ void MP_Volume (int vol); #endif /* MPLAYER_H */ mikmod-3.2.8/src/dosvideo.inc0000644000000000000000000001004312255111204014567 0ustar rootroot/* MikMod module player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: dosvideo.inc,v 1.1.1.1 2004/01/16 02:07:29 raph Exp $ DOS/DJGPP console i/o routines ==============================================================================*/ #include static struct text_info screen_info; static unsigned char *screen_contents; static int cursor_old = 0; struct SCREEN { int act_attr; char *changed; char *attrs; char *text; } screen = {A_NORMAL, NULL, NULL, NULL}; void clear(void) { memset (screen.changed, 1, winx*winy); memset (screen.attrs, screen.act_attr, winx*winy); memset (screen.text, ' ', winx*winy); } int attrset(int attrs) { screen.act_attr = attrs; return 1; } void mvaddnstr(int y,int x,const char *str,int len) { int i, d; if (y<0 || y>=winy) return; if (x<0) { str -= x; len += x; x = 0; } d = y*winx+x; for (i=0; iwidth - x; if (len > 0) { memset(storage, ' ', len); mvaddnstr(win->y + y, win->x + x, storage, len); } } void win_cursor_set(BOOL visible) { _setcursortype(visible ? cursor_old : _NOCURSOR); } void win_refresh(void) { int x, y, d, start, pos; char buffer[STORAGELEN * 2]; for (y=0; y=winx) break; d--; x = start; pos = 0; while (x #include "mfnmatch.h" #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) # if defined (STDC_HEADERS) || !defined (isascii) # define ISASCII(c) 1 # else # define ISASCII(c) isascii(c) # endif # define ISUPPER(c) (ISASCII (c) && isupper (c)) # ifndef errno extern int errno; # endif /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int fnmatch (pattern, string, flags) const char *pattern; const char *string; int flags; { register const char *p = pattern, *n = string; register char c; /* Note that this evaluates C many times. */ # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') { c = FOLD (c); switch (c) { case '?': if (*n == '\0') return FNM_NOMATCH; else if ((flags & FNM_FILE_NAME) && *n == '/') return FNM_NOMATCH; else if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; break; case '\\': if (!(flags & FNM_NOESCAPE)) { c = *p++; if (c == '\0') /* Trailing \ loses. */ return FNM_NOMATCH; c = FOLD (c); } if (FOLD (*n) != c) return FNM_NOMATCH; break; case '*': if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; for (c = *p++; c == '?' || c == '*'; c = *p++) { if ((flags & FNM_FILE_NAME) && *n == '/') /* A slash does not match a wildcard under FNM_FILE_NAME. */ return FNM_NOMATCH; else if (c == '?') { /* A ? needs to match one character. */ if (*n == '\0') /* There isn't another character; no match. */ return FNM_NOMATCH; else /* One character of the string is consumed in matching this ? wildcard, so *??? won't match if there are less than three characters. */ ++n; } } if (c == '\0') return 0; { char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; c1 = FOLD (c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD (*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } case '[': { /* Nonzero if the sense of the character class is inverted. */ register int not; if (*n == '\0') return FNM_NOMATCH; if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; not = (*p == '!' || *p == '^'); if (not) ++p; c = *p++; for (;;) { register char cstart = c, cend = c; if (!(flags & FNM_NOESCAPE) && c == '\\') { if (*p == '\0') return FNM_NOMATCH; cstart = cend = *p++; } cstart = cend = FOLD (cstart); if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; c = *p++; c = FOLD (c); if ((flags & FNM_FILE_NAME) && c == '/') /* [/] can never match. */ return FNM_NOMATCH; if (c == '-' && *p != ']') { cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == '\\') cend = *p++; if (cend == '\0') return FNM_NOMATCH; cend = FOLD (cend); c = *p++; } if (FOLD (*n) >= cstart && FOLD (*n) <= cend) goto matched; if (c == ']') break; } if (!not) return FNM_NOMATCH; break; matched:; /* Skip the rest of the [...] that already matched. */ while (c != ']') { if (c == '\0') /* [... (unterminated) loses. */ return FNM_NOMATCH; c = *p++; if (!(flags & FNM_NOESCAPE) && c == '\\') { if (*p == '\0') return FNM_NOMATCH; /* XXX 1003.2d11 is unclear if this is right. */ ++p; } } if (not) return FNM_NOMATCH; } break; default: if (c != FOLD (*n)) return FNM_NOMATCH; } ++n; } if (*n == '\0') return 0; if ((flags & FNM_LEADING_DIR) && *n == '/') /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ return 0; return FNM_NOMATCH; # undef FOLD } #endif /* _LIBC or not __GNU_LIBRARY__. */ mikmod-3.2.8/src/mlistedit.h0000644000000000000000000000246010001643557014443 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mlistedit.h,v 1.1.1.1 2004/01/16 02:07:43 raph Exp $ The playlist editor ==============================================================================*/ #ifndef MLISTEDIT_H #define MLISTEDIT_H #include "mmenu.h" /* test if path is a directory and recursively scan if for modules */ int list_scan_dir (char *path, BOOL quiet); /* open playlist menu */ void list_open(int *actLine); #endif /* MLISTEDIT_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/mwindow.c0000644000000000000000000005750613006175034014135 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mwindow.c,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Some window functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) #ifdef HAVE_SYS_IOCTL_H #include #endif #if !defined(GWINSZ_IN_SYS_IOCTL) && defined(HAVE_TERMIOS_H) #include #endif #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #if defined(__OS2__)||defined(__EMX__) #define INCL_VIO #define INCL_DOS #define INCL_KBD #define INCL_DOSPROCESS #endif #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include "display.h" #include "player.h" #include "mwindow.h" #include "mutilities.h" #include "keys.h" #include "mthreads.h" #define INVISIBLE(w) (win_quiet || ((w)!=cur_window && (w)!=panel[0])) #define INVISIBLE_RET(w) if (win_quiet || ((w)!=cur_window && (w)!=panel[0])) return; #ifdef ACS_ULCORNER #define BOX_UL ACS_ULCORNER #define BOX_UR ACS_URCORNER #define BOX_LL ACS_LLCORNER #define BOX_LR ACS_LRCORNER #define BOX_HLINE ACS_HLINE #define BOX_VLINE ACS_VLINE #else #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define BOX_UL '\xda' #define BOX_UR '\xbf' #define BOX_LL '\xc0' #define BOX_LR '\xd9' #define BOX_HLINE '\xc4' #define BOX_VLINE '\xb3' #else #define BOX_UL '+' #define BOX_UR '+' #define BOX_LL '+' #define BOX_LR '+' #define BOX_HLINE '-' #define BOX_VLINE '|' #endif #endif void win_do_resize(int dx, int dy, BOOL root); /* text creation buffer */ char storage[STORAGELEN+2]; static int root_y1 = 7, root_y2 = 0; /* size of visible root window partions */ static BOOL curses_on = 0, win_quiet = 1; static int cur_panel = 0, old_panel = 0; static MWINDOW *panel[DISPLAY_COUNT], *cur_window = NULL; static BOOL use_colors = 1; static int act_color = A_NORMAL; static THEME *theme = NULL; static int winx = 0, winy = 0; /* screen size */ typedef struct TIMEOUT { WinTimeoutFunc func; void *data; int interval; /* remaining time for the execution of this timeout compared to the timeout located in the timeouts array before this one */ int remaining; } TIMEOUT; static int cnt_timeouts = 0; static TIMEOUT *timeouts = NULL; /*========== Display routines */ #if defined(__OS2__)||defined(__EMX__) #include "os2video.inc" #elif defined(__DJGPP__) #include "dosvideo.inc" #elif defined(_WIN32) #include "winvideo.inc" #else /* unix, ncurses */ static int cursor_old = 0; static BOOL resize = 0; /* old AIX curses are very limited */ #if defined(AIX) && !defined(mvaddnstr) void mvaddnstr(int y, int x, const char *str, int len) { char buffer[STORAGELEN]; int l = strlen(str); strncpy(buffer, str, len); if (l < len) while (l < len) buffer[l++] = ' '; buffer[len] = '\0'; mvaddstr(y, x, buffer); } #endif /* HP-UX curses macros don't work with every cpp */ #if defined(__hpux) void getmaxyx_hpux(MWINDOW * win, int *y, int *x) { *y = __getmaxy(win); *x = __getmaxx(win); } #define getmaxyx(win,y,x) getmaxyx_hpux((win),&(y),&(x)) #endif #if defined(AIX) && !defined(NCURSES_VERSION) && !defined(getmaxyx) #define getmaxyx(win,y,x) (y = LINES, x = COLS) #endif #if !defined(getmaxyx) #define getmaxyx(w,y,x) ((y) = getmaxy(w), (x) = getmaxx(w)) #endif /* handler for terminal resize events */ RETSIGTYPE sigwinch_handler(int signum) { /* schedule a resizeterm() */ resize = 1; signal(SIGWINCH, sigwinch_handler); } /* update window */ void win_refresh(void) { if (win_quiet) return; refresh(); } void win_cursor_set(BOOL visible) { if (cursor_old != MIK_CURSES_ERROR) { if (visible) curs_set(cursor_old); else curs_set(0); } } #define COLOR_CNT 8 static void init_curses(void) { initscr(); cbreak(); noecho(); nonl(); nodelay(stdscr, TRUE); #if !defined(AIX) || defined(NCURSES_VERSION) timeout(0); #endif keypad(stdscr, TRUE); cursor_old = curs_set(0); curses_on = 1; /* Color setup */ start_color(); if (has_colors() && (COLOR_PAIRS >= COLOR_CNT*COLOR_CNT)) { static short colors[] = { COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE }; int i,j; for (i = 0; i < COLOR_CNT; i++) for (j = 0; j < COLOR_CNT; j++) if (i*COLOR_CNT+j+1 < COLOR_CNT*COLOR_CNT) init_pair(i*COLOR_CNT+j+1, colors[j], colors[i]); use_colors = 1; } else use_colors = 0; } static int color_to_pair (int attrs) { return 1 + ((attrs & COLOR_FMASK) >> COLOR_FSHIFT) + ((attrs & COLOR_BMASK) >> COLOR_BSHIFT) * COLOR_CNT; } /* system dependant window init function */ void win_init_system(void) { if (!win_quiet) { init_curses(); getmaxyx(stdscr, winy, winx); signal(SIGWINCH, sigwinch_handler); } } /* clean up (e.g. exit curses) */ void win_exit(void) { if (win_quiet || !curses_on) return; signal(SIGWINCH, SIG_DFL); clear(); mvaddnstr(winy - 2, 0, mikversion, winx); win_refresh(); win_cursor_set(1); endwin(); curses_on = 0; } /* clear to end of line on window win */ void win_clrtoeol(MWINDOW *win, int x, int y) { int len = win->width - x; INVISIBLE_RET(win); if (len > 0) { memset(storage, ' ', len); storage[len] = '\0'; mvaddnstr(win->y + y, win->x + x, storage, len); } } /* check if a resize was scheduled and do it */ BOOL win_check_resize(void) { static BOOL in_check_resize = 0; if (win_quiet || in_check_resize) return 0; in_check_resize = 1; /* if a resize was scheduled, do it now */ if (resize) { int oldx, oldy; #if (NCURSES_VERSION_MAJOR >= 4) && defined(TIOCGWINSZ) && defined(HAVE_NCURSES_RESIZETERM) struct winsize ws; ws.ws_col = ws.ws_row = 0; ioctl(0, TIOCGWINSZ, &ws); if (ws.ws_col && ws.ws_row) resizeterm(ws.ws_row, ws.ws_col); #else endwin(); init_curses(); win_refresh(); #endif resize = 0; oldx = winx; oldy = winy; getmaxyx(stdscr, winy, winx); win_do_resize(winx - oldx, winy - oldy, 1); in_check_resize = 0; return 1; } in_check_resize = 0; return 0; } static int win_getch(void) { int c = getch(); win_check_resize(); /* if (c>0) fprintf (stderr," %d ",c);*/ return c == MIK_CURSES_ERROR ? 0 : c; } #endif /* #ifdef unix */ /*========== Windowing system */ /* init window functions (e.g. init curses) */ void win_init(BOOL quiet) { win_quiet = quiet; win_init_system(); win_open(0, 0, winx, winy, 0, NULL, ATTR_SONG_STATUS); win_set_resize(1, NULL); } /* Does the terminal support colors? */ BOOL win_has_colors (void) { return use_colors; } /* set the attribute translation table */ void win_set_theme (THEME *new_theme) { theme = new_theme; } /* clear window win */ BOOL win_clear(MWINDOW * win) { if (INVISIBLE(win)) return 1; if ((win->width > 0) && (win->height > 0)) { int i; win_attrset(win->attrs); memset(storage, ' ', win->width); storage[win->width] = '\0'; if (win==panel[0]) { for (i = 0; i < win->height && i < root_y1; i++) mvaddnstr(win->y + i, win->x, storage, win->width); i = win->height - root_y2; if (i < 0) i = 0; for (; i < win->height; i++) mvaddnstr(win->y + i, win->x, storage, win->width); } else { for (i = 0; i < win->height; i++) mvaddnstr(win->y + i, win->x, storage, win->width); } } return 1; } void win_box_win(int x1, int y1, int x2, int y2, const char *title) { int i, sx1, sx2, sy1, sy2; if (win_quiet) return; sx1 = x1 >= 0 ? x1 + 1 : 0; sx2 = x2 < winx ? x2 - 1 : winx - 1; sy1 = y1 >= root_y1 ? y1 + 1 : root_y1; sy2 = y2 < winy - root_y2 ? y2 - 1 : winy - root_y2; if (y2 < winy - root_y2) { if (x1 >= 0) mvaddch(y2, x1, BOX_LL); if (x2 < winx) mvaddch(y2, x2, BOX_LR); for (i = sx1; i <= sx2; i++) mvaddch(y2, i, BOX_HLINE); } if (y1 >= root_y1) { if (x1 >= 0) mvaddch(y1, x1, BOX_UL); if (x2 < winx) mvaddch(y1, x2, BOX_UR); i = sx1; if (title) for (; i <= sx2 && *title; i++) mvaddch(y1, i, *title++); for (; i <= sx2; i++) mvaddch(y1, i, BOX_HLINE); } for (i = sy1; i <= sy2; i++) { if (x1 >= 0) mvaddch(i, x1, BOX_VLINE); if (x2 < winx) mvaddch(i, x2, BOX_VLINE); } } /* open new window on panel 'panel' */ MWINDOW *win_panel_open(int dst_panel, int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs) { MWINDOW *win = (MWINDOW *) malloc(sizeof(MWINDOW)), *help; int ofs = (border ? 1 : 0); if (x < ofs) x = ofs; if (!dst_panel) { /* root panel */ if (y < ofs) y = ofs; if (y + height > winy - ofs) height = winy - y - ofs; } else { if (y < ofs + root_y1) y = ofs + root_y1; if (y + height > winy - ofs - root_y2) height = winy - y - ofs - root_y2; } if (x + width > winx - ofs) width = winx - x - ofs; if (width < 0) width = 0; if (height < 0) height = 0; win_attrset(attrs); if (border && (dst_panel == cur_panel)) win_box_win(x - 1, y - 1, x + width, y + height, title); win->x = x; win->y = y; win->width = width; win->height = height; win->attrs = attrs; win->border = border; win->resize = 0; if (title) win->title = strdup(title); else win->title = NULL; win->next = NULL; win->repaint = win_clear; win->handle_key = NULL; win->handle_resize = NULL; for (help = panel[dst_panel]; help && help->next; help = help->next); if (help) help->next = win; else panel[dst_panel] = win; if (dst_panel == cur_panel) cur_window = win; return win; } /* open new window on current panel */ MWINDOW *win_open(int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs) { return win_panel_open(cur_panel, x, y, width, height, border, title, attrs); } MWINDOW *win_get_first(int dst_panel) { MWINDOW *win; for (win = panel[dst_panel]; win && win->next; win = win->next); return win; } /* set function which sould be called on a repaint request */ void win_set_repaint(WinRepaintFunc func) { cur_window->repaint = func; } void win_panel_set_repaint(int _panel, WinRepaintFunc func) { win_get_first(_panel)->repaint = func; } /* set function which sould be called on a key press */ void win_set_handle_key(WinKeyFunc func) { cur_window->handle_key = func; } void win_panel_set_handle_key(int _panel, WinKeyFunc func) { win_get_first(_panel)->handle_key = func; } /* should window be automatically resized? should a function be called on resize? */ void win_set_resize(BOOL auto_resize, WinResizeFunc func) { cur_window->resize = auto_resize; cur_window->handle_resize = func; } void win_panel_set_resize(int _panel, BOOL auto_resize, WinResizeFunc func) { MWINDOW *win = win_get_first(_panel); win->resize = auto_resize; win->handle_resize = func; } /* set private data */ void win_set_data(void *data) { cur_window->data = data; } void win_panel_set_data(int _panel, void *data) { win_get_first(_panel)->data = data; } void win_do_resize(int dx, int dy, BOOL root) { MWINDOW *win; int i = root ? 0 : 1; if (win_quiet) return; for (; i < DISPLAY_COUNT; i++) for (win = panel[i]; win; win = win->next) { if (win->resize) { win->width += dx; win->height += dy; } if (win->handle_resize) win->handle_resize(win, dx, dy); } win_panel_repaint_force(); } static char status_message[MAXWIDTH + 2]; static void win_status_repaint(void) { MWINDOW *win = panel[0]; int i; if (win_quiet) return; if ((root_y2 > 1) && (win->height > root_y1+1)) { win_attrset(ATTR_STATUS_LINE); for (i = 0; i < win->width; i++) mvaddch(win->height - 2, i, BOX_HLINE); } } /* init the status line(height=0,1,2 0: no status line) */ void win_init_status(int height) { int old_y2 = root_y2; if (height != root_y2) { root_y2 = height < 0 ? 0 : (height > 2 ? 2 : height); #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) status_message[0] = '\0'; #else status_message[0] = '\n'; status_message[1] = '\0'; #endif win_do_resize(0, old_y2 - root_y2, 0); } } /* set the status line */ void win_status(const char *msg) { MWINDOW *win = panel[0]; int len; if (msg) { len = strlen(msg); if (len > MAXWIDTH) len = MAXWIDTH; strncpy(status_message, msg, len); } else len = strlen(status_message); status_message[len] = '\0'; if (win_quiet) return; if ((root_y2 > 0) && (win->height > root_y1) && (win->width>0)) { win_attrset(ATTR_STATUS_TEXT); mvaddnstr(win->y + win->height - 1, win->x, status_message, win->width); win_clrtoeol(win, win->x + len, win->y + win->height - 1); } } /* repaint the whole panel */ void win_panel_repaint(void) { if (win_quiet) return; if (panel[cur_panel]) win_clear(panel[cur_panel]); if (panel[0]->repaint) if (!panel[0]->repaint(panel[0])) return; for (cur_window = panel[cur_panel]; cur_window; cur_window = cur_window->next) { win_attrset(cur_window->attrs); if (cur_window->border && cur_window->width >= 0 && cur_window->height >= 0) win_box_win(cur_window->x - 1, cur_window->y - 1, cur_window->x + cur_window->width, cur_window->y + cur_window->height, cur_window->title); if (cur_window->repaint && cur_window->width > 0 && cur_window->height > 0) if (!cur_window->repaint(cur_window)) return; } win_status_repaint(); win_status(NULL); for (cur_window = panel[cur_panel]; cur_window && cur_window->next; cur_window = cur_window->next); } /* repaint the whole panel, clear whole panel before */ void win_panel_repaint_force(void) { if (win_quiet) return; clear(); win_panel_repaint(); } /* close window win */ void win_close(MWINDOW * win) { int i; MWINDOW *pos; for (i = 0; i < DISPLAY_COUNT; i++) for (pos = panel[i]; pos; pos = pos->next) if (pos == win) { if (win == cur_window) for (cur_window = panel[i]; cur_window->next != win; cur_window = cur_window->next); for (pos = panel[i]; pos->next != win; pos = pos->next); pos->next = win->next; if (win->title) free(win->title); free(win); if (i == cur_panel) win_panel_repaint(); return; } } /* get size of window win */ void win_get_size(MWINDOW *win, int *x, int *y) { *x = win->width; *y = win->height; } /* get maximal size of a new window without a border and therefore the needed minimal y position */ void win_get_size_max(int *y, int *width, int *height) { *y = root_y1; *width = panel[0]->width; *height = panel[0]->height - root_y1 - root_y2; if (*height < 0) *height = 0; } /* get uppermost window */ MWINDOW *win_get_window(void) { return cur_window; } /* get root window */ MWINDOW *win_get_window_root(void) { return panel[0]; } /* print string in window win */ void win_print(MWINDOW *win, int x, int y, const char *str) { int len = strlen(str); #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) if (len > 1 && str[len - 1] == '\n' && str[len - 2] == '\r') len--; #endif INVISIBLE_RET(win); if ((x >= win->width) || (y >= win->height) || ((win != panel[0]) && (y + win->y >= winy - root_y2)) || (!len)) return; if (len + x > win->width) len = win->width - x; if (len > 0 && (str[len - 1] == '\n' || str[len - 1] == '\r')) #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (win->x + win->width < winx) #endif { len--; win_clrtoeol(win, x + len, y); } mvaddnstr(y + win->y, x + win->x, str, len); } /* draw horizontal/verticall line */ void win_line(MWINDOW *win, int x1, int y1, int x2, int y2) { int i; INVISIBLE_RET(win); if (y1 == y2) { if (y1 < cur_window->height) for (i = x1; i <= x2 && i < cur_window->width; i++) mvaddch(y1 + cur_window->y, i + cur_window->x, BOX_HLINE); } else { if (x1 < cur_window->width) for (i = y1; i <= y2 && i < cur_window->height; i++) mvaddch(i + cur_window->y, x1 + cur_window->x, BOX_VLINE); } } /* draw a box with colored background back: background colors from UL UR LR LL to UL */ void win_box_color(MWINDOW *win, int x1, int y1, int x2, int y2, ATTRS *back) { int i, j, k, sx1, sx2, sy1, sy2, maxx, maxy; INVISIBLE_RET(win); x1 += win->x; x2 += win->x; y1 += win->y; y2 += win->y; maxx = win->x+win->width-1; maxy = win->y+win->height-1; sx1 = x1>=win->x ? x1+1 : win->x; sy1 = y1>=win->y ? y1+1 : win->y; sx2 = x2<=maxx ? x2 - 1 : maxx; sy2 = y2<=maxy ? y2 - 1 : maxy; if (y2 <= maxy) { if (x1 >= win->x) { if (back) win_set_background (back[x2-x1+x2-x1+y2-y1]); mvaddch(y2, x1, BOX_LL); } if (x2 <= maxx) { if (back) win_set_background (back[x2-x1+y2-y1]); mvaddch(y2, x2, BOX_LR); } j = x2-x1+x2-sx1+y2-y1; for (i = sx1; i <= sx2; i++) { if (back) win_set_background (back[j--]); mvaddch(y2, i, BOX_HLINE); } } if (y1 >= win->y) { if (x1 >= win->x) { if (back) win_set_background (back[0]); mvaddch(y1, x1, BOX_UL); } if (x2 <= maxx) { if (back) win_set_background (back[x2-x1]); mvaddch(y1, x2, BOX_UR); } j = sx1-x1; for (i=sx1; i <= sx2; i++) { if (back) win_set_background (back[j++]); mvaddch(y1, i, BOX_HLINE); } } j = x2-x1+sy1-y1; k = x2-x1+x2-x1+y2-y1+y2-sy1; for (i = sy1; i <= sy2; i++) { if (x1 >= win->x) { if (back) win_set_background (back[k--]); mvaddch(i, x1, BOX_VLINE); } if (x2 <= maxx) { if (back) win_set_background (back[j++]); mvaddch(i, x2, BOX_VLINE); } } } /* draw a box */ void win_box(MWINDOW *win, int x1, int y1, int x2, int y2) { win_box_color (win, x1, y1, x2, y2, NULL); } /* set attribute for the following output operations, "attrs" is an index into the theme->attr translation table */ void win_attrset(ATTRS attrs) { if (theme && !win_quiet) { int theme_attr = theme->attrs[attrs]; act_color = theme_attr; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (theme->color) { int pair; if (theme_attr == ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-1) << COLOR_FSHIFT)) theme_attr = ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-2) << COLOR_FSHIFT); act_color = theme_attr; pair = COLOR_PAIR(color_to_pair(theme_attr)); if (theme_attr & COLOR_BOLDMASK) attrset(pair | A_BOLD); else attrset(pair); } else #endif attrset(theme_attr); } } ATTRS win_get_theme_color (ATTRS attrs) { if (theme) { int theme_attr = theme->attrs[attrs]; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (theme->color) if (theme_attr == ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-1) << COLOR_FSHIFT)) theme_attr = ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-2) << COLOR_FSHIFT); #endif return theme_attr; } else return 0; } /* set color for the following output operations */ void win_set_color(ATTRS attrs) { if (win_quiet) return; act_color = attrs; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (win_has_colors()) { int pair; if (attrs == ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-1) << COLOR_FSHIFT)) attrs = ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-2) << COLOR_FSHIFT); act_color = attrs; pair = COLOR_PAIR(color_to_pair(attrs)); if (attrs & COLOR_BOLDMASK) attrset(pair | A_BOLD); else attrset(pair); } else #endif attrset(attrs); } void win_set_forground(ATTRS fg) { if (win_has_colors()) win_set_color ((act_color & COLOR_BMASK) + (fg << COLOR_FSHIFT)); } void win_set_background(ATTRS bg) { if (win_has_colors()) win_set_color ((act_color & COLOR_FMASK) + (bg << COLOR_BSHIFT)); } /* change current panel */ void win_change_panel(int new_panel) { if (new_panel == cur_panel) new_panel = old_panel; old_panel = cur_panel; if (new_panel != cur_panel) { cur_panel = new_panel; for (cur_window = panel[cur_panel]; cur_window && cur_window->next; cur_window = cur_window->next); win_panel_repaint(); } } int win_get_panel(void) { return cur_panel; } /* handle key press(panel change and call of key handler of uppermost window),return: was key handled */ BOOL win_handle_key(int ch) { int ret; switch (ch) { case KEY_F(1): win_change_panel(DISPLAY_HELP); break; case KEY_F(2): win_change_panel(DISPLAY_SAMPLE); break; case KEY_F(3): win_change_panel(DISPLAY_INST); break; case KEY_F(4): #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) case KEY_SF(9): /* shift-F9 */ #else case KEY_F(19): /* shift-F9 on some curses implementations */ #endif win_change_panel(DISPLAY_MESSAGE); break; case KEY_F(5): win_change_panel(DISPLAY_LIST); break; case KEY_F(6): win_change_panel(DISPLAY_CONFIG); break; #if LIBMIKMOD_VERSION >= 0x030200 case KEY_F(7): win_change_panel(DISPLAY_VOLBARS); break; #endif default: ret = 0; if (cur_window->handle_key) ret = cur_window->handle_key(cur_window, ch); if (!ret && panel[0]->handle_key) ret = panel[0]->handle_key(panel[0], ch); return ret; } return 1; } /* Insert src (src!=NULL) or timeouts[0] (src==NULL) sorted after next execution in timeouts and set remaining appropriate. Expand timeouts array if src!=NULL. */ static void win_timeout_insert (TIMEOUT *src) { int time; int sum = 0, oldsum = 0, pos = 0, i; if (!src) { time = timeouts[0].interval; pos++; } else time = src->interval; for (; pos<=cnt_timeouts; pos++) { oldsum = sum; if (postime || pos==cnt_timeouts) { if (src) { timeouts = (TIMEOUT *) realloc (timeouts, sizeof(TIMEOUT)*(++cnt_timeouts)); for (i=cnt_timeouts-1; i>pos; i--) timeouts[i] = timeouts[i-1]; timeouts[pos] = *src; } else { TIMEOUT help = timeouts[0]; pos--; for (i=0; i #elif defined HAVE_CURSES_H #include #elif defined HAVE_NCURSES_CURSES_H #include #endif #define KEY_ASCII_DEL 127 #define KEY_ASCII_BS ('\b') #endif #endif /* ifndef KEYS_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/mdialog.h0000644000000000000000000000524312255111204014053 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mdialog.h,v 1.1.1.1 2004/01/16 02:07:40 raph Exp $ Some common dialog types ==============================================================================*/ #ifndef MDIALOG_H #define MDIALOG_H #include "mwidget.h" /* Function which is called on input w : dlg_input() : the input widgets dlg_message(): the button widget button: selected button (str- and int-fields selected -> button==-1) input : input in a int- or str-field data : user-pointer which was passed to dlg-function Return: close dialog? */ typedef BOOL (*handleDlgFunc) (WIDGET *w, int button, void *input, void *data); /* Opens a message box msg : text to display, can contain '\n' button: ".&..|...|...", &: hotkey, e.g.: "&Yes|&No" active: active button (0...n) warn : open message box with ATTR_WARNING? data : passed to handle_dlg */ void dlg_message_open(const char *msg, const char *button, int active, BOOL warn, handleDlgFunc handle_dlg, void *data); /* Shows a message. If errno is set a text describing the errno error code is appended to the message. */ void dlg_error_show(const char *txt, ...); /* Opens a string input dialog msg : text to display, can contain '\n' buttons: definition of the dialog buttons str : default text length : max allowed input length */ void dlg_input_str(const char *msg, const char *buttons, const char *str, int length, handleDlgFunc handle_dlg, void *data); /* Opens an integer input dialog msg : text to display, can contain '\n' buttons: definition of the dialog buttons value : default integer min,max: min, max allowed values */ void dlg_input_int(const char *msg, const char *buttons, int value, int min, int max, handleDlgFunc handle_dlg, void *data); #endif /* MDIALOG_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/mgetopt.c0000644000000000000000000007277312361532174014140 0ustar rootroot/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO #define _NO_PROTO #endif #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #include #endif /* GNU C library. */ #ifdef VMS #include #endif /*#ifdef HAVE_STRING_H*/ #include /*#endif*/ #if defined(_WIN32) && !defined(__CYGWIN32__) /* It's not Unix, really. See? Capital letters. */ #include #define getpid() GetCurrentProcessId() #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) #else # define _(msgid) (msgid) #endif #endif #if defined(__OS2__)||defined(__EMX__)||defined(sun)||defined(__DJGPP__) #include #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "mgetopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ char *getenv (); static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; extern pid_t __libc_pid; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } text_set_element (__libc_subinit, store_args_and_env); # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (&new_str[nonoption_flags_max_len], '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else { memcpy (__getopt_nonoption_flags, orig_str, len); memset (&__getopt_nonoption_flags[len], '\0', nonoption_flags_max_len - len); } } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ mikmod-3.2.8/src/mwidget.h0000644000000000000000000001737412255111204014107 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mwidget.h,v 1.1.1.1 2004/01/16 02:07:33 raph Exp $ Widget and Dialog creation functions ==============================================================================*/ #ifndef MWIDGET_H #define MWIDGET_H #include "mwindow.h" #define EVENT_HANDLED 100 #define FOCUS_NEXT (1) /* next widget gets focus */ #define FOCUS_PREV (-1) /* prev widget gets focus */ #define FOCUS_ACTIVATE (EVENT_HANDLED+1) /* button select, return in input field */ #define FOCUS_DONT (EVENT_HANDLED+2) /* on hotkey: action is done (e.g. toggle */ /* button is toggled), focus is not changed */ typedef enum { WID_SEL_SINGLE, WID_SEL_BROWSE } WID_SEL_MODE; typedef enum { WID_GET_FOCUS, WID_HOTKEY, WID_KEY } WID_EVENT; typedef enum { TYPE_LABEL, TYPE_STR, TYPE_INT, TYPE_BUTTON, TYPE_LIST, TYPE_CHECK, TYPE_TOGGLE, TYPE_COLORSEL } WID_TYPE; typedef struct WIDGET WIDGET; typedef struct { int active; /* active widget */ int cnt; /* Nuber of widgets */ ATTRS attrs; /* >=0: use it for DLG_FRAME and DLG_LABEL */ MWINDOW *win; WIDGET **widget; /* the widgets */ } DIALOG; struct WIDGET { WID_TYPE type; BOOL can_focus; /* can the widget have the focus? */ BOOL has_focus; /* has this widget the focus? */ int x, y, width, height; /* pos and size of widget (calculated) */ int def_width, def_height; /* size set by wid_set_size(), can be used */ /* by the widget as a default size */ /* >0 : Number of free lines to last widget =0 : Start of a new column of widget <0 : Start of a new row of columns of widgets, value is spacing between this and the previous row */ int spacing; DIALOG *d; void (*w_free) (WIDGET *w); void (*w_paint) (WIDGET *w); int (*w_handle_event) (WIDGET *w, WID_EVENT event, int ch); void (*w_get_size) (WIDGET *w, int *width, int *height); int (*handle_key) (WIDGET *w, int ch); int (*handle_focus) (WIDGET *w, int focus); void *data; /* not used by widget functions */ }; /* called on key press, back: +/-n : Widget n entries before/behind Widget w gets the focus EVENT_HANDLED: Key is not processed any more 0 : key is processed by the widgets own handleEventFunc */ typedef int (*handleKeyFunc) (WIDGET *w, int ch); /* called on focus loose with FOCUS_NEXT, FOCUS_PREV, or FOCUS_ACTIVATE, back: EVENT_HANDLED, FOCUS_ACTIVATE, +/-n, or 0 */ typedef int (*handleFocusFunc) (WIDGET *w, int focus); /* Free substructs of w and w itself */ typedef void (*freeFunc) (WIDGET *w); /* Display widget w */ typedef void (*paintFunc) (WIDGET *w); /* GET_FOCUS: Widget w gets the focus ch: -1: Last active widget was behind the new one 1: Last active widget was before the new one HOTKEY: ch: The Key which was pressed back: FOCUS_ACTIVATE: Widget w gets the focus EVENT_HANDLED : Focus is not changed, Key is not processed any more, e.g. necessary if function closes the dialog KEY: Key ch was pressed back: +/-n : Widget n entries before/behind Widget w gets the focus EVENT_HANDLED: Key is not processed any more 0 : event HOTKEY is send to the widgets */ typedef int (*handleEventFunc) (WIDGET *w, WID_EVENT event, int ch); /* Return the size of widget w Input: preferred maximal size */ typedef void (*getSizeFunc) (WIDGET *w, int *width, int *height); typedef struct { WIDGET w; char *msg; } WID_LABEL; typedef struct { WIDGET w; char *input; int cur_pos; /* cursor position */ int start; /* first visible char */ int length; /* max length of input */ } WID_STR; typedef struct { WIDGET w; char *input; int cur_pos; /* cursor position */ int start; /* first visible char */ int length; /* max length of input */ } WID_INT; typedef struct { WIDGET w; char *button; /* &but1|but2|... */ int cnt; /* number of buttons */ int active; /* active button */ } WID_BUTTON; typedef struct { WIDGET w; int cur; /* selected entry */ int first; /* first line of list which is displayed */ int cnt; /* number of list entries */ char **entries; /* the list entries */ char *title; WID_SEL_MODE sel_mode; /* SINGLE: call of handle_focus() only on return */ } WID_LIST; /* BROWSE: call of handle_focus() when cur changes */ typedef struct { WIDGET w; char *button; /* &but1|but2\nbu&t3\n... */ int cnt; /* number of buttons */ int selected; /* selected buttons */ int active; /* active button */ } WID_CHECK; typedef struct { WIDGET w; char *button; /* &but1|but2\nbu&t3\n... */ int cnt; /* number of buttons */ int selected; /* selected buttons */ int active; /* active button */ } WID_TOGGLE; typedef struct { WIDGET w; int active; /* selected color */ char hkeys[5]; /* hotkeys to move the selector <>^v */ WID_SEL_MODE sel_mode; /* SINGLE: call of handle_focus() only on return */ } WID_COLORSEL; /* BROWSE: call of handle_focus() when cur changes */ /* spacing: >0 : Number of free lines to last widget =0 : Start of a new column of widget <0 : Start of a new row of columns of widgets, value is spacing between this and the previous row */ WIDGET *wid_label_add(DIALOG *d, int spacing, const char *msg); void wid_label_set_label (WID_LABEL *w, const char *label); WIDGET *wid_str_add(DIALOG *d, int spacing, const char *input, int length); void wid_str_set_input (WID_STR *w, const char *input, int length); WIDGET *wid_int_add(DIALOG *d, int spacing, int value, int length); void wid_int_set_input(WID_INT *w, int value, int length); WIDGET *wid_button_add(DIALOG *d, int spacing, const char *button, int active); WIDGET *wid_list_add(DIALOG *d, int spacing, const char **entries, int cnt); void wid_list_set_title(WID_LIST *w, const char *title); void wid_list_set_entries(WID_LIST *w, const char **entries, int cur, int cnt); void wid_list_set_active(WID_LIST *w, int cur); void wid_list_set_selection_mode (WID_LIST *w, WID_SEL_MODE mode); WIDGET *wid_check_add(DIALOG *d, int spacing, const char *button, int selected, int active); void wid_check_set_selected(WID_CHECK *w, int selected); WIDGET *wid_toggle_add(DIALOG *d, int spacing, const char *button, int selected, int active); void wid_toggle_set_selected(WID_TOGGLE *w, int selected); WIDGET *wid_colorsel_add(DIALOG *d, int spacing, const char *hotkeys, int active); void wid_colorsel_set_active(WID_COLORSEL *w, int active); /* Set default size of widget, -1: ignore value */ void wid_set_size (WIDGET *w, int width, int height); void wid_set_func(WIDGET *w, handleKeyFunc key, handleFocusFunc focus, void *data); void wid_repaint (WIDGET *w); DIALOG *dialog_new(void); void dialog_open(DIALOG *d, const char *title); /* set attribute which is used for DLG_FRAME and DLG_LABEL, works only before dialog_open() */ void dialog_set_attr (DIALOG *d, ATTRS attrs); BOOL dialog_repaint(MWINDOW *win); void dialog_close(DIALOG *d); #endif /* MWIDGET_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/rcfile.c0000644000000000000000000003105012370621772013707 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: rcfile.c,v 1.1.1.1 2004/01/16 02:07:41 raph Exp $ General configuration file management ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "rcfile.h" #include "mutilities.h" #define INDENT_MAX 40 #define LINE_LEN 1024 #define OPTION_BLOCK 10 #define BTST(v, m) ((v) & (m) ? 1 : 0) typedef struct _OPTION OPTION; typedef struct _OPTIONS OPTIONS; typedef struct _STACK STACK; struct _OPTION { char *label; char *arg; OPTIONS *options; }; struct _OPTIONS { int cnt, max; OPTION *option; OPTIONS *parent; }; struct _STACK { STACK *next; char *data; }; static FILE *fp = NULL; static OPTIONS *options = NULL; static char indent[INDENT_MAX+1] = ""; static STACK *structs = NULL; static void indent_change (int delta) { int len = strlen(indent); delta *= 2; if (len+delta>=0 && len+delta<=INDENT_MAX) len += delta; indent[len] = '\0'; if (len>0) { indent[len-1] = ' '; indent[len-2] = ' '; } } static void options_free (OPTIONS *opts) { if (opts && opts->max>0) { while (opts->cnt>0) { opts->cnt--; if (opts->option[opts->cnt].label) free (opts->option[opts->cnt].label); if (opts->option[opts->cnt].arg) free (opts->option[opts->cnt].arg); if (opts->option[opts->cnt].options) { options_free (opts->option[opts->cnt].options); } } free (opts->option); opts->cnt = opts->max = 0; } if (opts) free (opts); } /* Save desc in file fp. Add '# ' in front of all lines. */ static void write_description (const char *desc) { const char *start; if (fp && desc) { fputs ("\n",fp); while (*desc) { start = desc; while (*desc && *desc!='\n') desc++; fprintf (fp, "%s# ", indent); fwrite (start,desc-start,1,fp); fputs ("\n",fp); if (*desc) desc++; } } } /* write argument arg with optional description and mark it with label */ BOOL rc_write_bool (const char *label, int arg, const char *description) { if (fp) { write_description (description); if (arg) return fprintf(fp, "%s%s = yes\n", indent, label) > 0; else return fprintf(fp, "%s%s = no\n", indent, label) > 0; } return 0; } BOOL rc_write_bit (const char *label, int arg, int mask, const char *description) { return rc_write_bool (label,BTST(arg,mask),description); } BOOL rc_write_int (const char *label, int arg, const char *description) { if (fp) { write_description (description); return fprintf(fp, "%s%s = %d\n", indent, label, arg) > 0; } return 0; } BOOL rc_write_float (const char *label, float arg, const char *description) { if (fp) { write_description (description); return fprintf(fp, "%s%s = %f\n", indent, label, arg) > 0; } return 0; } BOOL rc_write_label(const char *label, LABEL_CONV *convert, int arg, const char *description) { if (fp) { int i; write_description (description); for (i = 0; convert[i].id != arg; i++); return fprintf(fp, "%s%s = %s\n", indent, label, convert[i].label) > 0; } return 0; } BOOL rc_write_string (const char *label, const char *arg, const char *description) { if (fp) { write_description (description); if (arg) { if (fprintf(fp,"%s%s = \"", indent,label) <= 0) return 0; while (*arg) { if (*arg<32 || (unsigned char)*arg>127) fprintf (fp, "\\x%02x",*(const unsigned char*)arg); else if (*arg == '"') fputs ("\\\"", fp); else fputc (*arg, fp); arg++; } return fprintf(fp,"\"\n") > 0; } else return fprintf(fp,"%s%s = \"\"\n", indent,label) > 0; } return 0; } BOOL rc_write_struct (const char *label, const char *description) { if (fp) { BOOL ret; STACK *newstack = (STACK *) malloc (sizeof(STACK)); newstack->data = strdup (label); newstack->next = structs; structs = newstack; write_description (description); ret = fprintf(fp,"%sBEGIN \"%s\"\n", indent, label) > 0; indent_change (1); return ret; } return 0; } BOOL rc_write_struct_end (const char *description) { if (fp && structs) { BOOL ret; STACK *next = structs->next; char *label = structs->data; free (structs); structs = next; indent_change (-1); write_description (description); ret = fprintf(fp,"%sEND \"%s\"\n", indent, label) > 0; free (label); return ret; } return 0; } /* search for label in loaded options and return the associated value */ static char *get_argument (const char *label) { int i; for (i=0; icnt; i++) if (options->option[i].label && !strcasecmp (options->option[i].label,label)) { /* mark entry as handled */ free (options->option[i].label); options->option[i].label = NULL; return options->option[i].arg; } return NULL; } /* search for label in loaded options and return the associated value */ static OPTIONS *get_begin (const char *label) { int i; for (i=0; icnt; i++) if (options->option[i].label && !strcasecmp (options->option[i].label,"BEGIN") && !strcasecmp (options->option[i].arg,label)) { /* mark entry as handled */ free (options->option[i].label); options->option[i].label = NULL; return options->option[i].options; } return NULL; } /* Read 'value', which is saved in the config-file under label. Change 'value' only if label is present in config-file and associated value is valid. Return: value changed ? */ BOOL rc_read_bool (const char *label, BOOL *value) { char *arg = get_argument (label); if (arg) { if ((!strcasecmp(arg, "YES")) || (!strcasecmp(arg, "ON")) || (*arg == '1')) { *value = 1; return 1; } else if ((!strcasecmp(arg, "NO")) || (!strcasecmp(arg, "OFF")) || (*arg == '0')) { *value = 0; return 1; } } return 0; } BOOL rc_read_bit (const char *label, int *value, int mask) { const char *arg = get_argument (label); if (arg) { if ((!strcasecmp(arg, "YES")) || (!strcasecmp(arg, "ON")) || (*arg == '1')) { *value |= mask; return 1; } else if ((!strcasecmp(arg, "NO")) || (!strcasecmp(arg, "OFF")) || (*arg == '0')) { *value &= ~mask; return 1; } } return 0; } BOOL rc_read_int (const char *label, int *value, int min, int max) { const char *arg = get_argument (label); if (arg) { char *end; int t = strtol(arg, &end, 10); if ((!*end) && (t >= min) && (t <= max)) { *value = t; return 1; } } return 0; } BOOL rc_read_float (const char *label, float *value, float min, float max) { const char *arg = get_argument (label); if (arg) { float t; if (sscanf (arg,"%f",&t) == 1) if ((t >= min) && (t <= max)) { *value = t; return 1; } } return 0; } BOOL rc_read_label(const char *label, int *value, LABEL_CONV *convert) { const char *arg = get_argument (label); if (arg) { int i = 0; while (convert[i].label) { if (!strcasecmp(convert[i].label, arg)) { *value = convert[i].id; return 1; } i++; } } return 0; } BOOL rc_read_struct (const char *label) { OPTIONS *arg = get_begin (label); if (arg) { options = arg; return 1; } return 0; } BOOL rc_read_struct_end (void) { if (options->parent) { options = options->parent; return 1; } else return 0; } /* Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ void rc_set_string (char **value, const char *arg, int length) { int len = strlen(arg); if (len > length) len = length; if (*value) free(*value); *value = (char *)malloc((len + 1) * sizeof(char)); strncpy(*value, arg, len); (*value)[len] = '\0'; } /* Read a string. Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ BOOL rc_read_string (const char *label, char **value, int length) { const char *arg = get_argument (label); if (arg) { rc_set_string (value,arg,length); return 1; } return 0; } static char skip_space (char **line) { while (**line==' ' || **line=='\t') (*line)++; return **line; } static BOOL parse_line (char *line, char **label, char **arg) { char *end; *label = NULL; *arg = NULL; if (skip_space(&line) == '#') return 0; *label = line; while (isalnum((int)*line) || *line == '_') { *line = toupper ((int)*line); line++; } end = line; skip_space(&line); if (*line=='=') { line++; *end = '\0'; skip_space (&line); } else { *end = '\0'; if (strcmp(*label,"BEGIN") && strcmp(*label,"END")) return 0; } if (isgraph((int)*line)) { char *pos, ch1, ch2; BOOL string = (*line == '"'); if (string) line++; *arg = pos = line; while ((!string && *line && *line != '#') || (string && *line && *line!='"')) { if (!string) { *line=toupper((int)*line); } else { if (*line == '\\') { line++; switch (*line) { case 'a': *pos = '\a'; break; case 'b': *pos = '\b'; break; case 'f': *pos = '\f'; break; case 'n': *pos = '\n'; break; case 'r': *pos = '\r'; break; case 't': *pos = '\t'; break; case 'v': *pos = '\v'; break; case '\'': *pos = '\''; break; case '"': *pos = '\"'; break; case '\\': *pos = '\\'; break; case 'x': ch1 = toupper((int)*(line+1)); ch2 = toupper((int)*(line+2)); *pos = (ch1>='A' ? (ch1-'A'+10):(ch1-'0'))*16+ (ch2>='A' ? (ch2-'A'+10):(ch2-'0')); line += 2; break; default: line--; *pos = *line; } } else *pos = *line; } line++; pos++; } if (!string) { do { pos--; } while (*pos == ' ' || *pos == '\t'); pos++; } *pos = '\0'; return 1; } return 0; } static BOOL rc_parse (OPTIONS *opts, const char *sec_name) { char line[LINE_LEN],*label,*arg; BOOL ret = 1; while (ret && fgets(line,LINE_LEN,fp)) { if (line[strlen(line)-1]=='\n') line[strlen(line)-1]='\0'; if (parse_line(line,&label,&arg)) { if (!strcmp("END", label)) { if (strcmp(arg,sec_name)) { fprintf (stderr, "Error in config file: expected 'END %s', found 'END %s'" " Ignoring (remaining) config file...", sec_name, arg); return 0; } return 1; } else { if (opts->cnt >= opts->max) { opts->max += OPTION_BLOCK; opts->option = (OPTION *) realloc (opts->option,sizeof(OPTION)*opts->max); } opts->option[opts->cnt].label = strdup (label); opts->option[opts->cnt].arg = strdup (arg); if (!strcmp("BEGIN", label)) { OPTIONS *new_opts = (OPTIONS *) malloc(sizeof(OPTIONS)); new_opts->cnt = new_opts->max = 0; new_opts->option = NULL; new_opts->parent = opts; opts->option[opts->cnt].options = new_opts; ret = rc_parse (new_opts, opts->option[opts->cnt].arg); } else { opts->option[opts->cnt].options = NULL; } opts->cnt++; } } } if (ferror(fp)) fprintf (stderr, "Error in config file, ignoring (remaining) file..."); return ret && !ferror(fp); } /* open config-file 'name' and parse the file for following rc_read_...() */ BOOL rc_load (const char *name) { BOOL ret = 0; if (!(fp = fopen (path_conv_sys(name),"r"))) return 0; options = (OPTIONS *) malloc(sizeof(OPTIONS)); options->cnt = options->max = 0; options->option = NULL; options->parent = NULL; ret = rc_parse (options,"'NO END'"); fclose (fp); fp = NULL; return ret; } /* open config-file 'name' for following rc_write_...() and write a header for program 'prg_name' */ BOOL rc_save (const char *name, const char *prg_name) { if (!(fp=fopen(path_conv_sys(name),"w"))) return 0; if (fprintf (fp,"#\n" "# %s\n" "# configuration file\n" "#\n",prg_name) <= 0) { fclose (fp); fp = NULL; return 0; } return 1; } /* close config-file opened by rc_load() or rc_save() */ void rc_close (void) { if (fp) { fclose (fp); fp = NULL; } options_free (options); options = NULL; } mikmod-3.2.8/src/mconfedit.h0000644000000000000000000000247112255111204014407 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mconfedit.h,v 1.1.1.1 2004/01/16 02:07:43 raph Exp $ The config editor ==============================================================================*/ #ifndef MCONFEDIT_H #define MCONFEDIT_H #include "mmenu.h" /* set help text of menu entry free old menu->help and malloc new entry */ void set_help(MENTRY * entry, const char *str, ...); /* open config editor */ void config_open(void); #endif /* MCONFEDIT_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/mikmod.10000644000000000000000000003230713071724104013637 0ustar rootroot.TH MIKMOD 1 "Version 3.2.8, 07 April 2017" .SH NAME mikmod - play soundtracker etc. modules on a Unix machine. .SH SYNOPSIS .B mikmod [\fB\-options\fR]... [\fBmodule\fR|\fBplaylist\fR]... .SH DESCRIPTION \fIMikMod\fR is a \fIvery\fR portable module player based on libmikmod, written originally by Jean-Paul Mikkers (MikMak). It will play the IT, XM, MOD, MTM, S3M, STM, ULT, FAR, MED, DSM, AMF, IMF and 669 module formats. It works under AIX, FreeBSD, HP-UX, IRIX, Linux, NetBSD, OpenBSD, OSF/1, SunOS, Solaris, OS/2, DOS, and Windows. It is controllable via an easy-to-use curses interface and will extract and play modules from a variety of different archive formats. .SH OPTIONS Options can be given in any order, and are case-sensitive. For the options which have both a short and a long form, the long form can be prefixed by one or two dashes. Note that the settings in your $HOME/.mikmodrc will override the defaults shown in this man page. .SH OUTPUT OPTIONS .IP "\fB\-d \fIn\fR" .IP "\fB\-\-driver \fIn\fR" Use the specified device driver for output, 0 is autodetect. The default is 0. If your installed libmikmod engine is recent enough (>=3.1.7), you can also specify the driver with an alias, as well as driver options separated by commas. The list and driver aliases and recognized options can be found in libmikmod's documentation. .IP "\fB\-o[utput] \fI8m\fR|\fI8s\fR|\fI16m\fR|\fI16s\fR" Output settings, 8 or 16 bit in stereo or mono. The default is "16s". .IP "\fB\-f \fIfreq\fR" .IP "\fB\-\-frequency \fIfreq\fR" Set mixing frequency in hertz. The default is 44100. .IP "\fB\-i\fR" .IP "\fB\-\-interpolate\fR" Use interpolated mixing. This will generally improve audio quality, at the expense of a bit more CPU usage. Note that this option alters the behaviour of software drivers only ; hardware drivers are not affected (default). .IP "\fB\-\-nointerpolate\fR" Do not use interpolated mixing. .IP "\fB\-hq\fR" .IP "\fB\-\-hqmixer\fR" Use high quality software mixer. This improves audio quality, but requires a lot more CPU power. Note that this option alters the behaviour of software drivers only ; hardware drivers are not affected. .IP "\fB\-\-nohqmixer" Do not use high quality software mixer (default). .IP "\fB\-s\fR" .IP "\fB\-\-surround\fR" Use surround mixing. .IP "\fB\-\-nosurround\fR" Do not use surround mixing (default). .IP "\fB\-r \fIn\fR" .IP "\fB\-\-reverb \fIn\fR" Sets reverb amount from 0 (no reverb) to 15 (max reverb). The default is 0 (no reverb). .SH PLAYBACK OPTIONS .IP "\fB\-v \fIvolume\fR" .IP "\fB\-\-volume \fIvolume\fR" Set volume from 0% (silence) to 100%. The default is 100%. .IP "\fB\-F\fR" .IP "\fB\-\-fadeout\fR" Fade out the volume during the last pattern of each module. .IP "\fB\-\-nofadeout\fR" Do not fade out the volume during the last pattern of each module (default). .IP "\fB\-l\fR" .IP "\fB\-\-loops\fR" Enable in-module backwards loops. .IP "\fB\-\-noloops\fR" Disable in-module backwards loops (default). .IP "\fB\-a\fR" .IP "\fB\-\-panning\fR" Process panning effects (default). This should be disabled (using \-\-nopanning) for very old demo modules which use the panning effects for synchronization purposes. .IP "\fB\-\-nopanning\fR" Do not process panning effects. .IP "\fB\-x\fR" .IP "\fB\-\-protracker\fR" Enable protracker extended speed effect (default). This should be disabled (using \-\-noprotracker) for very old demo modules which use the extended speed effect for synchronization purposes. .IP "\fB\-\-noprotracker\fR" Disable protracker extended speed effect. .SH LOADING OPTIONS .IP "\fB\-y \fIdir\fR" .IP "\fB\-\-directory \fIdir\fR" Scan directory recursively for modules. .IP "\fB\-c\fR" .IP "\fB\-\-curious\fR" Look for hidden patterns in module. Most modules don't have hidden patterns, but you can find "bonus" patterns (or just silence) in some modules. .IP "\fB\-\-nocurious\fR" Do not look for hidden patterns in module (default). .IP "\fB\-p \fIn\fR" .IP "\fB\-\-playmode \fIn\fR" Playlist mode. The allowed values here are 1, to loop the current module; 2, to play the whole playlist repeatedly; 4, to shuffle the list before playing, and 8, to play the whole list randomly. The default is 2. .IP "\fB\-t\fR" .IP "\fB\-\-tolerant\fR" Don't halt MikMod if a module cannot be read or is an unknown format (default). .IP "\fB\-\-notolerant\fR" Halt MikMod if a module cannot be read or is an unknown format. .SH SCHEDULING OPTIONS The following options need root privileges (or a setuid root binary), and don't work under all systems. .IP "\fB\-s\fR" .IP "\fB\-\-renice\fR" Renice to \-20 if possible to gain more CPU priority. This option is only available under FreeBSD, Linux, NetBSD, OpenBSD and OS/2. .IP "\fB\-\-norenice\fR" Do not renice to \-20 (default). .IP "\fB\-S\fR" .IP "\fB\-\-realtime\fR" Reschedule mikmod to gain real-time priority (and thus more CPU time). \fBDANGEROUS! USE WITH CAUTION!\fR This option is only available under FreeBSD, Linux and OS/2. .IP "\fB\-\-norealtime\fR" Do not reschedule MikMod to gain real\-time priority (default). .SH DISPLAY OPTIONS .IP "\fB\-q\fR" .IP "\fB\-\-quiet\fR" Quiet mode. Disables interactive commands and displays only errors. .SH INFORMATION OPTIONS .IP "\fB\-n\fR" .IP "\fB\-\-information\fR" Display the list of the known drivers and module loaders. .IP "\fB\-N \fIn\fR" .IP "\fB\-\-drvinfo \fIn\fR" Display information about a specific driver. .IP "\fB\-V\fR" .IP "\fB\-\-version\fR" Display MikMod version. .IP "\fB\-h\fR" .IP "\fB\-\-help\fR" Display a summary of the options. .SH CONFIGURATION OPTION .IP "\fB\-\-norc\fR" Do not parse the $HOME/.mikmodrc configuration file. This file contains your default settings, so that you don't have to specify them each time you run MikMod. The file is read when you run MikMod and updated on exit. Using this option prevents MikMod from accessing this file. .SH RUNTIME COMMANDS At play time, the following keystrokes offer control over MikMod: .IP "\fBH\fR, \fBfunction key F1\fR" Display help panel. .IP "\fBS\fR, \fBfunction key F2\fR" Display samples panel. .IP "\fBI\fR, \fBfunction key F3\fR" Display instruments panel (if present in the module). .IP "\fBM\fR, \fBfunction key F4\fR" Display song message panel (if present in the module). .IP "\fBL\fR, \fBfunction key F5\fR" Display the playlist panel. .IP "\fBC\fR, \fBfunction key F6\fR" Display the configuration panel. .IP "\fBV\fR, \fBfunction key F7\fR" Display the volume panel. .IP "\fBdigits\fR" Set volume from 10% (digit 1) to 100% (digit 0). .IP "\fB<\fR" Decrease volume. .IP "\fB>\fR" Increase volume. .IP "\fB\-\fR, \fBLeft\fR" Restart current pattern / skip to previous pattern. .IP "\fB+\fR, \fBRight\fR" Skip to next pattern in current module. .IP "\fBUp\fR, \fBDown\fR" Scroll panel. .IP "\fBPgUp\fR, \fBPgDown\fR" Scroll panel (faster). .IP "\fBHome\fR" Go on top of the panel. .IP "\fBEnd\fR" Go to the end of the panel. .IP "\fB(\fR" Decrease speed variable (module plays faster). .IP "\fB)\fR" Increase speed variable (module plays slower). .IP "\fB{\fR" Decrease tempo variable (module plays slower). .IP "\fB}\fR" Increase tempo variable (module plays faster). .IP "\fB:\fR or \fB;\fR" Toggle interpolation mixing. .IP "\fBU\fR" Toggle surround mixing. .IP "\fBQ\fR" Exit MikMod. .IP "\fBP\fR" Switch to previous module in playlist. .IP "\fBN\fR" Switch to next module in playlist. .IP "\fBR\fR" Restart current module. .IP "\fBF\fR" Toggle fake/real volume bars in volume panel. .IP "\fBspace\fR" Toggle pause. .IP "\fBControl-L\fR" Refresh the screen. .SH MENU BASICS Some functions of MikMod are available through menus, in the playlist and configuration panels. You can select commands in the menus either by moving the selection with the arrow keys and pressing enter, or entering the highlighted letter corresponding ot the command you want to select. Menu entries ending with a \fB>\fR character open a submenu, whereas entries ending in \fB...\fR open a dialog box. You can dismiss a submenu either by choosing a command in this menu, or using the left arrow key to go back, or switching panels. In dialog boxes, you can move the focus from the input line to the \fBOk\fR and \fBCancel\fR buttons either with the "tab" key, or the up and down arrow keys. Also, if the statusbar is active (which is the default behaviour), it will contain a short help text describing the menu option currently highlighted. .SH PLAYLIST MENU When the playlist panel is displayed, pressing the \fIreturn\fR key will popup a menu. The menu commands are: .IP "\fBPlay\fR" Continue list playback from the currently highlighted module. .IP "\fBRemove\fR" Remove module from the playlist. .IP "\fBDelete...\fR" Remove module from the playlist, and delete module file on disk, or whole archive if the module is stored in an archive file. This function asks you to confirm your choice. .IP "\fBFile >\fR" This entry opens a submenu with four commands, "\fBLoad\fR", "\fBInsert\fR", "\fBSave\fR" and "\fBSave as\fR". The \fBLoad\fR and \fBInsert\fR commands ask you for a filename, and replace the playlist with it (load) or merge it with the playlist (insert). No wildcards are allowed. The \fBSave\fR and \fBSave as\fR commands save the current playlist in a file, by default ``playlist.mpl'', in the current directory. Note that playlist filenames should end in \fB.mpl\fR, or they won't be recognized immediately as a playlist by MikMod. .IP "\fBShuffle\fR" Randomize the playlist. .IP "\fBSort >\fR" This entry opens a submenu with sort commands. You can select a normal or \fBreverse\fR order, and then sort the playlist with one of the four criteria: \fBby name\fR, \fBby extension\fR, \fBby path\fR or \fBby time\fR. .IP "\fBBack\fR" Discards the menu. .SH CONFIGURATION PANEL The configuration panel lets you customize your MikMod settings, and save them. You can also try some particular settings without losing your previous configuration. .IP "\fBOutput options\fR" This section lets you choose various vital playback settings, such as the output driver, the stereo/mono and 16/8 bit output settings, the playback frequency, and the software mixer settings. .IP "\fBPlayback options\fR" This section lets you choose various module playback settings, such as the output volume, the processing of panning effects and bacwards loops, etc. .IP "\fBOther options\fR" This section lets you choose the remaining settings, such as the playlist mode, and various program settings. .IP "\fBUse config\fR" This command activates the current configuration settings, but does not save them. .IP "\fBSave config\fR" This command saves and activates the current configuration settings. .IP "\fBRevert config\fR" This command reverts to the on-disk configuration file settings. .SH MODULE FORMATS MikMod will currently play the following common and not so common formats: .IP "\fB669\fR" Composer 669 and Extended 669 modules. .IP "\fBAMF\fR" DSMI internal module format (Advanced Module Format, converted with M2AMF). .IP "\fBAMF\fR" ASYLUM Music format (From crusader games) .IP "\fBDSM\fR" DSIK's internal module format. .IP "\fBFAR\fR" Farandole composer modules. .IP "\fBGDM\fR" General Digital Munsic internal module format (converted with 2GDM). .IP "\fBIMF\fR" Imago Orpheus modules. .IP "\fBIT\fR" Impulse Tracker modules. .IP "\fBMED\fR" Amiga MED modules, but synthsounds are not supported. .IP "\fBMOD\fR" Protracker, Startracker, Fasttracker, Oktalyzer, and Taketracker modules. .IP "\fBMTM\fR" Multitracker module editor modules. .IP "\fBS3M\fR" Screamtracker version 3 modules. .IP "\fBSTM\fR" Screamtracker version 2 modules. .IP "\fBSTX\fR" STMIK converted modules. .IP "\fBULT\fR" Ultratracker modules. .IP "\fBUNI\fR, \fBAPUN\fR" Old MikMod (UNI) and APlayer (APUN) internal module format. .IP "\fBXM\fR" Fasttracker 2 modules. .SH ARCHIVE FORMATS MikMod should recognize and extract the following common archive formats. However, to use each of these you will need to find the appropriate program(s) for MikMod to use to extract them. These are commonly available and you will most likely find them with this distribution of MikMod. Other archive formats can be configured by editing the configuration file (see \fBFILES\fR below). .IP "\fBzip\fR" Info-zip or PkZip archives, commonly used on DOS/Windows platforms. .IP "\fBlha\fR, \fBlzh\fR" Lharc archives, commonly used on the Amiga. .IP "\fBzoo\fR" Zoo archives, quite rare those days... .IP "\fBrar\fR" Rar archives. .IP "\fBgz\fR" Gzip compressed files. .IP "\fBbz2\fR" Bzip2 compressed files. .IP "\fBtar\fR, \fBtar.gz\fR and \fBtar.bz2\fR" Tar archives, even compressed with gzip or bzip2. .SH FILES .IP "$HOME/.mikmodrc (or mikmod.cfg under OS/2 / Windows)" User configuration settings. .IP "$HOME/.mikmod_playlist (mikmodpl.cfg/mikmod_playlist.mpl under OS/2 / Windows)" The default playlist, loaded if no other files are specified on the command line. .IP playlist.mpl Default playlist filename. .SH AUTHORS \fIMikMod\fP is the result of the work of many people, including: Jean-Paul Mikkers, Jake Stine, Miodrag Vallat, Frank Loemker, Andrew Zabolotny, Raphael Assenat, Steve McIntyre, Peter Amstutz, "MenTaLguY", Dimitri Boldyrev, Shlomi Fish, Stefan Tibus, Tinic Urou. A full list of people having worked on libmikmod and MikMod is displayed when MikMod starts. .SH LOCATING NEWER VERSIONS The official MikMod and libmikmod home page is at http://mikmod.sourceforge.net/ mikmod-3.2.8/src/mfnmatch.h0000644000000000000000000000470512276756040014256 0ustar rootroot/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _FNMATCH_H #define _FNMATCH_H 1 #ifdef __cplusplus extern "C" { #endif #if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \ || defined (_WIN32)) #undef __P #define __P(protos) protos #else /* Not C++ or ANSI C. */ #undef __P #define __P(protos) () /* We can get away without defining `const' here only because in this file it is used only inside the prototype for `fnmatch', which is elided in non-ANSI C where `const' is problematical. */ #endif /* C++ or ANSI C. */ /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME #undef FNM_NOESCAPE #undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ #define FNM_NOMATCH 1 /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch __P ((const char *__pattern, const char *__string, int __flags)); #ifdef __cplusplus } #endif #endif /* fnmatch.h */ mikmod-3.2.8/src/mdialog.c0000644000000000000000000001207212255111204014044 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mdialog.c,v 1.1.1.1 2004/01/16 02:07:40 raph Exp $ Some common dialog types ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "mwidget.h" #include "mdialog.h" #include "display.h" #include "mutilities.h" typedef struct { handleDlgFunc handle_dlg; WIDGET *w; void *input; void *data; int min, max; } DLG_DATA; static int handle_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { DLG_DATA *data = (DLG_DATA *) w->data; if (data) { int button = -1; if (w->type == TYPE_BUTTON) button = ((WID_BUTTON *) w)->active; if ((button <= 0) && (data->min >= 0) && (data->max >= 0)) { int value = atoi((char*)data->input); if ((value < data->min) || (value > data->max)) return focus; } if (data->handle_dlg(data->w, button, data->input, data->data)) { free(data); dialog_close(w->d); } } else dialog_close(w->d); return EVENT_HANDLED; } return focus; } static DLG_DATA *init_dlg_data(handleDlgFunc handle_dlg, WIDGET *w, void *input, void *data) { DLG_DATA *dlg_data = NULL; if (handle_dlg) { dlg_data = (DLG_DATA *) malloc(sizeof(DLG_DATA)); dlg_data->handle_dlg = handle_dlg; dlg_data->w = w; dlg_data->input = input; dlg_data->data = data; dlg_data->min = dlg_data->max = -1; } return dlg_data; } /* Opens a message box msg : text to display,can contain '\n' button: ".&..|...|...",&: hotkey,e.g.: "&Yes|&No" active: active button(0...n) warn : open message box with ATTR_WARNING? data : passed to handle_dlg */ void dlg_message_open(const char *msg, const char *button, int active, BOOL warn, handleDlgFunc handle_dlg, void *data) { WIDGET *w; DIALOG *d = dialog_new(); if (warn) dialog_set_attr (d,ATTR_WARNING); wid_label_add(d, 1, msg); w = wid_button_add(d, 2, button, active); if (handle_dlg) wid_set_func(w, NULL, handle_focus, init_dlg_data(handle_dlg, w, NULL, data)); dialog_open(d, "Message"); } /* Shows a message. If errno is set a text describing the errno error code is appended to the message. */ void dlg_error_show(const char *txt, ...) { va_list args; char *err = NULL; int len; if (errno) { #ifdef HAVE_STRERROR err = strerror(errno); #else err = (errno >= sys_nerr) ? "(unknown error)" : sys_errlist[errno]; #endif } va_start(args, txt); VSNPRINTF (storage, STORAGELEN, txt, args); va_end(args); len = strlen(storage); if (leninput, data); wid_set_func(str_wid, NULL, handle_focus, dlg_data); wid_set_func(w, NULL, handle_focus, dlg_data); dialog_open(d, "Enter string"); } /* Opens an integer input dialog msg : text to display,can contain '\n' value : default integer min,max: min,max allowed values */ void dlg_input_int(const char *msg, const char *buttons, int value, int min, int max, handleDlgFunc handle_dlg, void *data) { char title[40]; WIDGET *w, *int_wid; DLG_DATA *dlg_data; DIALOG *d = dialog_new(); if (msg) wid_label_add(d, 1, msg); sprintf(title, "%d", max); int_wid = wid_int_add(d, 1, value, strlen(title)); w = wid_button_add(d, 2, buttons, 0); dlg_data = init_dlg_data(handle_dlg, int_wid, ((WID_INT*)int_wid)->input, data); dlg_data->min = min; dlg_data->max = max; wid_set_func(int_wid, NULL, handle_focus, dlg_data); wid_set_func(w, NULL, handle_focus, dlg_data); sprintf(title, "Enter value(%d - %d)", min, max); dialog_open(d, title); } /* ex:set ts=4: */ mikmod-3.2.8/src/mmenu.c0000644000000000000000000003135612276756040013577 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mmenu.c,v 1.1.1.1 2004/01/16 02:07:38 raph Exp $ Menu functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "display.h" #include "mmenu.h" #include "mwindow.h" #include "mdialog.h" #include "keys.h" #include "mutilities.h" static BOOL menu_check (char *text, char ch) { while (*text) { if (*text == '%') { text++; if (*text == ch) return 1; else if (*text != '%') return 0; } text++; } return 0; } static BOOL menu_is_sub(MENTRY *entry) { int i = 0, end = strlen(entry->text) - 1; if (entry->text[end--] == '>') { while (entry->text[end--] == '%') i++; return (i%2) != 0; } return 0; } static BOOL menu_is_option(MENTRY *entry) { return menu_check (entry->text,'o'); } static BOOL menu_is_toggle(MENTRY *entry) { return menu_check (entry->text,'c'); } static BOOL menu_is_int(MENTRY *entry) { return menu_check (entry->text,'d'); } static BOOL menu_is_str(MENTRY *entry) { return menu_check (entry->text,'s'); } static BOOL menu_has_sub(MENTRY *entry) { return menu_is_str(entry) || menu_is_int(entry) || menu_is_option(entry) || menu_is_sub(entry); } static int menu_width (char *txt) { int width = strlen(txt); char *help; while ((help = strchr(txt, '&'))) { txt = help+2; width--; } return width; } static char *get_text(MENTRY *entry, int width) { char *text, help[100], sub[100], *start, *pos; int i; if (entry) { if (entry->text[0] == '%' && entry->text[1] == '-') text = strdup(&entry->text[1]); else text = strdup(entry->text); if (menu_is_sub(entry)) { i = strlen(text); text[i-2] = '>'; text[i-1] = '\0'; } pos = text-1; do { pos++; pos = strchr(pos, '%'); if (pos) pos++; } while (pos && (*pos == '%' || *pos == '>' || *pos == '-')); if (pos) { if (*pos == 'c') sprintf(storage, text, (SINTPTR_T)(entry->data) ? 'x' : ' '); else if ((*pos == 'o') && (start = strchr(pos, '|'))) { char *s_pos = NULL; int max = 0; strncpy(help, text, start - text); help[start - text] = '\0'; help[pos - text] = 's'; start++; i = (SINTPTR_T)(entry->data); pos = start; while (start) { if (!i) s_pos = pos; if ((start = strchr(pos, '|'))) { if (start - pos > max) max = start - pos; pos = start + 1; } i--; } if (strlen(pos) > max) max = strlen(pos); if (width>0 && menu_width(help)-2+max > width) max = width - menu_width(help)+2; i = 0; while (s_pos && (*s_pos) && (*s_pos != '|')) sub[i++] = *s_pos++; while (i < max) sub[i++] = ' '; sub[max] = '\0'; sprintf(storage, help, sub); } else if ((*pos == 'd' || *pos == 's') && (start = strchr(pos, '|'))) { char *right = strrchr(start, '|') + 1; strncpy(help, text, pos - text); help[pos - text] = '\0'; if (*pos == 'd') { sprintf(sub, "%d", (int)strlen(right)); strcat(help, sub); } else strcat(help, right); i = strlen(help); strncat(help, pos, start - pos); help[i + start - pos] = '\0'; if (*pos == 'd') sprintf(storage, help, (int)(SINTPTR_T)(entry->data)); else { char ch; sscanf(right, "%d", &i); pos = (char *)(entry->data); ch = pos[i]; pos[i] = '\0'; sprintf(storage, help, pos); pos[i] = ch; } } else sprintf(storage, "%s", text); } else sprintf(storage, "%s", text); free (text); /* '...%>' -> '...>' */ i = strlen(storage); if (menu_is_sub(entry)) { i--; while (i < width) storage[i++] = ' '; storage[i++] = '>'; } else { while (i < width) storage[i++] = ' '; } storage[i] = '\0'; return storage; } return NULL; } static void menu_do_repaint(MWINDOW * win, int diff) { MMENU *m = (MMENU *) win->data; int height, t, hl_pos; char *pos, *txt, hl[2], *help; height = win->height; if (height > m->count) height = m->count; m->cur += diff; if (m->cur < 0) m->cur = m->count - 1; else if (m->cur >= m->count) m->cur = 0; while (m->entries[m->cur].text[0] == '%' && m->entries[m->cur].text[1] == '-') m->cur += diff > 0 ? 1 : -1; if (m->cur < m->first) m->first = m->cur; else if (m->cur >= m->first + height) m->first = m->cur - height + 1; hl[1] = '\0'; for (t = m->first; t < m->count && t < (height + m->first); t++) { txt = get_text(&m->entries[t], win->width); hl_pos = -1; help = txt; while ((pos = strchr(help, '&'))) { help = pos+1; if ((*(pos + 1) != '&')) { hl_pos = pos - txt; hl[0] = *(pos + 1); } for (++pos; *pos; pos++) *(pos - 1) = *pos; *(pos - 1) = ' '; if (hl_pos >= 0) txt[hl_pos] = '\0'; } if (t == m->cur) { win_attrset(ATTR_MENU_ACTIVE); win_print(win, 0, t - m->first, txt); if (hl_pos >= 0) { win_attrset(ATTR_MENU_AHOTKEY); win_print(win, hl_pos, t - m->first, hl); win_attrset(ATTR_MENU_ACTIVE); win_print(win, hl_pos + 1, t - m->first, &txt[hl_pos + 1]); } win_status(m->entries[t].help); } else if (m->entries[t].text[0] == '%' && m->entries[t].text[1] == '-') { win_attrset(ATTR_MENU_FRAME); win_line (win, 0, t - m->first, win->width-1, t - m->first); } else { win_attrset(ATTR_MENU_INACTIVE); if (hl_pos >= 0) { win_print(win, 0, t - m->first, txt); win_attrset(ATTR_MENU_IHOTKEY); win_print(win, hl_pos, t - m->first, hl); win_attrset(ATTR_MENU_INACTIVE); win_print(win, hl_pos + 1, t - m->first, &txt[hl_pos + 1]); } else win_print(win, 0, t - m->first, txt); } } } static BOOL menu_repaint(MWINDOW * win) { menu_do_repaint(win, 0); return 1; } static void handle_opt_menu(MMENU * menu) { int i; MMENU *m = (MMENU *) menu->data; m->entries[m->cur].data = (void *)(SINTPTR_T)menu->cur; menu_close(menu); for (i = 0; i < menu->count; i++) free(menu->entries[i].text); free(menu->entries); free(menu); if (m->handle_select) m->handle_select(m); } static BOOL handle_input_str(WIDGET *w, int button, void *input, void *data) { if (button<=0) { MMENU* m = (MMENU*) data; strcpy((char*)m->entries[m->cur].data, (char*)input); if (m->handle_select) m->handle_select(m); } return 1; } static BOOL handle_input_int(WIDGET *w, int button, void *input, void *data) { if (button<=0) { MMENU* m = (MMENU*) data; m->entries[m->cur].data = (void *)(SINTPTR_T)atoi((char*)input); if (m->handle_select) m->handle_select(m); } return 1; } static BOOL menu_do_select(MWINDOW * win) { MMENU *m = (MMENU *) win->data; MENTRY *entry = &m->entries[m->cur]; if (menu_is_toggle(entry)) { entry->data = (void *)(SINTPTR_T)(!((SINTPTR_T)(entry->data))); menu_do_repaint(win, 0); } else if (menu_is_option(entry)) { char *pos, *start; MENTRY *sub; MMENU *newmenu = (MMENU *) malloc(sizeof(MMENU)); int cnt = 1, i; start = strchr(entry->text, '|'); pos = ++start; while ((pos = strchr(pos, '|'))) { pos++; cnt++; } newmenu->cur = (SINTPTR_T)(entry->data); newmenu->first = 0; newmenu->count = cnt; newmenu->key_left = 1; newmenu->entries = (MENTRY *) malloc(sizeof(MENTRY) * cnt); newmenu->handle_select = handle_opt_menu; newmenu->win = NULL; newmenu->data = m; sub = newmenu->entries; for (i = 0; i < cnt; i++) { if (!(pos = strchr(start, '|'))) pos = &start[strlen(start)]; sub->text = (char *) malloc(sizeof(char) * (pos - start + 1)); strncpy(sub->text, start, pos - start); sub->text[pos - start] = '\0'; sub->data = NULL; sub->help = entry->help; start = pos + 1; sub++; } menu_open(newmenu, win->x + win->width + 1, win->y + m->cur - m->first); return 1; } else if (menu_is_str(entry)) { char *msg = NULL, *start, *pos; int length = 0; start = strchr(entry->text, '|') + 1; pos = strchr(start, '|'); msg = (char *) malloc(sizeof(char) * (pos - start + 1)); strncpy(msg, start, pos - start); msg[pos - start] = '\0'; sscanf(pos + 1, "%d", &length); dlg_input_str(msg, "<&Ok>|&Cancel", (char *)(entry->data), length, handle_input_str, m); free(msg); return 1; } else if (menu_is_int(entry)) { const char *start, *pos; char *msg = NULL; int min = 0, max = 0; start = strchr(entry->text, '|') + 1; pos = strchr(start, '|'); msg = (char *) malloc(sizeof(char) * (pos - start + 1)); strncpy(msg, start, pos - start); msg[pos - start] = '\0'; sscanf(pos + 1, "%d|%d", &min, &max); dlg_input_int(msg, "<&Ok>|&Cancel", (SINTPTR_T)(entry->data), min, max, handle_input_int, m); free(msg); return 1; } else if (menu_is_sub(entry)) { MMENU *sub = (MMENU *) entry->data; sub->cur = sub->first = 0; menu_open(sub, win->x + win->width + 1, win->y + m->cur - m->first); return 1; } return 0; } void menu_close(MMENU * menu) { int i; for (i = 0; i < menu->count; i++) if (menu_is_sub(&menu->entries[i])) menu_close((MMENU *) menu->entries[i].data); if (menu->win) { win_status(NULL); win_close(menu->win); menu->win = NULL; } } static BOOL menu_handle_key(MWINDOW * win, int ch) { MMENU *menu = (MMENU *) win->data; const char *pos, *help; int i, key; if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_DOWN: menu_do_repaint(win, 1); break; case KEY_UP: menu_do_repaint(win, -1); break; #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) case KEY_ESC: #endif case KEY_LEFT: if (menu->key_left) menu_close(menu); break; case KEY_RIGHT: if (menu_has_sub(&menu->entries[menu->cur])) menu_do_select(win); break; case KEY_ENTER: case '\r': if (!menu_do_select(win)) if (menu->handle_select) menu->handle_select(menu); break; default: for (i = 0; i < menu->count; i++) { key = 0; help = menu->entries[i].text; while ((pos = strchr(help, '&'))) { help = pos+2; if (*(pos+1) != '&') { key = toupper((int)(*(pos + 1))); break; } } if (key == ch) { menu_do_repaint(win, i - menu->cur); if (!menu_do_select(win)) if (menu->handle_select) menu->handle_select(menu); return 1; } } return 0; } return 1; } static void menu_handle_resize(MWINDOW * win, int dx, int dy) { int m_y, m_width, m_height; MMENU *menu = (MMENU *) win->data; win_get_size_max(&m_y, &m_width, &m_height); m_width -= 2; m_height -= 2; if (win->x + win->width > m_width) { win->x = m_width - win->width + 1; if (win->x < 1) win->x = 1; } if (win->y + win->height - m_y > m_height || win->y + menu->count - m_y > m_height) { win->y = m_height - menu->count + m_y + 1; if (win->y <= m_y) win->y = m_y + 1; } if (win->height < menu->count) win->height = menu->count; if (win->height > m_height) win->height = m_height; if (menu->first + win->height > menu->count) menu->first = menu->count - win->height; if (menu->first < 0) menu->first = 0; } void menu_open(MMENU * menu, int x, int y) { MWINDOW *win; char *entry; int m_y, m_width, m_height, width = 0; if (menu->count < 0) { menu->count = 0; while (menu->entries[menu->count].text) menu->count++; } /* get max. width of entries */ for (m_y = 0; m_y < menu->count; m_y++) { entry = get_text(&menu->entries[m_y], 0); m_width = menu_width(entry); if (m_width > width) width = m_width; } win_get_size_max(&m_y, &m_width, &m_height); m_width -= 2; m_height -= 2; if (x + width - 1 > m_width) x = m_width - width + 1; if (x < 1) x = 1; if (y + menu->count - m_y - 1 > m_height) y = m_height - menu->count + m_y + 1; if (y < m_y) y = m_y + 1; menu->win = win_open(x, y, width, menu->count, 1, NULL, ATTR_MENU_FRAME); win_set_repaint(menu_repaint); win_set_handle_key(menu_handle_key); win_set_resize(0, menu_handle_resize); win_set_data((void *)menu); win = win_get_window(); if (menu->first + win->height > menu->count) menu->first = menu->count - win->height; if (menu->first < 0) menu->first = 0; menu_repaint(win); } /* ex:set ts=4: */ mikmod-3.2.8/src/mmenu.h0000644000000000000000000000454710001643552013571 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mmenu.h,v 1.1.1.1 2004/01/16 02:07:38 raph Exp $ Menu functions ==============================================================================*/ #ifndef MMENU_H #define MMENU_H #include "mwindow.h" /* text metacharacters: '&x': highlight 'x' '&&' -> '&' '%%' -> '%' '%-' : separator, if at start of text '%c': toggle menu data: menu active yes|no '%o...|opt0|opt1|...': option menu data: active option '%d...|label|min|max': int input data: current value '%s...|label|maxlength|length of inserted text': string input data: current value '%>': submenu, if at end of text data: struct *MMENU, the sub menu else: normal menu data: unused */ typedef struct { char *text; void *data; char *help; } MENTRY; typedef struct MMENU { int cur; /* selected entry */ int first; /* first line of menu which is displayed */ int count; /* number of menu entries, -1 -> count is determined */ /* by first NULL entry in entries[].text */ BOOL key_left; /* can menu be closed with KEY_LEFT or KEY_ESC? */ MENTRY *entries; void (*handle_select) (struct MMENU *menu); /* called on menu selection */ MWINDOW *win; /* the window for this menu */ void *data; /* not used by menu functions */ int id; /* not used by menu functions */ } MMENU; typedef void (*MenuSelectFunc) (MMENU *menu); void menu_open(MMENU * menu, int x, int y); void menu_close(MMENU * menu); #endif /* MMENU_H */ /* ex:set ts=4: */ mikmod-3.2.8/src/mlist.c0000644000000000000000000003252312650703540013574 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mlist.c,v 1.1.1.1 2004/01/16 02:07:37 raph Exp $ Playlist management functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_FNMATCH_H #include "mfnmatch.h" #else #include #endif #include #include #include #include #ifdef SRANDOM_IN_MATH_H #include #endif #include "mlist.h" #include "marchive.h" #include "mutilities.h" static int mikmod_random(int limit) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) return rand() % limit; #else return random() % limit; #endif } /* Mark all the modules in the playlist as not played */ static void PL_ClearPlayed(PLAYLIST * pl) { int i; for (i = 0; i < pl->length; i++) pl->entry[i].played = 0; } BOOL PL_isPlaylistFilename(const CHAR *filename) { char *cfg_name = NULL; if (!fnmatch("*.mpl", filename, 0)) return 1; if ((cfg_name = PL_GetFilename())) { const char *p1 = FIND_LAST_DIRSEP(cfg_name); const char *p2 = FIND_LAST_DIRSEP(filename); if (!p1) p1 = cfg_name; if (!p2) p2 = filename; if (!filecmp(p1, p2)) { free(cfg_name); return 1; } free(cfg_name); } return 0; } void PL_InitList(PLAYLIST * pl) { pl->entry = NULL; pl->length = 0; pl->current = -1; pl->curr_deleted = 0; pl->add_pos = -1; #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) srand(time(NULL)); #else { const char * s = getenv("MIKMOD_SRAND_CONSTANT"); if (s) { srandom((unsigned int)atoi(s)); } else { srandom(time(NULL)); } } #endif } /* Choose the first non-played module */ void PL_InitCurrent(PLAYLIST * pl) { pl->current = 0; while ((pl->current < pl->length) && (pl->entry[pl->current].played)) pl->current++; if (pl->current >= pl->length) { PL_ClearPlayed(pl); pl->current = 0; } pl->current--; } void PL_ClearList(PLAYLIST * pl) { int i; for (i = 0; i < pl->length; i++) { if (pl->entry[i].file) free(pl->entry[i].file); if (pl->entry[i].archive) free(pl->entry[i].archive); } if (pl->entry) { free(pl->entry); pl->entry = NULL; } pl->current = -1; pl->curr_deleted = 0; pl->length = 0; } BOOL PL_CurrentDeleted(PLAYLIST * pl) { return pl->curr_deleted; } PLAYENTRY *PL_GetCurrent(PLAYLIST * pl) { if (pl->current < 0 || !pl->length) return NULL; return &pl->entry[pl->current]; } int PL_GetCurrentPos(PLAYLIST * pl) { if (pl->current < 0 || !pl->length) return -1; return pl->current; } PLAYENTRY *PL_GetEntry(PLAYLIST * pl, int number) { if ((number < 0) || (number >= pl->length)) return NULL; return &pl->entry[number]; } int PL_GetLength(PLAYLIST * pl) { return pl->length; } void PL_SetTimeCurrent(PLAYLIST * pl, long sngtime) { if (!pl->curr_deleted && pl->current >= 0 && pl->current < pl->length) pl->entry[pl->current].time = sngtime >> 10; } void PL_SetPlayedCurrent(PLAYLIST * pl) { if (!pl->curr_deleted && pl->current >= 0 && pl->current < pl->length) pl->entry[pl->current].played = 1; } BOOL PL_DelEntry(PLAYLIST * pl, int number) { int i; if (!pl->length) return 0; if (pl->entry[number].file) free(pl->entry[number].file); if (pl->entry[number].archive) free(pl->entry[number].archive); pl->length--; if (number <= pl->current) { if (number == pl->current) pl->curr_deleted = 1; pl->current--; } for (i = number; i < pl->length; i++) pl->entry[i] = pl->entry[i + 1]; pl->entry = (PLAYENTRY *) realloc(pl->entry, pl->length * sizeof(PLAYENTRY)); return 1; } BOOL PL_DelDouble(PLAYLIST * pl) { int i, j; if (!pl->length) return 0; for (i = pl->length - 2; i >= 0; i--) for (j = i + 1; j < pl->length; j++) if (!filecmp(pl->entry[i].file, pl->entry[j].file) && (!(pl->entry[i].archive || pl->entry[j].archive) || (pl->entry[i].archive && pl->entry[j].archive && !filecmp(pl->entry[i].archive, pl->entry[j].archive)))) { /* keep the time and played information whenever possible */ if (!pl->entry[i].time) pl->entry[i].time = pl->entry[j].time; if (!pl->entry[i].played) pl->entry[i].played = pl->entry[j].played; PL_DelEntry(pl, j); } return 1; } /* Following PL_Add will insert at pos */ void PL_StartInsert(PLAYLIST * pl, int pos) { pl->add_pos = pos; } /* Following PL_Add will append at end of playlist */ void PL_StopInsert(PLAYLIST * pl) { pl->add_pos = -1; } static void PL_Insert(PLAYLIST * pl, int pos, const CHAR *file, const CHAR *arc, int time, BOOL played) { int i; pl->length++; pl->entry = (PLAYENTRY *) realloc(pl->entry, pl->length * sizeof(PLAYENTRY)); for (i = pl->length - 1; i > pos; i--) pl->entry[i] = pl->entry[i - 1]; if (pos <= pl->current) pl->current++; pl->entry[pos].file = strdup(file); if (arc) { pl->entry[pos].archive = strdup(arc); } else pl->entry[pos].archive = NULL; pl->entry[pos].time = time; pl->entry[pos].played = played; } /* pl->add_pos < 0 => Append entry at end of playlist pl->add_pos >= 0 => Insert entry at pl->add_pos and increment pl->add_pos */ void PL_Add(PLAYLIST * pl, const CHAR *file, const CHAR *arc, int time, BOOL played) { if (pl->add_pos >= 0) { PL_Insert(pl, pl->add_pos, file, arc, time, played); pl->add_pos++; } else PL_Insert(pl, pl->length, file, arc, time, played); } #define LINE_LEN (PATH_MAX*2+20) /* "file" "arc" time played */ /* Loads a playlist */ BOOL PL_Load(PLAYLIST * pl, const CHAR *filename) { FILE *file; CHAR line[LINE_LEN]; CHAR *mod, *arc, *pos, *slash; int time, played; CHAR *ok = NULL; if (!(file = fopen(path_conv_sys(filename), "r"))) return 0; while ((ok = fgets(line, LINE_LEN, file)) && (strcasecmp(line, PL_IDENT))); if (!ok) { fclose(file); return 0; /* file is not a playlist */ } slash = FIND_LAST_DIRSEP(filename); while (fgets(line, LINE_LEN, file)) { if (*line != '"') continue; /* line == '"file" "arc" time played' */ mod = line + 1; /* file */ pos = mod; while (*pos != '"' && *pos) pos++; if (*pos != '"' || pos == mod) continue; *pos = '\0'; pos++; /* archive */ while (*pos != '"' && *pos) pos++; if (*pos == '"') pos++; arc = pos; while (*pos != '"' && *pos) pos++; time = played = 0; if (*pos) { *pos = '\0'; if (arc == pos) arc = NULL; pos += 2; /* time played */ sscanf(pos, "%d %d", &time, &played); } else arc = NULL; path_conv (arc); path_conv (mod); if (!arc && !time && !played) MA_FindFiles(pl, mod); else { /* we're loading a playlist, so it might be necessary to convert playlist paths to relative paths from cwd */ if (slash && path_relative(arc ? arc : mod)) { CHAR *dummy; dummy = (CHAR *) malloc(slash + 1 - filename + strlen(arc ? arc : mod) + 1); strncpy(dummy, filename, slash + 1 - filename); dummy[slash + 1 - filename] = '\0'; strcat(dummy, arc ? arc : mod); PL_Add(pl, arc ? mod : dummy, arc ? dummy : NULL, time, (BOOL)played); free (dummy); } else PL_Add(pl, mod, arc, time, (BOOL)played); } } fclose(file); return 1; } BOOL PL_Save(PLAYLIST * pl, const CHAR *filename) { FILE *file; int i; PLAYENTRY *entry; if (!(file = fopen(path_conv_sys(filename), "w"))) return 0; if (fputs(PL_IDENT, file) != EOF) { for (i = 0; i < pl->length; i++) { entry = &pl->entry[i]; if (entry->archive) fprintf(file, "\"%s\" \"%s\" %d %d\n", entry->file, entry->archive, entry->time, (int)entry->played); else fprintf(file, "\"%s\" \"\" %d %d\n", entry->file, entry->time, (int)entry->played); } fclose(file); return 1; } fclose(file); return 0; } char *PL_GetFilename(void) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_mikmod_amiga) return get_cfg_name("mikmodpl.cfg"); #elif defined(_WIN32) return get_cfg_name("mikmod_playlist.mpl"); #else return get_cfg_name(".mikmod_playlist"); #endif } BOOL PL_LoadDefault(PLAYLIST * pl) { char *name = PL_GetFilename(); BOOL ret = 0; if (name) { ret = PL_Load(pl, name); free(name); } return ret; } BOOL PL_SaveDefault(PLAYLIST * pl) { char *name = PL_GetFilename(); BOOL ret = 0; if (name) { ret = PL_Save(pl, name); free(name); } return ret; } /* check if selected file is a playlist and exchange it with the playlist */ static BOOL PL_CheckPlaylist(PLAYLIST * pl, BOOL *ok, int old_current, int cont, CHAR **retfile, CHAR **retarc, int arg) { /* check if selected file is a playlist */ if ((pl->entry[pl->current].file) && (!pl->entry[pl->current].archive)) { pl->add_pos = pl->current + 1; if (PL_Load(pl, pl->entry[pl->current].file)) { /* Yes -> del playlist-entry and get next entry in now modified list */ pl->add_pos = -1; PL_DelEntry(pl, pl->current); pl->current = old_current; switch (cont) { case PL_CONT_NEXT: *ok = PL_ContNext(pl, retfile, retarc, arg); return 1; case PL_CONT_PREV: *ok = PL_ContPrev(pl, retfile, retarc); return 1; case PL_CONT_POS: *ok = PL_ContPos(pl, retfile, retarc, arg); return 1; } } pl->add_pos = -1; } return 0; } /* get next module to play mode: PM_MODULE, PM_MULTI, PM_SHUFFLE, or PM_RANDOM return: was there a module? */ BOOL PL_ContNext(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int mode) { int num, i, not_played, old_current = pl->current; BOOL ok = 1; pl->curr_deleted = 0; if (!pl->length) return 0; if (BTST(mode, PM_RANDOM)) { not_played = 0; for (i = 0; i < pl->length; i++) if (!pl->entry[i].played) not_played++; if (!not_played) { PL_ClearPlayed(pl); not_played = pl->length; if (BTST(mode, PM_SHUFFLE)) PL_Randomize(pl); if (!BTST(mode, PM_MULTI)) return 0; } num = mikmod_random(not_played) + 1; while (num > 0) { pl->current++; if (pl->current == pl->length) pl->current = 0; if (!pl->entry[pl->current].played) num--; } } else { pl->current++; if (pl->current >= pl->length) { not_played = 0; for (i = 0; i < pl->length; i++) if (!pl->entry[i].played) not_played++; if (!not_played) { PL_ClearPlayed(pl); if (BTST(mode, PM_SHUFFLE)) PL_Randomize(pl); } pl->current = 0; if (!BTST(mode, PM_MULTI)) return 0; } } /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl, &ok, old_current, PL_CONT_NEXT, retfile, retarc, mode)) return ok; if (retfile) *retfile = pl->entry[pl->current].file; if (retarc) *retarc = pl->entry[pl->current].archive; return 1; } BOOL PL_ContPrev(PLAYLIST * pl, CHAR **retfile, CHAR **retarc) { int old_current = pl->current; BOOL ok = 1; pl->curr_deleted = 0; if (!pl->length) return 0; pl->current--; if (pl->current < 0) pl->current = pl->length - 1; /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl, &ok, old_current, PL_CONT_PREV, retfile, retarc, 0)) return ok; if (retfile) *retfile = pl->entry[pl->current].file; if (retarc) *retarc = pl->entry[pl->current].archive; return 1; } BOOL PL_ContPos(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int number) { int old_current = pl->current; BOOL ok = 1; pl->curr_deleted = 0; if ((number < 0) || (number >= pl->length)) return 0; pl->current = number; /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl, &ok, old_current, PL_CONT_POS, retfile, retarc, number)) return ok; if (retfile) *retfile = pl->entry[pl->current].file; if (retarc) *retarc = pl->entry[pl->current].archive; return 1; } void PL_Sort(PLAYLIST * pl, int (*compar) (PLAYENTRY * small, PLAYENTRY * big)) { int i, j; BOOL end = 0; PLAYENTRY tmp; for (i = 0; i < pl->length && !end; i++) { end = 1; for (j = pl->length - 1; j > i; j--) if (compar(&pl->entry[j - 1], &pl->entry[j]) > 0) { tmp = pl->entry[j]; pl->entry[j] = pl->entry[j - 1]; pl->entry[j - 1] = tmp; if (pl->current == j) pl->current = j - 1; else if (pl->current == j - 1) pl->current = j; end = 0; } } } void PL_Randomize(PLAYLIST * pl) { if (pl->length > 1) { int i, target; for (i = 0; i < pl->length - 1; i++) { target = mikmod_random(pl->length - i) + i; if (target != i) { PLAYENTRY temp; temp = pl->entry[i]; pl->entry[i] = pl->entry[target]; pl->entry[target] = temp; /* track selection */ if (pl->current == i) pl->current = target; else if (pl->current == target) pl->current = i; } } } } /* ex:set ts=4: */ mikmod-3.2.8/src/rcfile.h0000644000000000000000000000620012350755760013716 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: rcfile.h,v 1.1.1.1 2004/01/16 02:07:41 raph Exp $ General configuration file management ==============================================================================*/ #ifndef RCFILE_H #define RCFILE_H typedef struct { int id; const char *label; } LABEL_CONV; /* Write argument arg with optional description (multiple lines allowed) and mark it with label. Return: arg successfully written ? */ BOOL rc_write_bool (const char *label, int arg, const char *description); BOOL rc_write_bit (const char *label, int arg, int mask, const char *description); BOOL rc_write_int (const char *label, int arg, const char *description); BOOL rc_write_float (const char *label, float arg, const char *description); BOOL rc_write_label(const char *label, LABEL_CONV *convert, int arg, const char *description); BOOL rc_write_string (const char *label, const char *arg, const char *description); BOOL rc_write_struct (const char *label, const char *description); BOOL rc_write_struct_end (const char *description); /* Read 'value', which is saved in the config-file under label. Change 'value' only if label is present in config-file and associated value is valid. Return: value changed ? */ BOOL rc_read_bool (const char *label, BOOL *value); BOOL rc_read_bit (const char *label, int *value, int mask); BOOL rc_read_int (const char *label, int *value, int min, int max); BOOL rc_read_float (const char *label, float *value, float min, float max); BOOL rc_read_label(const char *label, int *value, LABEL_CONV *convert); BOOL rc_read_struct (const char *label); BOOL rc_read_struct_end (void); /* Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ void rc_set_string (char **value, const char *arg, int length); /* Read a string. Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ BOOL rc_read_string (const char *label, char **value, int length); /* open config-file 'name' and parse the file for following rc_read_...() */ BOOL rc_load (const char *name); /* open config-file 'name' for following rc_write_...() and write a header for program 'prg_name' */ BOOL rc_save (const char *name, const char *prg_name); /* close config-file opened by rc_load() or rc_save() */ void rc_close (void); #endif /* RCFILE_H */ mikmod-3.2.8/src/mikmod.c0000644000000000000000000006616012365204164013731 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mikmod.c,v 1.3 2004/01/30 18:01:40 raph Exp $ Module player which uses the MikMod library as the player engine. ==============================================================================*/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_GETOPT_LONG_ONLY # include #else # include "mgetopt.h" #endif #include #ifndef _WIN32 # include #endif #include #include #include #include #if defined(__OS2__)||defined(__EMX__) # define INCL_DOS # define INCL_KBD # define INCL_DOSPROCESS # include #endif #if defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) # ifdef HAVE_SYS_TIME_H # include # endif # include # include # ifdef __FreeBSD__ # include # endif #endif #if defined(__linux) # ifdef BROKEN_SCHED # define _P __P # endif # include #endif #include #include "player.h" #include "mutilities.h" #include "display.h" #include "rcfile.h" #include "mconfig.h" #include "mlist.h" #include "mlistedit.h" #include "marchive.h" #include "mwindow.h" #include "mdialog.h" #include "mplayer.h" #include "keys.h" #define CFG_MAXCHN 128 /* Long options definition */ static struct option options[] = { /* Output options */ {"driver", required_argument, NULL, 'd'}, {"output", required_argument, NULL, 'o'}, {"frequency", required_argument, NULL, 'f'}, {"interpolate", no_argument, NULL, 'i'}, {"nointerpolate", no_argument, NULL, 1}, {"hqmixer", no_argument, NULL, 2}, {"nohqmixer", no_argument, NULL, 3}, {"surround", no_argument, NULL, 4}, {"nosurround", no_argument, NULL, 5}, {"reverb", required_argument, NULL, 'r'}, /* Playback options */ {"volume", required_argument, NULL, 'v'}, {"fadeout", no_argument, NULL, 'F'}, {"nofadeout", no_argument, NULL, 6}, {"loops", no_argument, NULL, 'l'}, {"noloops", no_argument, NULL, 7}, {"panning", no_argument, NULL, 'a'}, {"nopanning", no_argument, NULL, 8}, {"protracker", no_argument, NULL, 'x'}, {"noprotracker", no_argument, NULL, 9}, /* Loading options */ {"directory", required_argument, NULL, 'y'}, {"curious", no_argument, NULL, 'c'}, {"nocurious", no_argument, NULL, 10}, {"playmode", required_argument, NULL, 'p'}, {"tolerant", no_argument, NULL, 't'}, {"notolerant", no_argument, NULL, 11}, /* Scheduling options */ {"renice", no_argument, NULL, 's'}, {"norenice", no_argument, NULL, 12}, {"realtime", no_argument, NULL, 'S'}, {"norealtime", no_argument, NULL, 12}, /* Display options */ {"quiet", no_argument, NULL, 'q'}, /* Information options */ {"information", optional_argument, NULL, 'n'}, {"drvinfo", required_argument, NULL, 'N'}, {"version", no_argument, NULL, 'V'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; static const CHAR *PRG_NAME; PLAYLIST playlist; CONFIG config; MODULE *mf = NULL; /* current module */ BOOL quiet = 0; /* set if quiet mode is enabled */ typedef enum { STATE_INIT, /* Library not initialised */ STATE_INIT_ERROR, /* Error during MikMod_Init() */ STATE_ERROR, /* Error during MikMod_Reset() */ STATE_READY, /* Player is ready for playing */ STATE_PLAY /* Playing in progess */ } PL_STATE; static struct { PL_STATE state; BOOL quit; /* quit was scheduled */ BOOL listend; /* end of playlist was reached */ BOOL norc; /* don't load default config file */ } status = {STATE_INIT,0,0,0}; /* playlist handling */ static int next = 0; /* 0 or a PL_CONT_xxx code */ static int next_pl_pos = 0; /* for PL_CONT_POS, next pos in playlist */ static int next_sng_pos = 0; /* next pos in module */ static BOOL settime = 1; static int uservolume = 128; /* help text */ #define S_B(b) ((b)?"Yes":"No") static void help(CONFIG * c) { char output[4]; char *conf_name = CF_GetFilename(); puts(mikcopyr); SNPRINTF(output, 4, "%s%c", c->mode_16bit ? "16" : "8", c->stereo ? 's' : 'm'); printf("\n" "Usage: %s [option|-y dir]... [module|playlist]...\n" "\n" "Output options:\n" " -d[river] n,options Use nth driver for output (0: autodetect), default: %d\n" " -o[utput] 8m|8s|16m|16s 8/16 bit output in stereo/mono, default: %s\n" " -f[requency] nnnnn Set mixing frequency, default: %d\n" "* -i[nterpolate] Use interpolate mixing, default: %s\n" "* -hq[mixer] Use high-quality (but slower) software mixer,\n" " default: %s\n" "* -su[rround] Use surround mixing, default: %s\n" " -r[everb] nn Set reverb amount (0-15), default: %d\n" "Playback options:\n" " -v[olume] nn Set volume from 0%% (silence) to 100%%, default: %d%%\n" "* -F, -fa[deout] Force volume fade at the end of module, default: %s\n" "* -l[oops] Enable in-module loops, default: %s\n" "* -a, -pa[nning] Process panning effects, default: %s\n" "* -x, -pr[otracker] Disable extended protracker effects, default: %s\n" "Loading options:\n" " -y, -di[rectory] dir Scan directory recursively for modules\n" "* -c[urious] Look for hidden patterns in module, default: %s\n" " -p[laymode] n Playlist mode (1: loop module, 2: list multi\n" " 4: shuffle list, 8: list random), default: %d\n" "* -t[olerant] Don't halt on file access errors, default: %s\n", PRG_NAME, c->driver, output, c->frequency, S_B(c->interpolate), S_B(c->hqmixer), S_B(c->surround), c->reverb, c->volume, S_B(c->fade), S_B(c->loop), S_B(c->panning), S_B(!c->extspd), S_B(c->curious), c->playmode, S_B(c->tolerant)); #if defined(__OS2__)||defined(__EMX__)||defined(__linux)||defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) #if defined(__OS2__)||defined(__EMX__) printf("Scheduling options:\n"); #else printf("Scheduling options (need root privileges or a setuid root binary):\n"); #endif printf("* -s, -ren[ice] Renice to -20 (more scheduling priority), default: %s\n", (c->renice == RENICE_PRI ? "Yes" : "No" )); #if !defined(__NetBSD__)&&!defined(__OpenBSD__) printf("* -S, -rea[ltime] Get realtime priority (will hog CPU power), default: %s\n", (c->renice == RENICE_REAL ? "Yes" : "No" )); #endif #endif printf("Display options:\n" " -q[uiet] Quiet mode, no interface, displays only errors.\n" "Information options:\n" " -n, -in[formation] List all available drivers and module loaders.\n" " -N n, -drvinfo Print information on a specific driver.\n" " -V -ve[rsion] Display MikMod version.\n" " -h[elp] Display this help screen.\n" "Configuration option:\n" " -norc Don't parse the file '%s' on startup\n" "\n" "Options marked with '*' also exist in negative form (eg -nointerpolate)\n" "F1 or H while playing: Display help panel.\n", conf_name); if (conf_name) free(conf_name); } /* nice exit function */ static void exit_player(int exitcode, const char *message, ...) { va_list args; win_exit(); if (status.state > STATE_INIT) { MikMod_Exit(); status.state = STATE_INIT; } if (message) { va_start(args, message); if (exitcode > 0) vfprintf(stderr, message, args); else if (!quiet) vprintf(message, args); va_end(args); } if (!exitcode && !status.norc) { if (config.save_config) CF_Save(&config); if (config.save_playlist) PL_SaveDefault(&playlist); } printf("\n"); exit(exitcode); } #ifndef _WIN32 /* signal handlers */ static RETSIGTYPE GotoNext(int signum) { next = PL_CONT_NEXT; signal(SIGUSR1, GotoNext); } static RETSIGTYPE GotoPrev(int signum) { next = PL_CONT_PREV; signal(SIGUSR2, GotoPrev); } static RETSIGTYPE ExitGracefully(int signum) { /* can't exit now if playing */ if (status.state == STATE_PLAY) { status.quit = 1; signal(signum, ExitGracefully); } else { win_exit(); if (!quiet) fputs((signum == SIGTERM) ? "Halted by SIGTERM\n" : "Halted by SIGINT\n", stderr); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); exit(0); } } #endif static void Player_SetNextModPos(int pos, int sng_pos) { next_pl_pos = pos; next_sng_pos = sng_pos; next = PL_CONT_POS; } void Player_SetNextMod(int pos) { Player_SetNextModPos(pos, 0); } static void Player_InitLib(void) { long engineversion = MikMod_GetVersion(); if (engineversion < LIBMIKMOD_VERSION) exit_player(2, "The current engine version (%ld.%ld.%ld) is too old.\n" "This programs requires at least version %ld.%ld.%ld\n", (engineversion >> 16) & 255, (engineversion >> 8) & 255, (engineversion) & 255, LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); /* Register the loaders we want to use: */ MikMod_RegisterAllLoaders(); /* Register the drivers we want to use: */ MikMod_RegisterAllDrivers(); } static void set_priority(CONFIG *cfg) { if (cfg->renice == RENICE_PRI) { #if defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) setpriority(PRIO_PROCESS, 0, -20); #endif #ifdef __linux nice(-20); #endif #if defined(__OS2__)||defined(__EMX__) DosSetPriority(PRTYS_PROCESSTREE, PRTYC_NOCHANGE, 20, 0); #endif } else if (cfg->renice == RENICE_REAL) { #ifdef __FreeBSD__ struct rtprio rtp; rtp.type = RTP_PRIO_REALTIME; rtp.prio = 0; rtprio(RTP_SET, 0, &rtp); #endif #ifdef __linux struct sched_param sp; memset(&sp, 0, sizeof(struct sched_param)); sp.sched_priority = sched_get_priority_min(SCHED_RR); sched_setscheduler(0, SCHED_RR, &sp); #endif #if defined(__OS2__)||defined(__EMX__) DosSetPriority(PRTYS_PROCESSTREE, PRTYC_TIMECRITICAL, 20, 0); #endif } } static BOOL cmp_bit (int value, int mask, BOOL cmp) { return (BTST(value, mask)) ? cmp : !cmp; } static void set_bit (UWORD *value, int mask, BOOL boolv) { if (boolv) *value |= mask; else *value &= ~mask; } static void config_error (const char *err, PL_STATE state) { if (quiet) { exit_player (1, "%s: %s.\n", err, MikMod_strerror(MikMod_errno)); } else { if (win_get_panel() != DISPLAY_CONFIG) win_change_panel (DISPLAY_CONFIG); sprintf (storage, "%s:\n %s.\nTry changing the configuration.", err, MikMod_strerror(MikMod_errno)); dlg_message_open (storage, "&Ok", 0, 1, NULL, NULL); status.state = state; } } void Player_SetConfig (CONFIG * cfg) { #if LIBMIKMOD_VERSION >= 0x030107 static char *driveroptions = NULL; #endif BOOL restart = MP_Active() && ( (cfg->frequency != md_mixfreq) || ((cfg->driver) && (cfg->driver != md_device)) || (!cmp_bit(md_mode, DMODE_16BITS, cfg->mode_16bit)) || (!cmp_bit(md_mode, DMODE_STEREO, cfg->stereo)) || (!cmp_bit(md_mode, DMODE_HQMIXER, cfg->hqmixer)) #if LIBMIKMOD_VERSION >= 0x030107 || ( (!driveroptions && cfg->driveroptions) || (driveroptions && strcmp(driveroptions, cfg->driveroptions))) #endif ); PL_STATE oldstate = status.state; if (status.state <= STATE_ERROR) status.state = STATE_READY; #if LIBMIKMOD_VERSION >= 0x030107 if (driveroptions) free(driveroptions); driveroptions = strdup(cfg->driveroptions); #endif md_pansep = 128; /* panning separation (0=mono 128=full stereo) */ md_volume = (cfg->volume * 128) / 100; md_reverb = cfg->reverb; md_device = cfg->driver; md_mixfreq = cfg->frequency; md_mode |= DMODE_SOFT_MUSIC; set_bit (&md_mode, DMODE_INTERP, cfg->interpolate); set_bit (&md_mode, DMODE_HQMIXER, cfg->hqmixer); set_bit (&md_mode, DMODE_SURROUND, cfg->surround); set_bit (&md_mode, DMODE_16BITS, cfg->mode_16bit); set_bit (&md_mode, DMODE_STEREO, cfg->stereo); if (!win_has_colors() && cfg->themes[cfg->theme].color) cfg->theme = THEME_MONO; win_set_theme (&cfg->themes[cfg->theme]); if (restart || oldstate == STATE_ERROR) { int cur = PL_GetCurrentPos(&playlist), pos = 0; if (cur >= 0) { if (mf) pos = mf->sngpos; Player_SetNextModPos(cur, pos); } if (mf) MP_End(); #if LIBMIKMOD_VERSION >= 0x030107 if (MikMod_Reset(cfg->driveroptions)) #else if (MikMod_Reset()) #endif config_error ("MikMod reset error", STATE_ERROR); cfg->frequency = md_mixfreq; } else win_panel_repaint(); win_init_status(cfg->statusbar); if (mf) mf->wrap = (BTST(config.playmode, PM_MODULE) ? 1 : 0); if (oldstate == STATE_INIT || oldstate == STATE_INIT_ERROR) #if LIBMIKMOD_VERSION >= 0x030107 if (MikMod_Init(config.driveroptions)) #else if (MikMod_Init()) #endif config_error ("MikMod initialisation error", STATE_INIT_ERROR); } /* Display the error when loading a file, and take the appropriate resume action */ static void handle_ListError(BOOL tolerant, const CHAR *filename, const CHAR *archive, BOOL mm_error) { char buf[PATH_MAX + 40] = ""; if (!tolerant) { if (mm_error) SNPRINTF(buf, PATH_MAX + 40, "(reason: %s)\n", MikMod_strerror(MikMod_errno)); if (!filename) exit_player(1, "Corrupted playlist, filename is NULL.\n%s", buf); else if (archive) exit_player(1, "MikMod error: can't load \"%s\" from archive \"%s\".\n%s", filename, archive, buf); else exit_player(1, "MikMod error: can't load %s\n%s", filename, buf); } else { if (filename) SNPRINTF(buf, PATH_MAX + 40, "Error loading list entry \"%s\" !", filename); else SNPRINTF(buf, PATH_MAX + 40, "Error loading list entry !"); display_message(buf); PL_DelEntry(&playlist, PL_GetCurrentPos(&playlist)); } } /* parse an integer argument */ static void get_int(const char *arg, int *value, int min, int max) { char *end = NULL; int t = min - 1; if (arg) t = strtol(arg, &end, 10); if (end && (!*end) && (t >= min) && (t <= max)) *value = t; else exit_player(1, mikcopyr "\n\n" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information.\n", arg ? arg : "(not given)", min, max, PRG_NAME); } static void display_driver_help (int drvno) { #define MAX_VALUES 64 char *version, *cmdline, *cmdend, *cur; driver_get_info (drvno, &version, &cmdline); if (!drvno || !version) exit_player (1, "Bad driver ordinal number: %d\n", drvno); printf ("Parameter list for %s:\n", version); free (version); if (!cmdline) { printf (" No arguments with this driver\n"); return; } cmdend = cmdline + strlen (cmdline); cur = cmdline; while (cur < cmdend) { char *tmp, *tmp2, *lineend; char *values [MAX_VALUES]; int nvalues = 0; char valuetype; int i; lineend = strchr (cur, '\n'); if (!lineend) lineend = cur + strlen (cur); *lineend = 0; if (!(tmp = strchr (cur, ':'))) break; *tmp++ = 0; valuetype = *tmp; if (!(tmp = strchr (tmp, ':'))) break; tmp++; if (!(tmp2 = strchr (tmp, ':'))) break; if (valuetype != 't') { while (tmp < tmp2 && nvalues < MAX_VALUES) { values [nvalues++] = tmp; tmp = strchr (tmp, ','); if (tmp && tmp < tmp2) *tmp++ = 0; else break; } } else values [nvalues++] = tmp; tmp = tmp2; *tmp++ = 0; printf (" %s (%s): %s\n", cur, (valuetype == 'c') ? "choice" : (valuetype == 't') ? "text" : (valuetype == 'r') ? "range" : (valuetype == 'b') ? "yes/no" : "unknown", tmp); if (valuetype == 'c' || valuetype == 'r') { printf (" %s:", valuetype == 'c' ? "values" : "range"); for (i = 0; i < nvalues - 1; i++) printf (" %s%c", values [i], i < nvalues - 2 ? ',' : '\n'); } printf (" default value: %s\n", values [nvalues - 1]); cur = lineend + 1; } free (cmdline); } /* handle global keys */ static BOOL player_handle_key(MWINDOW *win, int ch) { BOOL handled = 1; if (ch < 256 && isalpha(ch)) ch = toupper(ch); /* always enabled commands */ switch (ch) { case ' ': /* toggle pause */ MP_TogglePause(); win_panel_repaint(); break; case 'N': next = PL_CONT_NEXT; break; case 'P': next = PL_CONT_PREV; break; case 'Q': status.quit = 1; break; case CTRL_L: #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) case KEY_CLEAR: #endif win_panel_repaint_force(); break; case 'H': win_change_panel(DISPLAY_HELP); break; case 'S': win_change_panel(DISPLAY_SAMPLE); break; case 'I': win_change_panel(DISPLAY_INST); break; case 'M': win_change_panel(DISPLAY_MESSAGE); break; case 'L': win_change_panel(DISPLAY_LIST); break; case 'C': win_change_panel(DISPLAY_CONFIG); break; #if LIBMIKMOD_VERSION >= 0x030200 case 'V': win_change_panel(DISPLAY_VOLBARS); break; case 'F': config.fakevolbars = 1 - config.fakevolbars; break; #endif default: handled = 0; } /* commands which only work when module is not paused */ if (!MP_Paused()) { handled = 1; switch (ch) { case '+': case KEY_RIGHT: Player_NextPosition(); settime = 0; break; case '-': case KEY_LEFT: Player_PrevPosition(); settime = 0; break; case 'R': Player_SetPosition(0); settime = 1; break; case '(': if (mf) Player_SetSpeed(mf->sngspd - 1); settime = 0; break; case ')': if (mf) Player_SetSpeed(mf->sngspd + 1); settime = 0; break; case '{': if (mf) Player_SetTempo(mf->bpm - 1); settime = 0; break; case '}': if (mf) Player_SetTempo(mf->bpm + 1); settime = 0; break; case ';': case ':': md_mode ^= DMODE_INTERP; display_header(); break; case 'U': md_mode ^= DMODE_SURROUND; display_header(); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': Player_SetVolume(uservolume = ((ch - '0') << 7) / 10); break; case '0': Player_SetVolume(uservolume = 128); break; case '<': if (mf && mf->volume) Player_SetVolume(uservolume = mf->volume - 1); break; case '>': if (mf && mf->volume < 128) Player_SetVolume(uservolume = mf->volume + 1); break; default: handled = 0; } } return handled; } static void player_quit(void) { if (status.quit) exit_player(0,NULL); else if (!status.listend) exit_player(1, "MikMod error: %s\n", MikMod_strerror(MikMod_errno)); else exit_player(0,"Finished playlist..."); } static BOOL player_timeout (MWINDOW *win, void *data) { char *filename, *archive; /* exit if quit was scheduled */ if (status.quit) { if (status.state == STATE_PLAY) { MP_End(); Player_Stop(); Player_Free(mf); status.state = STATE_READY; } mf = NULL; player_quit(); } if (status.state >= STATE_READY && (!MP_Active() || next || PL_CurrentDeleted(&playlist)) && (!status.listend || (PL_GetLength(&playlist) > 0))) { /* stop playing */ if (status.state == STATE_PLAY) { MP_End(); if (!BTST(config.playmode, PM_MODULE) && !next && settime) PL_SetTimeCurrent(&playlist, mf->sngtime); PL_SetPlayedCurrent(&playlist); Player_Stop(); Player_Free(mf); status.state = STATE_READY; } mf = NULL; filename = archive = NULL; switch (next) { case 0: case PL_CONT_NEXT: status.listend = !PL_ContNext(&playlist, &filename, &archive, config.playmode); break; case PL_CONT_PREV: status.listend = !PL_ContPrev(&playlist, &filename, &archive); break; case PL_CONT_POS: status.listend = !PL_ContPos(&playlist, &filename, &archive, next_pl_pos); break; } next = 0; settime = 1; if (status.listend && (PL_GetLength(&playlist) > 0 || quiet)) player_quit(); if (!status.listend) { int playfd; FILE *playfile = NULL; char *playname; if (!filename) { handle_ListError(config.tolerant, filename, archive, 0); return 1; } /* load the module */ playfd = MA_dearchive(archive, filename, &playname); if (playfd >= 0) playfile = fdopen (playfd, "rb"); if (playfd < 0 || !playfile) { handle_ListError(config.tolerant, filename, archive, 0); return 1; } display_loadbanner(); mf = Player_LoadFP(playfile, CFG_MAXCHN, config.curious); fclose (playfile); if (playname) { unlink (path_conv_sys(playname)); free (playname); } if (!mf) { handle_ListError(config.tolerant, filename, archive, 1); return 1; } /* start playing */ mf->extspd = config.extspd; mf->panflag = config.panning; mf->wrap = (BTST(config.playmode, PM_MODULE) ? 1 : 0); mf->loop = config.loop; mf->fadeout = config.fade; Player_Start(mf); if (mf->volume > uservolume) Player_SetVolume(uservolume); if (next_sng_pos > 0) { Player_SetPosition(next_sng_pos); settime = 0; next_sng_pos = 0; } MP_Start(); status.state = STATE_PLAY; } display_start(); } MP_Update(); if (config.volrestrict && mf) if (mf->volume > uservolume) MP_Volume(uservolume); /* update the status display... */ display_status(); win_refresh(); return 1; } int main(int argc, char *argv[]) { int t; BOOL use_threads = 0; char *pos = NULL; long engineversion = MikMod_GetVersion(); #ifdef __EMX__ _wildcard(&argc, &argv); #endif /* Find program name without path component */ pos = FIND_LAST_DIRSEP(argv[0]); PRG_NAME = (pos)? pos + 1 : argv[0]; for (t = 0; t < argc; t++) if ((!strcmp(argv[t], "-norc")) || (!strcmp(argv[t], "--norc"))) { status.norc = 1; argv[t][0] = 0; break; } /* Read configuration */ CF_Init(&config); if (!status.norc) CF_Load(&config); /* Initialize libmikmod */ Player_InitLib(); /* Setup playlist */ PL_InitList(&playlist); /* Parse commandline */ opterr = 0; while ((t = getopt_long_only(argc, argv, "d:o:f:r:v:y:p:iFlaxctsSqn::N:Vh", options, NULL)) != -1) { switch (t) { case 'd': /* -d --driver */ #if LIBMIKMOD_VERSION >= 0x030107 if (strlen(optarg) > 2) { char *opts = strchr(optarg, ','); if (opts) { *opts = 0; /* numeric driver specification ? */ if (opts - optarg <= 2) get_int(optarg, &config.driver, 0, 999); else config.driver = MikMod_DriverFromAlias(optarg); rc_set_string(&config.driveroptions, ++opts, 99); } else config.driver = MikMod_DriverFromAlias(optarg); } else #endif get_int(optarg, &config.driver, 0, 999); break; case 'o': /* -o --output */ for (pos = optarg; pos && *pos; pos++) switch (toupper((int)*pos)) { case '1': case '6': config.mode_16bit = 1; break; case '8': config.mode_16bit = 0; break; case 'S': config.stereo = 1; break; case 'M': config.stereo = 0; break; } break; case 'f': /* -f --frequency */ get_int(optarg, &config.frequency, 4000, 60000); break; case 'i': /* -i --interpolate */ config.interpolate = 1; break; case 1: /* --nointerpolate */ config.interpolate = 0; break; case 2: /* --hqmixer */ config.hqmixer = 1; break; case 3: /* --nohqmixer */ config.hqmixer = 0; break; case 4: /* --surround */ config.surround = 1; break; case 5: /* --nosurround */ config.surround = 0; break; case 'r': /* -r --reverb */ get_int(optarg, &config.reverb, 0, 15); break; case 'v': /* -v --volume */ get_int(optarg, &config.volume, 0, 100); break; case 'F': /* -F --fadeout */ config.fade = 1; break; case 6: /* --nofadeout */ config.fade = 0; break; case 'l': /* -l --loops */ config.loop = 1; break; case 7: /* --noloops */ config.loop = 0; break; case 'a': /* -a --panning */ config.panning = 1; break; case 8: /* --nopanning */ config.panning = 0; break; case 'x': /* -x --protracker */ config.extspd = 0; break; case 9: /* --noprotracker */ config.extspd = 1; break; case 'y': /* -y --directory */ path_conv(optarg); list_scan_dir (optarg,quiet); break; case 'c': /* -c --curious */ config.curious = 1; break; case 10: /* --nocurious */ config.curious = 0; break; case 'p': /* -p --playmode */ get_int(optarg, &config.playmode, 0, PM_MODULE | PM_MULTI | PM_SHUFFLE | PM_RANDOM); break; case 't': /* -t --tolerant */ config.tolerant = 1; break; case 11: /* --notolerant */ config.tolerant = 0; break; case 's': /* -s --renice */ config.renice = RENICE_PRI; break; case 'S': /* -S --realtime */ config.renice = RENICE_REAL; break; case 12: /* --norenice --norealtime */ config.renice = RENICE_NONE; break; case 'q': /* -q --quiet */ quiet = 1; break; case 'n': /* -n --information */ if (optarg) { int drvno; get_int(optarg, &drvno, 1, 99); puts(mikcopyr); display_driver_help(drvno); } else { puts(mikcopyr); printf("Sound engine version %ld.%ld.%ld\n", (engineversion >> 16) & 255, (engineversion >> 8) & 255, (engineversion) & 255); printf("\nAvailable drivers are :\n%s\n" "\nRecognized module formats are :\n%s\n", MikMod_InfoDriver(), MikMod_InfoLoader()); } exit(0); case 'N': { int drvno; get_int(optarg, &drvno, 1, 99); puts(mikcopyr); display_driver_help(drvno); exit(0); } case 'V': /* --version */ puts(mikcopyr); printf("Sound engine version %ld.%ld.%ld\n", (engineversion >> 16) & 255, (engineversion >> 8) & 255, (engineversion) & 255); exit(0); case 'h': /* -h --help */ help(&config); exit(0); default: /* ignore errors */ break; } } set_priority(&config); /* Add remaining parameters to the playlist */ for (t = optind; t < argc; t++) { if (!quiet) { printf("\rScanning files... %c (%d left) ", ("/-\\|")[t & 3], argc - t); fflush(stdout); } path_conv(argv[t]); MA_FindFiles(&playlist, argv[t]); } if (!PL_GetLength(&playlist) && !status.norc) PL_LoadDefault(&playlist); PL_DelDouble(&playlist); if (BTST(config.playmode, PM_SHUFFLE)) PL_Randomize(&playlist); PL_InitCurrent(&playlist); if (!quiet) puts(mikbanner); /* initialize interface */ win_init(quiet); display_init(); Player_SetConfig(&config); use_threads = MP_Init(); #ifndef _WIN32 signal(SIGTERM, ExitGracefully); signal(SIGINT, ExitGracefully); #if defined(__linux) if (!use_threads) #endif { signal(SIGUSR1, GotoNext); signal(SIGUSR2, GotoPrev); } #endif if (!quiet) win_panel_set_handle_key(DISPLAY_ROOT, player_handle_key); win_timeout_add (5, player_timeout, NULL); win_run(); return 0; /* never reached */ } /* ex:set ts=4: */ mikmod-3.2.8/src/mconfig.h0000644000000000000000000001655012276756040014104 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mconfig.h,v 1.3 2004/01/29 03:09:23 raph Exp $ Configuration file management ==============================================================================*/ #ifndef MCONFIG_H #define MCONFIG_H #include #include "rcfile.h" #define RENICE_NONE 0 #define RENICE_PRI 1 #define RENICE_REAL 2 /*========== Color and attribute definitions */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define A_REVERSE 0x70 #define A_NORMAL 0x07 #define A_BOLD 0x0f #endif #define COLOR_BLACK_B 0x00 #define COLOR_BLUE_B 0x10 #define COLOR_GREEN_B 0x20 #define COLOR_CYAN_B 0x30 #define COLOR_RED_B 0x40 #define COLOR_MAGENTA_B 0x50 #define COLOR_BROWN_B 0x60 #define COLOR_GRAY_B 0x70 #define COLOR_BMASK 0x70 #define COLOR_BSHIFT 4 #define COLOR_BLACK_F 0x00 #define COLOR_BLUE_F 0x01 #define COLOR_GREEN_F 0x02 #define COLOR_CYAN_F 0x03 #define COLOR_RED_F 0x04 #define COLOR_MAGENTA_F 0x05 #define COLOR_BROWN_F 0x06 #define COLOR_GRAY_F 0x07 #define COLOR_DGRAY_F 0x08 #define COLOR_LBLUE_F 0x09 #define COLOR_LGREEN_F 0x0a #define COLOR_LCYAN_F 0x0b #define COLOR_LRED_F 0x0c #define COLOR_LMAGENTA_F 0x0d #define COLOR_YELLOW_F 0x0e #define COLOR_WHITE_F 0x0f #define COLOR_FMASK 0x07 #define COLOR_FSHIFT 0 #define COLOR_BOLDMASK 0x08 #define COLOR_CNT 8 /* These are the color table indices for win_attrset(); to the right in comment brackets are the default values for monochrome palette */ typedef enum { ATTR_NONE=-1, ATTR_WARNING, /* A_REVERSE */ ATTR_TITLE, /* A_REVERSE */ ATTR_BANNER, /* A_NORMAL */ ATTR_SONG_STATUS, /* A_NORMAL */ ATTR_INFO_INACTIVE, /* A_REVERSE */ ATTR_INFO_ACTIVE, /* A_NORMAL */ ATTR_INFO_IHOTKEY, /* A_NORMAL */ ATTR_INFO_AHOTKEY, /* A_NORMAL */ ATTR_HELP, /* A_NORMAL */ ATTR_PLAYENTRY_INACTIVE,/* A_NORMAL */ ATTR_PLAYENTRY_ACTIVE, /* A_REVERSE */ ATTR_SAMPLES, /* A_NORMAL */ ATTR_SAMPLES_KICK3, /* A_BOLD */ ATTR_SAMPLES_KICK2, /* A_NORMAL */ ATTR_SAMPLES_KICK1, /* A_NORMAL */ ATTR_SAMPLES_KICK0, /* A_NORMAL */ ATTR_CONFIG, /* A_NORMAL */ ATTR_VOLBAR, /* A_NORMAL */ ATTR_VOLBAR_LOW, /* A_NORMAL */ ATTR_VOLBAR_MED, /* A_NORMAL */ ATTR_VOLBAR_HIGH, /* A_BOLD */ ATTR_VOLBAR_INSTR, /* A_NORMAL */ ATTR_MENU_FRAME, /* A_REVERSE */ ATTR_MENU_INACTIVE, /* A_REVERSE */ ATTR_MENU_ACTIVE, /* A_NORMAL */ ATTR_MENU_IHOTKEY, /* A_NORMAL */ ATTR_MENU_AHOTKEY, /* A_REVERSE */ ATTR_DLG_FRAME, /* A_REVERSE */ ATTR_DLG_LABEL, /* A_REVERSE */ ATTR_DLG_STR_TEXT, /* A_NORMAL */ ATTR_DLG_STR_CURSOR, /* A_REVERSE */ ATTR_DLG_BUT_INACTIVE, /* A_REVERSE */ ATTR_DLG_BUT_ACTIVE, /* A_BOLD */ ATTR_DLG_BUT_IHOTKEY, /* A_NORMAL */ ATTR_DLG_BUT_AHOTKEY, /* A_REVERSE */ ATTR_DLG_BUT_ITEXT, /* A_REVERSE */ ATTR_DLG_BUT_ATEXT, /* A_BOLD */ ATTR_DLG_LIST_FOCUS, /* A_BOLD */ ATTR_DLG_LIST_NOFOCUS, /* A_NORMAL */ ATTR_STATUS_LINE, /* A_NORMAL */ ATTR_STATUS_TEXT /* A_NORMAL */ } ATTRS; #define ATTRS_COUNT ((int)ATTR_STATUS_TEXT+1) #define THEME_COLOR 0 #define THEME_MONO 1 #define THEME_COUNT 2 /* number of program intern themes */ #define THEME_NAME_LEN 99 /* max length of theme name */ extern const char *attrs_label[ATTRS_COUNT]; /* "WARNING", "TITLE", ... */ typedef struct { char *name; /* name of the theme */ BOOL color; /* color or mono */ int *attrs; /* attributes for the different screen elements */ } THEME; typedef struct { int location; /* if < 0, file extensions are checked */ char *marker; /* signature or possible file extensions */ char *list; int nameoffset; /* position of file name in list output */ char *extract; char *skippat; int skipstart, skipend; /* lines to skip in the extracted file */ } ARCHIVE; typedef struct { int driver; /* nth driver for output */ #if LIBMIKMOD_VERSION >= 0x030107 char *driveroptions; #endif BOOL stereo; /* mono/stereo output */ BOOL mode_16bit; /* 8/16 bit output */ int frequency; /* mixing frequency */ BOOL interpolate; /* Use interpolate mixing */ BOOL hqmixer; /* Use high-quality (but slow) mixer */ BOOL surround; /* surround mixing */ int reverb; /* reverb amount (0-15) */ int volume; /* volume from 0% (silence) to 100% */ BOOL volrestrict; /* restrict playervolume to volume supplied by user */ BOOL fade; /* allow volume fade at the end of the module */ BOOL loop; /* allow in-module loops */ BOOL panning; /* process panning effects */ BOOL extspd; /* extended protracker effects */ int playmode; /* PM_MODULE | PM_MULTI | PM_SHUFFLE | PM_RANDOM */ BOOL curious; /* look for hidden patterns in module */ BOOL tolerant; /* don't halt on file access errors */ int renice; /* RENICE_xxx */ int statusbar; /* size of statusbar */ BOOL save_config; /* save config on exit */ BOOL save_playlist; /* save playlist on exit */ char *pl_name; /* current playlist name */ int cnt_hotlist; /* size of next entry */ char **hotlist; /* entries in the directory hotlist */ BOOL fullpaths; /* display full path of the filenames */ #if LIBMIKMOD_VERSION >= 0x030200 BOOL forcesamples; /* always display sample names in bars panel */ BOOL fakevolbars; /* display fast, not accurate, volume bars */ #endif BOOL window_title; /* set the title in xterm (or equivalent) */ int theme; /* active theme */ int cnt_themes; /* size of next entry */ THEME *themes; /* the known themes (color definitions) */ int cnt_archiver; /* size of next entry */ ARCHIVE *archiver; /* definition of archivers (lha tar, ...) */ } CONFIG; extern CONFIG config; char *CF_GetFilename(void); void CF_theme_free (THEME *theme); void CF_theme_copy (THEME*dest, THEME *src); /* Free all themes and return {NULL, 0} */ void CF_themes_free (THEME **themes, int *cnt); /* Free the user themes (themes above THEME_COUNT) */ void CF_themes_free_user (THEME **themes, int *cnt); /* Free the theme at 'pos' in the array themes (length: cnt) */ void CF_theme_remove (int pos, THEME **themes, int *cnt); /* Copy theme and insert it alphabetically sorted in themes (after the intern themes). cnt: size of the array themes Return: position of insertion */ int CF_theme_insert (THEME **themes, int *cnt, THEME *theme); void CF_string_array_insert (int pos, char ***value, int *cnt, char *arg, int length); void CF_string_array_remove (int pos, char ***value, int *cnt); void CF_Init(CONFIG * cfg); BOOL CF_Save(CONFIG * cfg); BOOL CF_Load(CONFIG * cfg); void Player_SetConfig(CONFIG * cfg); #endif /* ex:set ts=4: */ mikmod-3.2.8/src/musleep.c0000644000000000000000000000455610001643550014113 0ustar rootroot/* * NAME: * usleep -- This is the precision timer for Test Set * Automation. It uses the select(2) system * call to delay for the desired number of * micro-seconds. This call returns ZERO * (which is usually ignored) on successful * completion, -1 otherwise. * * ALGORITHM: * 1) We range check the passed in microseconds and log a * warning message if appropriate. We then return without * delay, flagging an error. * 2) Load the Seconds and micro-seconds portion of the * interval timer structure. * 3) Call select(2) with no file descriptors set, just the * timer, this results in either delaying the proper * ammount of time or being interupted early by a signal. * * HISTORY: * Added when the need for a subsecond timer was evident. * Modified for Solaris-specific bits by SAM 24/10/96 * AUTHOR: * Michael J. Dyer Telephone: AT&T 414.647.4044 * General Electric Medical Systems GE DialComm 8 *767.4044 * P.O. Box 414 Mail Stop 12-27 Sect'y AT&T 414.647.4584 * Milwaukee, Wisconsin USA 53201 8 *767.4584 * internet: mike@sherlock.med.ge.com GEMS WIZARD e-mail: DYER */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef HAVE_SYS_TIME_H #include #endif #include #include int usleep_new(unsigned long microSeconds) { unsigned int Seconds, uSec; int nfds; struct timeval Timer; #if (defined(SOLARIS) || (defined(SGI))) fd_set readfds, writefds, exceptfds; nfds = 0; FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); #else int readfds, writefds, exceptfds; nfds = readfds = writefds = exceptfds = 0; #endif if ((microSeconds == (unsigned long)0) || microSeconds > (unsigned long)4000000) { errno = ERANGE; /* value out of range */ perror("usleep time out of range ( 0 -> 4000000 ) "); return -1; } Seconds = microSeconds / (unsigned long)1000000; uSec = microSeconds % (unsigned long)1000000; Timer.tv_sec = Seconds; Timer.tv_usec = uSec; if (select(nfds, &readfds, &writefds, &exceptfds, &Timer) < 0) { perror("usleep (select) failed"); return -1; } return 0; } mikmod-3.2.8/src/marchive.h0000644000000000000000000000414012364127454014247 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: marchive.h,v 1.1.1.1 2004/01/16 02:07:32 raph Exp $ Archive support ==============================================================================*/ #ifndef MARCHIVE_H #define MARCHIVE_H #include "mlist.h" #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32)&&!defined(_mikmod_amiga) /* Drop all root privileges we might have. */ BOOL DropPrivileges (void); #endif /* Extracts the file 'file' from the archive 'arc'. Return a file descriptor to the extracted file. If the file could not be unlinked (e.g. under Windows an open file can not be unlinked), return its name in 'extracted'. */ int MA_dearchive (const CHAR *arc, const CHAR *file, CHAR **extracted); /* Test if filename looks like a module or an archive playlist==1: also test against a playlist deep==1 : use Player_LoadTitle() for testing against a module, otherwise test based on the filename */ #if LIBMIKMOD_VERSION < 0x030302 BOOL MA_TestName (char *filename, BOOL playlist, BOOL deep); #else BOOL MA_TestName (const char *filename, BOOL playlist, BOOL deep); #endif /* Examines file 'filename' to add modules to the playlist 'pl'. */ void MA_FindFiles (PLAYLIST * pl, const CHAR *filename); #endif /* ex:set ts=4: */ mikmod-3.2.8/src/os2video.inc0000644000000000000000000000646513040414034014522 0ustar rootroot/* MikMod module player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== OS/2 console i/o routines ==============================================================================*/ static HVIO hvio = 0; static VIOCURSORINFO viocursorinfo; static BYTE clearscreen [2] = { ' ', A_NORMAL }; static BYTE mvattr = A_NORMAL; #define attrset(a) mvattr = a void clear(void) { /* overwrite entire screen with 0s */ clearscreen [1] = mvattr; VioWrtNCell(clearscreen, winy * winx, 0, 0, hvio); } void mvaddnstr(int y,int x,const char *str,int len) { char buffer[STORAGELEN]; int l=strlen(str); strncpy(buffer,str,len); if (lwidth-x>0) { clearscreen[1] = mvattr; VioWrtNCell(clearscreen, win->width - x, win->y + y, win->x + x, hvio); } } #ifdef __EMX__ static int _mik_kbhit(void) { KBDKEYINFO k; if (KbdPeek(&k, 0)) return 0; return (k.fbStatus & KBDTRF_FINAL_CHAR_IN); } #else #define _mik_kbhit kbhit #endif static int win_getch(void) { int c = 0; if (_mik_kbhit()) { c = getch(); if ((!c) || (c == 0xe0)) c = 0x100 | getch(); } return c; } mikmod-3.2.8/src/winvideo.inc0000644000000000000000000002133712350755760014630 0ustar rootroot/* MikMod module player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: winvideo.inc,v 1.1.1.1 2004/01/16 02:07:45 raph Exp $ Windows console i/o routines ==============================================================================*/ #include struct SCREEN { WORD act_attr; char *changed; CHAR_INFO *text; SHORT minx,miny,maxx,maxy; } screen = {A_NORMAL, NULL, NULL, 0, 0, 0, 0}; static HANDLE WINAPI GetConHandle (const TCHAR *name) { SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; return CreateFile (name, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, &sa, OPEN_EXISTING, (DWORD) 0, (HANDLE) 0); } #define GetConOut() GetConHandle(TEXT("CONOUT$")) #define GetConIn() GetConHandle(TEXT("CONIN$")) static void console_store (BOOL restore) { HANDLE conOut; COORD bufSize, bufOrg; SMALL_RECT srSource; static int oldx = -1, oldy = -1; static CHAR_INFO *screen_content = NULL; if (!restore && (oldx!=winx || oldy!=winy)) { screen_content = (CHAR_INFO *) realloc(screen_content, sizeof(CHAR_INFO)*winx*winy); oldx = winx; oldy = winy; } if (!screen_content) return; conOut = GetConOut(); if (conOut == INVALID_HANDLE_VALUE) return; srSource.Left = screen.minx; srSource.Top = screen.miny; srSource.Right = screen.maxx; srSource.Bottom = screen.maxy; bufSize.X = srSource.Right - srSource.Left + 1; bufSize.Y = srSource.Bottom - srSource.Top + 1; bufOrg.X = 0; bufOrg.Y = 0; if (restore) WriteConsoleOutput (conOut, screen_content, bufSize, bufOrg, &srSource); else ReadConsoleOutput (conOut, screen_content, bufSize, bufOrg, &srSource); CloseHandle (conOut); } static void console_get_size (SHORT *minx, SHORT *miny, SHORT *maxx, SHORT *maxy) { HANDLE conOut; CONSOLE_SCREEN_BUFFER_INFO bufInfo; conOut = GetConOut(); if (conOut != INVALID_HANDLE_VALUE) { if (GetConsoleScreenBufferInfo (conOut, &bufInfo)) { *minx = bufInfo.srWindow.Left; *miny = bufInfo.srWindow.Top; *maxx = bufInfo.srWindow.Right; *maxy = bufInfo.srWindow.Bottom; } CloseHandle (conOut); } } static void screen_alloc (void) { int oldx = screen.maxx-screen.minx+1; int oldy = screen.maxy-screen.miny+1; int x, y; console_get_size (&screen.minx, &screen.miny, &screen.maxx, &screen.maxy); winx = screen.maxx-screen.minx+1; winy = screen.maxy-screen.miny+1; screen.changed = (char *) realloc (screen.changed, winx*winy); screen.text = (CHAR_INFO *) realloc(screen.text, sizeof(CHAR_INFO)*winx*winy); for (y=0; y=winy) return; if (x<0) { str -= x; len += x; x = 0; } d = y*winx+x; for (i=0; iwidth - x; if (len > 0) { memset(storage, ' ', len); mvaddnstr(win->y + y, win->x + x, storage, len); } } void gotoxy (int x, int y) { HANDLE conOut; COORD coord; conOut = GetConOut(); if (conOut != INVALID_HANDLE_VALUE) { coord.X = screen.minx + x; coord.Y = screen.miny + y; SetConsoleCursorPosition (conOut, coord); CloseHandle (conOut); } } void win_cursor_set(BOOL visible) { HANDLE conOut; CONSOLE_CURSOR_INFO cci; conOut = GetConOut(); if (conOut != INVALID_HANDLE_VALUE) { GetConsoleCursorInfo (conOut, &cci); cci.bVisible = visible; SetConsoleCursorInfo (conOut, &cci); CloseHandle (conOut); } } void win_refresh(void) { int x, y, d, start; HANDLE conOut; COORD bufSize, bufOrg; SMALL_RECT srDest; conOut = GetConOut(); if (conOut == INVALID_HANDLE_VALUE) return; for (y=0; y=winx) break; d--; x = start; while (screen.changed[++d] && x 0) { ReadConsoleInputA (conIn, &input, 1, &nread); if (input.EventType == KEY_EVENT && input.Event.KeyEvent.bKeyDown) { KEY_EVENT_RECORD *key = &input.Event.KeyEvent; if (key->uChar.AsciiChar > 0) { ch = key->uChar.AsciiChar; } else { DWORD control = key->dwControlKeyState & ~CAPSLOCK_ON; ch = 0x100 | key->wVirtualScanCode; if (control == SHIFT_PRESSED && (ch >= KEY_F(1) && ch <= KEY_F(10))) { ch = KEY_SF(1) + ch - KEY_F(1); } else if ((control & ENHANCED_KEY) || control == 0) { if (key->wVirtualScanCode == 83) ch = KEY_DC; } else ch = 0; } } else if (input.EventType == WINDOW_BUFFER_SIZE_EVENT) { /* new size: input.Event.WindowBufferSizeEvent.dwSize.{X|Y} */ resize_window(); } GetNumberOfConsoleInputEvents (conIn, &nevents); } CloseHandle (conIn); return ch; } mikmod-3.2.8/src/mwindow.h0000644000000000000000000001375412361532174014144 0ustar rootroot/* MikMod module player (c) 1998-2014 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: mwindow.h,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Some window functions ==============================================================================*/ #ifndef MWINDOW_H #define MWINDOW_H #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) # ifdef HAVE_NCURSES_H # include # elif defined HAVE_CURSES_H # include # elif defined HAVE_NCURSES_CURSES_H # include # endif # define MIK_CURSES_ERROR ERR #else # define MIK_CURSES_ERROR (-1) #endif #include #include "mconfig.h" typedef struct MWINDOW { int x, y, width, height; /* Inner pos. and size */ ATTRS attrs; /* Window attributes, used for border */ /* and win_clear() */ BOOL border; /* Has window a border? */ BOOL resize; /* Window is automatically resized */ char *title; BOOL (*repaint) (struct MWINDOW * win); BOOL (*handle_key) (struct MWINDOW * win, int ch); void (*handle_resize) (struct MWINDOW * win, int dx, int dy); struct MWINDOW *next; void *data; /* not used by window functions */ } MWINDOW; /* return: 1: continue repaint with other windows 0: cancel repaint (if a new repaint was scheduled in the repaint func,e.g. by win_change_panel() */ typedef BOOL (*WinRepaintFunc) (MWINDOW *win); /* return: 1: key was handled */ typedef BOOL (*WinKeyFunc) (MWINDOW *win, int ch); /* dx,dy: amount of window size change */ typedef void (*WinResizeFunc) (MWINDOW *win, int dx, int dy); /* called on a timeout, timeout is removed if 0 is returned */ typedef BOOL (*WinTimeoutFunc) (MWINDOW *win, void *data); /* init window functions (e.g. init curses) */ void win_init(BOOL quiet); /* clean up (e.g. exit curses) */ void win_exit(void); /* Does the terminal support colors? */ BOOL win_has_colors(void); /* set the attribute translation table */ void win_set_theme (THEME *new_theme); /* open new window on current panel */ MWINDOW *win_open(int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs); /* open new window on panel 'panel' */ MWINDOW *win_panel_open(int dst_panel, int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs); /* set function which should be called on a repaint request */ void win_set_repaint(WinRepaintFunc func); void win_panel_set_repaint(int panel, WinRepaintFunc func); /* set function which sould be called on a key press */ void win_set_handle_key(WinKeyFunc func); void win_panel_set_handle_key(int panel, WinKeyFunc func); /* should window be automatically resized? should a function be called on resize? */ void win_set_resize(BOOL auto_resize, WinResizeFunc func); void win_panel_set_resize(int panel, BOOL auto_resize, WinResizeFunc func); /* set private data */ void win_set_data(void *data); void win_panel_set_data(int panel, void *data); /* close window win */ void win_close(MWINDOW * win); /* repaint the whole panel */ void win_panel_repaint(void); /* repaint the whole panel, clear whole panel before */ void win_panel_repaint_force(void); /* init the status line (height=0,1,2 0: no status line) */ void win_init_status(int height); /* set the status line */ void win_status(const char *msg); /* clear to end of line on window win */ void win_clrtoeol(MWINDOW *win, int x, int y); /* clear window win */ BOOL win_clear(MWINDOW *win); /* get size of window win */ void win_get_size(MWINDOW *win, int *x, int *y); /* get maximal size of a new window without a border and therefore the needed minimal y position */ void win_get_size_max(int *y, int *width, int *height); /* get uppermost window */ MWINDOW *win_get_window(void); /* get root window */ MWINDOW *win_get_window_root(void); /* print string in window win */ void win_print(MWINDOW *win, int x, int y, const char *str); /* draw horizontal/verticall line */ void win_line(MWINDOW *win, int x1, int y1, int x2, int y2); /* draw a box with colored background back: background colors from UL UR LR LL to UL */ void win_box_color(MWINDOW *win, int x1, int y1, int x2, int y2, ATTRS *back); /* draw a box */ void win_box(MWINDOW *win, int x1, int y1, int x2, int y2); /* set attribute for the following output operations, "attrs" is an index into the theme->attr translation table */ void win_attrset(ATTRS attrs); ATTRS win_get_theme_color (ATTRS attrs); /* set color for the following output operations */ void win_set_color(ATTRS attrs); void win_set_forground(ATTRS fg); void win_set_background(ATTRS bg); void win_cursor_set(BOOL visible); /* update window -> call curses.refresh() */ void win_refresh(void); /* change current panel */ void win_change_panel(int new_panel); /* return current panel */ int win_get_panel(void); /* handle key press (panel change and call of key handler of uppermost window), return: was key handled */ BOOL win_handle_key(int ch); /* add a new timeout function called approx. every interval ms */ void win_timeout_add (int interval, WinTimeoutFunc func, void *data); /* Handle scheduled timeouts and up to one key press, return 1 if key presses are pending. */ BOOL win_main_iteration(void); /* main event handling routine, does NOT return */ void win_run(void); #endif /* MWINDOW_H */ mikmod-3.2.8/mikmod.lsm0000644000000000000000000000116013071724104013474 0ustar rootrootBegin3 Title: MikMod module player Version: 3.2.8 Entered-date: no date yet Description: MikMod is a full-featured GPL module player based on the libmikmod Description: sound library. Keywords: mikmod player digital music sound audio Keywords: mod s3m xm mtm stm it ult dsm med 669 far med amf gdm alsa esd Author: (Many - see file AUTHORS for complete list) Maintained-by: O.Sezer Primary-site: http://mikmod.sourceforge.net/ Alternate-site: none Platforms: AIX, DOS, FreeBSD, HP-UX, IRIX, Linux, OSF/1, OS/2, NetBSD, Platforms: OpenBSD, Mac OS X, Solaris... more on request ! Copying-policy: GPL End mikmod-3.2.8/INSTALL0000644000000000000000000000303612350764324012543 0ustar rootrootINSTALL file for mikmod ======================= COMPILE USING CMAKE : ===================== Mikmod versions 3.2.5 and newer support CMake. CMake version 2.8.x or later is required. CMake homepage is at http://www.cmake.org/ . Run: mkdir build cd build cmake-gui .. # For the GUI configuration applet Or: mkdir build cd build ccmake .. # For the Curses-based configuration applet With a fallback to: mkdir build cd build cmake .. # Non-interactive application. You need libmikmod compiled and installed on your system. For installing under windows, consult the CMake documentation for generating a Visual C, MinGW, etc. compatible makefile or project. COMPILE USING CONFIGURE / AUTOTOOLS : ===================================== In most systems just run: $ ./configure $ make You need GNU make. On BSD or SysV systems, you may need to use gmake instead of make. Use ./configure --help to see configuration options. You need libmikmod compiled and installed on your system. To install mikmod, run "make install" as the superuser. To cross-compile, you will need to use the --host option of configury. For example: $ ./configure --host=powerpc-apple-darwin9 # for Mac OS X (powerpc) $ ./configure --host=i686-pc-mingw32 # for Windows (win32) $ ./configure --host=x86_64-w64-mingw32 # for Windows (win64) We also provide standalone makefiles for Windows, Mac OS X, DJGPP (DOS) which you can use for both compiling on the relevant native system, or for cross-compiling. mikmod-3.2.8/configure.ac0000644000000000000000000001615713071724104014001 0ustar rootrootdnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.59]) AC_INIT([mikmod],[3.2.8]) AC_CONFIG_AUX_DIR([autotools]) AM_INIT_AUTOMAKE([1.7 foreign]) AC_CONFIG_SRCDIR([src/mikmod.c]) AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE AC_CANONICAL_HOST dnl ============================================================== dnl mikmod specific control variables and their default values. dnl ============================================================== mikmod_threads=yes dnl ========================= dnl Configure script options. dnl ========================= AC_ARG_ENABLE([threads],[AS_HELP_STRING([--enable-threads],[use an own thread for the player [default=guessed]])], [if test "$enableval" = "yes" then mikmod_threads=yes else mikmod_threads=no fi]) dnl ==================== dnl Checks for programs. dnl ==================== AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl ================================= dnl Use -Wall warning level with gcc. dnl ================================= if test $ac_cv_prog_gcc = yes ; then CFLAGS="$CFLAGS -Wall" fi dnl ============================================================== dnl Checks for typedefs, structures, and compiler characteristics. dnl ============================================================== AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T dnl ======================== dnl Checks for header files. dnl ======================== AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h unistd.h) AC_CHECK_HEADERS(fnmatch.h) AC_CHECK_HEADERS(sched.h) AC_CHECK_HEADERS(ncurses.h curses.h ncurses/curses.h) AC_CHECK_HEADERS(termios.h) AC_HEADER_TIOCGWINSZ dnl Checks for bogus Linux old libc5 sched.h case "$host_os" in linux*) AC_MSG_CHECKING([whether sched.h is correct]) AC_TRY_COMPILE([#include ], [sched_yield();], broken_sched=no, broken_sched=yes) if test "$broken_sched" = "yes" then AC_DEFINE(BROKEN_SCHED, 1, [Define if your copy of has a _P instead of __P (old Linux libc5).]) AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi ;; esac dnl ===================== dnl Checks for libraries. dnl ===================== dnl libmikmod AM_PATH_LIBMIKMOD(3.1.5, , AC_MSG_ERROR([ --- ERROR: No suitable libmikmod library found. You need at least libmikmod 3.1.5 for this program to work. ])) # MikMod_free() is in libmikmod-3.2.0b3 and later. The only fool-proof # way of detecting MikMod_free() is a configury check at compile time # or a dlsym() check at runtime, and the bad thing is 3.2.0beta1/2 were # (still are?) in distros.. ac_save_LIBS=$LIBS LIBS="$LIBS $LIBMIKMOD_LIBS" AC_CHECK_LIB(mikmod, MikMod_free, AC_DEFINE(HAVE_MIKMOD_FREE, 1, [Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2).])) LIBS="$ac_save_LIBS" dnl ncurses case $host_os in mingw*|emx*|*djgpp) need_curses=no ;; *) need_curses=yes ;; esac if test "$need_curses" = "yes" ; then AC_CHECK_LIB([ncurses], [initscr], [libcurses=ncurses], AC_CHECK_LIB([curses], [initscr], [libcurses=curses], AC_MSG_ERROR([--- ERROR: No curses library found.]))) AC_CHECK_LIB([tinfo], [tgetflag], [have_tinfo=yes], [have_tinfo=no]) dnl resizeterm is an optional part of ncurses AC_CHECK_LIB($libcurses, resizeterm, AC_DEFINE(HAVE_NCURSES_RESIZETERM, 1, [Define if your libncurses defines resizeterm (not found in <4.2).])) ac_save_LIBS=$LIBS LIBS="$LIBS -l$libcurses" AC_MSG_CHECKING([whether curses links without libtinfo]) AC_TRY_LINK([#ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #elif defined(HAVE_NCURSES_CURSES_H) #include #endif], [#ifdef ACS_ULCORNER return ACS_ULCORNER; #endif], [need_tinfo=no], [need_tinfo=yes] ) if test "$need_tinfo" = "yes" ; then AC_MSG_RESULT(no) if test "$have_tinfo" = "no" ; then AC_MSG_ERROR([--- ERROR: libtinfo needed for ncurses, but not found.]) else AC_MSG_CHECKING([whether ncurses links with libtinfo]) LIBS="$LIBS -ltinfo" AC_TRY_LINK([#ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #endif], [#ifdef ACS_ULCORNER return ACS_ULCORNER; #endif], AC_MSG_RESULT(yes), AC_MSG_ERROR([--- ERROR: failed linking to ncurses library.]) ) fi else AC_MSG_RESULT(yes) fi LIBS="$ac_save_LIBS" fi dnl POSIX.4 threads dnl --------------- case "$host_os" in # mikmod_threads variable is for pthreads only mingw*|amigaos*|aros*|morphos*) mikmod_threads=no ;; esac if test "$mikmod_threads" = "yes"; then mikmod_threads=no dnl AC_CHECK_HEADERS(pthread.h) unreliable AC_CHECK_LIB([pthread], [pthread_create], [mikmod_threads=-lpthread], AC_CHECK_LIB([c_r], [pthread_attr_init], [mikmod_threads=-lc_r]) ) fi dnl ============================= dnl Checks for library functions. dnl ============================= AC_FUNC_FNMATCH AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(getopt_long_only, have_getopt_long_only=yes) AC_CHECK_FUNCS(mkstemp srandom snprintf vsnprintf strerror) AC_EGREP_HEADER(usleep, unistd.h, AC_DEFINE(HAVE_USLEEP_PROTO, 1, [Define if your system has the prototype for usleep(3).])) AC_EGREP_HEADER(usleep, sys/unistd.h, AC_DEFINE(HAVE_USLEEP_PROTO)) AC_EGREP_HEADER(srandom, math.h, AC_DEFINE(SRANDOM_IN_MATH_H, 1, [Define if your system defines random(3) and srandom(3) in math.h instead of stdlib.h.])) dnl ================================= dnl Set PACKAGE_DATA_DIR in config.h. dnl ================================= ax_package_data_dir="${datadir}/${PACKAGE}" AX_DEFINE_DIR([PACKAGE_DATA_DIR], [ax_package_data_dir], [Define the directory for shared data.]) dnl ================ dnl Choose settings. dnl ================ case $host in *-aix*) AC_DEFINE(AIX, 1, [Define if your system is AIX 3.* - might be needed for 4.* too.]) ;; esac if test "$mikmod_threads" != "no"; then AC_DEFINE(HAVE_PTHREAD, 1, [Define if your system provides POSIX.4 threads.]) CFLAGS="$CFLAGS -D_REENTRANT" PLAYER_LIB="$mikmod_threads $PLAYER_LIB" REENTRANT="-D_REENTRANT" fi dnl =================== dnl Choose extra stuff. dnl =================== dnl solaris usleep is not thread safe, use an alternative dnl implementation on this system case $host in *-*-solaris*) if test "$mikmod_threads" != "no"; then have_usleep=no else AC_CHECK_FUNCS(usleep, have_usleep=yes) fi AC_DEFINE(SOLARIS, 1, [Define if your system is SOLARIS.]) ;; *) AC_CHECK_FUNCS(usleep, have_usleep=yes) ;; esac if test "$have_getopt_long_only" != "yes"; then EXTRA_OBJ="mgetopt.o mgetopt1.o $EXTRA_OBJ" fi dnl Yet another kluge to get the result of AC_FUNC_FNMATCH. if test "$ac_cv_func_fnmatch_works" != "yes"; then EXTRA_OBJ="mfnmatch.o $EXTRA_OBJ" fi if test "$have_usleep" != "yes"; then EXTRA_OBJ="musleep.o $EXTRA_OBJ" fi if test "$need_curses" = "yes"; then PLAYER_LIB="$PLAYER_LIB -l$libcurses" if test "$need_tinfo" = "yes"; then PLAYER_LIB="$PLAYER_LIB -ltinfo" fi fi dnl ================= dnl Create Makefiles. dnl ================= AC_SUBST(EXTRA_OBJ) AC_SUBST(PLAYER_LIB) AC_CONFIG_FILES([Makefile src/Makefile]) AC_CONFIG_HEADERS([config.h]) AC_OUTPUT mikmod-3.2.8/CMakeLists.txt0000644000000000000000000001374013071724104014246 0ustar rootroot# if necessary, set CMAKE_PREFIX_PATH to the path where libmikmod # is installed, which you can do on your cmake command line, like: # cmake -DCMAKE_PREFIX_PATH=/path/to/libmikmod_dir .... PROJECT(mikmod C) CMAKE_MINIMUM_REQUIRED(VERSION 2.8) LIST(APPEND CMAKE_MODULE_PATH "${mikmod_SOURCE_DIR}/cmake") SET(VERSION "3.2.8") STRING(REGEX MATCHALL "([0-9]+)" VERSION_DIGITS "${VERSION}") LIST(GET VERSION_DIGITS 0 CPACK_PACKAGE_VERSION_MAJOR) LIST(GET VERSION_DIGITS 1 CPACK_PACKAGE_VERSION_MINOR) LIST(GET VERSION_DIGITS 2 CPACK_PACKAGE_VERSION_PATCH) # package generation (make package[_source]) SET(CPACK_PACKAGE_NAME "mikmod") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MikMod - a module player") SET(CPACK_PACKAGE_VENDOR "Shlomi Fish") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") SET(base_with_ver "mikmod-[0-9]+\\\\.[0-9]+\\\\.[0-9]+") SET(CPACK_SOURCE_IGNORE_FILES "/_CPack_Packages/" "/CMakeFiles/" "/.deps/" "^${base_with_ver}(-Source|-Linux)?/" "${base_with_ver}.tar\\\\.(gz|bz2|Z|lzma|xz)$" "\\\\.o$" "~$" "/\\\\.svn/" "/CMakeCache\\\\.txt$" "/CTestTestfile\\\\.cmake$" "/cmake_install\\\\.cmake$" "/CPackConfig\\\\.cmake$" "/CPackSourceConfig\\\\.cmake$" "/tags$" "^config\\\\.h$" "/install_manifest\\\\.txt$" "/Testing/" "ids-whitelist\\\\.txt" "/_Inline/" "/(B|build|BUILD)/" "/autom4te.cache/" ) INCLUDE(CPack) INCLUDE(CheckFunctionExists) INCLUDE(CheckSymbolExists) INCLUDE(CheckCCompilerFlag) INCLUDE(CheckCSourceCompiles) include(mik_macros) CHECK_MULTI_INCLUDE_FILES( "ncurses.h" "curses.h" "ncurses/curses.h" "termios.h" "fcntl.h" "fnmatch.h" "inttypes.h" "limits.h" "memory.h" "sched.h" "sys/ioctl.h" "sys/param.h" "sys/wait.h" "sys/time.h" "sys/types.h" "sys/stat.h" "stdint.h" "stdlib.h" "string.h" "strings.h" "unistd.h" "pthread.h" ) CHECK_SYMBOL_EXISTS(TIOCGWINSZ "sys/ioctl.h" GWINSZ_IN_SYS_IOCTL) CHECK_SYMBOL_EXISTS(usleep unistd.h HAVE_USLEEP_PROTO) IF (NOT HAVE_USLEEP_PROTO) CHECK_SYMBOL_EXISTS(usleep "sys/unistd.h" HAVE_USLEEP_PROTO) ENDIF() SET(EXTRA_LIBS ) find_path(MIKMOD_INCLUDE_DIR mikmod.h) find_library(MIKMOD_LIBRARIES mikmod) IF (MIKMOD_LIBRARIES STREQUAL "MIKMOD_LIBRARIES-NOTFOUND") MESSAGE(FATAL_ERROR "libmikmod not found.") ELSE() MESSAGE(STATUS "Found MikMod: ${MIKMOD_LIBRARIES}") ENDIF() IF(UNIX OR APPLE) INCLUDE(FindCurses) IF(NOT CURSES_FOUND) MESSAGE(FATAL_ERROR "Curses not found.") ENDIF() IF(HAVE_NCURSES_H) SET(CURSES_HDR "ncurses.h") ELSEIF(HAVE_CURSES_H) SET(CURSES_HDR "curses.h") ELSEIF(HAVE_NCURSES_CURSES_H) SET(CURSES_HDR "ncurses/curses.h") ELSE() MESSAGE(FATAL_ERROR "Neither ncurses.h nor curses.h found.") ENDIF() SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) CHECK_FUNCTION_EXISTS (resizeterm HAVE_NCURSES_RESIZETERM) CHECK_C_SOURCE_COMPILES( "#include <${CURSES_HDR}> int main(void) { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif return 0; }" CURSES_LINKSOK ) IF(CURSES_LINKSOK) LIST (APPEND EXTRA_LIBS ${CURSES_LIBRARY}) ELSE() find_library(TINFO_LIBRARY tinfo) IF(TINFO_LIBRARY STREQUAL "TINFO_LIBRARY-NOTFOUND") MESSAGE(FATAL_ERROR "libtinfo needed for ncurses, but not found.") ELSE() MESSAGE(STATUS "Found libtinfo: ${TINFO_LIBRARY}") SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY} ${TINFO_LIBRARY}) CHECK_C_SOURCE_COMPILES( "#include <${CURSES_HDR}> int main(void) { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif return 0; }" TINFO_LINKSOK ) IF(TINFO_LINKSOK) LIST (APPEND EXTRA_LIBS ${CURSES_LIBRARY}) LIST (APPEND EXTRA_LIBS ${TINFO_LIBRARY}) ELSE() MESSAGE(FATAL_ERROR "failed linking to ncurses library.") ENDIF() ENDIF() ENDIF() ENDIF() SET(HAVE_PTHREAD) IF (NOT WIN32) INCLUDE(FindThreads) IF (CMAKE_USE_PTHREADS_INIT) SET (HAVE_PTHREAD 1) IF (CMAKE_THREAD_LIBS_INIT) LIST (APPEND EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT}) ENDIF() ENDIF() ENDIF() CHECK_MULTI_FUNCTIONS_EXISTS( "getopt_long_only" mkstemp srandom snprintf vsnprintf strerror usleep srandom fnmatch memcmp vprintf ) CHECK_C_SOURCE_COMPILES( "#include #include int main(void) { return *(signal(0,0))(0) == 1; }" RETSIGTYPE_INT ) if(RETSIGTYPE_INT) set(RETSIGTYPE int) else() set(RETSIGTYPE void) endif() MESSAGE(STATUS "Return type of signal handlers: ${RETSIGTYPE}") SET(CMAKE_REQUIRED_INCLUDES ${MIKMOD_INCLUDE_DIR}) SET(CMAKE_REQUIRED_LIBRARIES ${MIKMOD_LIBRARIES}) CHECK_FUNCTION_EXISTS (MikMod_free HAVE_MIKMOD_FREE) ########### compiler flags ############## SET(COMPILER_FLAGS_TO_CHECK "-Wall" "-Werror=implicit-function-declaration" ) IF (CPU_ARCH) LIST(APPEND COMPILER_FLAGS_TO_CHECK "-march=${CPU_ARCH}") ENDIF(CPU_ARCH) SET (IDX 1) FOREACH (CFLAG_TO_CHECK ${COMPILER_FLAGS_TO_CHECK}) SET (FLAG_EXISTS_VAR "FLAG_EXISTS_${IDX}") MATH (EXPR IDX "${IDX} + 1") CHECK_C_COMPILER_FLAG("${CFLAG_TO_CHECK}" ${FLAG_EXISTS_VAR}) IF (${FLAG_EXISTS_VAR}) ADD_DEFINITIONS(${CFLAG_TO_CHECK}) ENDIF (${FLAG_EXISTS_VAR}) ENDFOREACH(CFLAG_TO_CHECK) ########### install files ############### ADD_DEFINITIONS("-DHAVE_CONFIG_H") SET (PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/mikmod") configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) # So it can find config.h INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}) INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR}) install( FILES mikmodrc DESTINATION "share/mikmod" ) add_subdirectory(src) mikmod-3.2.8/config.h.in0000644000000000000000000001071712361532174013537 0ustar rootroot/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if your system is AIX 3.* - might be needed for 4.* too. */ #undef AIX /* Define if your copy of has a _P instead of __P (old Linux libc5). */ #undef BROKEN_SCHED /* Define to 1 if `TIOCGWINSZ' requires . */ #undef GWINSZ_IN_SYS_IOCTL /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #undef HAVE_FNMATCH /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #undef HAVE_MIKMOD_FREE /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_H /* Define if your libncurses defines resizeterm (not found in <4.2). */ #undef HAVE_NCURSES_RESIZETERM /* Define if your system provides POSIX.4 threads. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_SCHED_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `srandom' function. */ #undef HAVE_SRANDOM /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define if your system has the prototype for usleep(3). */ #undef HAVE_USLEEP_PROTO /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define the directory for shared data. */ #undef PACKAGE_DATA_DIR /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define if your system is SOLARIS. */ #undef SOLARIS /* Define if your system defines random(3) and srandom(3) in math.h instead of stdlib.h. */ #undef SRANDOM_IN_MATH_H /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t mikmod-3.2.8/mikmod.cfg0000644000000000000000000002140413071724104013443 0ustar rootroot# # -= MikMod 3.2.8 =- # configuration file # # DRIVER = , nth driver for output, default: 0 DRIVER = 0 # DRV_OPTIONS = "options", the driver options, e.g. "buffer=14,count=16" # for the OSS-driver DRV_OPTIONS = "" # STEREO = Yes|No, stereo or mono output, default: stereo STEREO = yes # 16BIT = Yes|No, 8 or 16 bit output, default: 16 bit 16BIT = yes # FREQUENCY = , mixing frequency, default: 44100 Hz FREQUENCY = 44100 # INTERPOLATE = Yes|No, use interpolate mixing, default: Yes INTERPOLATE = yes # HQMIXER = Yes|No, use high-quality (but slow) software mixer, default: No HQMIXER = no # SURROUND = Yes|No, use surround mixing, default: No SURROUND = no # REVERB = , set reverb amount (0-15), default: 0 (none) REVERB = 0 # VOLUME = , volume from 0 (silence) to 100, default: 100 VOLUME = 100 # VOLRESTRICT = Yes|No, restrict volume of player to volume supplied by user, # default: No VOLRESTRICT = no # FADEOUT = Yes|No, volume fade at the end of the module, default: No FADEOUT = no # LOOP = Yes|No, enable in-module loops, default: No LOOP = no # PANNING = Yes|No, process panning effects, default: Yes PANNING = yes # EXTSPD = Yes|No, process Protracker extended speed effect, default: Yes EXTSPD = yes # PM_MODULE = Yes|No, Module repeats, default: No PM_MODULE = no # PM_MULTI = Yes|No, PlayList repeats, default: Yes PM_MULTI = yes # PM_SHUFFLE = Yes|No, Shuffle list at start and if all entries are played, # default: No PM_SHUFFLE = no # PM_RANDOM = Yes|No, PlayList in random order, default: No PM_RANDOM = no # CURIOUS = Yes|No, look for hidden patterns in module, default: No CURIOUS = no # TOLERANT = Yes|No, don't halt on file access errors, default: Yes TOLERANT = yes # RENICE = RENICE_NONE (change nothing), RENICE_PRI (Renice to -20) or # RENICE_REAL (get realtime priority), default: RENICE_NONE # Note that RENICE_PRI is only available under FreeBSD, Linux, NetBSD, # OpenBSD and OS/2, and RENICE_REAL is only available under FreeBSD, Linux # and OS/2. RENICE = RENICE_NONE # STATUSBAR = , size of statusbar from 0 to 2, default: 2 STATUSBAR = 2 # SAVECONFIG = Yes|No, save configuration on exit, default: Yes SAVECONFIG = yes # SAVEPLAYLIST = Yes|No, save playlist on exit, default: Yes SAVEPLAYLIST = yes # PL_NAME = "name", name under which the playlist will be saved # by selecting 'Save' in the playlist-menu PL_NAME = "playlist.mpl" # HOTLIST = "name", entries in the directory hotlist, # can occur any time in this file # FULLPATHS = Yes|No, display full path of files, default: Yes FULLPATHS = yes # FORCESAMPLES = Yes|No, always display sample names (instead of # instrument names) in volumebars panel, default: No FORCESAMPLES = no # FAKEVOLUMEBARS = Yes|No, display fast, but not always accurate, volumebars # in volumebars panel, default: Yes # The real volumebars (when this setting is "No") take some CPU time to # be computed, and don't work with every driver. FAKEVOLUMEBARS = yes # WINDOWTITLE = Yes|No, set the term/window title to song name # (or filename if song has no title), default: Yes WINDOWTITLE = yes # THEME = "name", name of the theme to use, default: THEME = "" # Definition of the themes # NAME = "name", specifies the name of the theme # = normal | bold | reverse , for mono themes or # = , , for color themes # where = black | blue | green | cyan | red | magenta | # brown | gray | b_black | b_blue | b_green | # b_cyan | b_red | b_magenta | yellow | white # = black | blue | green | cyan | red | magenta | # brown | gray BEGIN "THEME" NAME = "MC" WARNING = "white,red" TITLE = "white,cyan" BANNER = "b_green,black" SONG_STATUS = "white,blue" INFO_INACTIVE = "black,cyan" INFO_ACTIVE = "white,black" INFO_IHOTKEY = "yellow,cyan" INFO_AHOTKEY = "yellow,black" HELP = "gray,blue" PLAYENTRY_INACTIVE = "gray,blue" PLAYENTRY_ACTIVE = "black,cyan" SAMPLES = "gray,blue" SAMPLES_KICK3 = "white,blue" SAMPLES_KICK2 = "b_cyan,blue" SAMPLES_KICK1 = "b_blue,blue" SAMPLES_KICK0 = "blue,blue" CONFIG = "cyan,blue" VOLBAR = "cyan,blue" VOLBAR_LOW = "b_green,blue" VOLBAR_MED = "yellow,blue" VOLBAR_HIGH = "b_red,blue" VOLBAR_INSTR = "b_green,blue" MENU_FRAME = "black,cyan" MENU_INACTIVE = "white,cyan" MENU_ACTIVE = "white,black" MENU_IHOTKEY = "yellow,cyan" MENU_AHOTKEY = "yellow,black" DLG_FRAME = "black,gray" DLG_LABEL = "black,gray" DLG_STR_TEXT = "black,cyan" DLG_STR_CURSOR = "cyan,black" DLG_BUT_INACTIVE = "black,gray" DLG_BUT_ACTIVE = "black,cyan" DLG_BUT_IHOTKEY = "yellow,gray" DLG_BUT_AHOTKEY = "yellow,cyan" DLG_BUT_ITEXT = "black,gray" DLG_BUT_ATEXT = "black,cyan" DLG_LIST_FOCUS = "black,cyan" DLG_LIST_NOFOCUS = "yellow,cyan" STATUS_LINE = "gray,blue" STATUS_TEXT = "gray,blue" END "THEME" BEGIN "THEME" NAME = "Reverse" WARNING = normal TITLE = bold BANNER = reverse SONG_STATUS = reverse INFO_INACTIVE = normal INFO_ACTIVE = reverse INFO_IHOTKEY = reverse INFO_AHOTKEY = reverse HELP = reverse PLAYENTRY_INACTIVE = reverse PLAYENTRY_ACTIVE = normal SAMPLES = reverse SAMPLES_KICK3 = reverse SAMPLES_KICK2 = reverse SAMPLES_KICK1 = reverse SAMPLES_KICK0 = reverse CONFIG = reverse VOLBAR = reverse VOLBAR_LOW = reverse VOLBAR_MED = reverse VOLBAR_HIGH = reverse VOLBAR_INSTR = reverse MENU_FRAME = normal MENU_INACTIVE = normal MENU_ACTIVE = reverse MENU_IHOTKEY = reverse MENU_AHOTKEY = normal DLG_FRAME = normal DLG_LABEL = normal DLG_STR_TEXT = reverse DLG_STR_CURSOR = normal DLG_BUT_INACTIVE = normal DLG_BUT_ACTIVE = reverse DLG_BUT_IHOTKEY = reverse DLG_BUT_AHOTKEY = normal DLG_BUT_ITEXT = normal DLG_BUT_ATEXT = reverse DLG_LIST_FOCUS = reverse DLG_LIST_NOFOCUS = bold STATUS_LINE = reverse STATUS_TEXT = reverse END "THEME" # Definition of the archiver # LOCATION = , -1: MARKER gives list of possible file extensions # otherwise: location where MARKER must be found in the file # MARKER = , see LOCATION, e.g. ".TAR.GZ .TGZ" or "PK\x03\x04" # LIST = , command to list archive content (%A archive name, # %a short(DOS/WIN) archive name) # NAMEOFFSET = , column where file names begin, # -1: start at column 0 and end at first space # EXTRACT = , command to extract a file to stdout (%A archive name, # %a short archive name, %f file name, %d destination name(non UNIX)) # SKIPPAT = , Remove the first SKIPSTART lines starting from the first # occurence of SKIPPAT and the last SKIPEND lines from the # extracted file (if the command EXTRACT mixes status # information and the module). # SKIPSTART = , # SKIPEND = , BEGIN "ARCHIVER" LOCATION = 0 MARKER = "PK\x03\x04" LIST = "pkunzip -vb \"%a\"" NAMEOFFSET = 47 EXTRACT = "pkunzip -c \"%a\" \"%f\" >\"%d\"" SKIPPAT = "to console" SKIPSTART = 2 SKIPEND = 1 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 20 MARKER = "\xdc\xa7\xc4\xfd" LIST = "zoo lq \"%a\"" NAMEOFFSET = 47 EXTRACT = "zoo xpq \"%a\" \"%f\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "Rar!" LIST = "rar v -y -c- \"%a\"" NAMEOFFSET = 1 EXTRACT = "rar p -y -c- \"%a\" \"%f\" >\"%d\"" SKIPPAT = "--- Printing " SKIPSTART = 2 SKIPEND = 2 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lh" LIST = "lha v %a" NAMEOFFSET = -1 EXTRACT = "lha p /n %a %f >\"%d\"" SKIPPAT = "" SKIPSTART = 3 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lz" LIST = "lha v %a" NAMEOFFSET = -1 EXTRACT = "lha p /n %a %f >\"%d\"" SKIPPAT = "" SKIPSTART = 3 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 257 MARKER = "ustar" LIST = "djtar -t \"%A\"" NAMEOFFSET = 36 EXTRACT = "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = -1 MARKER = ".TAR.GZ .TAZ .TGZ" LIST = "djtar -t \"%A\"" NAMEOFFSET = 36 EXTRACT = "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "\x1f\x8b" LIST = "" NAMEOFFSET = 27 EXTRACT = "gzip -dqc \"%a\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "BZh" LIST = "" NAMEOFFSET = 0 EXTRACT = "bzip2 -dqc \"%a\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" mikmod-3.2.8/Makefile.in0000644000000000000000000006277513071724200013564 0ustar rootroot# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING INSTALL NEWS \ autotools/compile autotools/config.guess autotools/config.sub \ autotools/depcomp autotools/install-sh autotools/missing \ autotools/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \ $(top_srcdir)/m4/libmikmod.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(pkgdata_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_OBJ = @EXTRA_OBJ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_DATA_DIR = @PACKAGE_DATA_DIR@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLAYER_LIB = @PLAYER_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src pkgdata_DATA = mikmodrc EXTRA_DIST = mikmod.lsm mikmod.cfg $(pkgdata_DATA) \ dos os2 macosx win32 \ config.h.cmake CMakeLists.txt cmake all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgdataDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgdataDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgdataDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am uninstall-pkgdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mikmod-3.2.8/os2/0000755000000000000000000000000013117572536012217 5ustar rootrootmikmod-3.2.8/os2/config.h0000644000000000000000000000323012353574670013635 0ustar rootroot/* config.h.in. Generated manually for GCC/EMX. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE 1 /* Define if your system has a working fnmatch function. */ #define HAVE_FNMATCH 1 /* Define if you have the mkstemp function. */ #define HAVE_MKSTEMP 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define if your system has random(3) and srandom(3) */ #define HAVE_SRANDOM 1 /* Define if your system has snprintf(3) */ #define HAVE_SNPRINTF 1 /* Define if your system has strerror(3) */ #define HAVE_STRERROR 1 /* Define if you have the usleep function. */ #define HAVE_USLEEP 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define if you have the vsnprintf function. */ #define HAVE_VSNPRINTF 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_FNMATCH_H 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 mikmod-3.2.8/os2/README0000644000000000000000000000715513071724104013074 0ustar rootroot Hello folks ! This is MikMod, version 3.2.8, a module player for OS/2. As usual with each new version, there's a lot of bugfixes and improvements. Check out the file 'NEWS' for more information. >> BUILDING MIKMOD ------------------ - If you're not building libmikmod for OS/2, then you're lost in the sources. Go up one directory, and read the main README file. So you're on a good old OS/2 system, aren't you ? With a customized Object Desktop or some equivalent tool collection ? I hope you've installed REXX support during the system installation. If you didn't, you lose. Run 'selective install' from the system setup folder, install REXX support, check it works, and come back here. The first thing you need is to get and compile the libmikmod sound library, which is not bundled with MikMod anymore ! If you don't know where to get libmikmod, look at the "contact and download info" section later in this document. You need long filenames to compile MikMod, so you'll have to compile it on an HPFS drive, or an ext2fs drive, or a network drive where you can use decent-size filenames. Currently, MikMod can be build under OS/2 only with the Watcom compiler (tested with OpenWatcom 1.9), or with the EMX compiler (not tested). Edit the makefiles if you need to customize the build options and/or want to learn any details. For EMX, run: make -f Makefile.emx For Watcom, run: wmake -f Makefile.wat and you'll get your MikMod binary in this directory. Just copy the file 'mikmod.exe' somewhere in your PATH, and enjoy ! If the build fails, I'd like to hear from you to correct the problem. >> USING MIKMOD --------------- Run MikMod with the '--help' parameter to get the available options. Program documentation is available as an Unix man page (..\src\mikmod.1) which you can read if you've got a port of the 'man' tool. Also, after you've run MikMod for the first time, you might want to customize your mikmod.cfg file, either from the configuration panel or by editing the file yourself, so you won't need to supply the same options to MikMod all the time. This file will be created in the directory pointed to by the HOME environment variable. If you don't have the HOME environment variable, the file will be created in C:\, which is probably not what you want and should encourage you to have the HOME environment variable set. Once you're in the player, pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. >> THANKS --------- I would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- MikMod/libmikmod home page is located at SourceForge: http://mikmod.sourceforge.net/ http://sourceforge.net/projects/mikmod/ There's a mailing list (mikmod-public) for discussing the development of MikMod (new features, bugs, ideas...) Look for more information on the web site. >> LAST NOTES ------------- I hope you'll enjoy using this version of MikMod as well as I enjoyed debugging and improving it. -- Miodrag ("Miod") Vallat, 10/19/1999 miodrag@mikmod.darkorb.net mikmod-3.2.8/os2/Makefile.emx0000644000000000000000000000747712350763732014464 0ustar rootroot#------------------------------------------------------------------------------# # Makefile for building MikMod player under GCC/EMX # This is a Makefile designed explicitly for GNU Make. # # Targets: # - all (default): build mikmod.exe # - depend: Rebuild dependencies (at the end of this file) # You should have makedep from Crystal Space project installed # - clean: Clean up all generated files #------------------------------------------------------------------------------# # Use CMD.EXE for launching commands SHELL=$(COMSPEC) # The tools CC = gcc -c CFLAGS = -O2 -Wall -funroll-loops -ffast-math -fno-strength-reduce -Zomf -Zmt CPPFLAGS = -DHAVE_CONFIG_H INCLUDE = -I. -I../src LD = gcc LDFLAGS = -s -Zomf -Zmt -Zcrtdll -L. -lmikmod # if linking against static libmikmod.a, mmpm2 is needed too (for drv_os2 and drv_dart.) #LDFLAGS+= -lmmpm2 # Output directory OUT = out SRC = $(filter-out %mfnmatch.c %musleep.c,$(wildcard ../src/*.c)) OBJ = $(addprefix $(OUT)/,$(notdir $(SRC:.c=.o))) # Build rules $(OUT)/%.o: ../src/%.c $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE) -o $@ $< all: $(OUT) mikmod.exe depend: makedep -r -p $$(OUT)/ -DHAVE_CONFIG_H -D__EMX__ $(INCLUDE) $(SRC) clean: rm -rf $(OUT) mikmod.exe $(OUT): mkdir $@ mikmod.exe: $(OBJ) $(LD) -o $@ $^ $(LDFLAGS) # DO NOT DELETE this line - makedep uses it as a separator line $(OUT)/display.o: config.h ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h \ ../src/mconfedit.h ../src/mmenu.h ../src/keys.h ../src/mplayer.h \ ../src/mlistedit.h $(OUT)/marchive.o: config.h ../src/mlist.h ../src/marchive.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h ../src/display.h $(OUT)/mconfedit.o: config.h ../src/rcfile.h ../src/mconfig.h \ ../src/mconfedit.h ../src/mmenu.h ../src/mwindow.h ../src/mlist.h \ ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h $(OUT)/mconfig.o: config.h ../src/player.h ../src/mconfig.h ../src/rcfile.h \ ../src/mwindow.h ../src/mlist.h ../src/mutilities.h $(OUT)/mdialog.o: config.h ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/display.h ../src/mutilities.h $(OUT)/mikmod.o: config.h ../src/mgetopt.h ../src/player.h ../src/mutilities.h \ ../src/display.h ../src/rcfile.h ../src/mconfig.h ../src/mlist.h \ ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h ../src/marchive.h \ ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h $(OUT)/mlist.o: config.h ../src/mlist.h ../src/marchive.h ../src/mutilities.h $(OUT)/mlistedit.o: config.h ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h \ ../src/player.h ../src/mdialog.h ../src/mwidget.h ../src/mconfedit.h \ ../src/marchive.h ../src/keys.h ../src/display.h ../src/mutilities.h $(OUT)/mmenu.o: config.h ../src/display.h ../src/mmenu.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h \ ../src/keys.h ../src/mutilities.h $(OUT)/mplayer.o: config.h ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h $(OUT)/mutilities.o: config.h ../src/player.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h $(OUT)/mwidget.o: config.h ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mwidget.h ../src/keys.h \ ../src/mutilities.h $(OUT)/mwindow.o: config.h ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mutilities.h ../src/keys.h \ ../src/mthreads.h ../src/os2video.inc $(OUT)/rcfile.o: config.h ../src/rcfile.h ../src/mutilities.h $(OUT)/mgetopt.o: ../src/mgetopt.h $(OUT)/mgetopt1.o: ../src/mgetopt.h $(OUT)/mfnmatch.o: ../src/mfnmatch.h $(OUT)/musleep.o: config.h mikmod-3.2.8/os2/Makefile.wat0000644000000000000000000000265313054210004014432 0ustar rootroot# Makefile for OS/2 using Open Watcom compiler. # # wmake -f Makefile.wat # # to statically link to mikmod: # wmake -f Makefile.wat target=static !ifndef target target = dynamic !endif CC=wcc386 !ifndef __UNIX__ INCLUDES=-I..\os2 -I..\src !else INCLUDES=-I../os2 -I../src !endif CPPFLAGS=-DHAVE_FCNTL_H -DHAVE_LIMITS_H -DHAVE_SYS_IOCTL_H -DHAVE_SYS_TIME_H -DHAVE_STRERROR -DHAVE_SNPRINTF -DHAVE_MKSTEMP !ifneq target static LIBS=mikmod.lib !else CPPFLAGS+= -DMIKMOD_STATIC LIBS=mikmod_static.lib mmpm2.lib !endif CFLAGS = -bt=os2 -bm -fp5 -fpi87 -mf -oeatxh -w4 -zp8 -ei -zq # -5s : Pentium stack calling conventions. # -5r : Pentium register calling conventions. CFLAGS+= -5s .SUFFIXES: .SUFFIXES: .obj .c AOUT=mikmod.exe COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) OBJ = display.obj marchive.obj mconfedit.obj mconfig.obj mdialog.obj mikmod.obj mlist.obj mlistedit.obj & mmenu.obj mplayer.obj mutilities.obj mwidget.obj mwindow.obj rcfile.obj EXTRA_OBJ = mgetopt.obj mgetopt1.obj mfnmatch.obj all: $(AOUT) $(AOUT): $(OBJ) $(EXTRA_OBJ) wlink N $(AOUT) SYS OS2V2 LIBR {$(LIBS)} F {$(OBJ)} F {$(EXTRA_OBJ)} .c.obj: $(COMPILE) -fo=$^@ $< !ifndef __UNIX__ .c: ..\src distclean: clean .symbolic @if exist $(AOUT) del $(AOUT) clean: .symbolic @if exist *.obj del *.obj !else .c: ../src distclean: clean .symbolic rm -f $(AOUT) clean: .symbolic rm -f *.obj !endif mikmod-3.2.8/aclocal.m40000644000000000000000000010762213071724200013346 0ustar rootroot# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_define_dir.m4]) m4_include([m4/libmikmod.m4]) mikmod-3.2.8/macosx/0000755000000000000000000000000013117572536013006 5ustar rootrootmikmod-3.2.8/macosx/config.h0000644000000000000000000000647412361532206014425 0ustar rootroot/* config.h. Generated for Mac OS X. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE 1 /* Define the directory for shared data. */ #define PACKAGE_DATA_DIR "/usr/local/share/mikmod" /* Define to 1 if `TIOCGWINSZ' requires . */ /* #undef GWINSZ_IN_SYS_IOCTL */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #define HAVE_FNMATCH 1 /* Define to 1 if you have the header file. */ #define HAVE_FNMATCH_H 1 /* Define to 1 if you have the `getopt_long_only' function. */ #define HAVE_GETOPT_LONG_ONLY 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 /* Define to 1 if you have the header file. */ #define HAVE_CURSES_H 1 /* Define if your libncurses defines resizeterm (not found in <4.2). */ #define HAVE_NCURSES_RESIZETERM 1 /* Define if your system provides POSIX.4 threads. */ #define HAVE_PTHREAD 1 /* Define to 1 if you have the header file. */ #define HAVE_SCHED_H 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the `srandom' function. */ #define HAVE_SRANDOM 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TERMIOS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `usleep' function. */ #define HAVE_USLEEP 1 /* Define if your system has the prototype for usleep(3). */ #define HAVE_USLEEP_PROTO 1 /* Define to 1 if you have the `vprintf' function. */ #define HAVE_VPRINTF 1 /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define if your system defines random(3) and srandom(3) in math.h instead of stdlib.h. */ /* #undef SRANDOM_IN_MATH_H */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 mikmod-3.2.8/macosx/Makefile.darwin0000644000000000000000000000731012350764324015726 0ustar rootroot# Makefile for MikMod for Darwin (i.e. Mac OS X) # Edit the compiler/linker flags, etc. to meet your needs # This is a Makefile designed explicitly for GNU Make. ifeq ($(CROSS),) CC=gcc AS=as LIPO=lipo else CC=$(CROSS)-gcc AS=$(CROSS)-as LIPO=$(CROSS)-lipo endif LINKER=$(CC) # if building against a static libmikmod, add -DMIKMOD_STATIC to CFLAGS CFLAGS=-O2 -Wall -DHAVE_CONFIG_H -D_THREAD_SAFE COMPILE=$(CC) $(CFLAGS) -I. -o $@ -c ../src/$*.c # if building against static libmikmod, you will need adding # -Wl,-framework,CoreAudio (for drv_osx) to LIBS too, along with any # other extra driver libs that static libmikmod was compiled against. LIBS= -pthread -lcurses -L. -lmikmod OBJS= display.o marchive.o mconfedit.o mconfig.o mdialog.o mikmod.o \ mlist.o mlistedit.o mmenu.o mplayer.o mutilities.o mwidget.o \ mwindow.o rcfile.o all: mikmod clean: rm -f mikmod *.o mikmod: $(OBJS) $(LINKER) -o mikmod $(OBJS) $(LIBS) display.o: ../src/display.c ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h \ ../src/mconfedit.h ../src/mmenu.h ../src/keys.h ../src/mplayer.h \ ../src/mlistedit.h config.h $(COMPILE) marchive.o: ../src/marchive.c ../src/mfnmatch.h ../src/mlist.h \ ../src/marchive.h ../src/mconfig.h ../src/rcfile.h \ ../src/mutilities.h ../src/display.h config.h $(COMPILE) mconfedit.o: ../src/mconfedit.c ../src/rcfile.h ../src/mconfig.h \ ../src/mconfedit.h ../src/mmenu.h ../src/mwindow.h ../src/mlist.h \ ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h config.h $(COMPILE) mconfig.o: ../src/mconfig.c ../src/player.h ../src/mconfig.h ../src/rcfile.h \ ../src/mwindow.h ../src/mlist.h ../src/mutilities.h config.h $(COMPILE) mdialog.o: ../src/mdialog.c ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/display.h ../src/mutilities.h \ config.h $(COMPILE) mfnmatch.o: ../src/mfnmatch.c ../src/mfnmatch.h $(COMPILE) mgetopt.o: ../src/mgetopt.c ../src/mgetopt.h $(COMPILE) mgetopt1.o: ../src/mgetopt1.c ../src/mgetopt.h $(COMPILE) mikmod.o: ../src/mikmod.c ../src/mgetopt.h ../src/player.h ../src/mutilities.h \ ../src/display.h ../src/rcfile.h ../src/mconfig.h ../src/mlist.h \ ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h ../src/marchive.h \ ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h config.h $(COMPILE) mlist.o: ../src/mlist.c ../src/mfnmatch.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h config.h $(COMPILE) mlistedit.o: ../src/mlistedit.c ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h \ ../src/player.h ../src/mdialog.h ../src/mwidget.h \ ../src/mconfedit.h ../src/marchive.h ../src/keys.h \ ../src/display.h ../src/mutilities.h config.h $(COMPILE) mmenu.o: ../src/mmenu.c ../src/display.h ../src/mmenu.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h \ ../src/keys.h ../src/mutilities.h config.h $(COMPILE) mplayer.o: ../src/mplayer.c ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mutilities.o: ../src/mutilities.c ../src/player.h ../src/mlist.h \ ../src/marchive.h ../src/mutilities.h config.h $(COMPILE) mwidget.o: ../src/mwidget.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mwidget.h ../src/keys.h \ ../src/mutilities.h config.h $(COMPILE) mwindow.o: ../src/mwindow.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mutilities.h ../src/keys.h \ ../src/mthreads.h ../src/winvideo.inc config.h $(COMPILE) rcfile.o: ../src/rcfile.c ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mikmod-3.2.8/cmake/0000755000000000000000000000000013117572536012574 5ustar rootrootmikmod-3.2.8/cmake/mik_macros.cmake0000644000000000000000000000466212255302430015714 0ustar rootroot# Copyright (c) 2012 Shlomi Fish # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, # copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following # conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # (This copyright notice applies only to this file) include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckFunctionExists) # Taken from http://www.cmake.org/pipermail/cmake/2007-March/013060.html MACRO(REPLACE_FUNCTIONS sources) FOREACH(name ${ARGN}) STRING(TOUPPER have_${name} SYMBOL_NAME) CHECK_FUNCTION_EXISTS(${name} ${SYMBOL_NAME}) IF(NOT ${SYMBOL_NAME}) SET(${sources} ${${sources}} ${name}.c) ENDIF(NOT ${SYMBOL_NAME}) ENDFOREACH(name) ENDMACRO(REPLACE_FUNCTIONS) MACRO(REPLACE_FUNCTIONS_FROMDIR sources dir) FOREACH(name ${ARGN}) STRING(TOUPPER have_${name} SYMBOL_NAME) CHECK_FUNCTION_EXISTS(${name} ${SYMBOL_NAME}) IF(NOT ${SYMBOL_NAME}) SET(${sources} ${${sources}} ${dir}/${name}.c) ENDIF(NOT ${SYMBOL_NAME}) ENDFOREACH(name) ENDMACRO(REPLACE_FUNCTIONS_FROMDIR) MACRO(CHECK_MULTI_INCLUDE_FILES) FOREACH(name ${ARGN}) STRING(TOUPPER have_${name} SYMBOL_NAME) STRING(REGEX REPLACE "\\." "_" SYMBOL_NAME ${SYMBOL_NAME}) STRING(REGEX REPLACE "/" "_" SYMBOL_NAME ${SYMBOL_NAME}) CHECK_INCLUDE_FILE(${name} ${SYMBOL_NAME}) ENDFOREACH(name) ENDMACRO(CHECK_MULTI_INCLUDE_FILES) MACRO(CHECK_MULTI_FUNCTIONS_EXISTS) FOREACH(name ${ARGN}) STRING(TOUPPER have_${name} SYMBOL_NAME) CHECK_FUNCTION_EXISTS(${name} ${SYMBOL_NAME}) ENDFOREACH(name) ENDMACRO(CHECK_MULTI_FUNCTIONS_EXISTS) mikmod-3.2.8/README0000644000000000000000000001242113071724104012361 0ustar rootroot Hello folks ! This is MikMod, version 3.2.8, a module player for Unix. As usual with each new version, there's a lot of bug fixes and improvements. Check out the file 'NEWS' for more information. >> BUILDING MIKMOD ------------------ This MikMod version can build with any libmikmod version starting from 3.1.5, but building with 3.2.0 or newer (preferably 3.3.6 or newer) is recommended because some of the features and configuration functions are not available for older versions. - If you want to build MikMod for Windows, refer to the 'README' file under the 'win32' subdirectory. - If you want to build MikMod for Mac OS X, refer to the 'README' file under the 'macosx' subdirectory. - If you're building MikMod for DOS, refer to the 'README' file under the 'dos' subdirectory. - If you're building MikMod for OS/2, refer to the 'README' file under the 'os2' subdirectory. - If you're building MikMod for AmigaOS, or its variants like MorphOS or AROS, the configury method as explained below should work fine. The first thing you need is to get and compile the libmikmod sound library, which is not bundled with MikMod anymore ! If you don't know where to get libmikmod, look at the "contact and download info" section later in this document. So you're on a good old Unix workstation, aren't you ? You'll need an ANSI C compiler to build MikMod. To prevent clobbering the sources, I recommend building MikMod in an alternate directory, for example 'build': mkdir build cd build In this directory, run MikMod's configure script: ../configure The configure script will attempt to guess correct values for various system-dependent variables used during the build process, and will create appropriate Makefiles for proper compilation. If you're not familiar with configure scripts and their standard options, you can find more general information about them in the file INSTALL. After you've successfully run configure, simply run make to get all things build. Then, run make install to have the player installed. Depending on where you choose to install it (using the --prefix= option to configure), you may need root privileges for this operation. >> USING MIKMOD --------------- Run MikMod with the ``--help'' parameter to get the available options, or display its man page (if you did "make install") with man mikmod Also, after you've run MikMod for the first time, you might want to customize your $HOME/.mikmodrc, either from the configuration panel or by editing the file, so you won't need to supply the same options to MikMod all the time. Once you're in the player, pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. If you're playing MikMod in quiet mode (with the -q/-quiet switch), you can tell MikMod to jump to the next/previous song by sending the MikMod process SIGUSR1 or SIGUSR2 respectivly. In other words, let's say you're doing something like this: $ mikmod myalltimefavmods.mpl -quiet & [1] 7531 You've told MikMod to read the songs out of the playlist myalltimefavmods, to not spit out any output (-quiet), and to run in the background. Your shell will give you the process ID, in this case it's 7531. You can also find this out from "ps", "top", or a number of process management utilities. Now, let's say a song you don't like as much comes on, or for some reason one seems to be looping forever, you can do this... $ kill -s SIGUSR1 7531 or $ kill -USR1 %1 (if your shell supports the %n process notation) and MikMod will start playing the next file in the list. If you want the previous file, just use SIGUSR2 in place of SIGUSR1. This feature also works when MikMod is in interactive mode (with the curses interface), but is less useful then, since you have full player control... >> Y2K COMPLIANCE ----------------- MikMod does not deal with dates. So, as long as the few libc functions used by the program are Y2K-compliant, MikMod is Y2K-compliant. However, the archive handler invokes archiver programs to display the contents of the archive files ; if these external programs are not Y2K compliant when displaying archive contents, MikMod may not work as expected when dealing with archives. >> THANKS --------- I would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- MikMod and libmikmod home page is located at SourceForge: http://mikmod.sourceforge.net/ http://sourceforge.net/projects/mikmod/ There's a mailing list (mikmod-public) for discussing the development of MikMod (new features, bugs, ideas...) Look for more information on the web site. >> LAST NOTES ------------- I hope you'll enjoy using this version of MikMod as well as I enjoyed debugging and improving it. -- Miodrag ("Miod") Vallat, 10/19/1999 miodrag@mikmod.darkorb.net Raphael Assenat, 28/01/2004 raph@raphnet.net mikmod-3.2.8/win32/0000755000000000000000000000000013117572536012456 5ustar rootrootmikmod-3.2.8/win32/Makefile.mingw0000644000000000000000000000737212350757564015253 0ustar rootroot# Makefile for MikMod for the MinGW / MingGW-w64 compiler system # ifeq ($(CROSS),) CC=gcc AS=as else CC=$(CROSS)-gcc AS=$(CROSS)-as endif LINKER=$(CC) #RM=del RM=rm -f # if building against a static libmikmod, add -DMIKMOD_STATIC to CFLAGS CFLAGS=-O2 -Wall -DHAVE_CONFIG_H -DWIN32 COMPILE=$(CC) $(CFLAGS) -I. -o $@ -c ../src/$*.c # if building against static libmikmod, you will need adding -ldsound # (for drv_ds) and -lwinmm (for drv_win) to LIBS too, along with any # other extra driver libs that static libmikmod was compiled against. LIBS= -L. -lmikmod OBJS= display.o marchive.o mconfedit.o mconfig.o mdialog.o \ mfnmatch.o mgetopt.o mgetopt1.o mikmod.o mlist.o \ mlistedit.o mmenu.o mplayer.o mutilities.o mwidget.o \ mwindow.o rcfile.o all: mikmod.exe clean: $(RM) mikmod.exe *.o mikmod.exe: $(OBJS) $(LINKER) -mconsole -o mikmod.exe $(OBJS) $(LIBS) display.o: ../src/display.c ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h \ ../src/mconfedit.h ../src/mmenu.h ../src/keys.h ../src/mplayer.h \ ../src/mlistedit.h config.h $(COMPILE) marchive.o: ../src/marchive.c ../src/mfnmatch.h ../src/mlist.h \ ../src/marchive.h ../src/mconfig.h ../src/rcfile.h \ ../src/mutilities.h ../src/display.h config.h $(COMPILE) mconfedit.o: ../src/mconfedit.c ../src/rcfile.h ../src/mconfig.h \ ../src/mconfedit.h ../src/mmenu.h ../src/mwindow.h ../src/mlist.h \ ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h config.h $(COMPILE) mconfig.o: ../src/mconfig.c ../src/player.h ../src/mconfig.h ../src/rcfile.h \ ../src/mwindow.h ../src/mlist.h ../src/mutilities.h config.h $(COMPILE) mdialog.o: ../src/mdialog.c ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/display.h ../src/mutilities.h \ config.h $(COMPILE) mfnmatch.o: ../src/mfnmatch.c ../src/mfnmatch.h $(COMPILE) mgetopt.o: ../src/mgetopt.c ../src/mgetopt.h $(COMPILE) mgetopt1.o: ../src/mgetopt1.c ../src/mgetopt.h $(COMPILE) mikmod.o: ../src/mikmod.c ../src/mgetopt.h ../src/player.h ../src/mutilities.h \ ../src/display.h ../src/rcfile.h ../src/mconfig.h ../src/mlist.h \ ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h ../src/marchive.h \ ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h config.h $(COMPILE) mlist.o: ../src/mlist.c ../src/mfnmatch.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h config.h $(COMPILE) mlistedit.o: ../src/mlistedit.c ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h \ ../src/player.h ../src/mdialog.h ../src/mwidget.h \ ../src/mconfedit.h ../src/marchive.h ../src/keys.h \ ../src/display.h ../src/mutilities.h config.h $(COMPILE) mmenu.o: ../src/mmenu.c ../src/display.h ../src/mmenu.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h \ ../src/keys.h ../src/mutilities.h config.h $(COMPILE) mplayer.o: ../src/mplayer.c ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mutilities.o: ../src/mutilities.c ../src/player.h ../src/mlist.h \ ../src/marchive.h ../src/mutilities.h config.h $(COMPILE) mwidget.o: ../src/mwidget.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mwidget.h ../src/keys.h \ ../src/mutilities.h config.h $(COMPILE) mwindow.o: ../src/mwindow.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mutilities.h ../src/keys.h \ ../src/mthreads.h ../src/winvideo.inc config.h $(COMPILE) rcfile.o: ../src/rcfile.c ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mikmod-3.2.8/win32/config.h0000644000000000000000000000233112350764406014070 0ustar rootroot/* config.h. Generated manually for Windows/LCC. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE 1 /* Define the directory for shared data. */ #undef PACKAGE_DATA_DIR /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* but we do define HAVE_VSNPRINTF */ /* Define to 1 if you have the `srandom' function. */ #undef HAVE_SRANDOM /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR /* Define to 1 if you have the header file. */ #define HAVE_STRING_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H /* Define to 1 if you have the `vprintf' function. */ #define HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void mikmod-3.2.8/win32/README0000644000000000000000000000273412232267452013337 0ustar rootrootThis is the instructions to compile mikmod on win32. Mikmod can be compiler using Microsoft Visual Studio, lcc-win32, or MinGW or MinGW-w64 compilers. 1) First, compile libmikmod, and install it. To install libmikmod, I copied libmikmod.lib (generated when compiling libmikmod) in the /lib directory of lcc. Next, I copied the file mikmod.h in the /include directory of lcc. Should be similar if you used MinGW[-w64] or MSVC. 2) Compiling mikmod: - using lcc: cd to the win32 directory and type make -f Makefile.lcc - using MinGW or MinGW-w64: cd to the win32 directory and type make -f Makefile.mingw (you need GNU make: gmake, or mingw32-make, or whatever) - using MSVC: Compile using project files from MSVC6 or VS2005. The VS2005 project file imports just fine into newer Visual Studio versions, e.g. VS2012. Hopefully, it will compile and a file named mikmod.exe will be created. 3) Try it! There are 2 audio drivers for windows. - DirectSound Driver (Requires DirectX 6 or newer) - waveform-audio Depending on how you compliled libmikmod, the XAudio2 driver, and possibly others may be there too. To choose which driver to use from the command line, do a mikmod -n to get the list of drivers, and once you know the correct driver id, do mikmod -d ?? where ?? is the id. do mikmod -h for more command line options. -- Good Luck! Raphael Assenat raph@raphnet.net mikmod-3.2.8/win32/Makefile.lcc0000644000000000000000000000743312350757564014671 0ustar rootroot# Makefile for win32 for the lcc-win32 compiler. # # make -f Makefile.lcc CC=lcc.exe LINKER=lcclnk.exe # if building against a static libmikmod, add -DMIKMOD_STATIC to CFLAGS CFLAGS=-O -g4 -A -DHAVE_CONFIG_H COMPILE=$(CC) -errout=err.out $(CFLAGS) -I. -Fo$@ ..\src\$*.c # if building against static libmikmod, change mikmod.lib to mikmod_static.lib # and you will need adding dsound.lib (for drv_ds) and winmm.lib (for drv_win) # to LIBS too, along with any other extra driver libs that libmikmod_static.lib # was compiled against. LIBS= mikmod.lib OBJS= display.o marchive.o mconfedit.o mconfig.o mdialog.o \ mfnmatch.o mgetopt.o mgetopt1.o mikmod.o mlist.o \ mlistedit.o mmenu.o mplayer.o mutilities.o mwidget.o \ mwindow.o rcfile.o all: mikmod.exe clean: FOR %F IN ( err.out mikmod.exe *.o ) DO IF EXIST %F erase %F mikmod.exe: $(OBJS) $(LINKER) -subsystem console -o mikmod.exe $(OBJS) $(LIBS) display.o: ..\src\display.c ..\src\display.h ..\src\player.h ..\src\mconfig.h \ ..\src\rcfile.h ..\src\mlist.h ..\src\mutilities.h ..\src\mwindow.h \ ..\src\mconfedit.h ..\src\mmenu.h ..\src\keys.h ..\src\mplayer.h \ ..\src\mlistedit.h config.h $(COMPILE) marchive.o: ..\src\marchive.c ..\src\mfnmatch.h ..\src\mlist.h \ ..\src\marchive.h ..\src\mconfig.h ..\src\rcfile.h \ ..\src\mutilities.h ..\src\display.h config.h $(COMPILE) mconfedit.o: ..\src\mconfedit.c ..\src\rcfile.h ..\src\mconfig.h \ ..\src\mconfedit.h ..\src\mmenu.h ..\src\mwindow.h ..\src\mlist.h \ ..\src\mdialog.h ..\src\mwidget.h ..\src\mutilities.h config.h $(COMPILE) mconfig.o: ..\src\mconfig.c ..\src\player.h ..\src\mconfig.h ..\src\rcfile.h \ ..\src\mwindow.h ..\src\mlist.h ..\src\mutilities.h config.h $(COMPILE) mdialog.o: ..\src\mdialog.c ..\src\mwidget.h ..\src\mwindow.h ..\src\mconfig.h \ ..\src\rcfile.h ..\src\mdialog.h ..\src\display.h ..\src\mutilities.h \ config.h $(COMPILE) mfnmatch.o: ..\src\mfnmatch.c ..\src\mfnmatch.h $(COMPILE) mgetopt.o: ..\src\mgetopt.c ..\src\mgetopt.h $(COMPILE) mgetopt1.o: ..\src\mgetopt1.c ..\src\mgetopt.h $(COMPILE) mikmod.o: ..\src\mikmod.c ..\src\mgetopt.h ..\src\player.h ..\src\mutilities.h \ ..\src\display.h ..\src\rcfile.h ..\src\mconfig.h ..\src\mlist.h \ ..\src\mlistedit.h ..\src\mmenu.h ..\src\mwindow.h ..\src\marchive.h \ ..\src\mdialog.h ..\src\mwidget.h ..\src\mplayer.h ..\src\keys.h config.h $(COMPILE) mlist.o: ..\src\mlist.c ..\src\mfnmatch.h ..\src\mlist.h ..\src\marchive.h \ ..\src\mutilities.h config.h $(COMPILE) mlistedit.o: ..\src\mlistedit.c ..\src\mlistedit.h ..\src\mmenu.h \ ..\src\mwindow.h ..\src\mconfig.h ..\src\rcfile.h ..\src\mlist.h \ ..\src\player.h ..\src\mdialog.h ..\src\mwidget.h \ ..\src\mconfedit.h ..\src\marchive.h ..\src\keys.h \ ..\src\display.h ..\src\mutilities.h config.h $(COMPILE) mmenu.o: ..\src\mmenu.c ..\src\display.h ..\src\mmenu.h ..\src\mwindow.h \ ..\src\mconfig.h ..\src\rcfile.h ..\src\mdialog.h ..\src\mwidget.h \ ..\src\keys.h ..\src\mutilities.h config.h $(COMPILE) mplayer.o: ..\src\mplayer.c ..\src\mplayer.h ..\src\mthreads.h ..\src\mconfig.h \ ..\src\rcfile.h ..\src\mutilities.h config.h $(COMPILE) mutilities.o: ..\src\mutilities.c ..\src\player.h ..\src\mlist.h \ ..\src\marchive.h ..\src\mutilities.h config.h $(COMPILE) mwidget.o: ..\src\mwidget.c ..\src\display.h ..\src\player.h ..\src\mwindow.h \ ..\src\mconfig.h ..\src\rcfile.h ..\src\mwidget.h ..\src\keys.h \ ..\src\mutilities.h config.h $(COMPILE) mwindow.o: ..\src\mwindow.c ..\src\display.h ..\src\player.h ..\src\mwindow.h \ ..\src\mconfig.h ..\src\rcfile.h ..\src\mutilities.h ..\src\keys.h \ ..\src\mthreads.h ..\src\winvideo.inc config.h $(COMPILE) rcfile.o: ..\src\rcfile.c ..\src\rcfile.h ..\src\mutilities.h config.h $(COMPILE) mikmod-3.2.8/win32/Makefile.wat0000644000000000000000000000265713054210650014704 0ustar rootroot# Makefile for Win32 using Open Watcom compiler. # # wmake -f Makefile.wat # # to statically link to mikmod: # wmake -f Makefile.wat target=static !ifndef target target = dynamic !endif CC=wcc386 !ifndef __UNIX__ INCLUDES=-I..\win32 -I..\src !else INCLUDES=-I../win32 -I../src !endif CPPFLAGS=-DHAVE_FCNTL_H -DHAVE_LIMITS_H -DHAVE_SYS_TIME_H -DHAVE_STRERROR -DHAVE_SNPRINTF -DHAVE_MKSTEMP !ifneq target static LIBS=mikmod.lib !else CPPFLAGS+= -DMIKMOD_STATIC LIBS=mikmod_static.lib winmm.lib dsound.lib dxguid.lib !endif CFLAGS = -bt=nt -bm -fp5 -fpi87 -mf -oeatxh -w4 -zp8 -ei -zq # -5s : Pentium stack calling conventions. # -5r : Pentium register calling conventions. CFLAGS+= -5s .SUFFIXES: .SUFFIXES: .obj .c AOUT=mikmod.exe COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) OBJ = display.obj marchive.obj mconfedit.obj mconfig.obj mdialog.obj mikmod.obj mlist.obj mlistedit.obj & mmenu.obj mplayer.obj mutilities.obj mwidget.obj mwindow.obj rcfile.obj EXTRA_OBJ = mgetopt.obj mgetopt1.obj mfnmatch.obj all: $(AOUT) $(AOUT): $(OBJ) $(EXTRA_OBJ) wlink N $(AOUT) SYS NT LIBR {$(LIBS)} F {$(OBJ)} F {$(EXTRA_OBJ)} .c.obj: $(COMPILE) -fo=$^@ $< !ifndef __UNIX__ .c: ..\src distclean: clean .symbolic @if exist $(AOUT) del $(AOUT) clean: .symbolic @if exist *.obj del *.obj !else .c: ../src distclean: clean .symbolic rm -f $(AOUT) clean: .symbolic rm -f *.obj !endif mikmod-3.2.8/win32/MSVC6/0000755000000000000000000000000013117572536013314 5ustar rootrootmikmod-3.2.8/win32/MSVC6/mikmod.dsw0000644000000000000000000000103112226306364015300 0ustar rootrootMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "mikmod"=".\mikmod.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### mikmod-3.2.8/win32/MSVC6/mikmod.dsp0000644000000000000000000001452712226306364015307 0ustar rootroot# Microsoft Developer Studio Project File - Name="mikmod" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=mikmod - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "mikmod.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "mikmod.mak" CFG="mikmod - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "mikmod - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mikmod - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "mikmod - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\win32" /I "..\..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "HAVE_CONFIG_H" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib libmikmod.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "mikmod - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\win32" /I "..\..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "HAVE_CONFIG_H" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib libmikmod.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "mikmod - Win32 Release" # Name "mikmod - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\src\display.c # End Source File # Begin Source File SOURCE=..\..\src\marchive.c # End Source File # Begin Source File SOURCE=..\..\src\mconfedit.c # End Source File # Begin Source File SOURCE=..\..\src\mconfig.c # End Source File # Begin Source File SOURCE=..\..\src\mdialog.c # End Source File # Begin Source File SOURCE=..\..\src\mfnmatch.c # End Source File # Begin Source File SOURCE=..\..\src\mgetopt.c # End Source File # Begin Source File SOURCE=..\..\src\mgetopt1.c # End Source File # Begin Source File SOURCE=..\..\src\mikmod.c # End Source File # Begin Source File SOURCE=..\..\src\mlist.c # End Source File # Begin Source File SOURCE=..\..\src\mlistedit.c # End Source File # Begin Source File SOURCE=..\..\src\mmenu.c # End Source File # Begin Source File SOURCE=..\..\src\mplayer.c # End Source File # Begin Source File SOURCE=..\..\src\mutilities.c # End Source File # Begin Source File SOURCE=..\..\src\mwidget.c # End Source File # Begin Source File SOURCE=..\..\src\mwindow.c # End Source File # Begin Source File SOURCE=..\..\src\rcfile.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\config.h # End Source File # Begin Source File SOURCE=..\..\src\display.h # End Source File # Begin Source File SOURCE=..\..\src\keys.h # End Source File # Begin Source File SOURCE=..\..\src\marchive.h # End Source File # Begin Source File SOURCE=..\..\src\mconfedit.h # End Source File # Begin Source File SOURCE=..\..\src\mconfig.h # End Source File # Begin Source File SOURCE=..\..\src\mdialog.h # End Source File # Begin Source File SOURCE=..\..\src\mfnmatch.h # End Source File # Begin Source File SOURCE=..\..\src\mgetopt.h # End Source File # Begin Source File SOURCE=..\..\src\mlist.h # End Source File # Begin Source File SOURCE=..\..\src\mlistedit.h # End Source File # Begin Source File SOURCE=..\..\src\mmenu.h # End Source File # Begin Source File SOURCE=..\..\src\mplayer.h # End Source File # Begin Source File SOURCE=..\..\src\mthreads.h # End Source File # Begin Source File SOURCE=..\..\src\mutilities.h # End Source File # Begin Source File SOURCE=..\..\src\mwidget.h # End Source File # Begin Source File SOURCE=..\..\src\mwindow.h # End Source File # Begin Source File SOURCE=..\..\src\player.h # End Source File # Begin Source File SOURCE=..\..\src\rcfile.h # End Source File # Begin Source File SOURCE=..\winvideo.inc # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project mikmod-3.2.8/win32/VS2005/0000755000000000000000000000000013117572536013315 5ustar rootrootmikmod-3.2.8/win32/VS2005/mikmod.sln0000644000000000000000000000231612226306364015307 0ustar rootroot Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mikmod", "mikmod.vcproj", "{D3C21AC0-6154-451E-BDAA-26D4776D52E0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|Win32.ActiveCfg = Debug|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|Win32.Build.0 = Debug|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|x64.ActiveCfg = Debug|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|x64.Build.0 = Debug|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|Win32.ActiveCfg = Release|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|Win32.Build.0 = Release|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|x64.ActiveCfg = Release|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal mikmod-3.2.8/win32/VS2005/mikmod.vcproj0000644000000000000000000002266012226306364016022 0ustar rootroot mikmod-3.2.8/autotools/0000755000000000000000000000000013117572536013545 5ustar rootrootmikmod-3.2.8/autotools/mkinstalldirs0000755000000000000000000000672212255302430016344 0ustar rootroot#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the 'mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because '.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mikmod-3.2.8/autotools/config.guess0000755000000000000000000012564413032206764016072 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. timestamp='2017-01-01' # This file 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64el:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac cat >&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mikmod-3.2.8/autotools/missing0000755000000000000000000002370312255302430015133 0ustar rootroot#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.18; # UTC # Copyright (C) 1996-2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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 program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, 'missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file 'aclocal.m4' autoconf touch file 'configure' autoheader touch file 'config.h.in' autom4te touch the output file, or create a stub one automake touch all 'Makefile.in' files bison create 'y.tab.[ch]', if possible, from existing .[ch] flex create 'lex.yy.c', if possible, from existing .c help2man touch the output file lex create 'lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create 'y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running '$TOOL --version' or '$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'acinclude.m4' or '${configure_ac}'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified '${configure_ac}'. You might want to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'acconfig.h' or '${configure_ac}'. You might want to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: '$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get '$1' as part of Autoconf from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: '$1' $msg. You should only need it if you modified a '.y' file. You may need the Bison package in order for those modifications to take effect. You can get Bison from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a '.l' file. You may need the Flex package in order for those modifications to take effect. You can get Flex from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the Help2man package in order for those modifications to take effect. You can get Help2man from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a '.texi' or '.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy 'make' (AIX, DU, IRIX). You might want to install the Texinfo package or the GNU make package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: '$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the 'README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing '$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mikmod-3.2.8/autotools/compile0000755000000000000000000001610312255302430015106 0ustar rootroot#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-03-05.13; # UTC # Copyright (C) 1999-2012 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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 program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mikmod-3.2.8/autotools/depcomp0000755000000000000000000005600512255302430015112 0ustar rootroot#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-07-12.20; # UTC # Copyright (C) 1999-2012 Free Software Foundation, Inc. # 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 program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'` tmpdepfile="$base.d" # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir="$base.d-lock" trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0 ; do # mkdir is a portable test-and-set. if mkdir $lockdir 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rm -rf $lockdir break else ## the lock is being held by a different process, ## wait until the winning process is done or we timeout while test -d $lockdir && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mikmod-3.2.8/autotools/install-sh0000755000000000000000000003325512255302430015543 0ustar rootroot#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mikmod-3.2.8/autotools/config.sub0000755000000000000000000010703713032206764015531 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. timestamp='2017-01-01' # This file 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mikmod-3.2.8/NEWS0000644000000000000000000004315013117573656012222 0ustar rootrootSummary of changes between MikMod 3.2.7 and MikMod 3.2.8: ================================================================== MikMod 3.2.8 was released on June 14, 2017. - Fixed several warnings from clang static analyzer. - Fixed a misleading indentation warning from gcc6. - A few minor OS/2 fixes. - Support for building the Windows version using Open Watcom compiler. - Other minor fix/tidy-ups. Summary of changes between MikMod 3.2.6 and MikMod 3.2.7: ================================================================== MikMod 3.2.7 was released on 15-Nov-2015. - Documentation update. - Update DOS build for the new djgpp-2.05 release. Summary of changes between MikMod 3.2.5 and MikMod 3.2.6: ================================================================== MikMod 3.2.6 was released on 31-Aug-2014. - Fix curses linkage on some setups. (add -ltinfo if necessary.) - Windows version now relies on %USERPROFILE% instead of %HOME% for its config and playlist. - The dos version doesn't check %HOME% anymore and simply uses C: for its config and playlist. - Support for AmigaOS and its variants like MorphOS, AROS. (thanks to Szilard Biro for lots of help.) - Build system configuration and packaging simplifications, tidy-ups. - Configury: fix link tests for older binutils. - Cmake updates and improvements. Several makefile clean-ups. - Several portability tweaks. - Fix some OS/2 bit rot. (for nostalgia...) - Removed ancient convert_playlist script which used to supposed to convert pre-ancient mikmod playlists. Documentation updates. Summary of changes between MikMod 3.2.4 and MikMod 3.2.5: ================================================================== MikMod 3.2.5 was released on 10-Jan-2014. - New CMake build system. - Small autotols updates. - Fix configury $datadir variable expansion in PACKAGE_DATA_DIR. - Fix ALSA driver options menu for libmikmod2 versions >= 3.1.13. - Fix compilation against ancient libmikmod1 versions <= 3.1.6. - Several code clean-ups. Summary of changes between MikMod 3.2.3 and MikMod 3.2.4: ================================================================== MikMod 3.2.4 was released on 14/Oct/2013. This is a minor bug fix/maintenance release. - Addressed some snprintf issues and MSVC6 compilation issues. - New MSVC6 and VS2005 project files. The latter imports into newer Visual Studio versions, e.g. VS2012. - Use MikMod_free() on the string returned by Player_LoadTitle() if it is available. - Fixed some compiler warnings, minor cleanups. Summary of changes between MikMod 3.2.2 and MikMod 3.2.3: ================================================================== MikMod 3.2.3 was released on 05/Oct/2013. This is a maintenance release to fix minor bugs since mikmod-3.2.2 BUGFIXES - Made MikMod compilable against older versions of libmikmod without MikMod_Free(). - Fixed a minor buffer overrun (sf.net bug #2). - Fixed a minor string format issue. - Updated configury to support latest autotools. - Fixed djgpp builds. - Fixed windows mingw builds, proper win64 support. Summary of changes between MikMod 3.1.6 and MikMod 3.2.2 (Vitray): ================================================================== MikMod 3.2.2 was released on 23/Jun/2012 beta1: Mon Feb 2, 2004 beta0: never officially released THANKS - The winner of the ``it's rainy day, so I'll rewrite MikMod'' contest this time is Andrew Zabolotny. The colored MikMod looks great ! Thanks a lot ! - To Frank Loemker, who has done many changes since the last release in 1999, has improved the widget system a lot, added a file selector, theme support, improved the configuration routines, recursive directory scanning, made the player and library run in a separate thread, added win32 support (with lcc), fixed problems with DJGPP, and fixed a lot of small bugs. (please note that some of theses changes may have been done by Andrew Zabolotny. Frank Loemker sent me a big patch so I cannot know for sure who did what). NEW FEATURES - On terminals that support it, colors. There is a built-in theme editor in the configuration panel. Themes are loaded and saved from the config file. Set the environment variable TERM to mono to disable this under OS/2 and DOS. - Mikmod will now display it's version and the song name or filename currently being played in the terminal title bar. On unix, there is support for xterm compatible title setting (rxvt, Eterm, aixterm, dtterm...), and a few others (iris-ansi, hpterm). It is also supported under win32. - If using libmikmod 3.2, sample and instrument panels are dynamic, displaying which samples/instruments are currently played, and a volume panel displays volume bars and instruments/samples numbers. - A file selector for the load/insert/save operations: - Marks files which are in the actual playlist. - Includes the possibility to add/remove any number of entries to/from the playlist. - Directories can be changed with cursor keys and with an input line. - Editable hotlist allows quick switching to preferred directories. - Recursive directory scanning if "Add" or "Toggle" is used if a directory is selected. - Recursive directory scanning at startup with the option "-y, -di[rectory] dir Scan directory recursively for modules". - Threaded player (that is an own thread for MikMod_Update()), is switched off at compile time if the system supports no threads and at run tmie if libmikmod does not support threads. - Better archive support - Support for archivers which need short file names - The definition of archivers is loaded from the config file. - Many other improvements. - Of course, many bug fixes and clean ups. PLATFORM SPECIFIC - DOS is a supported platform again. - Can be compiled on WIN32 with lcc - Fixes for DJGPP - the MIKMOD_SRAND_CONSTANT environment variable can be used to set the srandom() seed on UNIX platforms. Its primary intent is to assist in testing - see https://bitbucket.org/shlomif/mikmod-test-suite . Summary of changes between MikMod 3.2.0 and MikMod 3.2.1: ================================================================ MikMod 3.2.1 was released on 07/10/2003 BUGFIXES - Enable/disable color gui should have appeared in configuration dialog, and On exit sub-menu in other options did not appear. NEW FEATURES - If a supported terminal is detected int the $TERM env var, MikMod will set the title bar with -= MikMod x.x.x =- followed by the song title between (). There is a configuration option for this in config->other_options Summary of changes between MikMod 3.1.6 and MikMod 3.2.0: ================================================================ MikMod 3.2.0 was released on 04/10/2003 THANKS - Info Saitz , the debian MikMod package maintainer for many bug fixes. BUGFIXES - Bugfixes from the debian MikMod package + cleaned up the documentation to match the output of the manpage, mikmod --help and the actual option processing. + Security fix when dealing with archives + Won't play LHA-compressed MODs with spaces in their names + Support for files with the extension prepended to the filename. Pretty common on Aminet. Maybe an Amiga convention? + Installed new versions of configure.{guess.sub} to support compiling on newer arches. They are taken from autotools-dev 20030110.1. NEW FEATURES - Color ncurse interface, and Option to enable/disable it. - Option to quit MikMod automatically when the playlist is finished. Summary of changes between MikMod 3.1.5 and MikMod 3.1.6 (Riom): ================================================================ MikMod 3.1.6 was released on 07/05/1999. THANKS - As usual, Frank Loemker contributed lots of stuff to the player. Thanks for your work. BUGFIXES - MikMod segfaulted when run as root (there was a public patch to 3.1.5 for this). - The mono/stereo setting in the -output option was ignored. - The frequency range was restricted to 8kHz-44.1kHz without reason. - Loading playlist not located in the current directory should work now. NEW FEATURES - Interface is even more featured: * On-screen configuration panel. * Playlist sorting, loading files or playlists from the player. - Added a restart module (R key) feature. REMOVED FEATURES - Support for the ARJ archiver has been dropped, as unarj needed an 'extra to stdout' extra feature, and the URL of the patch gave me an error 404 recently... Besides, ARJ isn't widely used in the Unix world (perhaps because we don't like plagiarism...) PLATFORM SPECIFIC - Fixed a compilation problem on HP-UX systems lacking ncurses (HP-UX curses doesn't define KEY_END). Summary of changes between MikMod 3.1.2 and MikMod 3.1.5 (Pradelles): ===================================================================== MikMod 3.1.5 was released on 03/01/1999. Starting from this version, the engine (libmikmod) and the module player (MikMod) are made separate, to make the life easier for people who use libmikmod and don't need the player. THANKS - The player was nearly completely rewritten by Frank Loemker. Nice job ! BUGFIXES - If the player is interrupted while loading a compressed file, a temporary file was not removed. - Dealing with archives containing a lot of files hanged the player at start (under Unix only). - When playing from a playlist, the last file of the playlist was played twice. NEW FEATURES - Player now displays which information panels are available, and should look better with less than 80 character wide terminals. - Bzip2 compressed modules, as well as tar and compressed tar archives, are recognized. - MikMod now stores your default settings in $HOME/.mikmodrc, so you don't have to specify a butch of options each time you invoke MikMod. Summary of changes between MikMod 3.1.1 and MikMod 3.1.2 (Monistrol): ===================================================================== MikMod 3.1.2 was released on 12/07/1998. THANKS - For this version, the special thanks distinction is awarded to Michal Svec, Thomas Sailer and Winfried Scheibe. You guys rule ! And as usual, thanks to all the people who submitted bug reports and helped me to get rid of'em. BUG FIXES - Due to an inverted test, the DSM loader rejected every valid DSM module. - Surround panning was misunderstood by the DSM loader. - FAR modules with more than 64 notes per pattern were incorrectly rejected. - report whether an IT module was compressed or not wasn't accurate. - STM identification test was broken and didn't reject some incorrect modules. - A few glitches in the pattern break and pattern jump effect have been fixed (thanks to Firelight for his "Backwards" module which showed the problem !) - The OSS driver had a serious memory allocation bug which could cause systematic coredumps, depending on your hardware and your environment variable settings. - Archive support didn't work correctly with some versions of lharc (1.01, 1.14c+) and unzip (5.40+), hopefully they should work now. NEW FEATURES - Support for rar archives has been added. The player looks for 'unrar' to display and extract the archives ; don't forget to put a symbolic link if you only have rar. PLATFORM SPECIFIC - The Sun audio driver didn't work correctly at 44100 Hz 16 bit stereo under Solaris, due to an incorrect default buffer size. - The generated Makefiles for Watcom C++ under OS/2 were incorrect. - When compiling with emx under OS/2, the optimization level was set too high and caused incorrect playback for some modules. MISC - I've found more DSM information to throw in the documentation. Summary of changes between MikMod 3.1 and MikMod 3.1.1 (Landos): ================================================================ MikMod 3.1.1 was released on 12/02/1998. This version contains only bugfixes and was released shortly after 3.1 because of a really annoying bug in the error messages. THANKS - Special thanks to Scott Miller for his help in tracking a nasty bug. And as usual, thanks to all the people who submitted bug reports and helped me to get rid of'em. BUG FIXES - Due to a missing coma, most error message texts didn't correspond to what was really happening. - MikMod 3.1 was too strict regarding the S3M speed effect and did not allow >32 speeds. - The 15 instrument MOD loader has been made more robust by recognizing and some non module filetypes which could be misunderstood as valid modules and caused coredumps. - IT effects S5x (set panbrello waveform), S7x (instrument/NNA commands) and SAx (set sample offset high part) were not processed correctly. - Modules written by Impulse Tracker 2.14p3 in the uncompressed Impulse 2 format could be rejected (detection routine had to be modified to cope with an IT2.14p3 save bug...) PLATFORM SPECIFIC - A bug in the configure script prevented MikMod from compiling correctly under IRIX, AIX and perhaps some other Unices. - Another bug in the configure script caused the detection of esd_close() in libesd to always return true. - The README.OS2 file was missing in 3.1 Summary of changes between MikMod 3.0.4 and MikMod 3.1 (Davayat): ================================================================= MikMod 3.1 was released on 11/30/1998. THANKS - Many thanks to Bjornar Henden, Steve Martin, "MenTaLguY", Sebastiaan Megens and Thomas Neumann for their precise bug reports and bug fixes. Also thanks to all the people who submitted bug reports and helped me to make MikMod better. Thanks, guys ! BUG FIXES - Panning overflows which resulted in extra noises of high volume )-: are now fixed. - Surround mixer fixed. - 669 pitch slides are rendered correctly now (used logarithmic periods before). - FAR modules now play at correct speed, and more effects implemented. - IT pitch envelope now works correctly. - IT effect G (porta to note) misbehaviour when changing instrument on the same row, or after a note cut, fixed. - IT volume column effect G was misunderstood (G0 was treated as G1, G1 as G2 etc). - Lots of bug fixes in MED loader. Should now play modules at correct speed, but still not perfect. - Some notes were not played in MODs. - Some effect fixes in ULT loader. - The S3M volume slides were not rendered correctly. - XM modules with more than 256 samples caused systematic coredumps when trying to load them. - XM effect G (set global volume) was misinterpreted, resulting in halved volumes during playback. NEW FEATURES - MikMod now plays DMP's AMF files. - A "curious" option has been added to look for extra patterns in MODs, S3Ms and ITs (useful for some Skaven's modules). - MikMod now uses autoconf for building, and you can build a shared MikMod library. - Programmer's documentation in texinfo format, suitable for online browsing (with GNU info) as well as printing. API function names made more consistant and more thematic. PLATFORM SPECIFIC - New driver for the Advanced Linux Sound Architecture (ALSA). - The EsounD driver has been improved and will attempt daemon reconnection on a regular time basis, should the esd been killed. - The SGI driver caused coredumps on some machines ; hopefully this is now fixed. - integrated OS/2 support, with a new DART driver for use under Warp 4 and CPU snagger feature. MISC - I was asked to put a copyright notice in MikMod. Although I don't like that, it seems that there has to be one to be sure the GPL and LGPL apply correctly. I really hate copyrighting free software I haven't entirely written... - I've also shaved my beard the day before this release. Nice to see there was still skin under the thick beard (-: Summary of changes between MikMod 3.0.3 and MikMod 3.0.4 (Combronde): ===================================================================== MikMod 3.0.4 was released on 09/21/1998. BUG FIXES - FAR, STM and ULT loader are fixed and work (at least for me...) - Imbricated loops won't block the player. - Updated all the old drivers to work with MikMod 3 interface. - Nosound driver now works. - 669 modules are now played at correct speed. - MED loader pattern size bug fixed. - MOD sample offsets (in file) computation fixed. - S3M with more than 16 channels (i.e not created with Scream Tracker) caused previous version to coredump, but worked in 2.* - End of song marker is now recognized in S3M and IT when it appears inside the pattern list. - It was possible to register the same loader or driver twice and this made the library hang. - Speed and Tempo can't escape their bounds (1-31 for speed, 32-255 for tempo) now. - Delay note effect did not work correctly in previous version, but did in 2.* - All divide by zero conditions are prevented. - Archive code forgot to erase its temporary file (and had too short buffers). - More accurate error messages in player. NEW FEATURES - Compressed IT samples are now supported. - If you use ncurses >= 4.0, MikMod is resize-aware and will continue to display correctly in an xterm. - New driver for the Enlightened sound daemon (http://www.tux.org/~ricdude/EsounD.html) - New "volume fadeout" option. - New "don't loop" option. - Help screen in the curses player. - Module time is displayed in the player. - MikMod 2 banners are back. - Randomized playlist can now be walked through correctly. REMOVED FEATURES - The Unimod format is not supported anymore (nobody used it, right ?). The MikCvt utility has been withdrawn, too. Both will be put back on request if someone really need them. Just ask ! PLATFORM SPECIFIC - OpenBSD support, although in mono 8bit 8000 Hz only, but that's a start. - Merged NetBSD and FreeBSD specific patches from their "ports collection". - Player works with old AIX curses, as well as with old HP-UX curses. MISC - Rewritten building mechanism. It's not yet Autoconf, but it's coming... - License terms are clear : LGPL for the library, GPL for the player. mikmod-3.2.8/m4/0000755000000000000000000000000013117572536012034 5ustar rootrootmikmod-3.2.8/m4/ax_define_dir.m40000644000000000000000000000352511634743340015056 0ustar rootroot# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_define_dir.html # =========================================================================== # # OBSOLETE MACRO # # Deprecated because it does not comply with the GNU Coding Standards. See # the autoconf manual section "Defining Directories" for alternatives. # # SYNOPSIS # # AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) # # DESCRIPTION # # This macro sets VARNAME to the expansion of the DIR variable, taking # care of fixing up ${prefix} and such. # # VARNAME is then offered as both an output variable and a C preprocessor # symbol. # # Example: # # AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) # # LICENSE # # Copyright (c) 2008 Stepan Kasal # Copyright (c) 2008 Andreas Schwab # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2008 Alexandre Oliva # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 8 AU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) AC_DEFUN([AX_DEFINE_DIR], [ prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn dnl refers to ${prefix}. Thus we have to use `eval' twice. eval ax_define_dir="\"[$]$2\"" eval ax_define_dir="\"$ax_define_dir\"" AC_SUBST($1, "$ax_define_dir") AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3]) test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ]) mikmod-3.2.8/m4/libmikmod.m40000644000000000000000000002202012237151100014217 0ustar rootroot# Configure paths for libmikmod # # Derived from glib.m4 (Owen Taylor 97-11-3) # Improved by Chris Butler # dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and dnl LIBMIKMOD_LDADD dnl AC_DEFUN([AM_PATH_LIBMIKMOD], [dnl dnl Get the cflags and libraries from the libmikmod-config script dnl AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)], libmikmod_config_prefix="$withval", libmikmod_config_prefix="") AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)], libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="") AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program], , enable_libmikmodtest=yes) if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no) min_libmikmod_version=ifelse([$1], ,3.1.5,$1) AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version) no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" AC_LANG_SAVE AC_LANG_C CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" dnl dnl Now check if the installed libmikmod is sufficiently new. (Also sanity dnl checks the results of libmikmod-config to some extent dnl rm -f conf.mikmodtest AC_TRY_RUN([ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *) malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main() { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; char *tmp_version; system("touch conf.mikmodtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_libmikmod_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255; libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255; libmikmod_micro_version=(MikMod_GetVersion() ) & 255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_RESTORE fi fi if test "x$no_libmikmod" = x ; then AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`]) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([ #include #include ], [ return (MikMod_GetVersion()!=0); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_RESTORE fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBMIKMOD_CFLAGS) AC_SUBST(LIBMIKMOD_LIBS) AC_SUBST(LIBMIKMOD_LDADD) rm -f conf.mikmodtest ]) mikmod-3.2.8/config.h.cmake0000644000000000000000000001017712361532174014211 0ustar rootroot/* Define if your system is AIX 3.* - might be needed for 4.* too. */ #cmakedefine AIX /* Define if your copy of has a _P instead of __P (old Linux libc5). */ #cmakedefine BROKEN_SCHED /* Define to 1 if `TIOCGWINSZ' requires . */ #cmakedefine GWINSZ_IN_SYS_IOCTL /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CURSES_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FCNTL_H /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #cmakedefine HAVE_FNMATCH /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FNMATCH_H /* Define to 1 if you have the `getopt_long_only' function. */ #cmakedefine HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #cmakedefine HAVE_MIKMOD_FREE /* Define to 1 if you have the `mkstemp' function. */ #cmakedefine HAVE_MKSTEMP /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NCURSES_CURSES_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NCURSES_H /* Define if your libncurses defines resizeterm (not found in <4.2). */ #cmakedefine HAVE_NCURSES_RESIZETERM /* Define if your system provides POSIX.4 threads. */ #cmakedefine HAVE_PTHREAD /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SCHED_H /* Define to 1 if you have the `snprintf' function. */ #cmakedefine HAVE_SNPRINTF /* Define to 1 if you have the `srandom' function. */ #cmakedefine HAVE_SRANDOM /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H /* Define to 1 if you have the `strerror' function. */ #cmakedefine HAVE_STRERROR /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRING_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #cmakedefine HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #cmakedefine HAVE_USLEEP /* Define if your system has the prototype for usleep(3). */ #cmakedefine HAVE_USLEEP_PROTO /* Define to 1 if you have the `vprintf' function. */ #cmakedefine HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #cmakedefine HAVE_VSNPRINTF /* Define the directory for shared data. */ #cmakedefine PACKAGE_DATA_DIR "${PACKAGE_DATA_DIR}" /* Define as the return type of signal handlers (`int' or `void'). */ #cmakedefine RETSIGTYPE ${RETSIGTYPE} /* Define if your system is SOLARIS. */ #cmakedefine SOLARIS /* Define if your system defines random(3) and srandom(3) in math.h instead of stdlib.h. */ #cmakedefine SRANDOM_IN_MATH_H /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS /* Define to 1 if you can safely include both and . */ #cmakedefine TIME_WITH_SYS_TIME /* Version number of package */ #cmakedefine VERSION "${VERSION}" /* Define to empty if `const' does not conform to ANSI C. */ #cmakedefine const /* Define to `int' if does not define. */ #cmakedefine pid_t /* Define to `unsigned int' if does not define. */ #cmakedefine size_t mikmod-3.2.8/configure0000755000000000000000000063150613071724200013420 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for mikmod 3.2.8. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mikmod' PACKAGE_TARNAME='mikmod' PACKAGE_VERSION='3.2.8' PACKAGE_STRING='mikmod 3.2.8' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/mikmod.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS PLAYER_LIB EXTRA_OBJ PACKAGE_DATA_DIR LIBOBJS LIBMIKMOD_LDADD LIBMIKMOD_LIBS LIBMIKMOD_CFLAGS LIBMIKMOD_CONFIG EGREP GREP LN_S CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_threads enable_dependency_tracking with_libmikmod_prefix with_libmikmod_exec_prefix enable_libmikmodtest ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures mikmod 3.2.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/mikmod] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of mikmod 3.2.8:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-threads use an own thread for the player [default=guessed] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libmikmodtest Do not try to compile and run a test libmikmod program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional) --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF mikmod configure 3.2.8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO" then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by mikmod $as_me 3.2.8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in autotools "$srcdir"/autotools do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in autotools \"$srcdir\"/autotools" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='mikmod' VERSION='3.2.8' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac mikmod_threads=yes # Check whether --enable-threads was given. if test "${enable_threads+set}" = set then : enableval=$enable_threads; if test "$enableval" = "yes" then mikmod_threads=yes else mikmod_threads=no fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file" then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" = maybe && test "x$build" != "x$host"; then cross_compiling=yes elif test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main (void) { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test $ac_cv_c_compiler_gnu = yes ; then CFLAGS="$CFLAGS -Wall" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1 then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1 then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main (void) { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1 then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1 then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main (void) { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main (void) { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fnmatch.h do : ac_fn_c_check_header_mongrel "$LINENO" "fnmatch.h" "ac_cv_header_fnmatch_h" "$ac_includes_default" if test "x$ac_cv_header_fnmatch_h" = xyes then : cat >>confdefs.h <<_ACEOF #define HAVE_FNMATCH_H 1 _ACEOF fi done for ac_header in sched.h do : ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" if test "x$ac_cv_header_sched_h" = xyes then : cat >>confdefs.h <<_ACEOF #define HAVE_SCHED_H 1 _ACEOF fi done for ac_header in ncurses.h curses.h ncurses/curses.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in termios.h do : ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : cat >>confdefs.h <<_ACEOF #define HAVE_TERMIOS_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termios.h defines TIOCGWINSZ" >&5 $as_echo_n "checking whether termios.h defines TIOCGWINSZ... " >&6; } if ${ac_cv_sys_tiocgwinsz_in_termios_h+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1 then : ac_cv_sys_tiocgwinsz_in_termios_h=yes else ac_cv_sys_tiocgwinsz_in_termios_h=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 $as_echo "$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 $as_echo_n "checking whether sys/ioctl.h defines TIOCGWINSZ... " >&6; } if ${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1 then : ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes else ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 $as_echo "$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then $as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h fi fi case "$host_os" in linux*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sched.h is correct" >&5 $as_echo_n "checking whether sched.h is correct... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { sched_yield(); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : broken_sched=no else broken_sched=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$broken_sched" = "yes" then $as_echo "#define BROKEN_SCHED 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi ;; esac # Check whether --with-libmikmod-prefix was given. if test "${with_libmikmod_prefix+set}" = set then : withval=$with_libmikmod_prefix; libmikmod_config_prefix="$withval" else libmikmod_config_prefix="" fi # Check whether --with-libmikmod-exec-prefix was given. if test "${with_libmikmod_exec_prefix+set}" = set then : withval=$with_libmikmod_exec_prefix; libmikmod_config_exec_prefix="$withval" else libmikmod_config_exec_prefix="" fi # Check whether --enable-libmikmodtest was given. if test "${enable_libmikmodtest+set}" = set then : enableval=$enable_libmikmodtest; else enable_libmikmodtest=yes fi if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi # Extract the first word of "libmikmod-config", so it can be a program name with args. set dummy libmikmod-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBMIKMOD_CONFIG+:} false then : $as_echo_n "(cached) " >&6 else case $LIBMIKMOD_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBMIKMOD_CONFIG="$LIBMIKMOD_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBMIKMOD_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBMIKMOD_CONFIG" && ac_cv_path_LIBMIKMOD_CONFIG="no" ;; esac fi LIBMIKMOD_CONFIG=$ac_cv_path_LIBMIKMOD_CONFIG if test -n "$LIBMIKMOD_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBMIKMOD_CONFIG" >&5 $as_echo "$LIBMIKMOD_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_libmikmod_version=3.1.5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmikmod - version >= $min_libmikmod_version" >&5 $as_echo_n "checking for libmikmod - version >= $min_libmikmod_version... " >&6; } no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" rm -f conf.mikmodtest if test "$cross_compiling" = yes then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *) malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main() { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; char *tmp_version; system("touch conf.mikmodtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_libmikmod_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255; libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255; libmikmod_micro_version=(MikMod_GetVersion() ) & 255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO" then : else no_libmikmod=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi if test "x$no_libmikmod" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, \`$LIBMIKMOD_CONFIG --version\`" >&5 $as_echo "yes, \`$LIBMIKMOD_CONFIG --version\`" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { return (MikMod_GetVersion()!=0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" as_fn_error $? " --- ERROR: No suitable libmikmod library found. You need at least libmikmod 3.1.5 for this program to work. " "$LINENO" 5 fi rm -f conf.mikmodtest # MikMod_free() is in libmikmod-3.2.0b3 and later. The only fool-proof # way of detecting MikMod_free() is a configury check at compile time # or a dlsym() check at runtime, and the bad thing is 3.2.0beta1/2 were # (still are?) in distros.. ac_save_LIBS=$LIBS LIBS="$LIBS $LIBMIKMOD_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MikMod_free in -lmikmod" >&5 $as_echo_n "checking for MikMod_free in -lmikmod... " >&6; } if ${ac_cv_lib_mikmod_MikMod_free+:} false then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmikmod $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MikMod_free (); int main (void) { return MikMod_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_mikmod_MikMod_free=yes else ac_cv_lib_mikmod_MikMod_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mikmod_MikMod_free" >&5 $as_echo "$ac_cv_lib_mikmod_MikMod_free" >&6; } if test "x$ac_cv_lib_mikmod_MikMod_free" = xyes then : $as_echo "#define HAVE_MIKMOD_FREE 1" >>confdefs.h fi LIBS="$ac_save_LIBS" case $host_os in mingw*|emx*|*djgpp) need_curses=no ;; *) need_curses=yes ;; esac if test "$need_curses" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 $as_echo_n "checking for initscr in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_initscr+:} false then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main (void) { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ncurses_initscr=yes else ac_cv_lib_ncurses_initscr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 $as_echo "$ac_cv_lib_ncurses_initscr" >&6; } if test "x$ac_cv_lib_ncurses_initscr" = xyes then : libcurses=ncurses else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lcurses" >&5 $as_echo_n "checking for initscr in -lcurses... " >&6; } if ${ac_cv_lib_curses_initscr+:} false then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main (void) { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_curses_initscr=yes else ac_cv_lib_curses_initscr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_initscr" >&5 $as_echo "$ac_cv_lib_curses_initscr" >&6; } if test "x$ac_cv_lib_curses_initscr" = xyes then : libcurses=curses else as_fn_error $? "--- ERROR: No curses library found." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetflag in -ltinfo" >&5 $as_echo_n "checking for tgetflag in -ltinfo... " >&6; } if ${ac_cv_lib_tinfo_tgetflag+:} false then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltinfo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tgetflag (); int main (void) { return tgetflag (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_tinfo_tgetflag=yes else ac_cv_lib_tinfo_tgetflag=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetflag" >&5 $as_echo "$ac_cv_lib_tinfo_tgetflag" >&6; } if test "x$ac_cv_lib_tinfo_tgetflag" = xyes then : have_tinfo=yes else have_tinfo=no fi as_ac_Lib=`$as_echo "ac_cv_lib_$libcurses''_resizeterm" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resizeterm in -l$libcurses" >&5 $as_echo_n "checking for resizeterm in -l$libcurses... " >&6; } if eval \${$as_ac_Lib+:} false then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$libcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char resizeterm (); int main (void) { return resizeterm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : $as_echo "#define HAVE_NCURSES_RESIZETERM 1" >>confdefs.h fi ac_save_LIBS=$LIBS LIBS="$LIBS -l$libcurses" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether curses links without libtinfo" >&5 $as_echo_n "checking whether curses links without libtinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #elif defined(HAVE_NCURSES_CURSES_H) #include #endif int main (void) { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : need_tinfo=no else need_tinfo=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$need_tinfo" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$have_tinfo" = "no" ; then as_fn_error $? "--- ERROR: libtinfo needed for ncurses, but not found." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ncurses links with libtinfo" >&5 $as_echo_n "checking whether ncurses links with libtinfo... " >&6; } LIBS="$LIBS -ltinfo" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #endif int main (void) { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "--- ERROR: failed linking to ncurses library." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi LIBS="$ac_save_LIBS" fi case "$host_os" in # mikmod_threads variable is for pthreads only mingw*|amigaos*|aros*|morphos*) mikmod_threads=no ;; esac if test "$mikmod_threads" = "yes"; then mikmod_threads=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main (void) { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes then : mikmod_threads=-lpthread else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_init in -lc_r" >&5 $as_echo_n "checking for pthread_attr_init in -lc_r... " >&6; } if ${ac_cv_lib_c_r_pthread_attr_init+:} false then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_attr_init (); int main (void) { return pthread_attr_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_r_pthread_attr_init=yes else ac_cv_lib_c_r_pthread_attr_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_attr_init" >&5 $as_echo "$ac_cv_lib_c_r_pthread_attr_init" >&6; } if test "x$ac_cv_lib_c_r_pthread_attr_init" = xyes then : mikmod_threads=-lc_r fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working POSIX fnmatch" >&5 $as_echo_n "checking for working POSIX fnmatch... " >&6; } if ${ac_cv_func_fnmatch_works+:} false then : $as_echo_n "(cached) " >&6 else # Some versions of Solaris, SCO, and the GNU C Library # have a broken or incompatible fnmatch. # So we run a test program. If we are cross-compiling, take no chance. # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. if test "$cross_compiling" = yes then : ac_cv_func_fnmatch_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) int main (void) { return (!(y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && 1)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_fnmatch_works=yes else ac_cv_func_fnmatch_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fnmatch_works" >&5 $as_echo "$ac_cv_func_fnmatch_works" >&6; } if test $ac_cv_func_fnmatch_works = yes then : $as_echo "#define HAVE_FNMATCH 1" >>confdefs.h fi if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1 then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1 then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF else ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in getopt_long_only do : ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" if test "x$ac_cv_func_getopt_long_only" = xyes then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_LONG_ONLY 1 _ACEOF have_getopt_long_only=yes fi done for ac_func in mkstemp srandom snprintf vsnprintf strerror do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "usleep" >/dev/null 2>&1 then : $as_echo "#define HAVE_USLEEP_PROTO 1" >>confdefs.h fi rm -f conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "usleep" >/dev/null 2>&1 then : $as_echo "#define HAVE_USLEEP_PROTO 1" >>confdefs.h fi rm -f conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "srandom" >/dev/null 2>&1 then : $as_echo "#define SRANDOM_IN_MATH_H 1" >>confdefs.h fi rm -f conftest* ax_package_data_dir="${datadir}/${PACKAGE}" prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ax_define_dir="\"$ax_package_data_dir\"" eval ax_define_dir="\"$ax_define_dir\"" PACKAGE_DATA_DIR="$ax_define_dir" cat >>confdefs.h <<_ACEOF #define PACKAGE_DATA_DIR "$ax_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE case $host in *-aix*) $as_echo "#define AIX 1" >>confdefs.h ;; esac if test "$mikmod_threads" != "no"; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h CFLAGS="$CFLAGS -D_REENTRANT" PLAYER_LIB="$mikmod_threads $PLAYER_LIB" REENTRANT="-D_REENTRANT" fi case $host in *-*-solaris*) if test "$mikmod_threads" != "no"; then have_usleep=no else for ac_func in usleep do : ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes then : cat >>confdefs.h <<_ACEOF #define HAVE_USLEEP 1 _ACEOF have_usleep=yes fi done fi $as_echo "#define SOLARIS 1" >>confdefs.h ;; *) for ac_func in usleep do : ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes then : cat >>confdefs.h <<_ACEOF #define HAVE_USLEEP 1 _ACEOF have_usleep=yes fi done ;; esac if test "$have_getopt_long_only" != "yes"; then EXTRA_OBJ="mgetopt.o mgetopt1.o $EXTRA_OBJ" fi if test "$ac_cv_func_fnmatch_works" != "yes"; then EXTRA_OBJ="mfnmatch.o $EXTRA_OBJ" fi if test "$have_usleep" != "yes"; then EXTRA_OBJ="musleep.o $EXTRA_OBJ" fi if test "$need_curses" = "yes"; then PLAYER_LIB="$PLAYER_LIB -l$libcurses" if test "$need_tinfo" = "yes"; then PLAYER_LIB="$PLAYER_LIB -ltinfo" fi fi ac_config_files="$ac_config_files Makefile src/Makefile" ac_config_headers="$ac_config_headers config.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by mikmod $as_me 3.2.8, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ mikmod config.status 3.2.8 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi mikmod-3.2.8/dos/0000755000000000000000000000000013117572536012301 5ustar rootrootmikmod-3.2.8/dos/config.h0000644000000000000000000000323312620611030013675 0ustar rootroot/* config.h.in. Generated manually for DOS/DJGPP. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE 1 /* djgpp-v2.04 and newer provide snprintf() and vsnprintf(). * djgpp-v2.05 is already released, so let's enable them by * default here. */ /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define if your system has a working fnmatch function. */ #define HAVE_FNMATCH 1 /* Define if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define if you have the mkstemp function. */ #define HAVE_MKSTEMP 1 /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define if your system has random(3) and srandom(3) */ #define HAVE_SRANDOM 1 /* Define if your system has strerror(3) */ #define HAVE_STRERROR 1 /* Define if you have the usleep function. */ #define HAVE_USLEEP 1 /* Define if your system has the prototype for usleep(3). */ #define HAVE_USLEEP_PROTO /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_FNMATCH_H 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 mikmod-3.2.8/dos/Makefile.dj0000644000000000000000000000672112525260004014325 0ustar rootroot#------------------------------------------------------------------------------# # Makefile for building MikMod under DOS/DJGPP # # This is a Makefile designed explicitly for GNU Make. # NOTE: Edit config.h, if necessary. #------------------------------------------------------------------------------# # Set to 1 for debug build DEBUG = 0 # The tools ifeq ($(CROSS),) CC=gcc AS=as else CC=$(CROSS)-gcc AS=$(CROSS)-as endif LD = $(CC) CFLAGS = -DHAVE_CONFIG_H $(INCLUDE) INCLUDE = -I. -I../src LDFLAGS = -L. -lmikmod ifeq ($(DEBUG),1) CFLAGS += -g -Wall else CFLAGS += -O2 -Wall -fomit-frame-pointer -ffast-math endif # Build rules %.o: ../src/%.c $(CC) -c $(CFLAGS) -o $@ $< SRC = $(filter-out %mfnmatch.c %musleep.c,$(wildcard ../src/*.c)) OBJ = $(notdir $(SRC:.c=.o)) all: mikmod.exe depend: makedep -r -DHAVE_CONFIG_H -D__DJGPP__ $(INCLUDE) $(SRC) -f Makefile.dj mikmod.exe: $(OBJ) $(LD) -o $@ $^ $(LDFLAGS) clean: rm -rf $(OBJ) mikmod.exe # DO NOT DELETE this line - makedep uses it as a separator line display.o: ../src/display.c config.h ../src/mgetopt.h ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h ../src/mconfedit.h ../src/mmenu.h \ ../src/keys.h ../src/mplayer.h ../src/mlistedit.h marchive.o: ../src/marchive.c config.h ../src/mgetopt.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h ../src/display.h mconfedit.o: ../src/mconfedit.c config.h ../src/rcfile.h ../src/mconfig.h ../src/mconfedit.h \ ../src/mmenu.h ../src/mwindow.h ../src/mlist.h ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h mconfig.o: ../src/mconfig.c config.h ../src/player.h ../src/mconfig.h ../src/rcfile.h ../src/mwindow.h \ ../src/mlist.h ../src/mutilities.h mdialog.o: ../src/mdialog.c config.h ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h \ ../src/mdialog.h ../src/display.h ../src/mutilities.h mikmod.o: ../src/mikmod.c config.h ../src/mgetopt.h ../src/player.h ../src/mutilities.h ../src/display.h \ ../src/rcfile.h ../src/mconfig.h ../src/mlist.h ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h \ ../src/marchive.h ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h mlist.o: ../src/mlist.c config.h ../src/mgetopt.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h mlistedit.o: ../src/mlistedit.c config.h ../src/mgetopt.h ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h ../src/player.h ../src/mdialog.h \ ../src/mwidget.h ../src/mconfedit.h ../src/marchive.h ../src/keys.h ../src/display.h ../src/mutilities.h mmenu.o: ../src/mmenu.c config.h ../src/display.h ../src/mmenu.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h ../src/keys.h ../src/mutilities.h mplayer.o: ../src/mplayer.c config.h ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h ../src/rcfile.h \ ../src/mutilities.h mutilities.o: ../src/mutilities.c config.h ../src/mgetopt.h ../src/player.h ../src/mlist.h \ ../src/marchive.h ../src/mutilities.h mwidget.o: ../src/mwidget.c config.h ../src/display.h ../src/player.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mwidget.h ../src/keys.h ../src/mutilities.h mwindow.o: ../src/mwindow.c config.h ../src/display.h ../src/player.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h ../src/keys.h ../src/mthreads.h ../src/dosvideo.inc rcfile.o: ../src/rcfile.c config.h ../src/rcfile.h mgetopt.o: ../src/mgetopt.h mgetopt1.o: ../src/mgetopt.h mikmod-3.2.8/dos/README0000644000000000000000000000556013071724104013154 0ustar rootroot Hello folks ! This is MikMod, version 3.2.8, a module player for DOS. Comments & feedback are welcome. >> BUILDING MIKMOD ------------------ - If you're not building libmikmod for DOS, then you're lost in the sources. Go up one directory, and read the main README file. This port has been designed to work only with DJGPP compiler. However, it should not be too complex to make it compile with any other compiler. If you manage to make libmikmod compile and work with another compiler, we'd like to hear from you. You'll likely have to write an appropiate makefile, or build things manually ... You should have pre-built libmikmod.a either in %DJGPP%/lib or in $(MIKMOD) (see Makefile) directory. Refer to the libmikmod source for instructions on how to build libmikmod under DOS. If you have all proper tools installed, just type make -f Makefile.dj You should end up with a MIKMOD.EXE binary in the current directory. >> USING MIKMOD --------------- Run MikMod with the ``--help'' parameter to get the available options. Program documentation is available as an Unix man page (..\src\mikmod.1) which you can read if you've got a port of the 'man' tool. Also, after you've run MikMod for the first time, you might want to customize your mikmod.cfg file, either from the configuration panel or by editing the file yourself, so you won't need to supply the same options to MikMod all the time. This file will be created in in C:\ Once you're in the player, pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. >> THANKS --------- We would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- MikMod and libmikmod home page is located at SourceForge: http://mikmod.sourceforge.net/ http://sourceforge.net/projects/mikmod/ There's a mailing list (mikmod-public) for discussing the development of MikMod (new features, bugs, ideas...) Look for more information on the web site. Things related to the DOS port should also be forwarded to the DOS ``portmaster'', Andrew Zabolotny, at: bit@eltech.ru >> LAST NOTES ------------- We hope you'll enjoy using this version of MikMod as well as we enjoyed debugging and improving it. -- Miodrag ("Miod") Vallat, 10/19/1999 miodrag@mikmod.darkorb.net Andrew Zabolotny bit@eltech.ru mikmod-3.2.8/AUTHORS0000644000000000000000000000445612506451324012565 0ustar rootrootMikMod main authors ------------------- * Jean-Paul Mikkers (MikMak) wrote MikMod and maintained it until version 3. * Jake Stine (Air Richter) [email doesn't work anymore...] made decisive contributions to the code (esp. IT support) and maintained MikMod version 3 until it was discontinued. * Frank Loemker rewrote nearly all the player, adding lots of features (independent panels, windowing system, playlist editor, better archive support, etc). * Andrew Zabolotny ported to DOS, added color support, volume panel, dynamic panels. Unix maintainers --------------- * Ozkan Sezer Took over the baton from Shlomi in 2013. (current maintainer.) * Shlomi Fish, http://www.shlomifish.org/ Revived the project after many years of inactivity, in 2012. * Steve McIntyre maintained MikMod'Unix version 2, and wrote the curses interface and the archive support. * Peter Amstutz maintained MikMod'Unix version 3.0, and wrote the playlist support. * Miodrag Vallat Maintained and developed MikMod from version 3.0.4 up to version 3.1.6, made an audit of the code resulting in many bugs fixed. * Raphael Assenat Initially added color to Mikmod 3.1.6, thus releasing version 3.2.0. Using patches contributed by Frank Loemker, has finally released MikMod 3.2.2, which contains many changes and improvements that had been made since version 3.1.6 but never officially released. Revived the project in 2003, and passed the baton to Shlomi Fish in 2012. Contributors on the Unix side ----------------------------- * "MenTaLguY" autoconfized the Unix MikMod distribution. Contributors on other platforms ------------------------------- * Anders Bjoerklund ported MikMod 3 to the Macintosh. * Dimitri Boldyrev ported MikMod 2 to the Macintosh. * Shlomi Fish, http://www.shlomifish.org/ ported MikMod to Java, and contributed bug fixes. * Stefan Tibus ported MikMod to OS/2. * Tinic Urou <5uro@informatik.uni-hamburg.de> ported MikMod 2 to BeOS. -- If your name is missing, don't hesitate to remind the current maintainer. mikmod-3.2.8/mikmodrc0000644000000000000000000002165713071724104013244 0ustar rootroot# # -= MikMod 3.2.8 =- # configuration file # # DRIVER = , nth driver for output, default: 0 DRIVER = 0 # DRV_OPTIONS = "options", the driver options, e.g. "buffer=14,count=16" # for the OSS-driver DRV_OPTIONS = "" # STEREO = Yes|No, stereo or mono output, default: stereo STEREO = yes # 16BIT = Yes|No, 8 or 16 bit output, default: 16 bit 16BIT = yes # FREQUENCY = , mixing frequency, default: 44100 Hz FREQUENCY = 44100 # INTERPOLATE = Yes|No, use interpolate mixing, default: Yes INTERPOLATE = yes # HQMIXER = Yes|No, use high-quality (but slow) software mixer, default: No HQMIXER = no # SURROUND = Yes|No, use surround mixing, default: No SURROUND = no # REVERB = , set reverb amount (0-15), default: 0 (none) REVERB = 0 # VOLUME = , volume from 0 (silence) to 100, default: 100 VOLUME = 100 # VOLRESTRICT = Yes|No, restrict volume of player to volume supplied by user, # default: No VOLRESTRICT = no # FADEOUT = Yes|No, volume fade at the end of the module, default: No FADEOUT = no # LOOP = Yes|No, enable in-module loops, default: No LOOP = no # PANNING = Yes|No, process panning effects, default: Yes PANNING = yes # EXTSPD = Yes|No, process Protracker extended speed effect, default: Yes EXTSPD = yes # PM_MODULE = Yes|No, Module repeats, default: No PM_MODULE = no # PM_MULTI = Yes|No, PlayList repeats, default: Yes PM_MULTI = yes # PM_SHUFFLE = Yes|No, Shuffle list at start and if all entries are played, # default: No PM_SHUFFLE = no # PM_RANDOM = Yes|No, PlayList in random order, default: No PM_RANDOM = no # CURIOUS = Yes|No, look for hidden patterns in module, default: No CURIOUS = no # TOLERANT = Yes|No, don't halt on file access errors, default: Yes TOLERANT = yes # RENICE = RENICE_NONE (change nothing), RENICE_PRI (Renice to -20) or # RENICE_REAL (get realtime priority), default: RENICE_NONE # Note that RENICE_PRI is only available under FreeBSD, Linux, NetBSD, # OpenBSD and OS/2, and RENICE_REAL is only available under FreeBSD, Linux # and OS/2. RENICE = RENICE_NONE # STATUSBAR = , size of statusbar from 0 to 2, default: 2 STATUSBAR = 2 # SAVECONFIG = Yes|No, save configuration on exit, default: Yes SAVECONFIG = yes # SAVEPLAYLIST = Yes|No, save playlist on exit, default: Yes SAVEPLAYLIST = yes # PL_NAME = "name", name under which the playlist will be saved # by selecting 'Save' in the playlist-menu PL_NAME = "playlist.mpl" # HOTLIST = "name", entries in the directory hotlist, # can occur any time in this file # FULLPATHS = Yes|No, display full path of files, default: Yes FULLPATHS = yes # FORCESAMPLES = Yes|No, always display sample names (instead of # instrument names) in volumebars panel, default: No FORCESAMPLES = no # FAKEVOLUMEBARS = Yes|No, display fast, but not always accurate, volumebars # in volumebars panel, default: Yes # The real volumebars (when this setting is "No") take some CPU time to # be computed, and don't work with every driver. FAKEVOLUMEBARS = yes # WINDOWTITLE = Yes|No, set the term/window title to song name # (or filename if song has no title), default: Yes WINDOWTITLE = yes # THEME = "name", name of the theme to use, default: THEME = "" # Definition of the themes # NAME = "name", specifies the name of the theme # = normal | bold | reverse , for mono themes or # = , , for color themes # where = black | blue | green | cyan | red | magenta | # brown | gray | b_black | b_blue | b_green | # b_cyan | b_red | b_magenta | yellow | white # = black | blue | green | cyan | red | magenta | # brown | gray BEGIN "THEME" NAME = "MC" WARNING = "white,red" TITLE = "white,cyan" BANNER = "b_green,black" SONG_STATUS = "white,blue" INFO_INACTIVE = "black,cyan" INFO_ACTIVE = "white,black" INFO_IHOTKEY = "yellow,cyan" INFO_AHOTKEY = "yellow,black" HELP = "gray,blue" PLAYENTRY_INACTIVE = "gray,blue" PLAYENTRY_ACTIVE = "black,cyan" SAMPLES = "gray,blue" SAMPLES_KICK3 = "white,blue" SAMPLES_KICK2 = "b_cyan,blue" SAMPLES_KICK1 = "b_blue,blue" SAMPLES_KICK0 = "blue,blue" CONFIG = "cyan,blue" VOLBAR = "cyan,blue" VOLBAR_LOW = "b_green,blue" VOLBAR_MED = "yellow,blue" VOLBAR_HIGH = "b_red,blue" VOLBAR_INSTR = "b_green,blue" MENU_FRAME = "black,cyan" MENU_INACTIVE = "white,cyan" MENU_ACTIVE = "white,black" MENU_IHOTKEY = "yellow,cyan" MENU_AHOTKEY = "yellow,black" DLG_FRAME = "black,gray" DLG_LABEL = "black,gray" DLG_STR_TEXT = "black,cyan" DLG_STR_CURSOR = "cyan,black" DLG_BUT_INACTIVE = "black,gray" DLG_BUT_ACTIVE = "black,cyan" DLG_BUT_IHOTKEY = "yellow,gray" DLG_BUT_AHOTKEY = "yellow,cyan" DLG_BUT_ITEXT = "black,gray" DLG_BUT_ATEXT = "black,cyan" DLG_LIST_FOCUS = "black,cyan" DLG_LIST_NOFOCUS = "yellow,cyan" STATUS_LINE = "gray,blue" STATUS_TEXT = "gray,blue" END "THEME" BEGIN "THEME" NAME = "Reverse" WARNING = normal TITLE = bold BANNER = reverse SONG_STATUS = reverse INFO_INACTIVE = normal INFO_ACTIVE = reverse INFO_IHOTKEY = reverse INFO_AHOTKEY = reverse HELP = reverse PLAYENTRY_INACTIVE = reverse PLAYENTRY_ACTIVE = normal SAMPLES = reverse SAMPLES_KICK3 = reverse SAMPLES_KICK2 = reverse SAMPLES_KICK1 = reverse SAMPLES_KICK0 = reverse CONFIG = reverse VOLBAR = reverse VOLBAR_LOW = reverse VOLBAR_MED = reverse VOLBAR_HIGH = reverse VOLBAR_INSTR = reverse MENU_FRAME = normal MENU_INACTIVE = normal MENU_ACTIVE = reverse MENU_IHOTKEY = reverse MENU_AHOTKEY = normal DLG_FRAME = normal DLG_LABEL = normal DLG_STR_TEXT = reverse DLG_STR_CURSOR = normal DLG_BUT_INACTIVE = normal DLG_BUT_ACTIVE = reverse DLG_BUT_IHOTKEY = reverse DLG_BUT_AHOTKEY = normal DLG_BUT_ITEXT = normal DLG_BUT_ATEXT = reverse DLG_LIST_FOCUS = reverse DLG_LIST_NOFOCUS = bold STATUS_LINE = reverse STATUS_TEXT = reverse END "THEME" # Definition of the archiver # LOCATION = , -1: MARKER gives list of possible file extensions # otherwise: location where MARKER must be found in the file # MARKER = , see LOCATION, e.g. ".TAR.GZ .TGZ" or "PK\x03\x04" # LIST = , command to list archive content (%A archive name, # %a short(DOS/WIN) archive name) # NAMEOFFSET = , column where file names begin, # -1: start at column 0 and end at first space # EXTRACT = , command to extract a file to stdout (%A archive name, # %a short archive name, %f file name, %d destination name(non UNIX)) # SKIPPAT = , Remove the first SKIPSTART lines starting from the first # occurence of SKIPPAT and the last SKIPEND lines from the # extracted file (if the command EXTRACT mixes status # information and the module). # SKIPSTART = , # SKIPEND = , BEGIN "ARCHIVER" LOCATION = 0 MARKER = "PK\x03\x04" LIST = "unzip -vqq \"%a\"" NAMEOFFSET = 58 EXTRACT = "unzip -pqq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 20 MARKER = "\xdc\xa7\xc4\xfd" LIST = "zoo lq \"%a\"" NAMEOFFSET = 47 EXTRACT = "zoo xpq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "Rar!" LIST = "unrar v -c- \"%a\"" NAMEOFFSET = 1 EXTRACT = "unrar p -inul \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lh" LIST = "lha vvq \"%a\"" NAMEOFFSET = -1 EXTRACT = "lha pq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lz" LIST = "lha vvq \"%a\"" NAMEOFFSET = -1 EXTRACT = "lha pq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 257 MARKER = "ustar" LIST = "tar -tf \"%a\"" NAMEOFFSET = 0 EXTRACT = "tar -xOf \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = -1 MARKER = ".TAR.GZ .TAZ .TGZ" LIST = "tar -tzf \"%a\"" NAMEOFFSET = 0 EXTRACT = "tar -xOzf \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = -1 MARKER = ".TAR.BZ2 .TBZ .TBZ2" LIST = "tar --use-compress-program=bzip2 -tf \"%a\"" NAMEOFFSET = 0 EXTRACT = "tar --use-compress-program=bzip2 -xOf \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "\x1f\x8b" LIST = "" NAMEOFFSET = 0 EXTRACT = "gzip -dqc \"%a\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "BZh" LIST = "" NAMEOFFSET = 0 EXTRACT = "bzip2 -dqc \"%a\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" mikmod-3.2.8/COPYING0000644000000000000000000004325412255302430012541 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.