Home > software compiled with MinGW a> Jpegopitm

Compiled with MinGW the Jpegopitm

I stumbled a little note to compile the Jpegoptim.

  1. Unzip the placement jpegoptim-1.2.3 under msys / src /
  2. Start msys, enter the following commands:
    $ cd /src/jpegoptim-1.2.3/ $ autoconf $ configure 
  3. configure does not pass, the following error come out
     configure: error: cannot find install-sh, install.sh, or shtool in aux "."/aux 
  4. to be modified as follows configure.in
     @@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(jpegoptim.c) AC_CONFIG_HEADER(config.h) -AC_CONFIG_AUX_DIR(aux) +AC_CONFIG_AUX_DIR(sub) AC_CANONICAL_HOST 
  5. Create a sub folder, bring from the appropriate location such as install-sh (In the example from Jpeglib)
     $ mkdir sub $ cp ../jpeg-6bx/install-sh ../jpeg-6bx/config.sub ../jpeg-6bx/config.guess ./sub 
  6. Again, to generate a configure file, run the configure
     $ autoconf $ configure 
  7. If you configure through, you run the make. Then get the following errors:
     jpegoptim.c:354: undefined reference to 'realpath' jpegoptim.c:354: undefined reference to 'realpath' 
  8. to be modified as follows jpegoptim.c
     @@ -351,7 +351,11 @@ } break; case 'd': - if (realpath(optarg,dest_path)==NULL || !is_directory(dest_path)) { +#ifdef WIN32 + if (_fullpath(dest_path,optarg,MAXPATHLEN)==NULL || !is_directory(dest_path)) { +#else + if (realpath(optarg,dest_path)==NULL || !is_directory(dest_path)) { +#endif fatal("invalid argument for option -d, --dest"); } if (verbose_mode) @@ -441,8 +445,13 @@ fatal("splitdir() failed!"); strncpy(newname,argv[i],sizeof(newname)); } - snprintf(tmpfilename,sizeof(tmpfilename), +#ifdef WIN32 + snprintf(tmpfilename,sizeof(tmpfilename), + "%sjpegoptim-%d.tmp", tmpdir, (int)getpid()); +#else + snprintf(tmpfilename,sizeof(tmpfilename), "%sjpegoptim-%d-%d.tmp", tmpdir, (int)getuid(), (int)getpid()); +#endif } retry_point: 
  9. Again, the compilation is passed in the make.

it, although it is folder named aux auxiliary scripts such as install-sh is it a relic of the system each BSD,
You can not create a folder named aux special folder in the remnants of DOS in Windows.
Therefore, we store some kinds auxiliary script to change the "sub" references, you can create a "sub" new folder, which is included in the software system GNU.
In addition, getuid realpath and that was in error at compile time is a function of the POSIX system
Has been deleted or replaced with one that works the same or because Windows does not exist.
I had better rewrite it more beautiful in our example but replaced the realpath in order to pass the compilation _fullpath

Comments: 0

Sorry, the comment form
Storing the information that you entered

Trackbacks: 0

TrackBack URL for this article
http://mwlab.net/2010/07/jpegopitm-mingw.html/trackback
TrackBack source list
Compiled with MinGW the Jpegopitm - MoonWing than

Home > software compiled with MinGW a> Jpegopitm

Search
Feed
Translation
Japanese flagItalian flagKorean flagChinese (Simplified) flagChinese (Traditional) flagEnglish flagGerman flagFrench flagRussian flagVietnamese flagThai flag

Back to the top of the page